/* Solvizz promo site — cozy warm-paper aesthetic.
 * Palette + tokens mirror the game's global.css. Board is the visual anchor;
 * everything else sizes around it.
 */

:root {
  --paper-plate: #F5EDE0;
  --paper-panel: #ECE2D2;
  --paper-border: #D9CCB6;

  --bg-primary: #F5EDE0;
  --bg-secondary: #ECE2D2;

  --text-primary: #3A2E22;
  --text-muted: #7A6A55;
  --text-faint: rgba(122, 106, 85, 0.7);

  --accent: #C4805A;
  --accent-hover: #B0724E;
  --success: #6B9173;
  --danger: #B8463F;
  --warning: #C99844;

  --duration-snap: 120ms;
  --duration-smooth: 240ms;
  --ease-snap: cubic-bezier(0.2, 0.8, 0.2, 1);

  --region-accent: var(--accent);
  --cell-radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Quicksand', system-ui, -apple-system, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(196, 128, 90, 0.07), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(122, 106, 85, 0.06), transparent 70%),
    var(--bg-primary);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22 0 0 0 0 0.18 0 0 0 0 0.13 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.7;
  mix-blend-mode: multiply;
}

.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px 24px 16px;
  gap: 12px;
}
@media (min-width: 1400px) {
  .app { padding: 16px 32px 20px; gap: 14px; }
}

/* ---------------- Top bar ---------------- */

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.topbar__left { justify-self: start; }
.topbar > .btn { justify-self: end; }
.topbar__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  justify-self: center;
  font-size: 18px;
  color: var(--text-primary);
}
.topbar__brand-name { font-weight: 700; letter-spacing: -0.01em; }
.topbar__brand-sep { color: var(--text-muted); font-weight: 400; }
.topbar__day { font-weight: 600; }

.langpicker__select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--paper-plate);
  border: 1px solid var(--paper-border);
  border-radius: 999px;
  padding: 6px 26px 6px 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4 L6 8 L10 4' fill='none' stroke='%237A6A55' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 10px 10px;
}
.langpicker__select:hover { border-color: var(--text-muted); }

/* ---------------- Stage ----------------
 * Desktop: rules-side | board+palette | (spacer). Board dominates the middle.
 * Mobile:  board is anchored, rules collapsed above, palette below.
 */

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 24px;
  background: var(--paper-panel);
  border: 1px solid var(--paper-border);
  border-radius: 18px;
  padding: 20px 24px;
  box-shadow:
    0 2px 0 rgba(122, 106, 85, 0.08),
    0 14px 36px -18px rgba(58, 46, 34, 0.18);
  position: relative;
  overflow: hidden;
}
@media (min-width: 1400px) {
  .stage {
    grid-template-columns: 340px 1fr;
    gap: 32px;
    padding: 24px 28px;
  }
}

.side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}
.side__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
}

.play {
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: center;
  justify-items: center;
  min-height: 0;
  gap: 14px;
}

/* Board row = palette (right, vertical strip) beside the board. */
.board-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
}

/* ---------------- Region tag + streak ---------------- */

.region-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--region-accent) 20%, var(--paper-plate));
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--region-accent) 45%, transparent);
}
.region-tag::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--region-accent);
}

.streak {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.streak__flame { color: var(--accent); font-size: 14px; }
.streak__count { font-weight: 700; color: var(--text-primary); font-size: 16px; }

/* ---------------- Rules panel ---------------- */

.rules-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rules-panel__summary {
  display: none; /* hidden on desktop (rules always visible in side column) */
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--paper-plate);
  border: 1px solid var(--paper-border);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  list-style: none;
  user-select: none;
}
.rules-panel__summary::-webkit-details-marker { display: none; }
.rules-panel__label { flex: 0 0 auto; }
.rules-panel__count {
  flex: 1 1 auto;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12.5px;
}
.rules-panel__caret {
  flex: 0 0 auto;
  color: var(--text-muted);
  transition: transform var(--duration-snap) var(--ease-snap);
}
.rules-panel[open] .rules-panel__caret { transform: rotate(180deg); }

.rules {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 2px;
}

/* Rule card — accordion. Mirrors the game's RuleExplainer.svelte. */

.rule-card {
  padding: 8px 10px;
  background: var(--paper-plate);
  border: 1px solid var(--paper-border);
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.3;
  transition:
    border-color var(--duration-smooth) var(--ease-snap),
    background var(--duration-smooth) var(--ease-snap),
    box-shadow var(--duration-smooth) var(--ease-snap),
    opacity var(--duration-smooth) var(--ease-snap);
}
/* Violated: 20% color-mix background + rule color border + soft ring — game's
   game-parity treatment. Satisfied: no color-shift (spec: game keeps rule cards
   fully legible while playing). */
.rule-card[data-satisfied="false"] {
  border-color: var(--rule-color, var(--danger));
  background: color-mix(in srgb, var(--rule-color, var(--danger)) 20%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rule-color, var(--danger)) 60%, transparent);
}
.rule-card__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-size: inherit;
}
.rule-card__thumb {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--paper-plate) 60%, var(--paper-border) 40%);
  border: 1px solid var(--paper-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
}
.rule-card__thumb svg { width: 100%; height: 100%; }
.rule-card__title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12.5px;
  line-height: 1.25;
}
.rule-card__mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.rule-card[data-satisfied="true"] .rule-card__mark { background: var(--success); }
.rule-card[data-satisfied="false"] .rule-card__mark { background: var(--rule-color, var(--danger)); }
.rule-card[data-satisfied="unknown"] .rule-card__mark {
  background: transparent;
  color: transparent;
}
.rule-card__caret {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 12px;
  transition: transform var(--duration-snap) var(--ease-snap);
}
.rule-card[data-expanded="true"] .rule-card__caret { transform: rotate(180deg); }

/* Expanded body: detail text + Allowed/Violation examples side-by-side.
   Matches the game's RuleExplainer detail region. */
.rule-card__expand {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--paper-border);
  display: none;
}
.rule-card[data-expanded="true"] .rule-card__expand { display: block; }
.rule-card__detail {
  color: var(--text-muted);
  font-size: 11.5px;
  margin: 0 0 10px;
  line-height: 1.5;
}
.rule-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.rule-example { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rule-example svg { width: 100%; height: auto; max-width: 120px; }
.rule-example__caption {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rule-example__caption--allowed { color: var(--success); }
.rule-example__caption--violation { color: var(--danger); }

/* ---------------- Rule modal ---------------- */

.rule-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn var(--duration-smooth) var(--ease-snap);
}
.rule-modal[hidden] { display: none !important; }
.rule-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 46, 34, 0.35);
  cursor: pointer;
}
.rule-modal__panel {
  position: relative;
  z-index: 1;
  background: var(--paper-plate);
  border: 1px solid var(--paper-border);
  border-radius: 16px;
  padding: 26px 28px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px -12px rgba(58, 46, 34, 0.35);
  animation: fadeUp var(--duration-smooth) var(--ease-snap);
}
.rule-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: 0;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.rule-modal__close:hover { color: var(--text-primary); }
.rule-modal__thumb {
  width: 160px;
  height: 160px;
  margin: 0 auto 14px;
  padding: 10px;
  background: var(--paper-panel);
  border: 1px solid var(--paper-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rule-modal__thumb svg { width: 100%; height: 100%; }
.rule-modal__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary);
}
.rule-modal__detail {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ---------------- Board ---------------- */

.board-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  height: 100%;
  touch-action: none;
  user-select: none;
}
.board {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 8px;
  background: var(--paper-panel);
  border: 1px solid var(--paper-border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.cell {
  width: var(--cell-size, 64px);
  height: var(--cell-size, 64px);
  border-radius: var(--cell-radius);
  background: var(--bg-secondary);
  border: 1.5px solid color-mix(in srgb, var(--region-accent) 40%, var(--paper-border));
  cursor: pointer;
  transition:
    background-color var(--duration-snap) var(--ease-snap),
    transform var(--duration-snap) var(--ease-snap),
    box-shadow var(--duration-snap) var(--ease-snap);
  position: relative;
  outline: none;
  padding: 0;
  overflow: hidden;
}
.cell[data-hole="true"] {
  visibility: hidden;
  pointer-events: none;
}
.cell[data-locked="true"] {
  cursor: not-allowed;
  border-color: var(--text-primary);
  border-width: 2px;
}
/* Small SVG lock glyph in the top-LEFT corner — matches PuzzleScreen.svelte. */
.cell[data-locked="true"]::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Crect x='2' y='5' width='8' height='6' rx='1' fill='%233A2E22' opacity='0.85'/%3E%3Cpath d='M 4 5 V 3.5 A 2 2 0 0 1 8 3.5 V 5' fill='none' stroke='%233A2E22' stroke-width='1.2' opacity='0.85'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
/* Tactile press: match the game's --scale(1.04) on hover, --scale(0.94) on active. */
.cell:not([data-hole="true"]):not([data-locked="true"]):hover {
  transform: scale(1.04);
}
.cell:not([data-hole="true"]):not([data-locked="true"]):active {
  transform: scale(0.94);
}
/* Diagonal stripes overlay for violating cells — matches
   `.solvizz-violation-stripes` in the game's global.css. Pattern rotates by
   rule index (mod 4); `currentColor` is set from the cell's --rule-color so
   the stripes carry the rule's hue. */
.cell-stripes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  border-radius: inherit;
  color: var(--rule-color, var(--danger));
  background-image: repeating-linear-gradient(45deg, currentColor 0, currentColor 4px, transparent 4px, transparent 10px);
}
.cell-stripes[data-pattern="1"] {
  background-image: repeating-linear-gradient(-45deg, currentColor 0, currentColor 4px, transparent 4px, transparent 10px);
}
.cell-stripes[data-pattern="2"] {
  background-image: repeating-linear-gradient(90deg, currentColor 0, currentColor 4px, transparent 4px, transparent 10px);
}
.cell-stripes[data-pattern="3"] {
  background-image: repeating-linear-gradient(0deg, currentColor 0, currentColor 4px, transparent 4px, transparent 10px);
}

/* Alert badge (!) sits at the top-right corner of a violating cluster. Uses
   the same 22 px circle + white border shape as the game's
   `.solvizz-violation-badge`. Positioned by JS on the cluster anchor. */
.cell-badge {
  position: absolute;
  z-index: 4;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  color: var(--bg-primary);
  background: var(--rule-color, var(--danger));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(58, 46, 34, 0.4);
  pointer-events: none;
}

/* ---------------- Palette (vertical strip beside board on desktop) ---------------- */

.palette {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 4px 0;
}
.palette__heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.swatch {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1.5px solid color-mix(in srgb, var(--region-accent) 40%, var(--paper-border));
  cursor: pointer;
  padding: 0;
  transition: transform var(--duration-snap) var(--ease-snap), box-shadow var(--duration-snap) var(--ease-snap);
  box-shadow: 0 2px 4px rgba(58, 46, 34, 0.10);
}
.swatch:hover { transform: scale(1.05); }
.swatch:active { transform: scale(0.94); }
.swatch[aria-pressed="true"] {
  transform: scale(1.10);
  /* Match the game's soft warm halo (solvizz-swatch-active) */
  box-shadow: 0 0 0 3px rgba(196, 128, 90, 0.35), 0 4px 14px -2px rgba(58, 46, 34, 0.25);
}

/* ---------------- Controls / kbd hints ---------------- */

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 13px;
  align-self: stretch;
}
.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kbd-hint kbd {
  font-family: 'Quicksand', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  background: var(--bg-secondary);
  border: 1px solid var(--paper-border);
  border-radius: 5px;
  padding: 3px 8px;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  line-height: 1;
}
.kbd-hint--button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}
.kbd-hint--button:hover kbd { border-color: var(--text-muted); }

/* ---------------- Buttons ---------------- */

.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--duration-snap) var(--ease-snap), background var(--duration-snap) var(--ease-snap);
  text-decoration: none;
  display: inline-block;
  letter-spacing: 0.02em;
  line-height: 1;
}
.btn--sm { font-size: 12.5px; padding: 7px 14px; }
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 0 rgba(122, 106, 85, 0.20);
}
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--paper-border);
}
.btn--ghost:hover { border-color: var(--text-muted); }

/* ---------------- Win panel ---------------- */

.win-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 22px 24px;
  background: color-mix(in srgb, var(--success) 12%, var(--paper-plate));
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  animation: fadeUp var(--duration-smooth) var(--ease-snap);
}
.win-panel[hidden] { display: none !important; }
.win-panel__mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.win-panel__title { margin: 0; font-size: 26px; font-weight: 700; }
.win-panel__body {
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  font-size: 14.5px;
  max-width: 440px;
}
.steam-widget {
  width: 100%;
  max-width: 646px;
  margin: 4px 0;
  overflow: hidden;
  border-radius: 6px;
}
.steam-widget iframe {
  width: 100%;
  max-width: 646px;
  height: 190px;
  border: 0;
  display: block;
}
.link-btn {
  background: none;
  border: 0;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.link-btn:hover { color: var(--text-primary); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- Responsive: mobile / short viewports ----------------
 * On mobile: the board is anchored in the middle; rules collapse above, palette
 * sits below, and the LMB / RMB hints disappear because they don't apply.
 * Rules panel is CLOSED by default on mobile via a JS-set attribute so the
 * board doesn't move when the panel opens / closes.
 */

@media (max-width: 780px), (max-height: 640px) {
  .app { padding: 8px 10px 10px; gap: 6px; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; }
  .topbar__brand { font-size: 15px; gap: 6px; }
  .btn--sm { padding: 6px 10px; font-size: 11.5px; }
  .langpicker__select { padding: 5px 22px 5px 10px; font-size: 12px; }

  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    padding: 10px 12px;
    gap: 8px;
  }
  /* Row 1: region + streak */
  .side { min-height: 0; gap: 6px; grid-row: auto; }
  /* Row 2: collapsible rules — the SUMMARY sits in normal flow; when the
     panel is open, .rules OVERLAYS on top of the board area so the board
     doesn't reflow. */
  .rules-panel { grid-row: auto; flex: 0 0 auto; position: relative; }
  .rules-panel__summary { display: flex; }
  .rules-panel:not([open]) .rules { display: none; }
  .rules-panel[open] .rules {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 15;
    background: var(--paper-plate);
    border: 1px solid var(--paper-border);
    border-radius: 12px;
    padding: 8px;
    max-height: 60vh;
    box-shadow: 0 12px 28px -10px rgba(58, 46, 34, 0.30);
  }
  .rule-card__thumb { width: 36px; height: 36px; }
  .rule-card__title { font-size: 12px; }
  .rule-card__detail { font-size: 11px; }

  /* Row 3: board + palette — board takes remaining space, palette below it. */
  .play {
    grid-template-rows: 1fr auto;
    gap: 8px;
    min-height: 0;
  }
  .board-row {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .palette {
    flex-direction: row;
    padding: 0;
    gap: 8px;
  }
  .palette__heading { display: none; }
  .swatch { width: 44px; height: 44px; }

  /* LMB / RMB / 1-N / R are keyboard-mouse concepts — hide on touch. */
  .controls { display: none; }

  .steam-widget { display: none; }
  .win-panel__title { font-size: 22px; }
  .win-panel__body { font-size: 13.5px; }
}
