:root {
  /* Cupcake Entertainment brand — aligned with studio site preview */
  --cupcake-blue: #a4d2e7;
  --cupcake-blue-deep: #7eb8d4;
  --cupcake-red: #b33c3c;
  --cupcake-ink: #120b0a;
  --cupcake-center: #3d2621;
  --cupcake-edge: #0f0908;

  --bg: var(--cupcake-edge);
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --panel: rgba(42, 28, 26, 0.92);
  --tile: #4a342f;
  --letter: #5a9ec0;
  --action: var(--cupcake-blue);
  --action-ink: var(--cupcake-ink);
  --undo: var(--cupcake-blue);
  --ok: #53c47a;
  --bad: #e45b55;
  --board-surface: #2a1c1a;
  --card: #2a1c1a;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --font: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --page-bg1: var(--cupcake-center);
  --page-bg2: #1a100e;
  --stage-bg: #0a0605;
  --word-row: rgba(255, 255, 255, 0.08);
  --word-ink: #ffffff;
  --restart-bg: rgba(255, 255, 255, 0.08);
  --restart-ink: #ffffff;
  --cap-shadow: 0 2px 8px rgba(164, 210, 231, 0.28);
  --btn-radius: 10px;
  --chip-radius: 10px;
  --pad-zoom: 1;
  --pad-base: 780px;
  --chrome-h: 210px;
  --nav-tracking: 0.12em;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
}

body,
body.dark {
  --bg: var(--cupcake-edge);
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --panel: rgba(42, 28, 26, 0.94);
  --tile: #4a342f;
  --letter: #5a9ec0;
  --action: var(--cupcake-blue);
  --action-ink: var(--cupcake-ink);
  --undo: var(--cupcake-blue);
  --board-surface: #2a1c1a;
  --card: #2a1c1a;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  --page-bg1: var(--cupcake-center);
  --page-bg2: #1a100e;
  --stage-bg: #0a0605;
  --word-row: rgba(255, 255, 255, 0.08);
  --word-ink: #ffffff;
  --restart-bg: rgba(255, 255, 255, 0.08);
  --restart-ink: #ffffff;
  --cap-shadow: 0 2px 8px rgba(164, 210, 231, 0.28);
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, var(--page-bg1) 0%, transparent 68%),
    radial-gradient(ellipse 90% 70% at 50% 100%, #1c1210 0%, transparent 55%),
    var(--cupcake-edge);
  color: var(--ink);
}

body.light {
  --bg: #f4ebe6;
  --ink: #1a100e;
  --muted: rgba(26, 16, 14, 0.62);
  --panel: rgba(255, 250, 247, 0.94);
  --tile: #ebe0d8;
  --letter: #3d7fa0;
  --action: #6aa8c4;
  --action-ink: #ffffff;
  --undo: #6aa8c4;
  --board-surface: #d9cfc6;
  --card: #fffaf7;
  --shadow: 0 14px 36px rgba(40, 20, 16, 0.16);
  --page-bg1: #e8d5cb;
  --page-bg2: #f0e4dc;
  --stage-bg: #2a1c1a;
  --word-row: rgba(255, 255, 255, 0.9);
  --word-ink: #1a100e;
  --restart-bg: #e4d6cc;
  --restart-ink: #1a100e;
  --cap-shadow: 0 2px 6px rgba(58, 120, 150, 0.28);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, var(--page-bg1) 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
}

.app {
  max-width: min(1280px, 100%);
  width: 100%;
  margin: 0 auto;
  padding: 10px 16px 14px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 10px;
  padding: 6px 2px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.light .topbar {
  border-bottom-color: rgba(26, 16, 14, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
}

.brand img {
  height: 36px;
  width: auto;
  display: block;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 36rem;
  line-height: 1.35;
  font-weight: 500;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.zoom-label {
  min-width: 3.6rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.chip.zoom {
  width: 2.4rem;
  padding-left: 0;
  padding-right: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.chip, .btn {
  border: 0;
  border-radius: var(--chip-radius);
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.chip:hover:not(:disabled),
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.chip {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: var(--nav-tracking);
}

body.light .chip {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(26, 16, 14, 0.14);
}

.chip.active {
  background: var(--cupcake-blue);
  color: var(--cupcake-ink);
  border-color: transparent;
}

body.light .chip.active {
  background: var(--action);
  color: #fff;
}

.btn {
  background: var(--cupcake-blue);
  color: var(--cupcake-ink);
  border-radius: var(--btn-radius);
}

body.light .btn {
  background: var(--action);
  color: var(--action-ink);
}

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

body.light .btn.secondary {
  border-color: rgba(26, 16, 14, 0.28);
  background: transparent;
  color: var(--ink);
}

.btn:disabled,
.chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.stage {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 8px 0 8px;
  overflow: visible;
  background: transparent;
}

.device {
  --board-max: min(
    calc(100vh - var(--chrome-h)),
    calc(var(--pad-base) * var(--pad-zoom) * 0.62)
  );
  --device-width: min(
    96vw,
    calc(var(--pad-base) * var(--pad-zoom)),
    calc(var(--board-max) / 0.68)
  );
  width: fit-content;
  max-width: 96vw;
  background: var(--stage-bg);
  border-radius: 18px;
  padding: calc(12px * min(var(--pad-zoom), 1.35));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-columns: var(--board-max) minmax(190px, calc(var(--board-max) * 0.42));
  gap: calc(12px * min(var(--pad-zoom), 1.35));
  align-items: stretch;
}

@media (max-width: 760px) {
  .brand p { font-size: 0.85rem; }
  .device {
    grid-template-columns: 1fr;
    width: min(94vw, calc(var(--pad-base) * var(--pad-zoom)));
  }
  .side {
    max-height: none;
  }
  .board-wrap {
    width: 100%;
    max-height: none;
  }
}

.board-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  width: var(--board-max);
  max-width: 100%;
  max-height: var(--board-max);
  justify-self: start;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: none;
}

.board {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 0.55%;
  padding: 1.8%;
  background: var(--board-surface);
  border-radius: 16px;
  user-select: none;
  touch-action: none;
}

.cell {
  background: var(--tile);
  border-radius: 14%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: clamp(0.65rem, 1.9vw + 0.15rem, 1.2rem);
  color: transparent;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 2px 3px rgba(0, 0, 0, 0.35);
  position: relative;
}

body.light .cell {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 2px 3px rgba(40, 20, 16, 0.12);
}

.cell.letter {
  background: linear-gradient(145deg, #7eb8d4 0%, #3d7fa0 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 2px 6px rgba(30, 80, 110, 0.4);
}

.cell.preview-ok {
  background: color-mix(in srgb, var(--ok) 78%, #fff);
  color: #fff;
}

.cell.preview-bad {
  background: color-mix(in srgb, var(--bad) 82%, #fff);
  color: #fff;
}

.cell.letter.draft {
  background: color-mix(in srgb, var(--bad) 82%, #fff);
  color: #fff;
}

.cell.letter.draft.draft-valid {
  background: color-mix(in srgb, var(--ok) 78%, #fff);
}

.cell.endpoint.last::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 18%;
  box-shadow:
    0 0 0 1.75px var(--cupcake-blue),
    0 0 6px rgba(164, 210, 231, 0.45);
  pointer-events: none;
  z-index: 2;
}

.splitter-layer {
  position: absolute;
  inset: 1.8%;
  pointer-events: none;
}

.splitter-layer .edge {
  position: absolute;
  background: #53da8d;
  border-radius: 999px;
  box-shadow: 0 0 6px rgba(83, 218, 141, 0.55);
}

.side {
  min-width: 0;
  width: 100%;
  max-height: var(--board-max);
  background: var(--panel);
  border-radius: 16px;
  padding: calc(12px * min(var(--pad-zoom), 1.4)) calc(12px * min(var(--pad-zoom), 1.4)) calc(10px * min(var(--pad-zoom), 1.4));
  display: flex;
  flex-direction: column;
  gap: calc(7px * min(var(--pad-zoom), 1.3));
  color: var(--ink);
  box-shadow: none;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

body.light .side {
  border-color: rgba(26, 16, 14, 0.08);
}

.side .logo-sm {
  height: calc(30px * min(var(--pad-zoom), 1.5));
  width: auto;
  align-self: center;
  margin-top: 2px;
  margin-bottom: 2px;
}

.level-meta {
  text-align: left;
  padding: 2px 2px 2px;
}

.level-line {
  margin: 0;
  font-size: calc(0.74rem * min(var(--pad-zoom), 1.35));
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.puzzle-title {
  margin: 3px 0 0;
  font-size: calc(1.05rem * min(var(--pad-zoom), 1.35));
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.words-heading {
  margin: 6px 0 0;
  font-size: calc(0.82rem * min(var(--pad-zoom), 1.35));
  font-weight: 800;
  color: var(--cupcake-blue);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.light .words-heading {
  color: var(--action);
}

.word-list {
  display: flex;
  flex-direction: column;
  gap: calc(6px * min(var(--pad-zoom), 1.3));
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding-right: 2px;
}

.word-list-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.continue-peek {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  z-index: 3;
}

.continue-peek[hidden] {
  display: none !important;
}

.continue-peek .btn {
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  background: #fff;
  color: rgba(0, 0, 0, 0.88);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

body.light .continue-peek .btn {
  background: #fff;
  color: rgba(0, 0, 0, 0.88);
}

.dialog .peek-board {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--muted, #8aa0b8);
  font-weight: 700;
  cursor: pointer;
}

.dialog .peek-board:hover {
  color: var(--cupcake-blue, #4aa3ff);
}

.word-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--word-row);
  color: var(--word-ink);
  border-radius: 12px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 700;
  font-size: calc(0.8rem * min(var(--pad-zoom), 1.35));
  touch-action: none;
  user-select: none;
  box-shadow: none;
}

body.light .word-row {
  border-color: rgba(26, 16, 14, 0.06);
  box-shadow: 0 1px 2px rgba(40, 20, 16, 0.06);
}

.word-row.selected {
  background: var(--word-row);
}

.word-row.placed {
  opacity: 0.7;
}

.word-row.placed .word-label {
  color: var(--muted);
}

.word-row.locked {
  opacity: 0.42;
  pointer-events: none;
}

.word-row.draft .word-label {
  color: color-mix(in srgb, var(--bad) 70%, var(--ink));
  font-weight: 700;
}

.word-row .draft-mark {
  color: var(--bad);
  margin-left: auto;
  margin-right: 6px;
  font-weight: 800;
}

.word-row.dragging {
  opacity: 0.35;
}

.word-row .word-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
  letter-spacing: 0.03em;
  text-align: center;
}

.word-cap {
  flex: 0 0 calc(30px * min(var(--pad-zoom), 1.35));
  width: calc(30px * min(var(--pad-zoom), 1.35));
  height: calc(30px * min(var(--pad-zoom), 1.35));
  border: 0;
  border-radius: 999px;
  background: var(--cupcake-blue);
  color: var(--cupcake-ink);
  font-weight: 800;
  font-size: calc(0.88rem * min(var(--pad-zoom), 1.35));
  cursor: grab;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  box-shadow: var(--cap-shadow);
}

body.light .word-cap {
  color: #fff;
  background: var(--action);
}

.word-cap:active {
  cursor: grabbing;
}

.word-row.placed .word-cap {
  display: none;
}

.word-row .check {
  color: var(--ok);
  margin-left: auto;
  margin-right: 6px;
  font-size: calc(0.95rem * min(var(--pad-zoom), 1.35));
  font-weight: 800;
}

.drag-ghost.cubes {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  width: 0;
  height: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  transform: translate(-8px, -8px);
}

.float-cube {
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    4px 4px 0 rgba(0, 0, 0, 0.18),
    0 4px 10px rgba(0, 0, 0, 0.28);
}

.drag-ghost.cubes.ok .float-cube {
  background: linear-gradient(145deg, #4cd964 0%, #248a3d 100%);
}

.drag-ghost.cubes.bad .float-cube {
  background: linear-gradient(145deg, #ff6b6b 0%, #c23b3b 100%);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: calc(8px * min(var(--pad-zoom), 1.3));
  margin-top: auto;
  padding-top: 6px;
}

.actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(8px * min(var(--pad-zoom), 1.3));
}

.actions .btn {
  width: 100%;
  border-radius: var(--btn-radius);
  padding: calc(12px * min(var(--pad-zoom), 1.25)) calc(10px * min(var(--pad-zoom), 1.25));
  font-size: calc(0.78rem * min(var(--pad-zoom), 1.35));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(164, 210, 231, 0.18);
}

.actions .btn .btn-icon {
  font-size: 1.05em;
  line-height: 1;
}

.actions .btn.home {
  background: var(--cupcake-blue);
  color: var(--cupcake-ink);
}

body.light .actions .btn.home {
  background: var(--action);
  color: #fff;
}

.actions .btn.help {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: none;
}

body.light .actions .btn.help {
  border-color: rgba(26, 16, 14, 0.22);
  color: var(--ink);
}

.actions .btn.undo {
  background: var(--cupcake-blue);
  color: var(--cupcake-ink);
  box-shadow: 0 2px 10px rgba(164, 210, 231, 0.22);
}

body.light .actions .btn.undo {
  color: #fff;
  background: var(--action);
}

.actions .btn.restart {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: none;
}

body.light .actions .btn.restart {
  border-color: rgba(26, 16, 14, 0.22);
  background: var(--restart-bg);
  color: var(--restart-ink);
}

.status {
  min-height: 1.1em;
  color: var(--muted);
  font-size: 0.82rem;
  margin: 8px 0 0;
  text-align: center;
}

.footer {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.light .footer {
  border-top-color: rgba(26, 16, 14, 0.1);
}

.footer .version,
.footer .copyright {
  flex: 1 0 100%;
  margin: 2px 0 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer .copyright {
  margin-top: 0;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

#getAppHint {
  color: var(--cupcake-blue);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

body.light #getAppHint {
  color: var(--action);
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-row a {
  text-decoration: none;
  background: var(--cupcake-blue);
  color: var(--cupcake-ink);
  padding: 9px 14px;
  border-radius: var(--btn-radius);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.store-row a:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.store-row a.play,
.store-row a.mac {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

body.light .store-row a {
  color: var(--cupcake-ink);
}

body.light .store-row a.play,
body.light .store-row a.mac {
  border-color: rgba(26, 16, 14, 0.22);
  color: var(--ink);
  background: transparent;
}

.publisher {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.publisher img {
  height: 54px;
  width: auto;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 4, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
  animation: overlay-in 0.28s ease-out;
}

.overlay[hidden] { display: none; }

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog {
  background: var(--card);
  color: var(--ink);
  border-radius: 18px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dialog.feature-dialog {
  max-width: 460px;
  padding: 0 0 18px;
  overflow: hidden;
  animation: dialog-in 0.34s cubic-bezier(0.2, 0.9, 0.25, 1);
  border: 1px solid rgba(164, 210, 231, 0.22);
}

.dialog-hero {
  padding: 22px 22px 14px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(164, 210, 231, 0.22) 0%, transparent 70%),
    linear-gradient(180deg, rgba(61, 38, 33, 0.9) 0%, var(--card) 100%);
}

body.light .dialog-hero {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(106, 168, 196, 0.22) 0%, transparent 70%),
    linear-gradient(180deg, #f0e4dc 0%, var(--card) 100%);
}

.dialog-logo {
  height: 40px;
  width: auto;
  display: block;
  margin: 0 auto 10px;
}

.dialog h2 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.dialog-prompt {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}

.dialog-score {
  margin: 0;
  color: var(--ok);
  font-weight: 800;
  font-size: 1.15rem;
}

.dialog-best {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
}

.dialog-pitch {
  margin-top: 4px;
}

.dialog-pitch[hidden] {
  display: none;
}

.dialog-lead {
  margin: 14px 22px 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.feature-list {
  list-style: none;
  margin: 0 18px 16px;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
}

.feature-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.light .feature-list li {
  background: rgba(26, 16, 14, 0.04);
  border-color: rgba(26, 16, 14, 0.06);
}

.feature-list .feat-icon {
  flex: 0 0 auto;
  width: 1.35rem;
  text-align: center;
  color: var(--cupcake-blue);
  font-weight: 800;
}

body.light .feature-list .feat-icon {
  color: var(--action);
}

.dialog-stores {
  justify-content: center;
  padding: 0 18px;
  gap: 10px;
}

.dialog-stores a {
  flex: 1 1 140px;
  text-align: center;
  padding: 13px 16px;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(164, 210, 231, 0.18);
}

.dialog .btn {
  margin: 12px 18px 0;
  width: calc(100% - 36px);
}

.dialog-actions {
  display: flex;
  gap: 10px;
  margin: 12px 18px 0;
}

.dialog-actions .btn {
  margin: 0;
  width: auto;
  flex: 1;
}

.picker-dialog {
  text-align: left;
}

.picker-dialog h2 {
  text-align: center;
  margin-bottom: 14px;
}

.picker-list {
  display: grid;
  gap: 10px;
}

.picker-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

body.light .picker-item {
  background: rgba(26, 16, 14, 0.03);
  border-color: rgba(26, 16, 14, 0.1);
}

.picker-item:hover,
.picker-item.current {
  border-color: var(--cupcake-blue);
  background: rgba(164, 210, 231, 0.12);
}

body.light .picker-item:hover,
body.light .picker-item.current {
  border-color: var(--action);
  background: rgba(106, 168, 196, 0.14);
}

.picker-item strong {
  font-size: 1.02rem;
}

.picker-item span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.picker-item.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.picker-item.locked:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

body.light .picker-item.locked:hover {
  border-color: rgba(26, 16, 14, 0.1);
  background: rgba(26, 16, 14, 0.03);
}

.help-dialog {
  text-align: left;
}

.help-dialog h2 {
  text-align: center;
  margin-bottom: 12px;
}

.help-figure {
  margin: 0 0 14px;
  display: flex;
  justify-content: center;
}

.help-figure[hidden] {
  display: none;
}

.help-board {
  width: min(220px, 100%);
  height: auto;
}

.help-cell {
  fill: var(--tile);
  stroke: rgba(164, 210, 231, 0.28);
  stroke-width: 1.5;
}

.help-cell.cross {
  fill: color-mix(in srgb, var(--cupcake-blue) 28%, var(--tile));
  stroke: var(--cupcake-blue);
}

.help-letter {
  fill: var(--cupcake-blue);
  font-family: var(--font);
  font-size: 24px;
  font-weight: 800;
  text-anchor: middle;
}

body.light .help-letter {
  fill: var(--action);
}

.help-letter.cross {
  fill: #ffffff;
}

body.light .help-letter.cross {
  fill: var(--action);
}

.help-rules {
  margin: 0 0 10px;
  padding-left: 1.2em;
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
}

.help-note {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}
