/* Ten Seconds — the giant Start/Stop button, the result, and charcoal stats
   cards. Shared page, button, and stats styles live in /assets/site.css. The
   charcoal stays charcoal in dark mode. */

body.game-tenseconds {
  --game-bg: #2B2D31;
  --game-deep: #1C1D20;
  --game-accent: #2EE6A6;          /* big numbers and links on the cards */
  --game-on-white: #2B2D31;
  --game-focus: #2EE6A6;
  --ts-mint: #2EE6A6;
  --ts-coral: #FF6B5E;
  --ts-blue: #5AB0FF;
  --ts-muted: #B8BCC4;
  --card-text: #FFFFFF;
  --card-muted: #B8BCC4;
  --card-line: rgba(255, 255, 255, 0.1);
  --btn: min(70vw, 300px);
}

@media (min-width: 900px) {
  body.game-tenseconds { --btn: min(360px, max(240px, calc(100vh - 460px))); }
}

/* ── Play page ─────────────────────────────────────────── */

.ts-play { padding-top: 10px; }

.ts-closest {
  display: inline-block;
  min-height: 1.4em;
  margin: 4px 16px 0;
  padding: 6px 14px;
  border: 1.5px solid rgba(46, 230, 166, 0.55);
  border-radius: 999px;
  font-size: 14px;
  color: var(--ts-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ts-closest strong { color: #FFFFFF; }

.ts-instruction {
  max-width: 30em;
  margin: 16px 20px 0;
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
  color: var(--ts-muted);
}

.ts-button {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--btn);
  height: var(--btn);
  margin: 22px auto 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ts-mint);
  color: #1F2124;
  font: 900 calc(var(--btn) * 0.17) / 1 var(--ws-font);
  letter-spacing: -0.01em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 90ms ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.ts-button[data-state="running"] { background: var(--ts-coral); }
.ts-button[data-state="done"] { font-size: calc(var(--btn) * 0.13); }

.ts-button:active:not(:disabled) { transform: scale(0.965); }
.ts-button:disabled { opacity: 0.5; cursor: default; }

body.game-tenseconds .ts-button:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 6px; }

.ts-kbd {
  position: absolute;
  left: 50%;
  bottom: 16%;
  margin: 0;
  transform: translateX(-50%);
}

/* While running, nothing changes but the button: the instruction and result
   keep their space so nothing moves. */
.ts-running .ts-instruction,
.ts-running .ts-result { visibility: hidden; }

.ts-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 150px;
  padding: 16px 16px 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  visibility: hidden;
}

.ts-result.is-shown { visibility: visible; }

.ts-time {
  margin: 0;
  font-size: 52px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.ts-miss { margin: 6px 0 0; font-size: 20px; font-weight: 800; }
.ts-miss.is-slow { color: var(--ts-coral); }
.ts-miss.is-fast { color: var(--ts-blue); }
.ts-miss.is-dead-on { color: var(--ts-mint); }

.ts-closer { margin: 6px 0 0; font-size: 16px; color: var(--ts-muted); }

.ts-badge { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 8px 0 0; font-size: 18px; font-weight: 800; }
.ts-perfect { color: var(--ts-mint); }
.ts-new { color: #FFFFFF; }

.ts-message { margin-top: 4px; }

@media (min-width: 900px) {
  .ts-time { font-size: 68px; }
  .ts-miss { font-size: 22px; }
}

@media (hover: hover) and (pointer: fine) {
  .ts-button:hover:not(:disabled) { filter: brightness(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .ts-button { transition: none; }
  .ts-button:active:not(:disabled) { transform: none; }
}

/* ── Stats: charcoal cards ─────────────────────────────── */

body.game-tenseconds .card {
  background: #35383E;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  body.game-tenseconds .card:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38); }
}

body.game-tenseconds .big-number small { font-size: 0.5em; font-weight: 700; margin-left: 2px; }

.ts-split {
  display: flex;
  height: 14px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.ts-split span { display: block; height: 100%; }
.ts-split .is-early { background: var(--ts-blue); }
.ts-split .is-late { background: var(--ts-coral); }

.ts-key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--card-muted); }
.ts-key i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: 0; }
.ts-key .is-early { background: var(--ts-blue); }
.ts-key .is-late { background: var(--ts-coral); }

.ts-closest-list { margin: 0; padding: 0; list-style: none; counter-reset: rank; }

.ts-closest-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-line);
  font-variant-numeric: tabular-nums;
  counter-increment: rank;
}

.ts-closest-list li:last-child { border-bottom: 0; }
.ts-closest-list li::before { content: counter(rank); width: 1.2em; font-weight: 800; color: var(--card-muted); }
.ts-closest-list .ts-c-time { font-size: 20px; font-weight: 800; }
.ts-closest-list .ts-c-meta { margin-left: auto; font-size: 13px; color: var(--card-muted); text-align: right; }

.ts-caption { margin-top: 6px; font-size: 15px; font-weight: 700; }

/* ApexCharts tooltips on the dark cards */
body.game-tenseconds .apexcharts-tooltip.apexcharts-theme-dark { background: #1F2124; border-color: #44474E; }
