.badge-row { display: flex; justify-content: center; margin-bottom: 4px; }
.draft-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent2); background: color-mix(in srgb, var(--accent2) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent2) 35%, transparent);
  border-radius: 999px; padding: 4px 12px;
}

.stat-row { display: flex; gap: 6px; margin-bottom: 8px; }
.stat-card {
  flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 6px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.stat-card .num { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-card .lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 0; }

.board-shell {
  background: var(--surface); border-radius: 16px; padding: 10px 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06); position: relative; margin-bottom: 8px;
  min-height: 300px; display: flex; flex-direction: column;
}

/* -- Target word list: one row per answer, blank tiles fill in when found -- */
.word-slots {
  flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start;
  justify-content: center; gap: 6px 10px; padding: 2px 2px 10px; overflow-y: auto;
}
.word-slot-row { display: flex; gap: 2px; }
.slot-box {
  width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--line);
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 10px; color: var(--ink); flex-shrink: 0;
}
.slot-box.filled { background: linear-gradient(120deg, var(--word1), var(--word2)); border-color: transparent; color: #fff; }

/* -- Letter circles: any circle connects to any other, in any order (no
   adjacency constraint, unlike a grid) -- tap/drag across them to build a
   word, release to submit. Arranged in a fixed ring (positions computed in
   JS, see renderLetters()) rather than flex-wrap -- wrap left an odd 6th/7th
   circle stranded off-center on its own row, which looked messy and made
   the drag path harder to predict. A ring keeps every circle equidistant
   from center and evenly spaced regardless of letter count. -- */
.letters-area { touch-action: none; padding-top: 6px; border-top: 1px dashed var(--line); }
.current-word {
  min-height: 20px; text-align: center; font-size: 17px; font-weight: 800;
  letter-spacing: .08em; color: var(--word1); margin-bottom: 4px;
}
.letters-wrap {
  position: relative; width: var(--wrap-size, 208px); height: var(--wrap-size, 208px);
  margin: 0 auto; user-select: none;
}
.connector-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.connector-overlay polyline {
  fill: none; stroke: var(--word1); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; opacity: .8;
}
.letter-circle {
  position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  box-sizing: border-box;
  transform: translate(var(--tx), var(--ty));
  border-radius: 50%; background: var(--bg); border: none; border-bottom: 3px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: var(--ink);
  transition: transform .12s cubic-bezier(.34,1.56,.64,1), background .12s, border-color .12s, color .12s, box-shadow .12s;
  box-shadow: 0 4px 0 rgba(0,0,0,.08), 0 6px 10px rgba(0,0,0,.08);
}
/* Glossy highlight (pure CSS, no image) -- gives each circle a candy-button
   sheen instead of a flat outlined disc. */
.letter-circle::before {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.85), rgba(255,255,255,0) 55%);
}
/* Idle state cycles through 4 pastel tints (assigned round-robin by index
   in renderLetters()/lwRenderLetterCircles(), not CSS nth-child -- the ring
   container's first child is the connector-line <svg>, which would throw
   off a structural selector's counting). */
.letter-circle.lc-c0 { background: linear-gradient(160deg, #fef3c7, #fbbf24); border-bottom-color: #d97706; }
.letter-circle.lc-c1 { background: linear-gradient(160deg, #fce7f3, #f472b6); border-bottom-color: #db2777; }
.letter-circle.lc-c2 { background: linear-gradient(160deg, #dbeafe, #60a5fa); border-bottom-color: #2563eb; }
.letter-circle.lc-c3 { background: linear-gradient(160deg, #d1fae5, #34d399); border-bottom-color: #059669; }
/* .sel/.flash-* must win over the lc-cN tint above regardless of class
   order on the element (both are single-class selectors of equal
   specificity, so source order alone would decide it) -- !important here
   is deliberate, not sloppiness; see the Pop Match .jelly/.primary lesson. */
.letter-circle.sel {
  background: linear-gradient(120deg, var(--word1), var(--word2)) !important; color: #fff; border-bottom-color: transparent !important;
  transform: translate(var(--tx), var(--ty)) scale(1.14);
  box-shadow: 0 3px 0 rgba(0,0,0,.15), 0 8px 16px rgba(67,56,202,.35);
}
.letter-circle.flash-ok { background: var(--success) !important; color: #fff; border-bottom-color: transparent !important; }
.letter-circle.flash-bad { background: var(--danger) !important; color: #fff; border-bottom-color: transparent !important; }

.actions-row { display: flex; gap: 8px; }
.actions-row .secondary, .actions-row .primary { margin-top: 0; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
  padding: 9px 16px; border-radius: 999px; opacity: 0; transition: opacity .18s, transform .18s;
  pointer-events: none; z-index: 50; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--danger); }

.board-loading, .board-empty {
  min-height: 260px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; text-align: center; padding: 20px;
}

/* ── Landing: mode picker (replaces the old always-visible Solo/Versus tab
   row -- that row stayed on screen even while actively playing, which the
   user called out directly. Now it's a one-time choice on entry, plus a
   small 🏠 header icon to come back and pick again.) ── */
.mode-pick-row { display: flex; gap: 10px; margin-top: 10px; }
.mode-pick-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 10px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.mode-pick-emoji { font-size: 30px; margin-bottom: 4px; }
.mode-pick-card b { font-size: 14px; color: var(--ink); }
.mode-pick-card p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mode-pick-solo:active, .mode-pick-versus:active { transform: scale(.97); }

/* ── Lawanan lobby ── */
.lw-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.lw-card h3 { font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.lw-row { display: flex; gap: 8px; }
.lw-select, .lw-input {
  flex: 1; border-radius: 10px; border: 1.5px solid var(--line); padding: 9px 10px;
  font-size: 13px; font-family: inherit; color: var(--ink); background: var(--bg);
}
.lw-btn { flex-shrink: 0; width: auto; padding: 9px 16px; margin-top: 0; font-size: 13px; }
.lw-btn.danger { border-color: var(--danger); color: var(--danger); }
.lw-invite-link {
  font-family: monospace; font-size: 12px; background: var(--bg); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px; word-break: break-all; color: var(--word1); font-weight: 700;
}
.lw-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.lw-waiting-list { display: flex; flex-direction: column; gap: 6px; }
.lw-waiting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 600;
}
.lw-btn-sm { width: auto; padding: 5px 12px; margin-top: 0; font-size: 12px; }

/* ── Lawanan match ── */
.lw-roster { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lw-roster-chip {
  display: flex; align-items: center; gap: 6px; background: var(--surface);
  border: 2px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700;
}
.lw-roster-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.lw-away { color: var(--muted); font-weight: 600; font-size: 10px; }
.lw-timer {
  text-align: center; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--word1); margin-bottom: 8px;
}
.lw-timer-low { color: var(--danger); animation: lwPulse .5s ease infinite; }
@keyframes lwPulse { 50% { transform: scale(1.08); } }
.lw-emoji-bar {
  display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 10px;
  position: relative; min-height: 40px;
}
.lw-emoji-btn {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px;
  font-size: 18px; padding: 4px 8px; cursor: pointer;
}
.lw-emoji-btn:active { transform: scale(.9); }
.lw-reaction-float {
  position: absolute; bottom: 30px; left: 50%; font-size: 18px; font-weight: 700;
  white-space: nowrap; animation: lwFloatUp 1.8s ease forwards; pointer-events: none;
}
.lw-reaction-name { font-size: 12px; font-weight: 800; margin-right: 3px; }
@keyframes lwFloatUp { from { transform: translate(-50%,0); opacity: 1; } to { transform: translate(-50%,-60px); opacity: 0; } }

.lw-bonus-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.lw-bonus-label { width: 100%; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.chip {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px;
}
.chip .pts { font-weight: 800; }

/* -- Always-visible rules card (was a click-to-open overlay -- the user
   wanted it impossible to miss on entering the lobby, not opt-in) -- */
.lw-rules-card {
  background: linear-gradient(160deg, color-mix(in srgb, var(--word1) 10%, var(--surface)), var(--surface) 60%);
  border: 1px solid color-mix(in srgb, var(--word1) 18%, var(--line));
  padding: 16px 14px;
}
.lw-rules-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lw-rules-head-emoji {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: linear-gradient(135deg, var(--word1), var(--word2)); box-shadow: 0 4px 10px color-mix(in srgb, var(--word1) 35%, transparent);
}
.lw-rules-head h3 { font-size: 14px; font-weight: 800; margin: 0; }
.lw-rules-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.lw-rules-grid { display: flex; flex-direction: column; gap: 8px; }
.lw-rule-tile {
  display: flex; gap: 10px; align-items: center; padding: 10px 11px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
}
.lw-rule-icon {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; background: color-mix(in srgb, var(--tile-c) 16%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tile-c) 30%, transparent);
}
.lw-rule-tile b { display: block; font-size: 12.5px; color: var(--ink); font-weight: 800; line-height: 1.3; }
.lw-rule-tile p { font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.lw-rule-c1 { --tile-c: var(--word1); }
.lw-rule-c2 { --tile-c: var(--accent2); }
.lw-rule-c3 { --tile-c: #0ea5e9; }
.lw-rule-c4 { --tile-c: var(--accent); }

/* -- Mode picker (Versus / Equipe) -- */
.lw-mode-btn { flex: 1; margin-top: 0; }
.lw-mode-btn.active { background: linear-gradient(120deg, var(--word1), var(--word2)); color: #fff; border-color: transparent; }

/* -- Live matches card: given a highlight so it actually reads as "live",
   not just another plain list card -- */
.lw-card-live { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.lw-card-live h3 { display: flex; align-items: center; gap: 6px; }
.lw-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); display: inline-block; animation: lwLivePulse 1.4s ease infinite; }
@keyframes lwLivePulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 50% { opacity: .6; box-shadow: 0 0 0 5px rgba(220,38,38,0); } }

/* -- Team mode's shared score banner -- */
.lw-team-score {
  text-align: center; font-size: 15px; font-weight: 700; color: var(--ink);
  background: var(--bg); border-radius: 12px; padding: 8px; margin-bottom: 8px;
}
.lw-team-score b { font-size: 20px; color: var(--word1); }

/* -- Results screen: a real "match end" moment, not just another plain
   card -- was flagged as looking lazy/unfinished. -- */
.lw-results-card {
  background: var(--surface); border-radius: 20px; padding: 26px 20px; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.12); max-width: 400px; margin: 20px auto 0;
}
.lw-results-banner { font-size: 48px; margin-bottom: 4px; }
.lw-results-title { font-family: 'Baloo 2', sans-serif; font-size: 21px; font-weight: 800; margin-bottom: 16px; }
.lw-results-list { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.lw-result-row {
  display: flex; align-items: center; gap: 8px; background: var(--bg); border: 2px solid transparent;
  border-radius: 12px; padding: 9px 12px;
}
.lw-result-winner { background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.lw-result-medal { font-size: 15px; width: 22px; text-align: center; flex-shrink: 0; }
.lw-result-name { flex: 1; font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lw-result-score { font-weight: 800; font-size: 15px; color: var(--word1); font-variant-numeric: tabular-nums; }
.lw-result-detail { font-size: 11px; color: var(--muted); flex-shrink: 0; }

/* -- Match-loading spinner: shown from the moment the match view opens
   until the first real state for THIS match has actually been rendered --
   without it, a player could briefly see stale data (or nothing useful)
   left over from whatever they were looking at a second ago. -- */
.lw-match-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 20px; text-align: center; }
.lw-match-loading p { font-size: 13px; color: var(--muted); font-weight: 600; }
.lw-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--word1);
  animation: lwSpin .8s linear infinite;
}
@keyframes lwSpin { to { transform: rotate(360deg); } }
