/* School coach tools — extends styles.css */

main:has(.school-page) {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6rem 1rem 3rem;
  background: linear-gradient(180deg, #0f1419 0%, #1a2332 40%, #f4f6f8 40%);
}

.school-page.section-wrapper {
  width: 100%;
  max-width: 52rem;
  padding: 0;
}

.school-page .headline {
  margin-bottom: 2rem;
  color: #fff;
}

.school-page .headline__title {
  font-family: Kanit, sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.school-page .headline__subtitle {
  color: #b8c5d0;
}

.school-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: #8a9aa8;
}

.school-breadcrumb a {
  color: #6eb8e8;
}

.school-breadcrumb a:hover {
  color: #9ed4f7;
}

.school-breadcrumb [aria-current='page'] {
  color: #cacdce;
}

/* Cards */
.school-card-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.school-card {
  display: block;
  padding: 1.25rem 1.4rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 4px 24px #00000014;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.school-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px #0000001f;
}

.school-card--disabled {
  opacity: 0.65;
}

.school-card--disabled .school-card__actions {
  opacity: 1;
}

.school-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a6a78;
}

.school-card__badge {
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  background: #e8f4fc;
  color: #1565c0;
}

.school-card__badge--soon {
  background: #f0f0f0;
  color: #666;
}

.school-card__title {
  font-family: Kanit, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #141515;
}

.school-card__desc {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #4a5560;
}

.school-card__link {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 600;
  color: hsl(202, 80%, 42%);
}

.school-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
}

.school-card__actions .school-card__link {
  margin-top: 0;
}

.school-card__link--tool {
  color: #1565c0;
}

.school-tools-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.4rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 4px 24px #00000014;
}

.school-tools-section__title {
  margin-bottom: 0.35rem;
  font-family: Kanit, sans-serif;
  font-size: 1.15rem;
  color: #141515;
}

.school-tools-section__desc {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #5a6a78;
}

.school-tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.school-tool-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1565c0;
  background: #e8f4fc;
  transition: background 0.15s ease;
}

.school-tool-link:hover {
  background: #d4ebfa;
}

/* Session guide */
.session-guide {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 4px 28px #0000000d;
}

.session-guide__objectives {
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border-left: 4px solid hsl(202, 80%, 50%);
  border-radius: 0 0.4rem 0.4rem 0;
  background: #f7fafc;
}

.session-guide__objectives h2 {
  margin-bottom: 0.5rem;
  font-family: Kanit, sans-serif;
  font-size: 1.1rem;
}

.session-guide__objectives ul {
  padding-left: 1.2rem;
  line-height: 1.6;
  color: #3a4550;
}

.session-timeline {
  list-style: none;
}

.session-timeline__item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e8ecef;
}

.session-timeline__item:last-child {
  border-bottom: none;
}

.session-timeline__time {
  font-family: Kanit, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1565c0;
}

.session-timeline__body h3 {
  font-family: Kanit, sans-serif;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.session-timeline__body p,
.session-timeline__body ul {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #4a5560;
}

.session-timeline__body ul {
  margin-top: 0.35rem;
  padding-left: 1.2rem;
}

.session-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e8ecef;
}

.school-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 0.4rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.school-btn--primary {
  color: #fff;
  background: hsl(202, 80%, 42%);
}

.school-btn--primary:hover {
  background: hsl(202, 80%, 36%);
}

.school-btn--secondary {
  color: #141515;
  background: #e8ecef;
}

.school-btn--secondary:hover {
  background: #d8dde2;
}

.school-btn--ghost {
  color: #1565c0;
  background: transparent;
  border: 1px solid #c5d5e8;
}

/* Timer page */
.timer-page {
  max-width: 56rem;
}

.timer-panel {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 4px 28px #0000000d;
}

.timer-panel__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.timer-panel__format {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5a6a78;
}

.timer-panel__phase {
  font-family: Kanit, sans-serif;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 600;
  color: #141515;
}

.timer-panel__cycle {
  font-size: 0.9rem;
  color: #5a6a78;
}

.timer-display {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 0.6rem;
  background: #0f1419;
}

.timer-display__clock {
  font-family: Kanit, sans-serif;
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #fff;
}

.timer-display--shooting .timer-display__clock {
  color: #7ee787;
}

.timer-display--retrieve .timer-display__clock {
  color: #f0c674;
}

.timer-display--coaching .timer-display__clock {
  color: #82b1ff;
}

.timer-panel__sublabel {
  margin-top: 0.25rem;
  font-family: Kanit, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #1565c0;
}

.timer-display--complete .timer-display__clock {
  color: #8a9aa8;
  font-size: clamp(2rem, 8vw, 3rem);
}

.timer-display__hint {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #8a9aa8;
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.rotation-diagram__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

@media (width <= 480px) {
  .rotation-diagram__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.rotation-diagram__target {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.6rem;
  border-radius: 0.5rem;
  border: 2px solid var(--team-color);
  background: var(--team-light);
  text-align: center;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.rotation-diagram__target--active {
  box-shadow: 0 0 0 3px var(--team-color);
  transform: scale(1.02);
}

.rotation-diagram__target--idle {
  opacity: 0.45;
}

.rotation-diagram--retrieve .rotation-diagram__target {
  opacity: 0.7;
  border-style: dashed;
}

.rotation-diagram--coaching .rotation-diagram__target {
  opacity: 0.35;
}

.rotation-diagram__badge {
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.35rem;
  font-family: Kanit, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  color: #fff;
  background: #141515;
}

.rotation-diagram__coaching-banner {
  margin-bottom: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.4rem;
  border: 2px solid var(--team-color);
  font-family: Kanit, sans-serif;
  font-weight: 600;
  text-align: center;
  color: var(--team-color);
  background: var(--team-light);
}

/* Ranking round */
.ranking-panel {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 4px 28px #0000000d;
}

.ranking-panel__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ranking-panel__field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #5a6a78;
}

.ranking-panel__field select {
  padding: 0.5rem 0.65rem;
  border: 1px solid #c5d0da;
  border-radius: 0.35rem;
  font-family: inherit;
  font-size: 0.95rem;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.school-page--wide {
  max-width: 72rem;
}

.ranking-panel__field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #5a6a78;
}

.ranking-mode-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ranking-mode-btn {
  padding: 0.5rem 0.75rem;
  border: 2px solid #c5d0da;
  border-radius: 0.35rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5560;
  background: #fff;
  cursor: pointer;
}

.ranking-mode-btn.is-active {
  border-color: #1565c0;
  color: #1565c0;
  background: #e8f4fc;
}

.ranking-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #4a5560;
}

.ranking-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ranking-legend__swatch {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
  pointer-events: none;
}

.ranking-table-scroll {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.ranking-table th,
.ranking-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #e8ecef;
  text-align: center;
  vertical-align: top;
}

.ranking-table__team {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 5.5rem;
  text-align: left;
  font-weight: 700;
  color: var(--team-color);
  background: #fff;
  vertical-align: top;
}

.ranking-table__team-name {
  display: block;
  margin-bottom: 0.5rem;
  font-family: Kanit, sans-serif;
  font-size: 1.05rem;
}

.ranking-paca {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ranking-paca__label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a9aa8;
}

.ranking-paca__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.2rem;
}

.paca-btn {
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0;
  border: 2px solid #d8dde2;
  border-radius: 0.3rem;
  font-family: Kanit, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #5a6a78;
  background: #f7fafc;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.paca-btn.is-active {
  border-color: var(--team-color, #1565c0);
  color: #fff;
  background: var(--team-color, #1565c0);
}

.paca-btn--duplicate.is-active {
  border-color: #e65100;
  box-shadow: 0 0 0 2px #ffcc80;
}

.ranking-end {
  min-width: 10.5rem;
  padding: 0.5rem;
  border: 2px solid #e8ecef;
  border-radius: 0.5rem;
  background: #fafbfc;
  text-align: center;
}

.ranking-end__header {
  display: block;
  width: 100%;
  margin-bottom: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e8ecef;
  text-align: center;
}

.ranking-end__subtotal {
  display: inline-block;
  min-width: 2.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.3rem;
  font-family: Kanit, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  text-align: center;
  color: #141515;
  background: #fff;
  box-shadow: inset 0 0 0 1px #d8dde2;
}

.ranking-end__archers {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.ranking-archer-card {
  display: grid;
  grid-template-columns: 1.15rem 1fr;
  gap: 0.35rem;
  align-items: center;
  width: fit-content;
  margin-inline: auto;
  padding: 0.35rem;
  border: 1px solid #e0e5ea;
  border-radius: 0.4rem;
  background: #fff;
  text-align: left;
}

.ranking-archer-card__label {
  font-family: Kanit, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #8a9aa8;
}

.ranking-archer-card__arrows {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ranking-arrow {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  border: 1px solid #d0d7de;
  border-radius: 0.35rem;
  background: #eef1f4;
  box-shadow: inset 0 1px 2px #00000008;
}

.score-btn {
  min-width: 1.85rem;
  min-height: 1.85rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  font-family: Kanit, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  color: #8a9aa8;
  background: #fff;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease, transform 0.08s ease, border-color 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.score-btn:not(.is-active) {
  border-color: #e0e5ea;
}

.score-btn:active {
  transform: scale(0.92);
}

.score-btn.is-active.score-btn--miss {
  color: #546e7a;
  background: #eceff1;
  border-color: #b0bec5;
}

.score-btn.is-active.score-btn--red {
  color: #b71c1c;
  background: #ffcdd2;
  border-color: #ef9a9a;
}

.score-btn.is-active.score-btn--yellow {
  color: #e65100;
  background: #fff59d;
  border-color: #fff176;
}

.ranking-results__paca {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8a9aa8;
}

.ranking-input {
  display: none;
}

.ranking-table__total,
.ranking-table__rank {
  text-align: center;
  vertical-align: middle;
}

.ranking-table__total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ranking-table__rank {
  font-weight: 700;
  color: #1565c0;
}

.ranking-results {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e8ecef;
}

.ranking-results h2 {
  margin-bottom: 0.75rem;
  font-family: Kanit, sans-serif;
  font-size: 1.1rem;
}

.ranking-results__empty {
  color: #5a6a78;
  font-size: 0.95rem;
}

.ranking-results__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ranking-results__item {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.4rem;
  border-left: 4px solid var(--team-color);
  background: #f7fafc;
}

.ranking-results__place {
  font-family: Kanit, sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #5a6a78;
}

.ranking-results__name {
  font-weight: 600;
  color: var(--team-color);
}

.ranking-results__score {
  font-family: Kanit, sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.ranking-panel__note {
  margin-top: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #5a6a78;
}

.rotation-diagram__target-num {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a6a78;
}

.rotation-diagram__team {
  font-family: Kanit, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--team-color);
}

.rotation-diagram__archer {
  font-size: 1.1rem;
  font-weight: 700;
  color: #141515;
}

.rotation-summary {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  text-align: center;
  color: #5a6a78;
}

.rotation-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e8ecef;
  font-size: 0.85rem;
}

.rotation-legend__item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rotation-legend__swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 0.15rem;
}
