:root {
  --paper: #f6f1e4;
  --paper-deep: #ede5ce;
  --hairline: #c8b890;
  --tile-shadow: #8a7455;
  --ink: #1a1410;
  --ink-soft: #5a4a3a;
  --ink-faint: #9a8a7a;
  --jade: oklch(54% 0.15 155);
  --jade-deep: oklch(40% 0.13 155);
  --sun: oklch(74% 0.17 70);
  --lacquer: oklch(52% 0.2 25);
  --font-display: 'Abril Fatface', serif;
  --font-ui: 'Work Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-ui);
  background: var(--paper-deep);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

/* The header used to be a 3-column grid so the game title sat centred. The
   bar is shared now and the title hugs the brand like every other game, so
   the grid only stopped margin-right:auto from working. */

/* Replaced by the shared .header-game rule, so every game's bar is built the
   same way. */


.screen { display: block; }
.screen.hidden { display: none; }

/* ============================================================
   Felt Band (shared by target + win screens)
   ============================================================ */
.felt-band {
  background: var(--jade);
  border-bottom: 4px solid var(--jade-deep);
  padding: 28px 24px 32px;
  text-align: center;
}

.welcome-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,0.7);
  margin-bottom: 10px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.brand-seal {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--sun);
  border: 2.5px solid rgba(255,255,255,0.6);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: #fff;
}

.welcome-puzzle-id {
  margin-top: 10px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
}

/* Compact header for the target/intro screen only */
#screen-target .felt-band {
  padding: 14px 20px 16px;
}
#screen-target .welcome-eyebrow {
  font-size: 0.65rem;
  margin-bottom: 6px;
}
#screen-target .brand-seal {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}
#screen-target .brand-wordmark {
  font-size: 1.2rem;
}
#screen-target .welcome-puzzle-id {
  margin-top: 5px;
  font-size: 0.75rem;
}

/* ============================================================
   Target Reveal Screen
   ============================================================ */
.target-reveal-body {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.target-date-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-align: center;
  width: 100%;
}

.reveal-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.target-card {
  width: 100%;
  background: var(--paper);
  border: 2px solid var(--hairline);
  border-radius: 12px;
  padding: 24px 24px 20px;
  box-shadow: 5px 6px 0 var(--tile-shadow);
  position: relative;
}
.target-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1.5px solid #ddd0ac;
  border-radius: 6px;
  pointer-events: none;
}

.target-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.target-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.group-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border: 1.5px solid;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.option-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--paper-deep);
  border: 1.5px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.option-tag.closed {
  background: #fde8d5;
  border-color: #e8a06a;
  color: #8b4a1a;
}

/* ============================================================
   Mode Picker (target screen)
   ============================================================ */
/* Free play, offered under the main action rather than beside it — named for
   what it gives you rather than what it lacks ("No target").

   A text action, not a button: a second pill under a filled one reads as two
   equal choices however light you make it, which is the layout this replaced.
   Ink-soft rather than ink-faint so it is legible, 600 so it reads as something
   you can press, and the underline held back until hover so it does not look
   like a stray hyperlink under the CTA. */
/* The "or" is not part of the link — it sits outside it, quieter, so the
   clickable text is only the option itself. */
.play-open-line {
  margin: 15px 0 0;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  color: var(--ink-faint);
}

.play-open {
  display: inline;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.12s;
}
.play-open:hover,
.play-open:focus-visible {
  color: var(--jade);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

.mode-picker {
  display: flex;
  gap: 10px;
  width: 100%;
}

.mode-option {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid var(--hairline);
  border-radius: 10px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  user-select: none;
}

.mode-option:hover {
  border-color: var(--jade);
}

.mode-option.mode-option-active {
  border-color: var(--jade);
  background: #f0f7f2;
  box-shadow: 2px 2px 0 var(--jade-deep);
}

.mode-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 4px;
  transition: color 0.12s;
}

.mode-option.mode-option-active .mode-title {
  color: var(--jade);
}

.mode-desc {
  font-size: 0.74rem;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ============================================================
   Shared Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 30px;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  border: 2px solid var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}
.btn:active { transform: translate(2px, 2px); box-shadow: none !important; }

.btn-primary {
  background: var(--jade);
  color: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-primary:hover { background: var(--jade-deep); }
.btn-primary:disabled {
  background: var(--hairline);
  border-color: var(--hairline);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--hairline);
  box-shadow: none;
}
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }

.btn.hidden { display: none; }

.how-to-goal {
  width: 100%;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.how-to-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.how-to-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.how-to-steps li .step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--jade);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.how-to-steps li strong {
  color: var(--ink);
  font-weight: 700;
}

.name-input-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.name-input-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.name-input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--hairline);
  border-radius: 10px;
  padding: 11px 16px;
  outline: none;
  transition: border-color 0.12s;
}
.name-input:focus { border-color: var(--jade); }
.name-input::placeholder { color: var(--ink-faint); font-weight: 400; }

.deal-btn-wrap {
  align-self: stretch;     /* was shrink-to-fit, which let the longer secondary
                              label set the width of the whole group */
  text-align: center;
  margin-top: 4px;
}

/* ============================================================
   Welcome Screen — Mini Game Preview
   ============================================================ */
.game-preview {
  align-self: center;
  width: 100%;
  max-width: 240px;
  border: 2px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 4px 5px 0 var(--tile-shadow);
}

.gp-band {
  background: var(--jade);
  border-bottom: 3px solid var(--jade-deep);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gp-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: #fff;
}
.gp-timer {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.15);
  border-radius: 999px;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}

.gp-track {
  background: var(--jade-deep);
  height: 26px;
  position: relative;
}
.gp-rail {
  position: absolute;
  top: 50%;
  left: 12px;
  right: 12px;
  height: 3px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  transform: translateY(-50%);
}
.gp-dot {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translateX(-50%) translateY(-50%);
  border: 1.5px solid rgba(255,255,255,0.4);
}
.gp-dot-gold   { left: 33.3%; background: #d4a830; }
.gp-dot-silver { left: 66.7%; background: #b0b8c8; }
.gp-dot-bronze { left: 96%;   background: #c07838; }

.gp-train {
  position: absolute;
  top: 50%;
  left: 12px;
  font-size: 0.65rem;
  line-height: 1;
  transform: translateX(-50%) translateY(-50%);
}

.gp-body {
  background: var(--paper);
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gp-target-ref {
  background: var(--paper-deep);
  border: 1.5px solid var(--hairline);
  border-radius: 6px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.gp-trl {
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.gp-chip {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 5px;
  border: 1px solid;
  border-radius: 4px;
}
.gp-g { background: #e8f5e8; border-color: #7ab88a; color: #2e7d32; }
.gp-r { background: #fde8e8; border-color: #d88888; color: #8b2222; }
.gp-b { background: #e5f0e8; border-color: #7ab88a; color: #1a5c2a; }

.gp-hand {
  display: flex;
  gap: 2px;
}
.gp-tile {
  flex: 1;
  aspect-ratio: 3/4;
  border-radius: 2px;
  background: var(--paper-deep);
  border: 1px solid var(--hairline);
  opacity: 0.55;
}

.gp-offer-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin: 0;
}
.gp-offered {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.gp-offer-tile {
  width: 28px;
  aspect-ratio: 3/4;
  border-radius: 4px;
  background: var(--paper-deep);
  border: 1.5px solid var(--hairline);
}

/* ============================================================
   Game Screen — Compact Header Band
   ============================================================ */
.game-felt-band {
  display: none;
}

.game-band-left {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #fff;
}

.game-band-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-move-count,
.game-timer {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.15);
  border-radius: 999px;
  padding: 4px 12px;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.game-phase-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 3px 11px;
  letter-spacing: 0.04em;
  flex: 1;
  text-align: center;
  margin: 0 8px;
}
.game-phase-badge.phase-swap {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
}
.game-phase-badge.hidden { display: none; }

/* ============================================================
   Medal Track
   ============================================================ */
.medal-track-wrap {
  background: var(--jade-deep);
  padding: 8px 20px 14px;
  border-bottom: 2px solid rgba(0,0,0,0.12);
}

.medal-track-row {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 680px;
  margin: 0 auto;
}

.medal-clock {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 52px;
  letter-spacing: -0.01em;
}

.medal-track-inner {
  position: relative;
  flex: 1;
  height: 38px;
}

.medal-rail {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  overflow: hidden;
  transform: translateY(-50%);
}

.medal-rail-fill {
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.52);
  border-radius: 2px;
  transition: width 1s linear;
}

.medal-stop-wrap {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) translateY(-50%);
  pointer-events: none;
}

.medal-gold-stop { left: 33.3%; }
.medal-silver-stop { left: 66.7%; }
.medal-bronze-stop { left: 96%; }

.medal-stop-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.45);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.gold-dot   { background: #d4a830; }
.silver-dot { background: #b0b8c8; }
.bronze-dot { background: #c07838; }

.medal-stop-label {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(255,255,255,0.62);
  white-space: nowrap;
  letter-spacing: 0.03em;
  line-height: 1;
}

.medal-train {
  position: absolute;
  top: 50%;
  left: 0%;
  font-size: 1rem;
  line-height: 1;
  transform: translateX(-50%) translateY(-50%);
  z-index: 2;
  transition: left 1s linear;
  user-select: none;
}

/* ============================================================
   Game Body
   ============================================================ */
.game-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 14px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================================
   Target Reference (in-game panel)
   ============================================================ */
.target-ref {
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-left: 4px solid var(--jade);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.target-ref-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--jade);
}

.target-ref-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.target-ref-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.target-ref-groups .group-chip {
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 8px;
}

/* ============================================================
   Hand Section
   ============================================================ */
.hand-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.hand-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.sort-control {
  display: flex;
  border: 1.5px solid var(--hairline);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper-deep);
}

.btn-sort-opt {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.btn-sort-opt + .btn-sort-opt {
  border-left: 1px solid var(--hairline);
}
.btn-sort-opt.sort-active {
  background: var(--ink-soft);
  color: var(--paper);
}

.hand-tray {
  display: flex;
  gap: 3px;
  user-select: none;
}

/* ============================================================
   Tiles — Shared Base
   ============================================================ */
.tile {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 5px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
  cursor: pointer;
  padding: 3px 2px;
  transition: transform 0.12s;
}
.tile-img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: contain;
  pointer-events: none;
  display: block;
}
.tile-num-label {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: clamp(8px, 1.4vw, 11px);
  font-weight: 800;
  background: rgba(255,255,255,0.96);
  border-radius: 3px;
  padding: 1px 3px;
  line-height: 1.4;
  color: #111;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  font-family: system-ui, -apple-system, sans-serif;
}
.tile-id {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.tile.suit-joker { filter: drop-shadow(0 0 3px #c8a840); }

/* ============================================================
   Hand Tiles
   ============================================================ */
.hand-tile {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 3/4;
  height: auto;
  cursor: grab;
}
.hand-tile.selectable:hover {
  transform: translateY(-3px);
}
.hand-tile.discard-selected {
  transform: translateY(-5px);
  filter: drop-shadow(0 0 4px var(--lacquer));
  cursor: pointer;
}
.hand-tile.dragging { opacity: 0.35; transform: scale(0.92); cursor: grabbing; }

.hand-tile-empty {
  border: 1.5px dashed var(--hairline);
  background: rgba(200, 184, 144, 0.10);
  cursor: default;
  box-shadow: none;
  pointer-events: none;
}

.drag-placeholder-el {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 3/4;
  border: 2px dashed var(--jade);
  border-radius: 4px;
  background: rgba(44,110,70,0.05);
}

/* ============================================================
   Offer Section
   ============================================================ */
.offer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.offer-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.btn-skip {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: transparent;
  border: 1.5px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 16px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.btn-skip:hover { border-color: var(--ink-soft); color: var(--ink); }

.offer-tiles {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.offered-tile {
  width: 58px;
  aspect-ratio: 3/4;
  flex-shrink: 0;
}
.offered-tile:hover {
  transform: translateY(-3px);
}
.offered-tile.offer-selected {
  transform: translateY(-8px);
  filter: drop-shadow(0 0 4px var(--jade));
}

.offer-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  flex-wrap: wrap;
}

/* ============================================================
   Win Medal
   ============================================================ */
.win-medal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.win-medal-icon {
  font-size: 4.5rem;
  line-height: 1;
}

.win-medal-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
}

/* ============================================================
   Win Screen
   ============================================================ */
.win-body {
  max-width: 460px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.win-score-card {
  background: var(--paper);
  border: 2px solid var(--hairline);
  border-radius: 16px;
  padding: 36px 48px;
  box-shadow: 5px 6px 0 var(--tile-shadow);
  width: 100%;
  position: relative;
}
.win-score-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1.5px solid #ddd0ac;
  border-radius: 10px;
  pointer-events: none;
}

.win-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

.win-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.win-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.win-stat-value {
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--jade);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.win-stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.win-stat-sep {
  width: 1px;
  height: 56px;
  background: var(--hairline);
  flex-shrink: 0;
}

.win-target-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.win-lb-section {
  width: 100%;
  border-top: 1px solid var(--hairline);
  padding-top: 20px;
}

.win-lb-heading {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-align: center;
  margin-bottom: 12px;
}

.win-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================================
   Leaderboard Screen
   ============================================================ */
.lb-body {
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lb-your-result {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper);
  border: 2px solid var(--hairline);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 3px 4px 0 var(--tile-shadow);
}

.lb-your-medal {
  font-size: 2.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.lb-your-stats {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lb-your-time {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--jade);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lb-your-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.lb-name-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lb-name-input {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--hairline);
  border-radius: 999px;
  padding: 10px 18px;
  outline: none;
  transition: border-color 0.12s;
}
.lb-name-input:focus { border-color: var(--jade); }
.lb-name-input::placeholder { color: var(--ink-faint); font-weight: 400; }

.lb-submit-btn {
  white-space: nowrap;
  padding: 10px 20px;
  font-size: 0.85rem;
}

.lb-submit-status {
  font-size: 0.8rem;
  color: var(--ink-faint);
  text-align: center;
  min-height: 1.2em;
  margin: -10px 0;
}

.lb-table-wrap {
  width: 100%;
}

.lb-status {
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.88rem;
  padding: 20px 0;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.lb-table thead tr {
  border-bottom: 2px solid var(--hairline);
}

.lb-table th {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  padding: 6px 10px 8px;
  text-align: left;
}

.lb-table th:last-child { text-align: right; }

.lb-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--paper-deep);
  color: var(--ink-soft);
  vertical-align: middle;
}

.lb-table td:first-child {
  font-weight: 800;
  color: var(--ink-faint);
  font-size: 0.8rem;
  width: 32px;
}

.lb-table td:last-child {
  text-align: right;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--jade);
  font-variant-numeric: tabular-nums;
}

.lb-table .lb-me td {
  color: var(--ink);
  font-weight: 700;
  background: oklch(from var(--jade) l c h / 0.06);
}

.lb-table .lb-medal-cell {
  font-size: 1rem;
  width: 28px;
}

.lb-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   Responsive
   ============================================================ */
/* Fourteen tiles in one row is 21.7px each on a 375px phone — a third of the
   artwork, and a tap target half the size it should be on tiles you are meant
   to click. Wrap to five a row instead, the way the Charleston and Pick Your
   Line do at the same width. The placeholder has to take the same basis or the
   row reflows while you drag. */
@media (max-width: 640px) {
  .hand-tray {
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 6px;
  }
  .hand-tray > .hand-tile,
  .hand-tray > .drag-placeholder-el {
    flex: 0 0 calc((100% - 4 * 6px) / 5);
    width: auto;
    max-width: 60px;   /* the tile artwork's own size — never larger */
  }
  /* The browser must not claim the gesture for scrolling, or a touch-drag on a
     tile pans the page instead of moving the tile. */
  .hand-tray > .hand-tile { touch-action: none; }
}

@media (max-width: 480px) {
  .brand-wordmark { font-size: 1.4rem; }
  .target-hand-name { font-size: 1.5rem; }
  .offered-tile { width: 48px; }
  .offer-tiles { gap: 8px; }
  .win-stat-value { font-size: 3.2rem; }
  .win-score-card { padding: 28px 24px; }
}
