/* ============ Nut Games — shared design system ============ */
:root {
  --bg: #fdfbf7;
  --bg-raised: #ffffff;
  --text: #1a1a1a;
  --text-dim: #6b6b6b;
  --border: #d9d4c9;
  --accent: #b8862c;          /* acorn gold */
  --accent-soft: #f3e7cd;
  --green: #6aaa64;
  --yellow: #c9b458;
  --gray: #787c7e;
  --gray-soft: #e4e0d7;
  --blue: #4a7ab5;
  --purple: #8a63b3;
  --red: #d0534f;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --hive: #f7da21;
  --hive-dim: #e6e6e6;
  --xw-block: #1a1a1a;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #17181c;
  --bg-raised: #212227;
  --text: #ececec;
  --text-dim: #9a9a9a;
  --border: #3a3b41;
  --accent: #d9a944;
  --accent-soft: #3a3222;
  --green: #538d4e;
  --yellow: #b59f3b;
  --gray: #55585b;
  --gray-soft: #33353a;
  --blue: #5f8fc9;
  --purple: #9c77c4;
  --red: #d0534f;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  --hive: #d9b821;
  --hive-dim: #3a3b41;
  --xw-block: #000000;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; color: inherit; }

/* ---------- header ---------- */
.ng-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  position: sticky;
  top: 0;
  z-index: 20;
}
.ng-header .left, .ng-header .right { display: flex; align-items: center; gap: 6px; flex: 1; }
.ng-header .right { justify-content: flex-end; }
.ng-title { font-weight: 800; font-size: 1.15rem; letter-spacing: 0.02em; text-align: center; white-space: nowrap; }
.ng-title a { color: inherit; text-decoration: none; }
.icon-btn {
  border: none; background: none; cursor: pointer; font-size: 1.15rem;
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text);
}
.icon-btn:hover { background: var(--gray-soft); }

main { width: 100%; max-width: 640px; padding: 16px; flex: 1; display: flex; flex-direction: column; align-items: center; }

/* ---------- hub ---------- */
.hub-hero { text-align: center; margin: 26px 0 8px; }
.hub-hero .logo { font-size: 3rem; }
.hub-hero h1 { font-size: 2rem; font-weight: 900; letter-spacing: 0.01em; }
.hub-hero p { color: var(--text-dim); margin-top: 6px; }
.hub-date { margin: 4px 0 18px; color: var(--text-dim); font-size: 0.9rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; width: 100%; }
.game-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.13); }
.game-card .emoji { font-size: 1.9rem; }
.game-card h2 { font-size: 1.05rem; font-weight: 800; }
.game-card p { font-size: 0.82rem; color: var(--text-dim); line-height: 1.35; }
.game-card .done-badge {
  position: absolute; top: 12px; right: 12px; font-size: 1rem;
}

/* ---------- generic controls ---------- */
.btn {
  border: 1.5px solid var(--border); background: var(--bg-raised);
  border-radius: 999px; padding: 10px 22px; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: background 0.12s;
}
.btn:hover { background: var(--gray-soft); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.small { padding: 6px 14px; font-size: 0.85rem; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.subtle { color: var(--text-dim); font-size: 0.88rem; }
.mode-row { display: flex; gap: 8px; margin: 4px 0 12px; }
.mode-chip {
  border: 1.5px solid var(--border); background: none; border-radius: 999px;
  padding: 5px 14px; font-size: 0.82rem; font-weight: 700; cursor: pointer; color: var(--text-dim);
}
.mode-chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- toast ---------- */
#ng-toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 8px;
  font-weight: 700; font-size: 0.92rem; z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity 0.2s; max-width: 90vw; text-align: center;
}
#ng-toast.show { opacity: 1; }

/* ---------- modal ---------- */
.ng-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.ng-modal {
  background: var(--bg-raised); border-radius: 16px; box-shadow: var(--shadow);
  max-width: 520px; width: 100%; max-height: 86vh; overflow-y: auto;
  padding: 24px; position: relative; animation: pop-in 0.18s ease;
}
@keyframes pop-in { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ng-modal h2 { margin-bottom: 12px; font-size: 1.3rem; }
.ng-modal h3 { margin: 14px 0 6px; font-size: 1rem; }
.ng-modal p, .ng-modal li { font-size: 0.92rem; line-height: 1.5; margin-bottom: 8px; }
.ng-modal ul { padding-left: 20px; margin-bottom: 8px; }
.ng-modal .close-x {
  position: absolute; top: 12px; right: 12px; border: none; background: none;
  font-size: 1.3rem; cursor: pointer; color: var(--text-dim); width: 34px; height: 34px; border-radius: 50%;
}
.ng-modal .close-x:hover { background: var(--gray-soft); }

/* stats blocks */
.stats-grid { display: flex; gap: 18px; justify-content: center; text-align: center; margin: 14px 0; }
.stats-grid .stat b { display: block; font-size: 1.8rem; font-weight: 900; }
.stats-grid .stat span { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.dist-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 0.85rem; }
.dist-bar {
  background: var(--gray); color: #fff; font-weight: 700; text-align: right;
  padding: 2px 8px; border-radius: 4px; min-width: 24px;
}
.dist-bar.hot { background: var(--green); }

/* result panel shown at game end */
.result-panel { text-align: center; margin: 16px 0; }
.result-panel h2 { font-size: 1.4rem; margin-bottom: 6px; }

/* ---------- Wordle ---------- */
.wordle-board { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; margin: 10px 0 16px; }
.wordle-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tile {
  width: 60px; height: 60px; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; font-weight: 800; text-transform: uppercase;
  transition: transform 0.08s;
  background: var(--bg);
}
@media (max-width: 420px) { .tile { width: 54px; height: 54px; font-size: 1.65rem; } }
.tile.filled { border-color: var(--gray); animation: tile-pop 0.1s ease; }
@keyframes tile-pop { 50% { transform: scale(1.08); } }
.tile.reveal { animation: tile-flip 0.45s ease; }
@keyframes tile-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.tile.green { background: var(--green); border-color: var(--green); color: #fff; }
.tile.yellow { background: var(--yellow); border-color: var(--yellow); color: #fff; }
.tile.gray { background: var(--gray); border-color: var(--gray); color: #fff; }
.wordle-row.shake { animation: row-shake 0.4s; }
@keyframes row-shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); }
}
.wordle-row.bounce .tile { animation: tile-bounce 0.5s ease; }
@keyframes tile-bounce { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-14px); } 70% { transform: translateY(3px); } }

.keyboard { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 500px; margin-top: auto; padding-bottom: 8px; user-select: none; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1; max-width: 44px; height: 54px; border: none; border-radius: 6px;
  background: var(--gray-soft); font-weight: 700; font-size: 0.95rem; text-transform: uppercase;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.key.wide { max-width: 68px; flex: 1.6; font-size: 0.72rem; }
.key.green { background: var(--green); color: #fff; }
.key.yellow { background: var(--yellow); color: #fff; }
.key.gray { background: var(--gray); color: #fff; }

/* ---------- Connections ---------- */
.conn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 560px; margin: 10px 0; }
.conn-tile {
  aspect-ratio: 2 / 1; border-radius: 8px; border: none;
  background: var(--gray-soft); font-weight: 800; text-transform: uppercase;
  font-size: clamp(0.6rem, 2.4vw, 0.95rem); cursor: pointer; padding: 2px;
  transition: transform 0.1s, background 0.15s; overflow-wrap: anywhere; line-height: 1.1;
}
.conn-tile.selected { background: var(--gray); color: #fff; transform: scale(0.96); }
.conn-tile.shake { animation: row-shake 0.4s; }
.conn-solved { grid-column: 1 / -1; border-radius: 8px; padding: 12px; text-align: center; color: #1a1a1a; animation: pop-in 0.25s ease; }
.conn-solved h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em; }
.conn-solved p { font-size: 0.85rem; text-transform: uppercase; }
.conn-solved.c0 { background: #f9df6d; }
.conn-solved.c1 { background: #a0c35a; }
.conn-solved.c2 { background: #b0c4ef; }
.conn-solved.c3 { background: #ba81c5; }
.conn-dots { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.conn-dots .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gray); }
.conn-dots .dot.lost { background: var(--border); }

/* ---------- Spelling Bee ---------- */
.bee-wrap { display: flex; flex-direction: column; align-items: center; width: 100%; }
.bee-input {
  min-height: 46px; font-size: 1.5rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; display: flex; align-items: center; justify-content: center; margin: 8px 0;
}
.bee-input .caret { display: inline-block; width: 2px; height: 1.4em; background: var(--hive); animation: blink 1s step-end infinite; }
.bee-input .center-l { color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }
.hive { position: relative; width: 240px; height: 220px; margin: 8px 0 14px; }
.hive-cell {
  position: absolute; width: 76px; height: 66px; border: none; cursor: pointer;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--hive-dim); font-size: 1.35rem; font-weight: 800; text-transform: uppercase;
  transition: transform 0.08s;
}
.hive-cell:active { transform: scale(0.92); }
.hive-cell.center { background: var(--hive); }
.bee-progress { width: 100%; max-width: 480px; display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.bee-rank { font-weight: 800; font-size: 0.9rem; white-space: nowrap; }
.bee-bar { flex: 1; height: 6px; background: var(--gray-soft); border-radius: 3px; position: relative; }
.bee-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--hive); border-radius: 3px; transition: width 0.3s; }
.bee-found {
  width: 100%; max-width: 480px; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin-top: 10px; min-height: 46px;
  font-size: 0.9rem; line-height: 1.7;
}
.bee-found .pangram { color: var(--accent); font-weight: 800; }
.bee-found summary { cursor: pointer; font-weight: 700; color: var(--text-dim); font-size: 0.85rem; }

/* ---------- Letter Boxed ---------- */
.lb-wrap { display: flex; flex-direction: column; align-items: center; }
.lb-current { min-height: 40px; font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 6px; }
.lb-words { color: var(--text-dim); font-size: 0.95rem; min-height: 24px; text-transform: uppercase; text-align: center; max-width: 90vw; overflow-wrap: anywhere; }
.lb-board { margin: 10px 0; touch-action: manipulation; }
.lb-board .side-line { stroke: var(--text); stroke-width: 2.5; fill: none; }
.lb-board .used-line { stroke: var(--accent); stroke-width: 2; opacity: 0.55; fill: none; }
.lb-board .cur-line { stroke: var(--red); stroke-width: 2.5; fill: none; stroke-dasharray: 5 4; }
.lb-letter { font-size: 20px; font-weight: 800; cursor: pointer; fill: var(--text); text-transform: uppercase; user-select: none; }
.lb-letter.used { fill: var(--accent); }
.lb-letter.active { fill: var(--red); }
.lb-dot { fill: var(--bg); stroke: var(--text); stroke-width: 2; cursor: pointer; }
.lb-dot.used { fill: var(--accent); stroke: var(--accent); }
.lb-dot.active { fill: var(--red); stroke: var(--red); }
.lb-status { font-weight: 700; margin: 6px 0; }

/* ---------- Crossword ---------- */
.xw-top { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 480px; margin-bottom: 8px; }
.xw-timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text-dim); }
.xw-grid { display: grid; gap: 0; border: 2.5px solid var(--text); user-select: none; touch-action: manipulation; }
.xw-cell {
  width: 64px; height: 64px; border: 0.5px solid var(--border); position: relative;
  background: var(--bg-raised); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 700; text-transform: uppercase;
}
@media (max-width: 420px) { .xw-cell { width: 56px; height: 56px; font-size: 1.45rem; } }
.xw-cell.block { background: var(--xw-block); cursor: default; }
.xw-cell .num { position: absolute; top: 2px; left: 3px; font-size: 0.6rem; font-weight: 600; color: var(--text-dim); }
.xw-cell.sel { background: var(--hive); color: #1a1a1a; }
.xw-cell.word { background: var(--accent-soft); }
html[data-theme="dark"] .xw-cell.sel { color: #1a1a1a; }
.xw-cell.wrong::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top right, transparent 46%, var(--red) 46%, var(--red) 54%, transparent 54%);
}
.xw-cell.checked-ok { color: var(--blue); }
.xw-clue-bar {
  width: 100%; max-width: 480px; background: var(--accent-soft); border-radius: 8px;
  padding: 10px 14px; margin: 10px 0; display: flex; align-items: center; gap: 8px; min-height: 52px;
}
.xw-clue-bar .arrow { border: none; background: none; font-size: 1.1rem; cursor: pointer; padding: 4px; color: var(--text); }
.xw-clue-bar .text { flex: 1; text-align: center; font-size: 0.95rem; font-weight: 600; }
.xw-clues { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; max-width: 480px; margin-top: 12px; }
@media (max-width: 460px) { .xw-clues { grid-template-columns: 1fr; } }
.xw-clues h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-bottom: 6px; }
.xw-clues li { list-style: none; font-size: 0.88rem; padding: 5px 6px; border-radius: 6px; cursor: pointer; line-height: 1.3; }
.xw-clues li b { margin-right: 5px; }
.xw-clues li.active { background: var(--accent-soft); }
.xw-clues li.done { color: var(--text-dim); text-decoration: line-through; }

/* ---------- Word Ladder ---------- */
.ladder-list { display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 12px 0; }
.ladder-word { display: flex; gap: 5px; }
.ladder-word .lt {
  width: 52px; height: 52px; border-radius: 8px; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem; text-transform: uppercase;
  background: var(--bg-raised);
}
.ladder-word.goal .lt { background: var(--green); border-color: var(--green); color: #fff; }
.ladder-word.start .lt { background: var(--gray); border-color: var(--gray); color: #fff; }
.ladder-word.current .lt { border-color: var(--accent); }
.ladder-word .lt.diff { background: var(--accent-soft); border-color: var(--accent); }
.ladder-sep { color: var(--text-dim); font-size: 0.8rem; }

/* ---------- Anagrams ---------- */
.ana-slots { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0; max-width: 560px; }
.ana-col { display: flex; flex-direction: column; gap: 5px; }
.ana-slot { display: flex; gap: 3px; }
.ana-slot .sq {
  width: 26px; height: 26px; border-radius: 4px; background: var(--gray-soft);
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 800; text-transform: uppercase;
}
.ana-slot.found .sq { background: var(--green); color: #fff; }
.ana-rack { display: flex; gap: 8px; margin: 14px 0; }
.ana-rack .rl {
  width: 52px; height: 52px; border-radius: 10px; background: var(--bg-raised); border: 2px solid var(--border);
  font-size: 1.5rem; font-weight: 800; text-transform: uppercase; cursor: pointer; box-shadow: var(--shadow);
}
.ana-rack .rl.used { opacity: 0.25; }
.ana-guess { min-height: 40px; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.ana-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.2rem; }
.ana-timer.low { color: var(--red); }

/* ---------- Word Search ---------- */
.ws-grid { display: grid; gap: 2px; user-select: none; touch-action: none; margin: 10px 0; }
.ws-cell {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; text-transform: uppercase; border-radius: 6px;
  background: var(--bg-raised); border: 1px solid var(--border); cursor: pointer;
}
@media (max-width: 460px) { .ws-cell { width: 28px; height: 28px; font-size: 0.85rem; } }
.ws-cell.trace { background: var(--yellow); color: #fff; border-color: var(--yellow); }
.ws-cell.found { background: var(--green); color: #fff; border-color: var(--green); }
.ws-words { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 520px; margin: 8px 0; }
.ws-words .w { border: 1px solid var(--border); padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; }
.ws-words .w.found { background: var(--green); border-color: var(--green); color: #fff; text-decoration: line-through; }

/* ---------- Quordle ---------- */
.quad-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 14px; }
.quad-board { display: grid; gap: 3px; }
.quad-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.quad-board .tile { width: 30px; height: 30px; font-size: 1rem; border-width: 1.5px; }
@media (max-width: 420px) { .quad-board .tile { width: 26px; height: 26px; font-size: 0.85rem; } }
.quad-board.solved-board { opacity: 0.55; }
.key .quads { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; border-radius: 6px; overflow: hidden; z-index: 0; }
.key .quads span { background: transparent; }
.key .quads span.green { background: var(--green); }
.key .quads span.yellow { background: var(--yellow); }
.key .quads span.gray { background: var(--gray); }
.key.quad-key { position: relative; }
.key.quad-key b { position: relative; z-index: 1; font-weight: 700; }

/* ---------- Cryptogram ---------- */
.cryp-quote { display: flex; flex-wrap: wrap; gap: 12px 16px; justify-content: center; margin: 16px 0; max-width: 560px; }
.cryp-word { display: flex; gap: 3px; }
.cryp-letter { display: flex; flex-direction: column; align-items: center; width: 26px; cursor: pointer; }
.cryp-letter .guess {
  width: 24px; height: 30px; border-bottom: 2px solid var(--gray);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; text-transform: uppercase;
}
.cryp-letter.sel .guess { border-color: var(--accent); background: var(--accent-soft); }
.cryp-letter.samesel .guess { background: var(--accent-soft); }
.cryp-letter .cipher { font-size: 0.68rem; color: var(--text-dim); margin-top: 2px; text-transform: uppercase; }
.cryp-letter.revealed .guess { color: var(--blue); }
.cryp-letter.conflict .guess { color: var(--red); }
.cryp-punct { font-weight: 800; font-size: 1.1rem; align-self: flex-end; padding-bottom: 6px; }
.cryp-author { text-align: center; color: var(--text-dim); font-style: italic; margin-bottom: 8px; }

/* ---------- Boggle ---------- */
.bog-grid { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; margin: 10px 0; user-select: none; touch-action: none; }
.bog-cell {
  width: 64px; height: 64px; border-radius: 12px; background: var(--bg-raised);
  border: 2px solid var(--border); box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 800; text-transform: uppercase;
}
@media (max-width: 420px) { .bog-cell { width: 56px; height: 56px; font-size: 1.45rem; } }
.bog-cell.sel { background: var(--yellow); border-color: var(--yellow); color: #fff; }
.bog-cell.last { background: var(--accent); border-color: var(--accent); color: #fff; }
.bog-found {
  width: 100%; max-width: 480px; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; margin-top: 8px; font-size: 0.88rem; line-height: 1.7; min-height: 40px;
}
.bog-found .missed { color: var(--text-dim); }

/* ---------- Strands ---------- */
.str-theme {
  background: var(--accent-soft); border-radius: 10px; padding: 10px 18px;
  text-align: center; margin-bottom: 4px;
}
.str-theme .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
.str-theme .name { font-weight: 800; font-size: 1.05rem; }
.str-current { min-height: 30px; font-weight: 800; font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.05em; }
.str-wrap { position: relative; margin: 6px 0; }
.str-lines { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.str-lines .fline { stroke: #a8c8f0; stroke-width: 10; stroke-linecap: round; opacity: 0.85; }
html[data-theme="dark"] .str-lines .fline { stroke: #3d5f8a; }
.str-lines .spline { stroke: #f2d34f; }
html[data-theme="dark"] .str-lines .spline { stroke: #8a7620; }
.str-grid { position: relative; display: grid; grid-template-columns: repeat(6, auto); gap: 8px; user-select: none; touch-action: none; z-index: 1; }
.str-cell {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 700; text-transform: uppercase;
  background: transparent; border: none; position: relative; z-index: 1;
}
@media (max-width: 420px) { .str-cell { width: 40px; height: 40px; font-size: 1rem; } .str-grid { gap: 6px; } }
.str-cell.sel { background: var(--gray-soft); box-shadow: 0 0 0 2px var(--text-dim) inset; }
.str-cell.theme-found { background: #a8c8f0; color: #10233c; }
html[data-theme="dark"] .str-cell.theme-found { background: #3d5f8a; color: #e8eef7; }
.str-cell.span-found { background: #f2d34f; color: #3c3208; }
html[data-theme="dark"] .str-cell.span-found { background: #8a7620; color: #f7f0d0; }
.str-cell.hinted { box-shadow: 0 0 0 2.5px var(--accent) inset; border-radius: 50%; }
.str-meta { display: flex; align-items: center; gap: 14px; margin: 8px 0; }
.str-progress { font-weight: 700; }
.hint-meter { display: flex; gap: 5px; }
.hint-meter .pip { width: 12px; height: 12px; border-radius: 50%; background: var(--gray-soft); border: 1px solid var(--border); }
.hint-meter .pip.on { background: var(--accent); border-color: var(--accent); }

/* ---------- Waffle ---------- */
.waf-grid { display: grid; grid-template-columns: repeat(5, auto); gap: 6px; margin: 12px 0; user-select: none; }
.waf-cell {
  width: 60px; height: 60px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; text-transform: uppercase; color: #fff;
  transition: transform 0.1s;
}
@media (max-width: 420px) { .waf-cell { width: 54px; height: 54px; font-size: 1.4rem; } }
.waf-cell.green { background: var(--green); cursor: default; }
.waf-cell.yellow { background: var(--yellow); }
.waf-cell.gray { background: var(--gray); }
.waf-cell.picked { transform: scale(0.9); outline: 3px solid var(--accent); }
.waf-hole { width: 60px; height: 60px; }
@media (max-width: 420px) { .waf-hole { width: 54px; height: 54px; } }

/* ---------- Missing Vowels ---------- */
.mv-category {
  background: var(--accent-soft); border-radius: 10px; padding: 8px 18px;
  font-weight: 800; margin-bottom: 10px; text-align: center;
}
.mv-phrase {
  font-size: clamp(1.3rem, 6vw, 2rem); font-weight: 900; letter-spacing: 0.12em;
  text-transform: uppercase; text-align: center; margin: 24px 0; min-height: 50px;
  overflow-wrap: anywhere; max-width: 92vw;
}
.mv-input {
  width: 100%; max-width: 420px; font-size: 1.1rem; font-weight: 700; text-transform: uppercase;
  padding: 12px 16px; border-radius: 10px; border: 2px solid var(--border);
  background: var(--bg-raised); color: var(--text); text-align: center; outline: none;
  font-family: inherit;
}
.mv-input:focus { border-color: var(--accent); }
.mv-progress { display: flex; gap: 6px; margin: 12px 0; }
.mv-progress .p { width: 26px; height: 8px; border-radius: 4px; background: var(--gray-soft); }
.mv-progress .p.right { background: var(--green); }
.mv-progress .p.wrong { background: var(--red); }

/* ---------- Hangman ---------- */
.hm-face { font-size: 3.4rem; margin: 8px 0; }
.hm-lives { display: flex; gap: 6px; margin-bottom: 6px; }
.hm-lives .acorn { font-size: 1.3rem; transition: opacity 0.3s; }
.hm-lives .acorn.lost { opacity: 0.18; filter: grayscale(1); }
.hm-word { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 14px 0; }
.hm-word .space { width: 18px; }
.hm-word .hl {
  width: 34px; height: 44px; border-bottom: 3px solid var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; text-transform: uppercase;
}
.hm-word .hl.miss { color: var(--red); }
.hm-cat { color: var(--text-dim); font-weight: 700; }

/* ---------- Ghost ---------- */
.gh-fragment {
  font-size: 2.2rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase;
  min-height: 56px; display: flex; align-items: center; margin: 14px 0;
}
.gh-fragment .you { color: var(--blue); }
.gh-fragment .bot { color: var(--red); }
.gh-turn { font-weight: 700; min-height: 24px; }
.gh-score { display: flex; gap: 20px; font-weight: 800; margin: 8px 0; }
.gh-score .win { color: var(--green); }

/* ---------- Pyramid ---------- */
.pyr-stack { display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; margin: 14px 0; }
.pyr-row { display: flex; gap: 5px; }
.pyr-row .pt {
  width: 44px; height: 44px; border-radius: 8px; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem; text-transform: uppercase;
}
@media (max-width: 420px) { .pyr-row .pt { width: 38px; height: 38px; font-size: 1.05rem; } }
.pyr-row.pending .pt { background: var(--bg-raised); color: var(--text); border: 2px dashed var(--border); }
.pyr-row.typing .pt { background: var(--accent-soft); color: var(--text); border: 2px solid var(--accent); }

/* ---------- Typeshift ---------- */
.ts-board { display: flex; gap: 8px; margin: 10px 0; align-items: center; }
.ts-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ts-col .shift {
  border: none; background: none; cursor: pointer; font-size: 1.1rem; color: var(--text-dim);
  width: 40px; height: 30px; border-radius: 6px;
}
.ts-col .shift:hover { background: var(--gray-soft); }
.ts-window { display: flex; flex-direction: column; gap: 4px; }
.ts-letter {
  width: 48px; height: 48px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3rem; text-transform: uppercase;
  color: var(--text-dim); background: var(--bg-raised); border: 1px solid var(--border);
}
@media (max-width: 460px) { .ts-letter { width: 40px; height: 40px; font-size: 1.1rem; } .ts-col .shift { width: 36px; } }
.ts-letter.mid { background: var(--hive); color: #1a1a1a; border-color: var(--hive); font-size: 1.5rem; }
.ts-letter.used-up { color: var(--green); }
.ts-letter.mid.was-used { outline: 3px solid var(--green); }
.ts-letter.ghosted { opacity: 0; pointer-events: none; }
.ts-found { max-width: 480px; text-align: center; line-height: 1.7; font-size: 0.9rem; min-height: 24px; }

/* ---------- Before & After ---------- */
.ba-clues { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 480px; margin: 12px 0; }
.ba-clue {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; font-weight: 600;
}
.ba-clue .tag { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 3px; }
.ba-plus { text-align: center; font-weight: 900; color: var(--text-dim); }

/* ---------- Speed Type ---------- */
.st-quote {
  max-width: 560px; font-size: 1.35rem; line-height: 1.8; font-weight: 600;
  margin: 18px 0; letter-spacing: 0.01em; overflow-wrap: anywhere;
}
.st-quote span.ok { color: var(--green); }
.st-quote span.bad { color: #fff; background: var(--red); border-radius: 3px; }
.st-quote span.cur { border-left: 2.5px solid var(--accent); animation: blink 1s step-end infinite; }
.st-quote span.todo { color: var(--text-dim); }
.st-stats { display: flex; gap: 26px; font-variant-numeric: tabular-nums; }
.st-stats div { text-align: center; }
.st-stats b { display: block; font-size: 1.7rem; font-weight: 900; }
.st-stats span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.st-input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- Achievements ---------- */
.ach-grid { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 560px; margin: 8px 0 20px; }
.ach-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; opacity: 0.55; filter: grayscale(0.7);
}
.ach-card.unlocked { opacity: 1; filter: none; box-shadow: var(--shadow); border-color: var(--accent); }
.ach-card .emoji { font-size: 1.8rem; }
.ach-card h2 { font-size: 0.98rem; font-weight: 800; }
.ach-card p { font-size: 0.82rem; color: var(--text-dim); }
.ach-card .state { margin-left: auto; font-size: 1.1rem; }

/* ---------- Auth ---------- */
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.auth-form input {
  font-size: 1rem; padding: 11px 14px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font-family: inherit; outline: none;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 0.8rem; margin: 6px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-provider { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.auth-user-chip { display: flex; align-items: center; gap: 12px; background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; margin: 10px 0; }
.auth-user-chip .avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.2rem; text-transform: uppercase;
}
.auth-badge { position: absolute; bottom: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg-raised); }
.icon-btn.signed-in { position: relative; }

/* ---------- Leaderboard & friends ---------- */
.lbd-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 620px; margin: 10px 0 16px; }
.lbd-chip {
  border: 1.5px solid var(--border); background: var(--bg-raised); border-radius: 999px;
  padding: 6px 12px; font-size: 0.8rem; font-weight: 700; cursor: pointer; color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 4px;
}
.lbd-chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.lbd-chip .you-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.lbd-list { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 520px; align-items: stretch; }
.lbd-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
}
.lbd-row.you { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow); }
.lbd-row .medal { width: 30px; text-align: center; font-size: 1.15rem; }
.lbd-row .rank { font-weight: 800; color: var(--text-dim); font-size: 0.95rem; }
.lbd-row .avatar { font-size: 1.35rem; }
.lbd-row .pname { flex: 1; font-weight: 700; }
.lbd-row .pname small { color: var(--text-dim); font-weight: 600; }
.lbd-row .pdetail { font-weight: 800; font-variant-numeric: tabular-nums; }
.friend-code-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 20px; width: 100%; max-width: 420px; margin: 8px 0 14px; text-align: center;
}
.code-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0; }
.code-row b { font-size: 1.5rem; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
.code-row input {
  font-size: 1rem; padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font-family: inherit; outline: none;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.code-row input:focus { border-color: var(--accent); }
.friend-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; margin-top: 4px;
}
.friend-head { display: flex; align-items: center; gap: 12px; }
.friend-head .avatar { font-size: 1.6rem; }
.friend-head div { flex: 1; }
.friend-head .remove { color: var(--text-dim); font-size: 0.95rem; }
.friend-games { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.friend-games .fg {
  background: var(--gray-soft); border-radius: 999px; padding: 3px 10px;
  font-size: 0.78rem; font-weight: 700;
}

footer.ng-footer { padding: 14px; color: var(--text-dim); font-size: 0.8rem; text-align: center; }
footer.ng-footer a { color: inherit; }
