:root {
  --court: #075d3b;
  --deep: #043f2a;
  --lime: #d8ff52;
  --paper: #f1fbf5;
  --ink: #09271c;
  --muted: #617b70;
  --line: #9db7ab;
  --good: #0b7651;
  --danger: #b43639;
  --warning: #d99613;
  --shadow: #033422;
  font-family: Inter, "Noto Sans TC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--court); }
.court-lines { position: fixed; inset: 0; pointer-events: none; opacity: .22; background: linear-gradient(90deg, transparent calc(50% - 2px), #d8f1e2 calc(50% - 2px), #d8f1e2 calc(50% + 2px), transparent calc(50% + 2px)), repeating-linear-gradient(0deg, transparent 0 31.5rem, #d8f1e2 31.5rem 31.75rem); }
.shell { position: relative; width: min(1540px, calc(100% - 48px)); margin-inline: auto; }
.site-header { height: 150px; display: flex; align-items: flex-start; justify-content: space-between; padding-top: 28px; color: white; }
.brand { display: flex; gap: 14px; align-items: center; color: inherit; text-decoration: none; letter-spacing: .12em; }
.brand-mark { display: grid; place-items: center; width: 58px; height: 58px; color: var(--ink); background: var(--lime); border: 4px solid white; box-shadow: 6px 6px 0 var(--shadow); font-weight: 950; }
.brand strong, .brand small { display: block; }.brand strong { font-size: 20px; }.brand small { margin-top: 5px; color: #a9cbbc; font-size: 12px; }
.page-tag { padding: 12px 18px; border: 1px solid #9fc3b2; color: #bcd6ca; font: 700 13px ui-monospace, monospace; }
.hero { color: white; padding: 22px 0 58px; }
.eyebrow, .section-heading small, .context-panel small, footer, #userReference { font: 800 13px ui-monospace, monospace; letter-spacing: .16em; }
.eyebrow { color: var(--lime); }.hero h1 { margin: 14px 0 6px; font-size: clamp(52px, 7vw, 102px); line-height: .98; }.hero-copy { margin: 24px 0 0; color: #c8ded3; font-size: 20px; }
.panel, .state-panel { position: relative; margin-bottom: 38px; padding: 52px; background: rgba(247,255,250,.96); border: 4px solid white; box-shadow: 10px 12px 0 var(--shadow); }
.state-panel { text-align: center; font-size: 18px; }.state-error { display: grid; gap: 12px; }.state-error button { justify-self: center; padding: 10px 18px; background: var(--lime); border: 3px solid var(--ink); font-weight: 900; }
.section-heading { display: flex; align-items: center; gap: 20px; margin-bottom: 36px; }.section-heading .step { display: grid; place-items: center; width: 64px; height: 64px; background: var(--court); color: white; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--shadow); font-size: 24px; font-weight: 950; }.section-heading small, .context-panel small { color: var(--muted); }.section-heading h2, .context-panel h2 { margin: 5px 0 0; font-size: 34px; }
.completion-overview { position:relative; display: grid; grid-template-columns: minmax(260px, auto) minmax(240px, 1fr); gap: 28px; align-items: center; margin: -10px 0 26px; padding: 20px 54px 20px 22px; background: #e4f0e9; border: 2px solid var(--line); }
.completion-dismiss{position:absolute;right:8px;top:6px;width:44px;height:44px;border:2px solid var(--line);border-radius:999px;background:#fff;color:var(--ink);font-size:22px;font-weight:900;line-height:1;cursor:pointer}.completion-dismiss:hover{background:#f8df9b}.completion-overview.is-dismissed{display:none}
.completion-overview > div:first-child { display: grid; gap: 5px; }
.completion-overview span { width: max-content; padding: 5px 8px; color: white; background: var(--court); font: 800 11px ui-monospace, monospace; letter-spacing: .08em; }
.completion-overview strong { font-size: 22px; }
.completion-overview small { color: var(--muted); line-height: 1.5; }
.completion-track { height: 18px; overflow: hidden; background: #f7fff9; border: 3px solid var(--line); }
.completion-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--good), var(--lime)); transition: width 240ms ease; }
.radar-layout { display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(330px, .85fr); gap: 46px; align-items: center; }.chart-wrap { width: min(100%, 520px); aspect-ratio: 1; min-height: 0; margin-inline: auto; }#competencyRadar { display: block; width: 100%; height: 100%; aspect-ratio: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 22px; font-weight: 800; }.legend span { display: inline-flex; align-items: center; gap: 9px; }.legend i { width: 34px; height: 12px; display: inline-block; }.legend-current { background: rgba(216,255,82,.55); border: 3px solid var(--good); }.legend-previous { border-top: 3px dashed #7e8a85; }
.comparison-note { margin: 20px 0 26px; padding: 16px; color: var(--muted); background: #e4f0e9; border-left: 7px solid var(--lime); }
.axis-changes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.axis-change { display: grid; grid-template-columns: 1fr auto; gap: 5px 16px; padding: 15px 17px; border: 2px solid var(--line); }.axis-change:last-child:nth-child(odd) { grid-column: 1 / -1; }.axis-change strong { font-size: 17px; }.axis-change small { color: var(--muted); }.delta { align-self: center; grid-row: 1 / 3; grid-column: 2; font: 900 20px ui-monospace, monospace; }.delta.improved { color: var(--good); }.delta.declined { color: var(--danger); }.delta.unchanged { color: var(--muted); }
.motion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }.motion-card { padding: 27px; border: 3px solid var(--line); background: #e6f1eb; }.motion-card header { display: flex; justify-content: space-between; align-items: start; }.motion-card h3 { margin: 0; font-size: 26px; }.motion-level { padding: 7px 10px; background: var(--deep); color: white; font: 800 12px ui-monospace, monospace; }.motion-score { margin: 25px 0 14px; font-size: 58px; font-weight: 950; color: var(--court); }.motion-score small { font-size: 19px; color: var(--muted); }.motion-track { height: 16px; border: 3px solid var(--line); }.motion-fill { height: 100%; background: var(--good); }.motion-progress { min-height: 24px; margin: 14px 0; color: var(--muted); }.motion-card a { color: var(--court); font-weight: 900; }
.motion-card.is-pending { background: #f5f6f1; border-style: dashed; }
.motion-card.is-pending .motion-score { color: #83958d; }
.history-trend-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: -8px 0 26px; }
.history-trend-tabs button { min-width: 112px; padding: 11px 18px; color: var(--court); background: #e4f0e9; border: 3px solid var(--court); cursor: pointer; font-weight: 900; }
.history-trend-tabs button[aria-selected="true"] { color: var(--ink); background: var(--lime); box-shadow: 4px 4px 0 var(--shadow); }
.history-trend-tabs button:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.history-trend-chart-wrap { min-width: 0; padding: 18px 20px 12px; background: #e6f1eb; border: 3px solid var(--line); }
#historyTrendChart { display: block; width: 100%; height: auto; min-height: 260px; overflow: visible; }
.history-grid-line { stroke: #b8ccc2; stroke-width: 1.5; }
.history-axis-label, .history-date-label { fill: var(--muted); font: 700 12px ui-monospace, monospace; }
.history-trend-line { stroke: var(--court); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.history-trend-point { fill: var(--lime); stroke: var(--deep); stroke-width: 4; cursor: pointer; }
.history-trend-point:hover, .history-trend-point:focus { fill: white; stroke: var(--court); outline: none; }
.history-trend-detail { min-height: 24px; margin: 12px 0 0; color: var(--court); text-align: center; font: 900 14px ui-monospace, monospace; }
.history-trend-empty { margin: 0; padding: 36px 20px; color: var(--muted); background: #e6f1eb; border: 3px dashed var(--line); text-align: center; font-weight: 800; }
.coach-headline { margin: 0; padding: 23px; color: white; background: var(--court); border-left: 9px solid var(--lime); font-size: 21px; }.progress-summary { padding: 16px 20px; border: 2px solid var(--line); }.coach-columns { display: grid; grid-template-columns: .7fr 1.3fr; gap: 40px; margin-top: 28px; }.coach-columns h3 { margin-top: 0; }.tags { display: flex; flex-wrap: wrap; gap: 10px; }.tag { padding: 9px 13px; background: var(--lime); border: 2px solid var(--ink); font-weight: 900; }.coach-columns li { margin-bottom: 12px; line-height: 1.6; }
.context-panel { display: flex; justify-content: space-between; align-items: center; }.hand-result { text-align: right; }.hand-result strong { display: block; color: var(--court); font-size: 38px; }.hand-result span { color: var(--muted); }
.bottom-actions { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 70px; color: #c1dacd; }.primary-action { padding: 18px 24px; color: var(--ink); background: var(--lime); border: 4px solid var(--ink); box-shadow: 7px 7px 0 var(--shadow); font-weight: 950; text-decoration: none; }
footer { display: flex; justify-content: space-between; padding: 30px 0 42px; color: #b8d3c6; border-top: 1px solid #74a58e; }
@media (max-width: 980px) { .radar-layout, .coach-columns { grid-template-columns: 1fr; }.motion-grid { grid-template-columns: 1fr; }.radar-copy { max-width: 620px; margin-inline: auto; }.panel { padding: 32px; } }
@media (max-width: 620px) { .shell { width: min(100% - 24px, 1540px); }.site-header { height: 120px; }.brand small { display: none; }.page-tag { font-size: 10px; }.hero { padding-bottom: 38px; }.hero-copy { font-size: 16px; }.panel { padding: 22px 16px; border-width: 3px; }.section-heading h2 { font-size: 26px; }.section-heading .step { width: 52px; height: 52px; }.completion-overview { grid-template-columns: 1fr; gap: 14px; padding: 16px; }.chart-wrap { width: min(100%, 390px); min-height: 0; }#competencyRadar { height: 100%; }.history-trend-tabs button { flex: 1 1 0; min-width: 0; padding-inline: 8px; }.history-trend-chart-wrap { padding: 10px 6px 8px; overflow: hidden; }#historyTrendChart { min-height: 220px; }.context-panel, .bottom-actions, footer { align-items: flex-start; gap: 24px; flex-direction: column; }.hand-result { text-align: left; } }

.axis-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.axis-help-wrap {
  position: relative;
  display: inline-flex;
}

.axis-help {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--court);
  background: transparent;
  border: 2px solid var(--court);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.axis-help::before {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: auto;
  content: "?";
  border: 2px solid currentColor;
  border-radius: 50%;
}

.axis-help {
  color: transparent;
  border: 0;
}

.axis-help::before {
  color: var(--court);
}

.axis-help:hover,
.axis-help:focus-visible {
  color: transparent;
  background: transparent;
  outline: none;
}

.axis-help:hover::before,
.axis-help:focus-visible::before {
  color: var(--ink);
  background: var(--lime);
}

.axis-tooltip {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(100% + 12px);
  width: min(310px, 72vw);
  padding: 13px 15px;
  color: white;
  background: var(--deep);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--shadow);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 6px);
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    visibility 120ms ease;
  pointer-events: none;
}

.axis-tooltip::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 12px;
  height: 12px;
  content: "";
  background: var(--deep);
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: translate(-50%, -7px) rotate(45deg);
}

.axis-help-wrap:hover .axis-tooltip,
.axis-help-wrap:focus-within .axis-tooltip,
.axis-help-wrap.is-open .axis-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.motion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.motion-actions.single-action {
  grid-template-columns: 1fr;
}

.motion-actions a {
  display: inline-flex;
  align-items: center;
}

.motion-actions .retest-link {
  padding: 8px 12px;
  color: var(--ink);
  background: var(--lime);
  border: 2px solid var(--ink);
  text-decoration: none;
}

.motion-actions .retest-link:hover,
.motion-actions .retest-link:focus-visible {
  color: white;
  background: var(--court);
}

/* Compact experimental player context */
.player-context-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 18px 0 26px;
  padding: 12px 15px;
  color: var(--muted);
  background: rgba(7, 93, 59, .05);
  border-left: 5px solid var(--lime);
}

.player-context-line[hidden] {
  display: none;
}

.player-context-line > span {
  padding: 5px 7px;
  color: var(--court);
  border: 1px solid var(--court);
  font: 800 10px/1 ui-monospace, monospace;
  letter-spacing: .08em;
}

.player-context-line strong {
  color: var(--ink);
  font-size: 17px;
}

.player-context-line small {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 620px) {
  .player-context-line {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Radar point value tooltip */
.chart-wrap {
  position: relative;
}

#competencyRadar {
  cursor: crosshair;
  touch-action: manipulation;
}

.radar-point-tooltip {
  position: absolute;
  z-index: 20;
  transform: translate(-50%, -100%);
  max-width: min(260px, calc(100% - 20px));
  padding: 9px 12px;
  color: #ffffff;
  background: #064c34;
  border: 2px solid #09271c;
  box-shadow: 4px 4px 0 rgba(2, 38, 25, .25);
  pointer-events: none;
  white-space: nowrap;
  font: 800 13px/1.35 ui-monospace, monospace;
}

.radar-point-tooltip[hidden] {
  display: none;
}

.radar-point-tooltip::after {
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 12px;
  height: 12px;
  content: "";
  background: #064c34;
  border-right: 2px solid #09271c;
  border-bottom: 2px solid #09271c;
  transform: translateX(-50%) rotate(45deg);
}

.axis-help-panel,
.ability-mobile-nav {
  display: none;
}

.coach-synthesis {
  margin-top: 14px;
  overflow: hidden;
  background: #f8fbf6;
  border: 2px solid var(--line);
  border-radius: 16px;
}

.coach-synthesis-row {
  display: grid;
  grid-template-columns: 38px minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
  padding: 15px 16px;
}

.coach-synthesis-row + .coach-synthesis-row,
.coach-synthesis > .progress-highlight + .progress-highlight {
  border-top: 1px solid rgba(97, 123, 112, .34);
}

.coach-synthesis-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: white;
  background: var(--court);
  border-radius: 50%;
  font: 900 11px/1 ui-monospace, monospace;
}

.progress-pair-cell {
  min-width: 0;
}

.progress-pair-cell > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font: 800 10px/1.3 ui-monospace, monospace;
  letter-spacing: .08em;
}

.progress-pair-cell > p {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.55;
}

.coach-synthesis-training-link {
  min-height: 44px;
  margin-top: 7px;
  display: inline-flex;
  align-items: center;
  color: var(--court);
  font-size: 13px;
  font-weight: 900;
  text-underline-offset: 3px;
}

.coach-synthesis-training-link:hover,
.coach-synthesis-training-link:focus-visible {
  color: var(--ink);
}

.coach-synthesis > .progress-highlight {
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

@media (max-width: 767px) {
  .radar-point-tooltip {
    max-width: calc(100% - 16px);
    font-size: 11px;
    white-space: normal;
  }

  .axis-tooltip {
    display: none !important;
  }

  .axis-help-panel {
    position: fixed;
    z-index: 90;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    padding: 16px 58px 16px 16px;
    color: var(--ink);
    background: #fbfaf3;
    border: 2px solid var(--court);
    border-radius: 18px;
    box-shadow: 0 16px 42px rgba(3, 52, 34, .28);
  }

  .axis-help-panel.is-open {
    display: grid;
    gap: 6px;
  }

  .axis-help-panel-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    overflow: hidden;
    color: var(--court);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 0;
  }

  .axis-help-panel-close::before {
    content: "×";
    font-size: 26px;
    line-height: 1;
  }

  .axis-help-panel-close:focus-visible {
    outline: 3px solid var(--lime);
    outline-offset: 1px;
  }

  .axis-help-panel-title {
    font-size: 16px;
  }

  .axis-help-panel-text {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
  }
}

/* Motion card actions alignment */
.motion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.motion-actions a {
  display: flex;
  min-height: 46px;
  padding: 9px 12px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--court);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.motion-actions > a:first-child {
  color: var(--court);
  background: transparent;
}

.motion-actions > a:first-child:hover,
.motion-actions > a:first-child:focus-visible {
  color: white;
  background: var(--court);
}

.motion-actions .retest-link {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
}

.motion-actions .retest-link:hover,
.motion-actions .retest-link:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}

@media (max-width: 390px) {
  .motion-actions {
    grid-template-columns: 1fr;
  }
}

.motion-level.level-excellent {
  color: #ffffff;
  background: #2f8f5b;
}

.motion-level.level-wonderful {
  color: #09271c;
  background: #a7c93d;
}

.motion-level.level-great {
  color: #09271c;
  background: #f2d74c;
}

.motion-level.level-good {
  color: #09271c;
  background: #f5b82e;
}

.motion-level.level-nice {
  color: #09271c;
  background: #f28c28;
}

.motion-level.level-fair {
  color: #09271c;
  background: #e85d3f;
}

.motion-fill[data-level="EXCELLENT"] { background: #2f8f5b; }
.motion-fill[data-level="WONDERFUL"] { background: #a7c93d; }
.motion-fill[data-level="GREAT"] { background: #f2d74c; }
.motion-fill[data-level="GOOD"] { background: #f5b82e; }
.motion-fill[data-level="NICE"] { background: #f28c28; }
.motion-fill[data-level="FAIR"] { background: #e85d3f; }

.motion-level.level-empty {
  color: #43534c;
  background: #bdc9c3;
}


/* Progress V2 highlights */
.axis-comparison-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.progress-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 26px;
}

.progress-highlight {
  padding: 17px 18px;
  background: #eef7f2;
  border: 2px solid var(--line);
}

.progress-highlight small {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font: 800 11px/1.3 ui-monospace, monospace;
  letter-spacing: .08em;
}

.progress-highlight-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.progress-highlight strong {
  font-size: 18px;
}

.progress-highlight span {
  font: 950 24px/1 ui-monospace, monospace;
}

.progress-highlight.improved {
  border-left: 7px solid var(--good);
}

.progress-highlight.improved span {
  color: var(--good);
}

.progress-highlight.declined {
  border-left: 7px solid var(--danger);
}

.progress-highlight.declined span {
  color: var(--danger);
}

.progress-highlight.unchanged {
  border-left: 7px solid var(--muted);
}

.progress-highlight.unchanged span {
  color: var(--muted);
}

@media (max-width: 760px) {
  .progress-highlights {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .progress-highlight {
    padding: 11px 13px;
  }

  .progress-highlight small {
    margin-bottom: 5px;
  }

  .progress-highlight span {
    font-size: 20px;
  }

  .coach-synthesis-row {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 13px 12px;
  }

  .coach-synthesis-number {
    grid-row: 1 / 3;
    width: 28px;
    height: 28px;
  }

  .progress-pair-cell {
    grid-column: 2;
  }

  .progress-pair-recommendation {
    padding-top: 9px;
    border-top: 1px solid rgba(97, 123, 112, .24);
  }

  .progress-pair-cell > p {
    font-size: 14px;
  }
}
