/* Dan grade belt icons + register layout
   Belts: 1–5 black (+ white bars), 6–8 kōhaku, 9–10 red */

.dan-belt {
  --dan-black: #141414;
  --dan-white: #f5f5f5;
  --dan-red: #c4122f;
  --dan-stitch: rgba(255, 255, 255, 0.22);
  position: relative;
  display: inline-flex;
  align-items: stretch;
  width: 3.25rem;
  height: 0.85rem;
  border-radius: 0.2rem;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  vertical-align: middle;
}

.dan-belt--lg {
  width: 4.5rem;
  height: 1.15rem;
  border-radius: 0.25rem;
}

.dan-belt--black {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 40%),
    var(--dan-black);
}

.dan-belt--black::before,
.dan-belt--black::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--dan-stitch);
  opacity: 0.7;
}

.dan-belt--black::before { left: 18%; }
.dan-belt--black::after { right: 18%; }

.dan-belt__bars {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.16rem;
  z-index: 1;
}

.dan-belt__bar {
  width: 0.14rem;
  height: 0.55rem;
  border-radius: 1px;
  background: var(--dan-white);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}

.dan-belt--lg .dan-belt__bar {
  width: 0.18rem;
  height: 0.75rem;
}

.dan-belt--kohaku {
  background: repeating-linear-gradient(
    90deg,
    var(--dan-red) 0,
    var(--dan-red) 16.66%,
    var(--dan-white) 16.66%,
    var(--dan-white) 33.33%
  );
}

.dan-belt--red {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 45%),
    var(--dan-red);
}

.dan-belt--red::before,
.dan-belt--red::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.28);
}

.dan-belt--red::before { left: 18%; }
.dan-belt--red::after { right: 18%; }

/* Belt icons inside referee-style grade filter */
.referee-level-select__badge--belt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 3.25rem;
}

.referee-level-select__badge--belt .dan-belt {
  width: 3rem;
  height: 0.75rem;
}

.dan-grade {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.dan-grade__text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.dan-grade__label {
  font-weight: 600;
  line-height: 1.2;
}

.dan-grade__jp {
  font-size: 0.8em;
  opacity: 0.72;
  line-height: 1.2;
}

.dan-register__deceased {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  opacity: 0.85;
  vertical-align: middle;
}

.dan-register__cert,
.dan-register__date {
  font-variant-numeric: tabular-nums;
}

.dan-register__muted {
  opacity: 0.45;
}

.coach-register__row--deceased .coach-register__name {
  opacity: 0.88;
}

.coach-register__head--dan,
.coach-register__row--dan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'name name'
    'level date';
  gap: 0.45rem 0.85rem;
  align-items: center;
}

.coach-register--dan .coach-register__col--name {
  grid-area: name;
  min-width: 0;
}

.coach-register--dan .coach-register__col--level {
  grid-area: level;
  justify-self: start;
  min-width: 0;
}

.coach-register--dan .coach-register__col--date {
  grid-area: date;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  font-size: 0.875rem;
  min-width: 0;
}

@media (min-width: 48rem) {
  .coach-register__head--dan {
    display: grid;
  }

  .coach-register--dan .coach-register__row--dan,
  .coach-register--dan .coach-register__head--dan {
    grid-template-columns: minmax(0, 1.6fr) minmax(12rem, 1.2fr) minmax(6.5rem, 0.7fr);
    grid-template-areas: none;
    gap: 0.75rem 1rem;
  }

  .coach-register--dan .coach-register__col--name,
  .coach-register--dan .coach-register__col--level,
  .coach-register--dan .coach-register__col--date {
    grid-area: auto;
  }

  .coach-register--dan .coach-register__col--level {
    justify-self: end;
  }
}

@media (max-width: 47.99rem) {
  .coach-register__head--dan {
    display: none;
  }

  .coach-register--dan .dan-grade__jp {
    display: none;
  }

  .coach-register--dan .dan-belt {
    width: 2.75rem;
    height: 0.7rem;
  }

  .coach-register--dan .dan-grade {
    gap: 0.45rem;
  }

  .coach-register--dan .dan-grade__label {
    font-size: 0.875rem;
  }
}

.coach-register__row--clickable {
  cursor: pointer;
}

.coach-register__row--clickable:hover,
.coach-register__row--clickable:focus-visible {
  background: rgba(0, 0, 0, 0.035);
  outline: none;
}

.coach-register__row--clickable:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(26, 86, 160, 0.35);
}

body.dan-history-modal-open {
  overflow: hidden;
}

.dan-history-modal__dialog {
  max-width: 26rem;
}

.dan-history-modal__heading {
  min-width: 0;
}

.dan-history-modal__meta {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted, #667);
}

.dan-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dan-history-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.65);
}

.dan-history-list__grade {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.dan-history-list__belt {
  display: inline-flex;
  flex-shrink: 0;
}

.dan-history-list__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.dan-history-list__text strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.dan-history-list__jp {
  font-size: 0.8rem;
  opacity: 0.7;
  line-height: 1.2;
}

.dan-history-list__date {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0.85;
}

.dan-history-empty {
  margin: 0;
  color: var(--color-text-muted, #667);
}


.grading__belts-intro {
  margin: 0 0 1.25rem;
  max-width: 40rem;
}

.grading__belt-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.85rem;
}

.grading__belt-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.55);
}

.grading__belt-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.92rem;
}

.grading__belt-card-text span {
  opacity: 0.75;
  font-size: 0.85em;
}

.grading__belt-family {
  font-size: 0.78em !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.grading__cta {
  margin: 2rem 0 0;
}

.grading__key {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.grading__key-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.grading__key-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
}

.grading__key-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
}
