/* Step 9 style guide — shared UI components in /core.
   These are the exact components every later screen reuses.
   No internet calls. Fonts are local woff2 files in core/fonts/. */
@font-face {
  font-family: "Orbitron";
  src: url("fonts/Orbitron.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("fonts/Rajdhani-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("fonts/Rajdhani-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("fonts/Rajdhani-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("fonts/Rajdhani-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("fonts/Rajdhani-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07060D;
  --surface: #120F1F;
  --panel: #1C1730;
  --cyan: #00E5FF;
  --pink: #FF2BD6;
  --magenta: #FF007A;
  --violet: #8B5CF6;
  --text: #F2F0FF;
  --muted: #9A93B8;
  --success: #39FF88;
  --danger: #FF3B5C;
  --radius: 16px;
  --radius-lg: 20px;
  --anim: 200ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(600px 300px at 50% -40px, rgba(0, 229, 255, 0.16), transparent 60%),
    radial-gradient(600px 300px at 50% 110%, rgba(255, 43, 214, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Rajdhani";
  font-weight: 500;
  font-size: 17px;
  line-height: 1.45;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  touch-action: manipulation;
  min-height: 100vh;
  min-height: 100dvh;
}
/* Text fields stay selectable (the user-select exception). */
input, textarea { user-select: text; -webkit-user-select: text; }
/* Subtle scanlines + grain, CSS only, no image files. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  opacity: 0.5;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(120% 90% at 50% 0%, transparent 60%, rgba(0, 0, 0, 0.35));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 15, 31, 0.92);
  border-bottom: 1px solid rgba(0, 229, 255, 0.35);
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-bottom: 10px;
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}
.topbar-inner { max-width: 430px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-title { font-family: "Orbitron"; font-weight: 800; letter-spacing: 2px; font-size: 15px; color: var(--text); text-shadow: 0 0 12px rgba(0, 229, 255, 0.65); }
.topbar-note { color: var(--muted); font-size: 13px; }

/* Home-fit fix (v6): Home is exactly one viewport tall — a flex
   column at 100dvh with overflow hidden, so the page never scrolls.
   The tile grid is the flexible part: it shrinks on short screens
   and scrolls internally only when it still does not fit. */
main { max-width: 430px; margin: 0 auto; padding: 16px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); position: relative; z-index: 10; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.panel {
  background: linear-gradient(180deg, #221c3d, var(--panel));
  border: 1px solid rgba(154, 147, 184, 0.28);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.panel h2 {
  font-family: "Orbitron";
  font-size: 15px;
  letter-spacing: 1.5px;
  margin: 0 0 6px 0;
  color: var(--text);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}
.panel p { margin: 6px 0; color: var(--text); }
.panel .muted { color: var(--muted); font-size: 14px; }
.section-label { font-family: "Orbitron"; font-size: 12px; letter-spacing: 2px; color: var(--cyan); margin: 14px 0 8px 0; }

.title-main {
  font-family: "Orbitron";
  font-weight: 900;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 1px;
  text-align: center;
  color: #eafcff;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.85), 0 0 42px rgba(0, 229, 255, 0.35);
  margin: 8px 0 4px 0;
}
.title-sub {
  font-family: "Orbitron";
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 7px;
  text-align: center;
  color: var(--pink);
  text-shadow: 0 0 14px rgba(255, 43, 214, 0.7);
  margin: 0 0 12px 0;
}
.title-small { font-family: "Orbitron"; font-weight: 700; font-size: 20px; letter-spacing: 1px; margin: 0; }

/* Buttons — primary is pink with dark text, as in the mockup. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-family: "Orbitron";
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform var(--anim), box-shadow var(--anim), background var(--anim), opacity var(--anim);
  touch-action: manipulation;
}
.btn:active, .btn.is-pressed { transform: translateY(2px) scale(0.99); }
.btn-primary {
  background: linear-gradient(180deg, #ff5ce0, var(--pink) 55%, #e01fb8);
  color: #14030f;
  box-shadow: 0 8px 24px rgba(255, 43, 214, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  width: 100%;
}
.btn-primary:active, .btn-primary.is-pressed { box-shadow: 0 2px 10px rgba(255, 43, 214, 0.4), inset 0 2px 6px rgba(0, 0, 0, 0.3); }
.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.btn-secondary:active, .btn-secondary.is-pressed { background: #241d42; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.btn:disabled, .btn.is-disabled {
  background: #241e38;
  color: var(--muted);
  border-color: rgba(154, 147, 184, 0.25);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.75;
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 0; }

/* Round top-bar icon buttons, as in the mockup. */
.icon-btn {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform var(--anim), box-shadow var(--anim);
}
.icon-btn:active { transform: scale(0.96); }
.icon-btn svg { width: 26px; height: 26px; }
.icon-row { display: flex; gap: 12px; align-items: center; }

/* Toggle switches. */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(154, 147, 184, 0.18); }
.toggle-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 56px; height: 32px; flex: 0 0 auto; appearance: none; background: #241e38; border: 1px solid rgba(154, 147, 184, 0.4); border-radius: 999px; cursor: pointer; transition: background var(--anim), border-color var(--anim); outline: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #cfc8e8; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); transition: transform var(--anim), background var(--anim); }
.switch:checked { background: rgba(0, 229, 255, 0.25); border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 229, 255, 0.45); }
.switch:checked::after { transform: translateX(24px); background: var(--cyan); }
.switch-label { font-weight: 600; }
.switch-state { color: var(--muted); font-size: 14px; }

/* Volume slider. */
.slider-wrap { display: flex; align-items: center; gap: 12px; }
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--cyan) var(--fill, 70%), #2a2350 var(--fill, 70%)); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--pink); border: 2px solid #fff; box-shadow: 0 0 14px rgba(255, 43, 214, 0.8); }
input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--pink); border: 2px solid #fff; box-shadow: 0 0 14px rgba(255, 43, 214, 0.8); }
.slider-value { font-family: "Orbitron"; font-size: 14px; color: var(--cyan); min-width: 44px; text-align: right; }

/* Tab pills and filter chips, as in the Customize mockup. */
.tab-row, .chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-pill, .chip {
  border-radius: 999px;
  padding: 9px 14px;
  font-family: "Rajdhani";
  font-weight: 600;
  font-size: 16px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid rgba(154, 147, 184, 0.3);
  cursor: pointer;
  transition: all var(--anim);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.tab-pill.is-selected { color: var(--text); border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 229, 255, 0.4), inset 0 0 10px rgba(0, 229, 255, 0.12); background: #1a2440; }
.chip.is-selected { color: var(--text); border-color: var(--pink); box-shadow: 0 0 12px rgba(255, 43, 214, 0.35); background: #2a1430; }

/* Search box. */
.search-box { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid rgba(154, 147, 184, 0.35); border-radius: 14px; padding: 12px 14px; transition: border-color var(--anim), box-shadow var(--anim); }
.search-box:focus-within { border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 229, 255, 0.35); }
.search-box input { flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font-family: "Rajdhani"; font-size: 17px; font-weight: 500; min-width: 0; }
.search-box input::placeholder { color: var(--muted); }
.search-box svg { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }

/* Picker tiles, as in the Customize mockup. */
.picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.picker-tile {
  background: var(--surface);
  border: 1px solid rgba(154, 147, 184, 0.3);
  border-radius: 16px;
  padding: 12px 8px 10px 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color var(--anim), box-shadow var(--anim), transform var(--anim);
}
.picker-tile:active { transform: scale(0.97); }
.picker-tile.is-selected { border-color: var(--cyan); box-shadow: 0 0 16px rgba(0, 229, 255, 0.45), inset 0 0 12px rgba(0, 229, 255, 0.1); }
.picker-tile .disc { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 8px auto; box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.35), inset 0 4px 8px rgba(255, 255, 255, 0.35), 0 6px 14px rgba(0, 0, 0, 0.45); position: relative; }
.picker-tile .disc::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.45); }
.picker-tile .name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.picker-tile .heart { position: absolute; top: 8px; right: 10px; color: var(--pink); font-size: 14px; }

/* Tokens. */
.token-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.token { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid rgba(154, 147, 184, 0.25); border-radius: 12px; padding: 9px 10px; font-size: 13px; }
.token .swatch { width: 28px; height: 28px; border-radius: 8px; flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, 0.2); }
.token .hex { color: var(--muted); font-size: 12px; }

/* Toast. Step 23 item 8: toasts never block taps (pointer-events
   none even while visible) and disappear after about 1.8 s. */
.toast {
  background: var(--surface);
  border: 1px solid rgba(0, 229, 255, 0.6);
  border-radius: 999px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 229, 255, 0.3);
  font-weight: 600;
  transition: opacity 250ms, transform 250ms;
  pointer-events: none;
}
.toast.hidden-toast { opacity: 0; transform: translateY(8px); pointer-events: none; }
.toast-fixed {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 300;
  width: min(400px, calc(100vw - 32px));
}
.toast-fixed.hidden-toast { transform: translateX(-50%) translateY(8px); }

/* Board. */
.board-wrap { background: var(--surface); border: 1px solid rgba(0, 229, 255, 0.4); border-radius: 18px; padding: 10px; box-shadow: 0 0 24px rgba(0, 229, 255, 0.18), 0 12px 30px rgba(0, 0, 0, 0.5); }
.board-wrap canvas { display: block; width: 100%; height: auto; border-radius: 12px; }
.piece-list { font-size: 14px; color: var(--muted); }
.finish-row { display: flex; gap: 10px; justify-content: space-between; margin-top: 10px; }
.finish-item { text-align: center; flex: 1; font-size: 12px; color: var(--muted); }
.finish-disc { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 4px auto; background: radial-gradient(circle at 32% 28%, #7df3ff, #00b8d4 45%, #7a1fa2 100%); box-shadow: inset 0 -5px 8px rgba(0, 0, 0, 0.4), 0 4px 10px rgba(0, 0, 0, 0.4); }
.finish-canvas { display: block; margin: 0 auto 4px auto; }

/* Effects canvas — full screen, never blocks taps. */
#effects-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 200; }
.effect-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.effect-row .btn { font-size: 13px; min-height: 44px; padding: 10px 8px; }

.footer { color: var(--muted); font-size: 13px; text-align: center; padding: 8px 0 4px 0; }
.footer a { color: var(--cyan); }

/* ===== Step 10 — Home screen (S01) ===== */
.home-page { background: #07060D; }
.home-bg {
  position: fixed; inset: 0; z-index: 0;
  background-image: url("../game/art/home_bg.jpg");
  background-size: cover; background-position: center top; background-repeat: no-repeat;
}
/* Slow animated glows over the fixed background. Transform/opacity only, so it stays smooth. */
.home-glow {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
}
.home-glow::before {
  content: ""; position: absolute; left: 50%; top: -140px; width: 640px; height: 340px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0,229,255,0.28), transparent 70%);
  animation: home-glow-top 18s ease-in-out infinite alternate;
}
.home-glow::after {
  content: ""; position: absolute; left: 50%; bottom: -160px; width: 640px; height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,43,214,0.22), transparent 70%);
  animation: home-glow-bottom 22s ease-in-out infinite alternate;
}
@keyframes home-glow-top { from { opacity: 0.7; transform: translateX(-52%) scale(1); } to { opacity: 1; transform: translateX(-48%) scale(1.08); } }
@keyframes home-glow-bottom { from { opacity: 0.7; transform: translateX(-48%) scale(1); } to { opacity: 1; transform: translateX(-52%) scale(1.08); } }

/* v11: Home black — everything from the top of the first button
   down is solid black (#000000). The panel sits above the
   background, scene and glow layers and below the buttons; its top
   is set by home.js to 24 px above the first visible button, and
   its top 24 px fade from transparent to black so there is no hard
   line where the image meets the black. No top in CSS: before JS
   runs the panel has zero height and is invisible. */
.home-black {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0, #000000 24px);
}

.home-hero { text-align: center; padding: 6px 0 10px 0; flex: none; }
.emblem-img {
  width: clamp(96px, 20dvh, 168px); height: clamp(96px, 20dvh, 168px); border-radius: 50%; object-fit: cover;
  filter: drop-shadow(0 0 18px rgba(0,229,255,0.65));
  animation: emblem-breathe 6s ease-in-out infinite alternate;
}
@keyframes emblem-breathe { from { filter: drop-shadow(0 0 14px rgba(0,229,255,0.5)); } to { filter: drop-shadow(0 0 24px rgba(0,229,255,0.8)); } }
.logo-img { width: auto; max-width: min(360px, 100%); max-height: clamp(40px, 12dvh, 119px); height: auto; display: block; margin: 14px auto 0 auto; }
.home-title-fallback { display: none; }
.home-title-fallback.show { display: block; }

.home-actions { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; overflow: hidden; }
/* Home: exactly five big buttons. They flex to fill tall screens and
   shrink to their minimum on short ones, so Home fits in 100dvh
   with no page scroll. */
.home-menu-btn {
  width: 100%; flex: 1 1 0; min-height: 56px; max-height: 88px;
  justify-content: flex-start; gap: 14px; text-align: left; margin-top: 0;
  font-family: "Orbitron"; font-weight: 700; font-size: 16px; letter-spacing: 1px;
}
.home-menu-btn .home-menu-icon { color: var(--cyan); display: inline-flex; flex: none; }
.home-menu-btn .home-menu-icon svg { width: 26px; height: 26px; }
.home-menu-btn.btn-primary .home-menu-icon { color: #14030f; }
.home-menu-btn .home-menu-label { flex: 1; min-width: 0; }
.home-menu-btn .home-menu-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-menu-btn .home-menu-sub { color: var(--muted); font-family: "Rajdhani"; font-weight: 500; font-size: 14px; letter-spacing: 0; }
/* On the highlighted (pink) button the sub-line is dark, like the
   label, or it is unreadable against the pink. */
.btn-primary.home-menu-btn .home-menu-sub { color: rgba(20, 3, 15, 0.75); }
.btn:disabled .home-menu-icon, .btn.is-disabled .home-menu-icon { color: var(--muted); }

/* Overlays: wizard, OPTIONS, HIGH SCORES, Settings and the rest. */
.overlay {
  position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(3,2,10,0.72); padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.overlay.hidden-overlay { display: none; }
/* Home-fit fix (v6): while an overlay is open the page behind it is
   locked — no page scroll. Overlays scroll inside their own sheets. */
html.overlay-open, html.overlay-open body { overflow: hidden; }
.overlay-center { align-items: center; }
.overlay-sheet {
  width: 100%; max-width: 430px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, #221c3d, var(--panel));
  border: 1px solid rgba(0,229,255,0.4); border-radius: 22px; padding: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 24px rgba(0,229,255,0.2);
}
.overlay-sheet h2 { font-family: "Orbitron"; font-size: 17px; letter-spacing: 1px; margin: 0 0 6px 0; }
.overlay-sheet .muted { color: var(--muted); font-size: 14px; }
.mode-card {
  width: 100%; text-align: left; background: var(--surface); border: 1px solid rgba(154,147,184,0.35);
  border-radius: 16px; padding: 16px; color: var(--text); cursor: pointer; margin-top: 10px;
  transition: border-color var(--anim), box-shadow var(--anim), transform var(--anim);
}
.mode-card:active { transform: scale(0.98); }
.mode-card.is-selected { border-color: var(--cyan); box-shadow: 0 0 16px rgba(0,229,255,0.4); }
.mode-card .mode-name { font-family: "Orbitron"; font-weight: 700; letter-spacing: 1px; }
.mode-card .mode-desc { color: var(--muted); font-size: 14px; margin-top: 2px; }
/* v11: Rules and Styles of Play cards — icon column left, name + one-line
   description stacked right. Wizard-scoped only; Customize unchanged. */
#wizard-body .rule-set-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-top: 6px; }
/* v11: the first card's top margin collapses through #wizard-body
   (height:100%, no padding/border) and adds exactly that many px to
   #wizard-scroll's scrollHeight — the 6px panel scroll at every size. */
#wizard-body .rule-set-card:first-child { margin-top: 0; }
#wizard-body .rule-set-card .rule-icon { flex: 0 0 auto; width: 28px; height: 28px; color: var(--cyan); display: flex; align-items: center; justify-content: center; }
#wizard-body .rule-set-card .rule-icon svg { width: 28px; height: 28px; }
#wizard-body .rule-set-card .rule-text { flex: 1; min-width: 0; }
#wizard-body .rule-set-card .mode-desc { font-size: 12px; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.close-btn { background: var(--surface); border: 1px solid rgba(154,147,184,0.4); color: var(--text); border-radius: 12px; width: 44px; height: 44px; font-size: 20px; cursor: pointer; }
.setup-group { margin-top: 16px; }
.setup-group .section-label { margin-bottom: 6px; }
.locked-note { color: var(--muted); font-size: 13px; margin-top: 4px; }
.text-btn { background: none; border: 0; color: var(--cyan); font-family: "Rajdhani"; font-weight: 600; font-size: 15px; cursor: pointer; padding: 8px 0; }

/* Simple mode: larger text and buttons, icons next to every label. */
body.mode-simple { font-size: 19px; }
body.mode-simple .btn { min-height: 56px; font-size: 16px; }
body.mode-simple .home-menu-btn { min-height: 64px; font-size: 17px; }
body.mode-simple .tab-pill, body.mode-simple .chip { min-height: 48px; font-size: 17px; }

/* Press animation for every button, in addition to :active. */
.btn.is-pressing, .icon-btn.is-pressing { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
  .home-glow::before, .home-glow::after, .emblem-img { animation: none; }
}

/* ===== Step 10 v2 fixes ===== */
/* 2. Rating chip number: bright white, bold, as in 1_home.png. */
.rating-chip { color: #F2F0FF; }
#rating-value { color: #F2F0FF; font-weight: 800; font-family: "Orbitron"; }
#rating-rank { color: #9A93B8; }

/* 3. Fonts: buttons and form controls do NOT inherit body font by default
   in browsers, which is why some text fell back to Arial. Force inheritance
   everywhere, then set the two game fonts explicitly on every component. */
button, input, select, textarea { font-family: inherit; }
.home-tile, .mode-card, .continue-btn, .rating-chip, .text-btn, .close-btn {
  font-family: "Rajdhani";
}
.home-tile .tile-label, .mode-card .mode-name, .continue-btn .continue-label,
.rating-chip, .overlay-sheet h2 {
  font-family: "Orbitron";
}
.home-tile .tile-sub, .mode-card .mode-desc, .switch-label, .continue-btn .continue-sub,
.tab-pill, .chip, .toast, .locked-note, .setup-group p, .overlay-sheet .muted {
  font-family: "Rajdhani";
}

/* 1. Inline SVG neon line icons: thin strokes, soft glow, same look as the gear. */
.icon-svg { width: 22px; height: 22px; flex: 0 0 auto; vertical-align: middle; }
.icon-svg.icon-inline { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; margin-right: 6px; }
.tile-icon .icon-svg { width: 26px; height: 26px; }
.tile-icon.cyan .icon-svg { filter: drop-shadow(0 0 6px rgba(0,229,255,0.6)); }
.tile-icon.pink .icon-svg { filter: drop-shadow(0 0 6px rgba(255,43,214,0.6)); }
.mode-name { display: flex; align-items: center; gap: 10px; }
.mode-name .icon-svg { color: var(--cyan); filter: drop-shadow(0 0 6px rgba(0,229,255,0.5)); }
.switch-label { display: inline-flex; align-items: center; gap: 8px; }
.switch-label .icon-svg { color: var(--cyan); }
.tab-pill .icon-svg { color: var(--cyan); }
.btn .icon-svg { width: 20px; height: 20px; }
.continue-btn .resume-icon .icon-svg { color: var(--cyan); filter: drop-shadow(0 0 6px rgba(0,229,255,0.5)); }
.continue-btn .chev .icon-svg { color: var(--cyan); width: 20px; height: 20px; }
.rating-chip .star-svg { width: 18px; height: 18px; color: var(--pink); filter: drop-shadow(0 0 6px rgba(255,43,214,0.6)); }
.close-btn .icon-svg { width: 20px; height: 20px; }
.toast .icon-svg { width: 20px; height: 20px; color: var(--cyan); }
.continue-label { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Step 13 — Game Setup + board ===== */
.hidden-screen { display: none; }
.hidden-panel { display: none; }
#board-screen { max-width: 430px; margin: 0 auto; padding: 8px 16px 28px 16px; position: relative; z-index: 10; }
.board-bar {
  display: flex; align-items: center; gap: 10px;
  background: rgba(18,15,31,0.95); border: 1px solid rgba(0,229,255,0.4);
  border-radius: 16px; padding: 10px 12px; margin-bottom: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.board-bar-main { flex: 1; min-width: 0; }
.board-turn { font-family: "Orbitron"; font-weight: 700; font-size: 14px; letter-spacing: 0.5px; }
.board-hud, .board-timers, .board-prompt, .board-toast { color: #9A93B8; font-size: 14px; }
.board-bar-rotated { transform: rotate(180deg); }
.board-bar-rotated .tab-pill { transform: rotate(0deg); }
#board-wrap { position: relative; }
#board-canvas { width: 100%; height: auto; display: block; border-radius: 12px; touch-action: none; cursor: pointer; }
.board-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.board-rated-note { text-align: center; color: #9A93B8; font-size: 14px; margin: 10px 0 0 0; }
.thinking-indicator {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  background: rgba(18,15,31,0.92); border: 1px solid rgba(0,229,255,0.5);
  border-radius: 999px; padding: 8px 14px; align-items: center; gap: 6px;
  font-weight: 600; font-size: 14px; color: #F2F0FF; pointer-events: none;
}
.thinking-dot { width: 8px; height: 8px; border-radius: 50%; background: #00E5FF; animation: think-pulse 1s ease-in-out infinite; }
.thinking-dot:nth-child(2) { animation-delay: 0.15s; }
.thinking-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes think-pulse { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }
/* Heavy-event board shake: about 150 ms, a few pixels. */
@keyframes board-shake-kf { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(2px, -1px); } 50% { transform: translate(-2px, 1px); } 75% { transform: translate(1px, 0); } }
.board-wrap.board-shake { animation: board-shake-kf 150ms linear; }
/* Multi-jump landing micro-flex: 1 px. */
@keyframes board-flex-kf { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.0025); } }
.board-wrap.board-flex { animation: board-flex-kf 150ms linear; }
/* Setup cards: mode portraits and rule preset cards, built from the manifest/rules. */
.setup-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.setup-card {
  background: #120F1F; border: 1px solid rgba(154,147,184,0.35); border-radius: 16px;
  padding: 10px; color: #F2F0FF; cursor: pointer; text-align: center;
}
.setup-card.is-selected { border-color: #00E5FF; box-shadow: 0 0 16px rgba(0,229,255,0.4); }
.setup-card img { width: 100%; height: auto; border-radius: 10px; display: block; }
.setup-card-label { display: block; font-family: "Orbitron"; font-weight: 700; font-size: 14px; margin-top: 8px; }
.setup-preset {
  width: 100%; text-align: left; background: #120F1F; border: 1px solid rgba(154,147,184,0.35);
  border-radius: 14px; padding: 12px 14px; color: #F2F0FF; cursor: pointer; margin-top: 8px; display: block;
}
.setup-preset.is-selected { border-color: #00E5FF; box-shadow: 0 0 14px rgba(0,229,255,0.35); }
.setup-preset-name { display: block; font-family: "Orbitron"; font-weight: 700; font-size: 14px; }
.setup-preset-desc { display: block; color: #9A93B8; font-size: 14px; margin-top: 2px; }
.setup-level {
  display: inline-flex; align-items: center; gap: 8px;
  background: #120F1F; border: 1px solid rgba(154,147,184,0.3); border-radius: 999px;
  padding: 6px 14px 6px 6px; color: #9A93B8; cursor: pointer; min-height: 44px;
}
.setup-level.is-selected { color: #F2F0FF; border-color: #00E5FF; box-shadow: 0 0 14px rgba(0,229,255,0.4); }
.setup-level img { width: 32px; height: 32px; border-radius: 50%; }
.setup-level-name { font-weight: 700; }
.setup-level-rating { color: #9A93B8; font-size: 14px; }
/* Step 23: Recommended badge + More/Fewer levels link in Setup. */
.setup-recommended {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: #07130B; background: #39FF88; border-radius: 999px; padding: 2px 8px; margin-left: 6px;
}
.setup-more-levels {
  display: block; background: none; border: none; color: #00E5FF; cursor: pointer;
  font-family: "Rajdhani"; font-size: 16px; font-weight: 700; margin: 10px auto 0; padding: 6px 12px; min-height: 44px;
}
/* Step 23 item 5: review overlay move rows. */
.review-move-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 10px; margin-top: 6px;
  background: #120F1F; border: 1px solid rgba(154,147,184,0.25);
}
.review-move-row.is-selected { border-color: #00E5FF; box-shadow: 0 0 10px rgba(0,229,255,0.35); }
.review-move-label {
  background: none; border: none; color: #F2F0FF; cursor: pointer;
  font-family: "Rajdhani"; font-size: 16px; font-weight: 700; text-align: left; padding: 6px 0;
}
#history-list { font-size: 15px; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) {
  .thinking-dot { animation: none; }
}

/* Step 13 v2 board screen, mockup 3_board.png. Fills a phone screen:
   flex column at 100dvh, board flexes to fill the space between the
   panels, toolbar pinned at the bottom, no horizontal scroll. */
#board-screen { height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 10px; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); box-sizing: border-box; overflow: hidden; width: 100%; max-width: 100vw; background: #07060D; }
#board-screen.hidden-screen { display: none; }
.board-topbar { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; }
.board-top-center { flex: 1; text-align: center; min-width: 0; }
.board-turn-status { font-family: Orbitron; font-size: 18px; letter-spacing: 2px; color: #F2F0FF; }
.board-top-sub { font-size: 13px; color: #9A93B8; margin-top: 2px; }
.player-panel { display: flex; align-items: center; gap: 12px; background: #120F1F; border: 1px solid rgba(0,229,255,0.25); border-radius: 16px; padding: 10px 12px; min-height: 56px; box-sizing: border-box; }
.player-panel .panel-text { flex: 1; min-width: 0; }
.panel-icon { width: 44px; height: 44px; border-radius: 12px; background: #1C1730; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #00E5FF; }
.panel-icon.panel-you { font-family: Orbitron; font-size: 13px; letter-spacing: 1px; color: #FF2BD6; }
.panel-text { display: flex; flex-direction: column; min-width: 0; }
.panel-name { font-family: Orbitron; font-size: 15px; color: #F2F0FF; white-space: normal; overflow: visible; line-height: 1.25; }
.panel-name-line { display: block; }
.panel-name-line2 { display: block; font-size: 13px; color: #9A93B8; font-family: Rajdhani; letter-spacing: 0; }
.panel-sub { font-size: 13px; color: #9A93B8; }
.panel-captured { display: flex; gap: 3px; align-items: center; min-height: 10px; }
.cap-dot { width: 10px; height: 10px; border-radius: 50%; background: #9A93B8; opacity: 0.85; flex: none; }
.cap-dot.cap-king { background: #FFD75E; }
.cap-mini { width: 18px; height: 18px; flex: none; }
.panel-material { color: #39FF88; font-weight: 700; min-width: 1.5em; }
.panel-timer { margin-left: auto; font-family: Orbitron; font-size: 18px; color: #00E5FF; flex-shrink: 0; }
#board-player-panel .panel-timer { color: #FF2BD6; }
#board-wrap { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; }
#board-wrap #board-canvas { width: 100%; height: auto; max-width: calc(100dvh - 456px); max-height: calc(100dvh - 456px); aspect-ratio: 1 / 1; border-radius: 16px; border: 1px solid rgba(0,229,255,0.4); display: block; }
.board-status-pill { border: 1px solid rgba(0,229,255,0.4); border-radius: 999px; padding: 10px 14px; text-align: center; font-size: 15px; background: #120F1F; display: flex; gap: 8px; align-items: center; justify-content: center; color: #F2F0FF; }
.board-controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 0; }
.board-tool { background: #120F1F; border: 1px solid rgba(154,147,184,0.35); border-radius: 16px; padding: 10px; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; color: #F2F0FF; font-family: Orbitron; font-size: 12px; letter-spacing: 0.5px; min-height: 48px; text-align: left; white-space: nowrap; }
.board-tool svg { width: 22px; height: 22px; flex-shrink: 0; }
.board-tool.is-off { opacity: 0.55; }
@media (max-height: 680px) {
  .board-topbar { min-height: 36px; }
  .player-panel { min-height: 48px; padding: 8px 12px; }
  .board-status-pill { padding: 8px 14px; }
  .board-tool { min-height: 40px; padding: 8px 10px; font-size: 11px; }
  .board-controls { gap: 6px; }
  #board-wrap #board-canvas { max-width: calc(100dvh - 404px); max-height: calc(100dvh - 404px); }
}

/* v11 (Additions 4+5): name screen, player line, Move History sheet,
   save slots, profiles, high-scores player line. */
.home-player-line { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 12px 0; min-height: 18px; }
/* v11: on short screens the Player line (item 7) pushes the five Home
   buttons down, so OPTIONS is clipped (390x664: 29 px over; 360x640:
   45 px over; 375x553: fully hidden). Compact the hero on short
   screens so the buttons fit as they did before the Player line.
   Only below 700 px height; the taller sizes are unaffected. */
@media (max-height: 700px) {
  .emblem-img { width: clamp(80px, 14dvh, 120px); height: clamp(80px, 14dvh, 120px); }
  .home-hero { padding: 4px 0 6px 0; }
  .home-player-line { margin-bottom: 8px; }
}
#name-screen { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: #07060D; padding: 24px; box-sizing: border-box; }
#name-screen.hidden-screen { display: none; }
.name-card { width: 100%; max-width: 340px; text-align: center; }
.name-card h1 { font-family: Orbitron; font-size: 22px; letter-spacing: 1px; margin: 0; color: #F2F0FF; }
.name-card .muted { margin: 10px 0 0 0; }
#name-input { width: 100%; box-sizing: border-box; background: #120F1F; border: 1px solid rgba(0,229,255,0.4); border-radius: 12px; color: #F2F0FF; font-family: Rajdhani; font-size: 18px; font-weight: 600; padding: 12px 14px; text-align: center; margin: 18px 0; }
#name-continue-btn { width: 100%; }
.history-sheet-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; font-size: 15px; line-height: 1.7; }
.history-sheet-list li { padding: 2px 0; border-bottom: 1px solid rgba(154,147,184,0.15); }
.slot-row { position: relative; display: flex; flex-direction: column; gap: 2px; background: #120F1F; border: 1px solid rgba(154,147,184,0.35); border-radius: 12px; padding: 10px 12px; margin-top: 8px; text-align: left; width: 100%; box-sizing: border-box; cursor: pointer; }
.slot-row.slot-empty { opacity: 0.6; }
.slot-row.slot-finished { opacity: 0.5; cursor: default; }
.slot-row.slot-last { border-color: rgba(0,229,255,0.4); }
.slot-name { font-family: Orbitron; font-size: 14px; color: #F2F0FF; padding-right: 28px; }
.slot-name.slot-renameable { text-decoration: underline dotted; text-underline-offset: 3px; }
.slot-meta { font-size: 13px; color: var(--muted); }
.slot-delete { position: absolute; top: 6px; right: 8px; background: none; border: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px 6px; cursor: pointer; }
.profile-row { display: flex; align-items: center; gap: 8px; background: #120F1F; border: 1px solid rgba(154,147,184,0.35); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.profile-row.is-active { border-color: rgba(0,229,255,0.6); }
.profile-name { flex: 1; min-width: 0; background: none; border: none; color: #F2F0FF; font-family: Orbitron; font-size: 14px; text-align: left; padding: 0; cursor: pointer; }
.profile-make-active { font-size: 12px; color: var(--muted); white-space: nowrap; }
.profile-new input, .slot-rename-input { flex: 1; min-width: 0; box-sizing: border-box; background: #07060D; border: 1px solid rgba(0,229,255,0.4); border-radius: 8px; color: #F2F0FF; font-family: Rajdhani; font-size: 16px; font-weight: 600; padding: 8px 10px; }
/* v11: the NEW PROFILE button is a .btn-primary (width: 100%); inside
   the flex .profile-new row it must size to its label so the name
   input (flex: 1) keeps the remaining space instead of collapsing. */
.profile-new .btn { flex: 0 0 auto; width: auto; }
.slot-rename-input { width: 100%; }
.high-scores-player { text-align: center; color: var(--muted); font-size: 14px; margin: 6px 0 0 0; }


/* Step 14 polish (c): on the board page the toast sits above the
   toolbar, so no button is ever covered by it. Step 23 item 8: on
   Home it sits at the top, so it never covers the Home tiles. */
body.board-page .toast-fixed { bottom: calc(92px + env(safe-area-inset-bottom)); }
body:not(.board-page) .toast-fixed { top: calc(12px + env(safe-area-inset-top)); bottom: auto; }
/* Step 23 item 7: the non-modal Kinged! banner, floating on the
   crowned square. Taps pass straight through it. */
.board-wrap { position: relative; }
#board-kinged-banner {
  position: absolute; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 5; display: none;
  font-family: "Orbitron"; font-weight: 700; font-size: 18px; letter-spacing: 1px;
  color: #FFD75E; text-shadow: 0 0 12px rgba(255, 215, 94, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap; animation: kinged-pop 900ms ease-out forwards;
}
@keyframes kinged-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) { #board-kinged-banner { animation: none; } }
/* Endgame overlays: style-guide panel, animated in, safe areas. */
.overlay-sheet { animation: sheet-in 220ms ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .overlay-sheet { animation: none; } }
.endgame-stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.endgame-stat { background: #120F1F; border: 1px solid rgba(154,147,184,0.35); border-radius: 12px; padding: 10px 14px; text-align: center; min-width: 84px; }
.endgame-stat .stat-value { font-family: Orbitron; font-size: 20px; color: #F2F0FF; }
.endgame-stat .stat-label { font-size: 12px; color: #9A93B8; letter-spacing: 1px; }
.trophy-anim { animation: trophy-float 2.4s ease-in-out infinite; }
@keyframes trophy-float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .trophy-anim { animation: none; } }
.shimmer { position: relative; overflow: hidden; color: transparent !important; background: rgba(154,147,184,0.25); border-radius: 8px; }
.review-list { text-align: left; margin: 12px 0; }
.review-item { background: #120F1F; border: 1px solid rgba(154,147,184,0.35); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.review-item .review-title { font-family: Orbitron; font-size: 14px; }
.review-item .review-sub { font-size: 14px; color: #9A93B8; }

/* Step 15 fix (b): endgame buttons stay visible without scrolling.
   The result sheet is a flex column capped at the viewport; the
   review list scrolls inside it, and every button, image and stat
   block keeps its size, so Play Again / Share Result / Back to Home
   sit in a fixed row area at the bottom of the panel. */
#board-result-overlay .overlay-sheet { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); overflow: hidden; }
#board-result-overlay .overlay-sheet > img,
#board-result-overlay .overlay-sheet > h2,
#board-result-overlay .overlay-sheet > p,
#board-result-overlay .endgame-stats,
#board-result-overlay .overlay-sheet > canvas,
#board-result-overlay .overlay-sheet > button { flex-shrink: 0; }
#board-result-overlay .review-list,
#board-result-overlay #result-review-list { overflow-y: auto; flex: 1 1 auto; min-height: 0; }

/* Step 15 Customize picker. */
.picker-preview { text-align: center; margin: 8px 0 12px 0; border-radius: 16px; padding: 10px; }
.picker-preview canvas { width: 100%; max-width: 280px; height: auto; border-radius: 12px; border: 1px solid rgba(0,229,255,0.4); display: block; margin: 0 auto; }
.picker-filters { flex-wrap: wrap; overflow-x: auto; }
.picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.picker-card { position: relative; background: #120F1F; border: 1px solid rgba(154,147,184,0.35); border-radius: 14px; padding: 8px; color: #F2F0FF; cursor: pointer; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.picker-card.is-selected { border-color: #00E5FF; box-shadow: 0 0 14px rgba(0,229,255,0.45); }
.picker-card img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; }
.picker-card-name { font-size: 12px; line-height: 1.2; text-align: center; }
.picker-low-contrast-triangle { position: absolute; top: 0; right: 0; width: 0; height: 0; border-top: 14px solid #FFB020; border-left: 14px solid transparent; }

.picker-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: #00E5FF; color: #07060D; display: flex; align-items: center; justify-content: center; }
.picker-check .icon-svg { width: 14px; height: 14px; }
.picker-heart { position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; color: #9A93B8; display: flex; align-items: center; justify-content: center; }
.picker-heart .icon-svg { width: 18px; height: 18px; }
.picker-heart.is-fav { color: #FF2BD6; }
.picker-heart.is-fav .icon-svg { fill: #FF2BD6; }
.picker-dots { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.picker-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(154,147,184,0.4); border: none; cursor: pointer; padding: 0; }
.picker-dot.is-active { background: #00E5FF; }
.search-input { width: 100%; box-sizing: border-box; background: #120F1F; border: 1px solid rgba(154,147,184,0.4); border-radius: 12px; color: #F2F0FF; font-size: 16px; padding: 11px 12px; }

/* Step 15 v2 picker layout, matching mockup 4_customize.png. */
#customize-overlay .picker-sheet { display: flex; flex-direction: column; height: calc(100dvh - 32px); max-height: none; overflow: hidden; }
#customize-overlay .picker-sheet > * { flex-shrink: 0; }
/* Picker fix (Eric/Claude decision, 2026-11-05): only the title, the
   compact live preview, the tabs and the search stay fixed. Everything
   else — Featured, Complete Looks, crown/finish rows, filter chips and
   the grid — scrolls together inside .picker-scroll, and DONE stays
   pinned at the bottom. The grid no longer scrolls on its own. */
#customize-overlay .picker-fixed { flex-shrink: 0; }
#customize-overlay .picker-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; position: relative; }
#customize-overlay .picker-scroll .picker-grid { flex: none; overflow: visible; }
#customize-overlay .picker-bottom-bar { flex-shrink: 0; }
#customize-overlay .sheet-top h2 { font-size: 20px; letter-spacing: 1px; }
.picker-preview { position: relative; height: 64px; flex-shrink: 0; overflow: hidden; border-radius: 16px; border: 1px solid rgba(0,229,255,0.4); margin: 8px 0 8px 0; padding: 0; box-sizing: border-box; }
.picker-preview canvas { width: 100%; max-width: none; height: 64px; display: block; }
.picker-preview-label { position: absolute; left: 10px; bottom: 10px; background: rgba(7,6,13,0.7); border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.picker-preview-summary { margin: 0 0 4px 0; }
.picker-scroll-row { flex-wrap: nowrap !important; overflow-x: auto !important; scrollbar-width: none; }
.picker-scroll-row::-webkit-scrollbar { display: none; }
.picker-scroll-row .tab-pill { flex-shrink: 0; }
.picker-segmented { display: flex; background: #120F1F; border: 1px solid rgba(154,147,184,0.35); border-radius: 14px; padding: 4px; gap: 4px; }
.picker-segmented .tab-pill { flex: 1; border: none; background: transparent; margin: 0; }
.picker-segmented .tab-pill.is-selected { background: #00E5FF; color: #07060D; }
.picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; padding-bottom: 4px; }
.picker-card { position: relative; background: #120F1F; border: 1px solid rgba(154,147,184,0.35); border-radius: 14px; padding: 8px; color: #F2F0FF; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; min-height: 0; }
.picker-card.is-selected { border-color: #00E5FF; box-shadow: 0 0 16px rgba(0,229,255,0.65); }
.picker-card img { width: 100%; max-width: 88px; height: auto; aspect-ratio: 1; object-fit: contain; display: block; margin: 0 auto; }
.picker-card-name { font-size: 12px; line-height: 1.2; text-align: center; }
.picker-check { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: #00E5FF; color: #07060D; display: flex; align-items: center; justify-content: center; }
.picker-check .icon-svg { width: 14px; height: 14px; }
.picker-heart { position: absolute; top: 6px; right: 6px; left: auto; width: 26px; height: 26px; color: #9A93B8; display: flex; align-items: center; justify-content: center; }
.picker-heart .icon-svg { width: 18px; height: 18px; }
.picker-heart.is-fav { color: #FF2BD6; }
.picker-heart.is-fav .icon-svg { fill: #FF2BD6; }
.picker-page-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.picker-page-text { font-size: 13px; color: #9A93B8; }
.picker-dots { display: flex; gap: 8px; justify-content: center; margin-top: 0; }
.picker-bottom-bar { display: flex; gap: 12px; margin-top: 12px; padding-top: 4px; }
.picker-bottom-bar .btn-secondary { flex: 0 0 auto; margin-top: 0 !important; }
.picker-bottom-bar .btn-primary { flex: 1; margin-top: 0 !important; }

/* Step 15 v2: picker layout by id as well as class, so a test page
   that copies the overlay without its classes still lays out. */
#picker-preview { position: relative; height: 64px; flex-shrink: 0; overflow: hidden; border-radius: 16px; border: 1px solid rgba(0,229,255,0.4); margin: 8px 0 8px 0; padding: 0; box-sizing: border-box; }
#picker-preview canvas { width: 100%; max-width: none; height: 64px; display: block; }
#picker-tabs, #picker-filters, #picker-finish-bar, #picker-variant-bar { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
#picker-side { display: flex; background: #120F1F; border: 1px solid rgba(154,147,184,0.35); border-radius: 14px; padding: 4px; gap: 4px; }
#picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; padding-bottom: 4px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#picker-dots { display: flex; gap: 8px; justify-content: center; margin-top: 0; }
#picker-bottom-bar { display: flex; gap: 12px; margin-top: 12px; padding-top: 4px; }

/* Wizard (v6): the sheet is a fixed-height flex column like the
   picker sheet — fixed header (title, progress, step label), a
   scroll area for the step, and a pinned bottom bar (Back / NEXT).
   v7: the 'Use last choices' link under the bar is gone. */
.wizard-sheet { display: flex; flex-direction: column; height: calc(100dvh - 32px); max-height: none; overflow: hidden; }
.wizard-sheet > * { flex-shrink: 0; }
.wizard-fixed { flex-shrink: 0; }
.wizard-progress { height: 6px; background: #120F1F; border-radius: 999px; overflow: hidden; margin: 10px 0 6px 0; }
.wizard-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); border-radius: 999px; transition: width 0.2s ease; }
.wizard-step-label { margin: 0 0 4px 0; }
.wizard-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; position: relative; }
/* v10: the wizard body is exactly the scroll viewport tall, so the
   picker host (height:100%) cannot grow past it and the wizard
   panel never scrolls inside. The picker's own .picker-scroll
   scrolls internally when its grid needs it. */
#wizard-body { height: 100%; min-height: 0; }
/* v10: tighten the wizard picker's vertical spacing so the 3-row
   grid + page row fit the panel (the board step's 2-line tile
   names made its grid 15px too tall). Scoped to the wizard so
   Customize is untouched. */
#wizard-body .picker-grid { gap: 6px; }
#wizard-body #picker-search { padding-top: 6px; padding-bottom: 6px; }
#wizard-body .picker-page-row { margin-top: 4px; }
.wizard-bottom-bar { flex-shrink: 0; display: flex; gap: 12px; margin-top: 12px; padding-top: 4px; }
.wizard-bottom-bar .btn-secondary { flex: 0 0 auto; margin-top: 0 !important; }
.wizard-bottom-bar .btn-primary { flex: 1; margin-top: 0 !important; }
/* v11: at 360 px the three bar buttons need 324 px (Back 87 + SELECT 120 +
   NEXT 93 + 2 x 12 gap) but the sheet gives only 286 px, so NEXT overflowed
   the sheet by 16 px (pre-existing in v10 — see its step-5 360x640 shot).
   Trim only the bar's gap and the buttons' side padding at narrow widths;
   touch height (48 px) and every other screen are unchanged. */
@media (max-width: 380px) {
  .wizard-bottom-bar { gap: 8px; }
  .wizard-bottom-bar .btn { padding-left: 12px; padding-right: 12px; }
}
.wizard-step-title { font-family: "Orbitron"; font-size: 16px; letter-spacing: 0.5px; margin: 6px 0 12px 0; }
.wizard-step-note { color: var(--muted); font-size: 14px; margin: 0 0 12px 0; }
/* v7: the selected rule preset's 2-sentence description, shown
   directly under its card. */
.wizard-rule-detail { color: var(--text); font-size: 14px; line-height: 1.45; margin: 2px 2px 12px 2px; }
/* Wizard player step: vs Computer and Pass & Play are image cards
   in a two-column grid (the old Setup card presentation); Puzzles
   keeps its icon card below. The image slot is 131 x 175 (3:4, the
   file's own aspect, so nothing stretches); the name and description
   sit below the image, centred. */
.wizard-player-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 0; }
.player-image-card { padding: 6px; margin-top: 0; }
.player-image-card img { width: 131px; height: auto; border-radius: 10px; display: block; margin: 0 auto; }
.player-image-card .mode-name { margin-top: 8px; justify-content: center; text-align: center; white-space: nowrap; font-family: "Rajdhani"; font-size: 13px; }
.player-puzzles-card .mode-name { font-family: "Rajdhani"; font-size: 13px; }
.player-image-card .mode-desc { text-align: center; }
/* Wizard embedding: the picker host inside a step mirrors the
   picker sheet minus tabs, side toggle, Looks and the bottom bar,
   and fills the wizard's scroll area. */
.picker-host { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.picker-host .picker-fixed { flex: none; }
.picker-host .picker-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#wizard-overlay .picker-scroll .picker-grid { flex: none; overflow: visible; }
.picker-host-bar { flex: none; display: flex; justify-content: flex-end; padding-top: 10px; }
.picker-host-bar .btn { margin-top: 0; }
/* A blocked item (wizard: opponent colour too close to the
   player's) is greyed out and cannot be picked. */
.picker-card.is-blocked, .picker-featured-card.is-blocked { opacity: 0.35; }
/* OPTIONS (v6) + HIGH SCORES (v6) cards: one raised card holding
   the rows, then the action buttons below it. */
.options-card, .high-scores-card {
  background: var(--panel);
  border: 1px solid rgba(0,229,255,0.25);
  border-radius: 16px;
  padding: 4px 16px;
  margin-top: 12px;
}
.options-row { padding: 12px 0; }
.options-row + .options-row { border-top: 1px solid rgba(255,255,255,0.08); }
.options-link {
  display: inline-block;
  background: none; border: none; padding: 6px 0 0 0;
  color: var(--cyan); font-family: "Rajdhani"; font-size: 15px; font-weight: 600;
  text-decoration: underline; cursor: pointer;
}
/* Move Timer drop-up: the menu opens upward from its row, inside
   the card, so it never runs off the bottom of the screen. */
.options-timer-row { position: relative; }
.move-timer-btn {
  background: var(--bg); border: 1px solid var(--cyan); border-radius: 8px;
  color: var(--text); font-family: "Rajdhani"; font-size: 15px; font-weight: 600;
  padding: 8px 12px; min-width: 118px; text-align: left; cursor: pointer;
}
.move-timer-btn::after { content: " \25BE"; color: var(--cyan); }
.move-timer-menu {
  display: none; position: absolute; bottom: calc(100% + 4px); left: 0; right: 0;
  background: var(--panel); border: 1px solid var(--cyan); border-radius: 12px;
  padding: 4px; z-index: 5; box-shadow: 0 -8px 24px rgba(0,0,0,0.5);
}
.move-timer-menu.is-open { display: block; }
.move-timer-option {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--text); font-family: "Rajdhani"; font-size: 16px; font-weight: 600;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.move-timer-option.is-selected { background: rgba(0,229,255,0.15); color: var(--cyan); }
/* More Settings row under the OPTIONS card. */
.options-more-row {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  background: transparent; border: 1px solid rgba(0,229,255,0.35); border-radius: 12px;
  padding: 14px 16px; margin-top: 16px; color: var(--text);
  font-family: "Rajdhani"; font-size: 16px; font-weight: 600; cursor: pointer;
}
.options-more-row .chev { color: var(--cyan); display: flex; }
/* HIGH SCORES (v6) card rows. v9: compact, so the scores, RESET
   and BACK fit inside the panel without scrolling at 375x553. */
.high-scores-head { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 6px 0 0 0; }
.high-scores-rating { font-family: "Orbitron"; font-size: 24px; font-weight: 700; color: var(--cyan); letter-spacing: 1px; }
.high-scores-rank { font-family: "Rajdhani"; font-size: 15px; font-weight: 600; color: var(--text); }
.high-scores-hint { flex-basis: 100%; text-align: center; font-size: 12px; margin: 2px 0 0 0; }
.high-scores-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 6px 0; border-top: 1px solid rgba(255,255,255,0.08);
}
.high-scores-label { font-family: "Rajdhani"; font-size: 16px; color: var(--text); }
.high-scores-value { font-family: "Rajdhani"; font-size: 16px; font-weight: 600; color: var(--cyan); text-align: right; }
/* v9: Records as a 2x2 grid of stat cells (label over value). */
.high-scores-records { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.high-scores-stat { background: var(--bg); border: 1px solid rgba(154,147,184,0.25); border-radius: 12px; padding: 6px 10px; display: flex; flex-direction: column; gap: 1px; }
.high-scores-stat-label { font-family: "Rajdhani"; font-size: 13px; color: var(--muted); }
.high-scores-stat-value { font-family: "Rajdhani"; font-size: 16px; font-weight: 700; color: var(--cyan); }
/* v9: tighter card + buttons on High Scores only. */
#high-scores-card { margin-top: 6px; padding: 2px 16px; }
#high-scores-card .section-label { margin: 6px 0 2px 0; }
#high-scores-card > p.muted { margin: 4px 0; }
#high-scores-overlay .overlay-sheet { padding: 16px; }
#high-scores-overlay h2 { margin-bottom: 0; }
#high-scores-reset-btn { min-height: 44px; padding: 8px 18px; }
#high-scores-back-btn { min-height: 44px; padding: 8px 18px; }
/* The RESET confirm box, shown inside the sheet. */
.high-scores-confirm {
  background: var(--bg); border: 1px solid var(--danger); border-radius: 16px;
  padding: 16px; margin-top: 16px; text-align: center;
}
/* v9: the confirm box has no .overlay class, so the generic
   ".overlay.hidden-overlay" rule never hid it — it showed on open.
   Hidden until RESET taps it open. */
.high-scores-confirm.hidden-overlay { display: none; }
.high-scores-confirm p { margin: 0 0 12px 0; font-size: 16px; }
/* Destructive button: red, for the RESET confirm. */
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:active { background: #e02a4a; }
/* Music tracks have no thumbnail: a note icon fills the swatch so
   the card shows a name and a picture, like every other option. */
.picker-no-thumb-wrap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 64px; }
.picker-no-thumb { width: 52px; height: 52px; color: var(--cyan); }

/* Step 16 polish (c): tiles stay square at every width. The card
   itself is square; the swatch flexes inside it and object-fit
   contains it, so swatches never overflow their tiles. */
.picker-card { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 6px; gap: 4px; min-height: 0; }
.picker-card img { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; height: 100%; max-height: 100%; aspect-ratio: 1; object-fit: contain; display: block; margin: 0 auto; }
.picker-card-name { flex-shrink: 0; font-size: 11px; line-height: 1.15; max-height: 2.3em; overflow: hidden; text-align: center; }
#picker-grid .picker-card { box-sizing: border-box; }

/* Step 16: Zen Mode — top bar, buttons, panels and status fade to
   0%; only the board and scene remain. Clocks (.panel-timer and
   .board-timers) stay visible in timed matches. */
#board-screen.zen-hidden #board-topbar,
#board-screen.zen-hidden #board-controls,
#board-screen.zen-hidden #board-status-pill,
#board-screen.zen-hidden #board-confirm-bar,
#board-screen.zen-hidden .player-panel .panel-text,
#board-screen.zen-hidden .player-panel .panel-icon,
#board-screen.zen-hidden .board-bar-main .board-turn,
#board-screen.zen-hidden .board-bar-main .board-prompt,
#board-screen.zen-hidden .board-bar-main .board-toast,
#board-screen.zen-hidden .board-bar button { opacity: 0; pointer-events: none; transition: opacity 0.4s; }
#board-screen.zen-hidden .panel-timer,
#board-screen.zen-hidden .board-bar-main .board-timers { opacity: 1; }
/* Step 16: Reduce Motion — shorter animations everywhere. */
body.reduce-motion * { animation-duration: 0.1s !important; transition-duration: 0.1s !important; }

/* Step 16 v2 (b): compact puzzle tiles, about 4-5 per row. */
.puzzle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; margin-bottom: 14px; }
.puzzle-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; aspect-ratio: 1; box-sizing: border-box; background: #1C1730; border: 1px solid rgba(154,147,184,0.35); border-radius: 12px; color: #F2F0FF; padding: 6px 2px; }
.puzzle-tile-num { font-family: Orbitron; font-size: 18px; font-weight: 700; }
.puzzle-tile-goal { font-size: 10px; line-height: 1.15; color: #9A93B8; text-align: center; }
.puzzle-tile.is-solved { border-color: #00E5FF; box-shadow: 0 0 10px rgba(0,229,255,0.45); }
.puzzle-tile-check { position: absolute; top: 4px; right: 6px; color: #39FF88; font-size: 13px; font-weight: 700; }
/* Step 16 v2 (c): settings rows — title + switch on one line,
   description full width underneath, never squeezed beside it. */
.settings-row { display: block !important; }
.settings-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-row-head .switch-label { flex: 1 1 auto; min-width: 0; }
.settings-row-note { margin: 4px 0 0 0 !important; font-size: 13px; line-height: 1.35; }
/* Step 16 v2 (d): Zen Mode fades the whole panel — background and
   border too — so no empty dark boxes remain. Timers are not
   opacity-faded, so they stay visible as plain text without a box. */
#board-screen.zen-hidden .player-panel,
#board-screen.zen-hidden .board-bar { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }

/* Step 17: crown row on the Pieces tab (secondary row under the
   finish bar). Crown buttons show the gold crown thumbnails. */
.picker-crown-label { align-self: center; font-size: 13px; color: #9A93B8; margin-right: 6px; }
.picker-crown-btn { background: #1C1730; border: 1px solid rgba(154,147,184,0.35); border-radius: 10px; padding: 4px; cursor: pointer; }
.picker-crown-btn.is-selected { border-color: #00E5FF; box-shadow: 0 0 10px rgba(0,229,255,0.45); }
.picker-crown-btn img { display: block; width: 36px; height: 36px; }

/* Step 17 v2: picker tile swatches. The box itself is square
   (aspect-ratio from its own width), so a tile row's height never
   depends on a loading image and rows cannot squash or overlap.
   Tile canvases (Pieces tab) fill the box exactly. */
.picker-card { min-width: 0; }
.picker-card-swatch { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.picker-card-swatch img { width: 100%; height: 100%; max-width: none; object-fit: contain; display: block; margin: 0; }
.picker-card-swatch canvas { width: 100%; height: 100%; display: block; }

/* Step 17 v3: Pieces-tab phone layout. The finish chips and the
   crown choices share ONE horizontally scrolling row, so the grid
   keeps room for a full tile row at phone sizes. Grid rows size to
   their content and never compress below it, and cards carry a
   floor high enough for a swatch plus a two-line name, so a swatch
   can never overflow into the next row. The picker itself is
   slightly tighter (padding, row margins) so the first tile row
   fits without scrolling at 360x740; the 110px preview strip stays.
   On short screens the summary line hides; the preview stays. */
#picker-option-row { display: flex; gap: 12px; align-items: center; overflow-x: auto; flex-wrap: nowrap; margin-top: 8px; scrollbar-width: none; }
#picker-option-row::-webkit-scrollbar { display: none; }
#picker-option-row #picker-finish-bar { margin-top: 0; flex-shrink: 0; }
/* Round 2 item 17: the crown row is its OWN single row, scrolling
   sideways with a fade at the edge; it never wraps. */
#picker-crown-row { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%); mask-image: linear-gradient(to right, black 88%, transparent 100%); }
#picker-crown-row::-webkit-scrollbar { display: none; }
#picker-crown-row #picker-crown-bar { margin-top: 8px; flex-shrink: 0; }
#picker-grid, #customize-overlay .picker-grid { grid-auto-rows: max-content; align-content: start; }
#picker-grid .picker-card, #customize-overlay .picker-card { min-height: 128px; }
/* v7: compact choice tiles on colours, designs, background, board and
   sound — 70% of the standard tile, 4 per row at 390 wide, centred
   with even spacing (the grid fills its full width). Music keeps the
   standard 3-per-row tiles; the difficulty step uses mode cards, not
   picker tiles, and is unchanged. Labels stay 11 px, wrap to 2 lines,
   then ellipsis. The tick (22 px) and heart (26 px) are not shrunk,
   so they stay visible. The live preview is untouched.
   .picker-special rows span the full grid on compact tabs: the v6
   sound grid was broken because the interface-sounds row (a grid item
   in one cell) forced its column to 1756 px, squashing the tiles to
   14 px. Spanning + min-width 0 fixes the column widths. */
#picker-grid.picker-grid-compact, .picker-grid.picker-grid-compact { grid-template-columns: repeat(4, 1fr); }
#picker-grid.picker-grid-compact .picker-card, .picker-grid.picker-grid-compact .picker-card { min-height: 90px; }
#picker-grid.picker-grid-compact .picker-card-name, .picker-grid.picker-grid-compact .picker-card-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
#picker-grid.picker-grid-compact .picker-special, .picker-grid.picker-grid-compact .picker-special { grid-column: 1 / -1; min-width: 0; }
#customize-overlay .picker-sheet { padding: 16px; }
#picker-grid { margin-top: 8px; }
#customize-overlay .picker-page-row { margin-top: 6px; }
@media (max-height: 760px) {
  #customize-overlay .picker-preview-summary { display: none; }
  /* Picker fix (2026-11-05): on short screens the scroll viewport is
     only ~387 px tall, so 3 full 128 px grid rows (404 px + gaps) do
     not fit. Slightly shorter tiles (112 px) let 3 full rows show
     without scrolling; the tiles stay well above the 44 px touch
     target. Only applies below 760 px height (390x844 is unaffected). */
  #customize-overlay #picker-grid .picker-card, #customize-overlay .picker-grid .picker-card { min-height: 112px; }
  /* v7: compact tiles at short heights — 70% of the 112 px floor. */
  #customize-overlay #picker-grid.picker-grid-compact .picker-card, #customize-overlay .picker-grid.picker-grid-compact .picker-card { min-height: 78px; }
}

/* ===== Step 18 — background scene layers =====
   Home: fixed siblings sitting above .home-bg (same z, later in the
   DOM) and below the glow and the content. Board: negative-z children
   of #board-screen, so they paint above the screen's own background
   but below every panel, button and the board itself. Both layers are
   pointer-transparent and never block taps. The scrim keeps the board
   and buttons readable over every background, however busy. */
#home-scene-layer, #home-scene-scrim {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
#home-scene-layer img, #home-scene-layer canvas {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
#home-scene-scrim { background: rgba(7,6,13,0.5); }
#board-scene-layer, #board-scene-scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
}
#board-scene-layer img, #board-scene-layer canvas {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
#board-scene-scrim { background: rgba(7,6,13,0.5); }

.board-you-line { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.you-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(242,240,255,0.6); }
.board-you-bar { text-align: center; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; padding: 4px 0 2px; }

/* Step 23 item 17: at narrow widths the Pieces option row wraps,
   so the crown row sits on its own line and stays fully visible
   at 360 px instead of hiding past the finish chips' scroll. */


/* Step 23 item 18: left-handed toolbar mirrors the button order. */
body.left-handed #board-controls { direction: rtl; }
body.left-handed #board-controls > * { direction: ltr; }
body.left-handed .board-bar { flex-direction: row-reverse; }
/* Step 23 item 18: screen-reader square grid over the board canvas.
   Buttons never intercept pointer input (canvas keeps tap + drag);
   they stay keyboard/screen-reader focusable and show a focus ring. */
.board-a11y-grid { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.board-a11y-btn { position: absolute; background: transparent; border: none; padding: 0; opacity: 0; pointer-events: none; }
.board-a11y-btn:focus-visible { opacity: 1; background: rgba(0,229,255,0.25); outline: 2px solid #00E5FF; outline-offset: -2px; }

/* Step 23 item 21: Featured strip + Complete Looks row. */
.picker-featured-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.picker-featured-card { flex: 0 0 auto; width: 76px; background: #1C1730; border: 1px solid rgba(154,147,184,0.35); border-radius: 12px; padding: 6px; cursor: pointer; }
.picker-featured-card.is-selected { border-color: #00E5FF; box-shadow: 0 0 10px rgba(0,229,255,0.45); }
.picker-featured-swatch { width: 64px; height: 64px; margin: 0 auto; }
.picker-featured-swatch canvas, .picker-featured-swatch img { width: 64px; height: 64px; display: block; border-radius: 8px; }
.picker-featured-name { display: block; font-size: 11px; text-align: center; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-looks-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }

/* Step 23 item 22: Puzzle of the Day panel on Home. */
/* Puzzle of the Day row at the top of the Puzzles screen: one slim
   row, about 56 px — icon, label, streak, check when solved, play. */
.potd-row {
  display: flex; align-items: center; gap: 10px; flex: none;
  width: 100%; min-height: 56px; padding: 6px 12px; margin-bottom: 12px;
  background: #1C1730; border: 1px solid rgba(0,229,255,0.4); border-radius: 16px;
  color: var(--text); cursor: pointer; text-align: left;
}
.potd-row:active { transform: scale(0.98); border-color: var(--cyan); }
.potd-row-icon { color: var(--cyan); display: inline-flex; flex: none; }
.potd-row-icon svg { width: 26px; height: 26px; }
.potd-row-label { font-family: "Orbitron"; font-weight: 700; font-size: 14px; letter-spacing: 0.5px; flex: 1; min-width: 0; }
.potd-row-streak { color: var(--muted); font-size: 13px; flex: none; }
.potd-row-streak:empty { display: none; }
.potd-row-check { display: inline-flex; flex: none; }
.potd-row-check svg { width: 20px; height: 20px; }
.potd-row-play { color: var(--cyan); display: inline-flex; flex: none; }
.potd-row-play svg { width: 20px; height: 20px; }
