/* ==========================================================================
   Octordle Chill — style.css
   Chill dark theme · soft greens · gentle blues · glassmorphism · 60fps
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Chill dark palette (default) */
  --bg: #0b1220;
  --bg-soft: #101a2c;
  --surface: #141f33;
  --surface-2: #1a2740;
  --glass: rgba(16, 26, 44, 0.72);
  --border: #24324d;
  --text: #e6edf7;
  --text-muted: #8fa3c0;

  --green: #4ade80;
  --green-soft: #1f7a4d;
  --green-deep: #15803d;
  --blue: #60a5fa;
  --blue-deep: #2563eb;
  --yellow: #fbbf24;

  --tile-correct: #2f9e5f;
  --tile-present: #c79a2e;
  --tile-absent: #2c3a55;
  --tile-empty: #16233b;
  --tile-border: #2a3a59;
  --tile-text: #f4f8ff;

  --key-bg: #25344f;
  --key-text: #dbe6f5;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 9px;

  --header-h: 56px;
  --anim-flip: 420ms;
  --ease-pop: cubic-bezier(0.2, 1.4, 0.4, 1);
}

[data-theme="light"] {
  --bg: #f2f6fc;
  --bg-soft: #e9eff8;
  --surface: #ffffff;
  --surface-2: #f0f4fb;
  --glass: rgba(255, 255, 255, 0.78);
  --border: #d7e0ee;
  --text: #16243a;
  --text-muted: #5b6e8c;

  --tile-correct: #3aa869;
  --tile-present: #d7a72e;
  --tile-absent: #9aa9c0;
  --tile-empty: #ffffff;
  --tile-border: #c4d0e2;
  --tile-text: #ffffff;

  --key-bg: #d8e1ef;
  --key-text: #2a3b57;

  --shadow: 0 10px 26px rgba(35, 60, 100, 0.16);
}

/* High contrast (color-blind friendly): orange & blue */
[data-contrast="high"] {
  --tile-correct: #e8742c;
  --tile-present: #4a8df0;
  --green: #f08a3c;
  --yellow: #66a3ff;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(96, 165, 250, 0.10), transparent 60%),
    radial-gradient(900px 450px at 5% 0%, rgba(74, 222, 128, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  touch-action: manipulation; /* prevent double-tap zoom */
  overscroll-behavior-y: none;
}

button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -48px;
  background: var(--blue-deep); color: #fff;
  padding: 8px 14px; border-radius: 8px; z-index: 200;
  transition: top 160ms ease;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.muted { color: var(--text-muted); }
.small { font-size: 0.8rem; }

/* ---------- Header (sticky + glassmorphism) ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1180px; margin: 0 auto;
  height: var(--header-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
}

.brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }

.brand-mark { width: 30px; height: 30px; flex: 0 0 auto; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-mark circle { fill: var(--green); }
.brand-mark circle.dot-alt { fill: var(--blue); }

.brand-name {
  font-size: 1.02rem; font-weight: 800; letter-spacing: 0.2px;
  margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-chill {
  background: linear-gradient(90deg, var(--green), var(--blue));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.mode-badge {
  flex: 0 0 auto;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.4px;
  padding: 4px 10px; border-radius: 999px;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 38%, transparent);
  white-space: nowrap;
}

.header-actions { display: flex; align-items: center; gap: 2px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: none; color: var(--text);
  transition: background 140ms ease, transform 140ms var(--ease-pop);
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 21px; height: 21px; fill: currentColor; }

/* ---------- Drawer (slide-out menu) ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(4, 8, 16, 0.55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 220ms ease;
}
.drawer-backdrop.is-open { opacity: 1; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  width: min(86vw, 320px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(-104%);
  transition: transform 260ms cubic-bezier(0.3, 0.9, 0.3, 1);
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.drawer.is-open { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 8px 18px;
  border-bottom: 1px solid var(--border);
}
.drawer-title { font-weight: 800; letter-spacing: 0.5px; font-size: 0.95rem; color: var(--text-muted); text-transform: uppercase; }

.drawer-list { list-style: none; margin: 0; padding: 10px; overflow-y: auto; flex: 1; }
.drawer-list a, .drawer-list button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 10px;
  border: none; background: transparent;
  color: var(--text); text-decoration: none;
  font-size: 0.98rem; font-weight: 600;
  transition: background 140ms ease, transform 140ms ease;
}
.drawer-list a:hover, .drawer-list button:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.drawer-list a:active, .drawer-list button:active { transform: scale(0.98); }
.drawer-list .is-current {
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
}
.drawer-sep { height: 1px; background: var(--border); margin: 8px 6px; border: none; }

/* ---------- Status / progress bar ---------- */
.status-bar { border-bottom: 1px solid var(--border); background: var(--bg-soft); }

.status-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 7px 12px 9px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  position: relative;
}

.puzzle-label { font-size: 0.83rem; font-weight: 700; color: var(--text-muted); }

.status-stats { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
}
.status-chip svg { width: 14px; height: 14px; fill: var(--green); }

.text-btn {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--blue); font-weight: 700; font-size: 0.8rem;
  padding: 5px 12px; border-radius: 999px;
  transition: background 140ms ease;
}
.text-btn:hover { background: color-mix(in srgb, var(--blue) 12%, transparent); }

.progress-track {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: transparent;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 0 3px 3px 0;
  transition: width 600ms cubic-bezier(0.3, 0.9, 0.3, 1);
}

/* ---------- Boards ---------- */
.game-area {
  flex: 1;
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: 10px 8px 6px;
}

.boards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 6px 7px;
  position: relative;
  transition: box-shadow 400ms ease, border-color 400ms ease;
}

.board-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 3px 4px;
}
.board-num { font-size: 0.66rem; font-weight: 800; color: var(--text-muted); letter-spacing: 0.4px; }
.board-check { width: 14px; height: 14px; fill: var(--green); opacity: 0; transform: scale(0); transition: all 320ms var(--ease-pop); }

.board.is-solved {
  border-color: color-mix(in srgb, var(--green) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 40%, transparent),
              0 0 18px color-mix(in srgb, var(--green) 25%, transparent);
}
.board.is-solved .board-check { opacity: 1; transform: scale(1); }
.board.is-solved { animation: solvedPulse 900ms ease 1; }

@keyframes solvedPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

.board-rows { display: grid; gap: 3px; }

.tile-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }

.tile {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: clamp(0.78rem, 2.9vw, 1.15rem);
  text-transform: uppercase;
  background: var(--tile-empty);
  border: 1px solid var(--tile-border);
  border-radius: 5px;
  color: var(--text);
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
  will-change: transform;
}

/* Row currently being typed: clearly highlighted on every unsolved board.
   Solid rgba colors (no color-mix) so it is visible in every browser/theme. */
.tile-row.is-active .tile {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(96, 165, 250, 0.10);
  box-shadow: inset 0 -3px 0 rgba(96, 165, 250, 0.5);
}

/* Letters being typed: bright box, strong border, vivid text */
.tile.is-filled {
  background: rgba(96, 165, 250, 0.26);
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.5);
  color: var(--text);
  animation: tilePop 130ms var(--ease-pop);
}

@keyframes tilePop {
  0% { transform: scale(0.86); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.tile.is-correct { background: var(--tile-correct); border-color: var(--tile-correct); color: var(--tile-text); }
.tile.is-present { background: var(--tile-present); border-color: var(--tile-present); color: var(--tile-text); }
.tile.is-absent  { background: var(--tile-absent);  border-color: var(--tile-absent);  color: color-mix(in srgb, var(--tile-text) 90%, transparent); }

.tile.is-hint {
  background: color-mix(in srgb, var(--blue) 22%, var(--tile-empty));
  border-color: var(--blue);
  color: var(--blue);
}

/* flip reveal */
.tile.is-flipping { animation: tileFlip var(--anim-flip) ease forwards; }
@keyframes tileFlip {
  0% { transform: rotateX(0); }
  49% { transform: rotateX(90deg); }
  51% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

/* shake for invalid word */
.tile-row.is-shake { animation: rowShake 480ms ease; }
@keyframes rowShake {
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}

/* dim rows after a board is solved */
.board.is-solved .tile-row.is-after-solve .tile { opacity: 0.28; }

/* ---------- Keyboard ---------- */
.keyboard {
  position: sticky; bottom: 0; z-index: 40;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  user-select: none;
  -webkit-user-select: none;
}

.kb-row { display: flex; justify-content: center; gap: 4px; margin-bottom: 4px; }
.kb-row:last-child { margin-bottom: 0; }

.key {
  position: relative;
  flex: 1 1 0; max-width: 44px; height: 52px;
  border: none; border-radius: 7px;
  background: var(--key-bg); color: var(--key-text);
  font-weight: 800; font-size: 0.82rem; text-transform: uppercase;
  overflow: hidden;
  transition: transform 90ms var(--ease-pop), filter 140ms ease;
}
.key:active { transform: scale(0.92); filter: brightness(1.25); }
[data-keyanim="off"] .key:active { transform: none; }

.key--wide { max-width: 64px; flex: 1.5 1 0; font-size: 0.66rem; }
.key svg { width: 20px; height: 20px; fill: currentColor; }

/* 8 mini-cells per key: 4 columns x 2 rows behind the letter */
.key-cells {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  z-index: 0;
}
.key-cell { background: transparent; transition: background 240ms ease; }
.key-cell.is-correct { background: var(--tile-correct); }
.key-cell.is-present { background: var(--tile-present); }
.key-cell.is-absent  { background: color-mix(in srgb, var(--tile-absent) 80%, black); }

.key-label { position: relative; z-index: 1; text-shadow: 0 1px 3px rgba(0,0,0,0.55); pointer-events: none; }
[data-theme="light"] .key-label { text-shadow: 0 1px 2px rgba(255,255,255,0.4); }
.key.has-status .key-label { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--header-h) + 52px);
  transform: translateX(-50%);
  z-index: 150;
  background: var(--text); color: var(--bg);
  font-weight: 700; font-size: 0.9rem;
  padding: 10px 18px; border-radius: 10px;
  box-shadow: var(--shadow);
  animation: toastIn 200ms var(--ease-pop);
  pointer-events: none;
  max-width: 88vw; text-align: center;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.94); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ---------- Confetti canvas ---------- */
.confetti {
  position: fixed; inset: 0; z-index: 140;
  pointer-events: none;
  display: none;
}
.confetti.is-active { display: block; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 160; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 8, 16, 0.6);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: fadeIn 180ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: 100%; max-width: 480px;
  max-height: min(86svh, 700px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: cardIn 240ms var(--ease-pop);
}
.modal-card--small { max-width: 400px; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 1.15rem; }

.modal-body { padding: 16px 20px 22px; }
.modal-body h3 { font-size: 0.95rem; margin: 18px 0 8px; }
.modal-body p { line-height: 1.55; margin: 8px 0; font-size: 0.92rem; }

.hl-green { color: var(--green); }
.hl-yellow { color: var(--yellow); }
.hl-gray { color: var(--text-muted); }

.example-row { display: flex; gap: 4px; margin: 10px 0 4px; }
.ex-tile {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; border-radius: 6px;
  background: var(--tile-empty); border: 1px solid var(--tile-border);
}
.ex-tile.is-correct { background: var(--tile-correct); border-color: var(--tile-correct); color: #fff; }
.ex-tile.is-present { background: var(--tile-present); border-color: var(--tile-present); color: #fff; }
.ex-tile.is-absent  { background: var(--tile-absent); border-color: var(--tile-absent); color: #fff; }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.stat-value { font-size: 1.35rem; font-weight: 800; color: var(--green); }
.stat-label { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }

/* ---------- Settings ---------- */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-of-type { border-bottom: none; }
.setting-name { display: block; font-weight: 700; font-size: 0.93rem; }
.setting-desc { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.switch {
  flex: 0 0 auto;
  width: 48px; height: 28px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  position: relative;
  transition: background 180ms ease, border-color 180ms ease;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-muted);
  transition: transform 200ms var(--ease-pop), background 180ms ease;
}
.switch[aria-checked="true"] { background: color-mix(in srgb, var(--green) 30%, var(--surface-2)); border-color: var(--green); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); background: var(--green); }

.settings-subhead { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin: 20px 0 10px; }

.plan-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.plan-badge {
  display: inline-block;
  background: linear-gradient(90deg, var(--green), var(--blue));
  color: #07101f; font-weight: 800; font-size: 0.75rem;
  padding: 3px 12px; border-radius: 999px;
}

/* ---------- Hints ---------- */
.big-btn {
  display: block; width: 100%; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px; margin: 10px 0;
  color: var(--text);
  transition: border-color 160ms ease, transform 140ms ease;
}
.big-btn:hover { border-color: var(--blue); }
.big-btn:active { transform: scale(0.98); }
.big-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.big-btn-title { display: block; font-weight: 800; font-size: 0.95rem; }
.big-btn-desc { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Result ---------- */
.result-summary { font-size: 1.02rem; font-weight: 700; }

.result-words { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.result-word {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 0.9rem;
}
.result-word .rw-num { color: var(--text-muted); font-size: 0.7rem; letter-spacing: 0; }
.result-word.is-solved { border-color: color-mix(in srgb, var(--green) 50%, transparent); color: var(--green); }
.result-word.is-missed { color: var(--yellow); }

.result-actions { display: flex; gap: 10px; }

.primary-btn {
  flex: 1;
  background: linear-gradient(90deg, var(--green-deep), var(--green));
  border: none; color: #fff; font-weight: 800; font-size: 0.95rem;
  padding: 13px; border-radius: 10px;
  transition: transform 140ms var(--ease-pop), filter 140ms ease;
}
.primary-btn:hover { filter: brightness(1.1); }
.primary-btn:active { transform: scale(0.97); }

.secondary-btn {
  flex: 1;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-weight: 800; font-size: 0.95rem;
  padding: 13px; border-radius: 10px;
  transition: transform 140ms var(--ease-pop), border-color 140ms ease;
}
.secondary-btn:hover { border-color: var(--blue); }
.secondary-btn:active { transform: scale(0.97); }

/* ---------- Footer ---------- */
.app-footer { padding: 12px; text-align: center; }
.app-footer p { margin: 0; font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Reduce motion (setting + OS preference) ---------- */
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive ----------
   Mobile: 4 boards top + 4 boards bottom (2 rows of 4, compact)
   Desktop: 4 columns x 2 rows with comfortable sizing
------------------------------------ */

/* Small phones: keep 4 columns but ultra compact */
@media (max-width: 519px) {
  .brand-name { font-size: 0.92rem; }
  .mode-badge { display: none; }
  .boards-grid { gap: 5px; }
  .board { padding: 4px 4px 5px; border-radius: 10px; }
  .board-rows { gap: 2px; }
  .tile-row { gap: 2px; }
  .tile { border-radius: 4px; font-size: clamp(0.68rem, 3.8vw, 0.95rem); }
  .key { height: 48px; font-size: 0.74rem; }
  .status-inner { padding: 5px 10px 7px; }
  .puzzle-label { font-size: 0.74rem; }
  .status-chip { font-size: 0.72rem; padding: 3px 8px; }
}

/* Tablets and up */
@media (min-width: 760px) {
  .header-inner { padding: 0 16px; }
  .game-area { padding: 16px 14px 10px; }
  .boards-grid { gap: 12px; }
  .board { padding: 9px 9px 10px; }
  .board-rows { gap: 4px; }
  .tile-row { gap: 4px; }
  .tile { font-size: clamp(0.7rem, 1.5vw, 1rem); border-radius: 6px; }
  .key { max-width: 46px; height: 56px; }
  .key--wide { max-width: 70px; }
  .keyboard { padding-top: 8px; }
  .kb-row { gap: 6px; margin-bottom: 6px; }
}

/* Large desktop: cap play-area width so 16-row boards stay compact */
@media (min-width: 1100px) {
  .game-area { max-width: 880px; padding-top: 14px; }
  .boards-grid { gap: 12px; }
  .tile { font-size: 0.92rem; border-radius: 5px; }
  .board-rows { gap: 3px; }
  .tile-row { gap: 3px; }
}
