:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --card: #fff;
  --text: #192439;
  --muted: #768397;
  --soft: #a1aab8;
  --stroke: #e8edf3;
  --accent: #e4a63e;
  --accent-rich: #cf8f25;
  --amber-light: #fff1c9;
  --amber-dim: #fff8e9;
  --navy: #263548;
  --blue: #4a6b9c;
  --mint: #3ea48c;
  --danger: #d55954;
  --surface: #f5f7fa;
  --board-empty: #fff;
  --board-bg: #dce3ed;
  --board-shadow: 0 15px 35px rgba(26,40,62,.075);
  --ring-track: #edf0f4;
  --card-shadow: 0 8px 34px rgba(29,46,67,.035), 0 1px 1px rgba(29,46,67,.015);
}
* {box-sizing: border-box}
html {min-width: 320px}
body {margin:0;min-height:100vh;background: radial-gradient(ellipse 500px 400px at 9% 3%,rgba(234,205,144,.09),transparent 80%),var(--bg);color:var(--text);font-family:Inter, ui-sans-serif, -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;-webkit-font-smoothing:antialiased}
button,a {font:inherit;-webkit-tap-highlight-color:transparent}
button {cursor:pointer}
button:focus-visible,a:focus-visible {outline:3px solid rgba(227,164,60,.7);outline-offset:3px}
button:disabled {opacity:.34;cursor:not-allowed}
svg {width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round}
.icon-library {position:absolute;width:0;height:0;overflow:hidden}
[hidden] {display:none!important}
.site-shell {max-width:1200px;margin:0 auto;padding:0 40px}
.site-header {height:92px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--stroke)}
.brand {color:inherit;display:inline-flex;align-items:center;gap:11px;text-decoration:none}
.brand-mark {width:31px;height:31px;background:var(--navy);border-radius:10px;display:grid;place-items:center;position:relative;transform:rotate(-4deg)}
.brand-spark {width:13px;height:13px;position:relative;border-radius:100%;background:#f3c86e;box-shadow:0 0 0 4px rgba(243,200,110,.14)}
.brand-spark:before,.brand-spark:after {content:"";position:absolute;background:#f3c86e;left:5.5px;top:-6px;width:2px;height:25px;border-radius:2px;z-index:-1}
.brand-spark:after {transform:rotate(90deg)}
.brand-word {font-weight:760;font-size:25px;letter-spacing:-1.65px}
.brand-period {color:var(--accent-rich)}
.header-right {display:flex;align-items:center;gap:12px}
.header-caption {font-size:10px;font-weight:800;letter-spacing:1.8px;color:#98a3b1;margin-right:22px}
.header-icon-btn {display:grid;place-items:center;width:37px;height:37px;border:1px solid var(--stroke);background:var(--card);border-radius:11px;color:var(--muted);transition:.18s}
.header-icon-btn:hover {color:var(--text);border-color:#c7d0dc;transform:translateY(-1px)}
.header-icon-btn svg {width:17px;height:17px}
.main-layout {display:grid;grid-template-columns:minmax(0,1.55fr) minmax(275px,.87fr);gap:29px;padding-top:38px;align-items:start}
.game-column {min-width:0}
.intro-head {display:flex;justify-content:space-between;align-items:center}
.eyebrow,.aside-eyebrow {font-size:10px;font-weight:800;letter-spacing:2px;color:var(--blue);display:flex;align-items:center;gap:9px}
.eyebrow-dot {width:6px;height:6px;border-radius:50%;background:var(--accent)}
.eyebrow-slash {color:#c3cad3;padding-left:5px}
h1 {font-size:clamp(32px,3vw,43px);font-weight:740;letter-spacing:-1.8px;line-height:1.15;margin:14px 0 10px}
h1 em {font-style:normal;color:var(--accent-rich)}
.intro-copy {font-size:14px;color:var(--muted);line-height:1.5;margin:0}
.difficulty-row {display:flex;align-items:center;justify-content:space-between;gap:15px;margin:29px 0 18px}
.difficulty-group {display:flex;gap:4px;padding:5px;border:1px solid var(--stroke);border-radius:13px;background:#eef1f6;min-width:0}
.difficulty-btn {border:0;background:transparent;color:var(--muted);border-radius:9px;padding:10px 13px;font-size:12px;font-weight:720;white-space:nowrap;transition:.15s}
.difficulty-btn span {font-size:10px;color:var(--soft);font-weight:630;margin-left:4px}
.difficulty-btn:hover:not(.active) {background:rgba(255,255,255,.45);color:var(--text)}
.difficulty-btn.active {color:var(--text);background:var(--card);box-shadow:0 2px 7px rgba(23,41,60,.08)}
.difficulty-btn.active span {color:var(--muted)}
.new-game-btn {background:var(--navy);border:1px solid var(--navy);border-radius:11px;padding:12px 16px;color:#fff;font-size:12px;font-weight:720;display:flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;transition:.18s}
.new-game-btn:hover {filter:brightness(1.13);transform:translateY(-1px)}
.new-game-btn svg {width:16px;height:16px;stroke-width:2}
.game-card,.control-card,.stats-card,.rules-card {background:var(--card);border:1px solid var(--stroke);box-shadow:var(--card-shadow);border-radius:19px}
.game-card {padding:20px 24px 22px}
.game-card-top {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}
.board-identity {display:flex;align-items:center;gap:12px;min-width:0}
.board-tag {color:var(--text);font-weight:800;font-size:11px;letter-spacing:.8px;white-space:nowrap}
.status-pill {display:inline-flex;align-items:center;gap:7px;color:var(--muted);font-size:11px;font-weight:680;white-space:nowrap}
.status-dot {width:6px;height:6px;background:#56b69b;border-radius:50%}
.status-pill.paused .status-dot {background:var(--accent)}
.status-pill.solved .status-dot {background:var(--blue)}
.timer-group {display:flex;align-items:center;gap:8px;color:var(--muted)}
.small-icon {width:16px;height:16px}
.timer-value {color:var(--text);font-size:15px;font-variant-numeric:tabular-nums;font-weight:750;letter-spacing:.4px;min-width:45px;text-align:right}
.timer-control {border:1px solid var(--stroke);width:28px;height:28px;border-radius:8px;background:var(--surface);display:grid;place-items:center;color:var(--muted);margin-left:5px}
.timer-control:hover {color:var(--text)}
.timer-control svg {width:14px;height:14px;stroke-width:2.2}
.board-region {position:relative;display:flex;justify-content:center;align-items:center;width:100%;min-height:200px}
.puzzle-board {width:min(100%, 498px);aspect-ratio:1;display:grid;grid-auto-rows:minmax(0, 1fr);gap:2px;background:var(--board-bg);padding:3px;border-radius:10px;overflow:hidden;box-shadow:0 5px 22px rgba(33,51,73,.09);touch-action:manipulation;user-select:none; -webkit-user-select:none}
.cell {min-width:0;min-height:0;width:100%;height:100%;padding:0;line-height:1;position:relative;border:0;display:flex;align-items:center;justify-content:center;font-weight:750;transition:background .13s,color .13s}
.cell.white {background:var(--board-empty);color:var(--text);cursor:pointer}
.cell.white:hover {background:#f0f4fa;z-index:1}
.cell.white.lit {background:var(--amber-light)}
.cell.white.lit:hover {background:#ffe7ae}
.cell.white.bulb-cell {background:var(--amber-light)}
.cell.white .bulb-art {width:61%;height:61%;max-width:29px;max-height:29px;color:#d49a33;stroke-width:1.85;filter:drop-shadow(0 0 3px rgba(225,166,58,.18))}
.cell.white.bulb-cell:after {content:"";position:absolute;inset:17%;border:1px solid rgba(222,170,69,.27);border-radius:50%;pointer-events:none}
.cell.white.mark-cell .mark-art {color:#aeb5c2;font-size:clamp(14px,2.2vw,23px);font-weight:520;line-height:1}
.cell.white.conflict {background:#ffdad8!important}
.cell.white.conflict .bulb-art {color:var(--danger);filter:none}
.cell.white.conflict:after {border-color:rgba(213,89,84,.3)}
.cell.white.attention {box-shadow:inset 0 0 0 3px var(--danger)}
.cell.white.hint-placed {animation:hint-pop .9s ease}
@keyframes hint-pop {0%,100% {box-shadow:inset 0 0 0 0 transparent}35% {box-shadow:inset 0 0 0 4px rgba(66,160,129,.9)}}
.cell.wall {background:var(--navy);color:#fff;cursor:default}
.cell.wall.numbered {font-size:clamp(15px,2.2vw,27px);font-weight:720;font-variant-numeric:tabular-nums}
.cell.wall.satisfied {color:#8fe1b7}
.cell.wall.over {color:#fff;background:#b84e53}
.cell.wall.attention {box-shadow:inset 0 0 0 3px #f0ada5}
.pause-cover {position:absolute;inset:0;background:rgba(251,252,254,.96);backdrop-filter:blur(13px);border:1px solid var(--stroke);border-radius:12px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;z-index:4;padding:18px}
.pause-cover-icon {background:#fff3d9;color:var(--accent-rich);border-radius:17px;width:61px;height:61px;display:grid;place-items:center;margin-bottom:12px}
.pause-cover-icon svg {width:27px;height:27px}
.pause-cover h2 {font-size:22px;letter-spacing:-.6px;margin:3px 0 6px}
.pause-cover p {font-size:12px;color:var(--muted);margin:0 0 20px}
.board-bottom {margin-top:21px}
.progress-labels {display:flex;justify-content:space-between;align-items:center;margin-bottom:9px}
.progress-labels span {font-size:10px;color:var(--soft);font-weight:800;letter-spacing:1px}
.progress-labels strong {font-size:12px;font-weight:760;color:var(--accent-rich);font-variant-numeric:tabular-nums}
.progress-track {height:7px;background:#f1f3f6;border-radius:100px;overflow:hidden}
.progress-fill {height:100%;width:0%;border-radius:100px;background:linear-gradient(90deg,#edc170,#dfa045);transition:width .25s ease}
.control-card {padding:17px 19px;margin-top:13px}
.control-topline {display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:13px}
.control-caption {font-weight:800;font-size:10px;letter-spacing:1.4px;color:var(--muted)}
.control-help {font-size:10px;color:var(--soft)}
.key-hint {border:1px solid var(--stroke);padding:0 5px;border-radius:4px;font-size:11px}
.control-body {display:flex;align-items:center;gap:13px}
.mode-picker {display:flex;gap:3px;background:var(--surface);border:1px solid var(--stroke);border-radius:11px;padding:4px}
.mode-btn {background:transparent;border:0;padding:9px 12px;border-radius:8px;font-size:12px;color:var(--muted);display:flex;gap:7px;align-items:center;justify-content:center;font-weight:760;transition:.15s}
.mode-btn svg {width:17px;height:17px}
.mode-btn.active {background:var(--card);color:var(--text);box-shadow:0 1px 6px rgba(25,39,58,.08)}
.mode-btn.active svg {color:var(--accent-rich)}
.control-divider {height:31px;width:1px;background:var(--stroke);flex:0 0 1px}
.action-buttons {display:flex;justify-content:space-between;flex:1;min-width:0;gap:4px}
.action-btn {border:0;background:transparent;border-radius:10px;padding:6px 8px;min-width:0;flex:1;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:4px;transition:.15s}
.action-btn:hover:not(:disabled) {background:var(--surface);color:var(--text)}
.action-btn svg {width:19px;height:19px}
.action-btn span {font-size:10px;font-weight:720;white-space:nowrap}
.action-btn.accent-action {color:#b88228}
.side-column {padding-top:2px;display:flex;flex-direction:column;gap:18px}
.stats-card,.rules-card {padding:25px 24px}
.aside-eyebrow {justify-content:space-between;color:var(--blue)}
.aside-decoration {color:#a4adb9;font-size:19px;font-weight:500;letter-spacing:0}
.stats-card h2,.rules-card h2 {margin:6px 0 18px;font-size:23px;font-weight:760;letter-spacing:-.8px}
.progress-hero {display:flex;align-items:center;gap:21px}
.progress-ring {width:139px;height:139px;flex:0 0 139px;border-radius:50%;background:conic-gradient(var(--accent) 0deg,var(--accent) 0deg,#edf0f4 0deg);display:grid;place-items:center;transition:background .2s}
.progress-ring-center {width:111px;height:111px;border-radius:50%;background:var(--card);display:flex;flex-direction:column;align-items:center;justify-content:center}
.progress-ring-center>span {font-size:38px;font-weight:730;letter-spacing:-1.2px;font-variant-numeric:tabular-nums;line-height:1.15}
.progress-ring-center small {font-size:9px;color:var(--soft);font-weight:820;letter-spacing:1.05px}
.quick-metrics {display:flex;flex-direction:column;gap:22px;min-width:0}
.quick-metric {display:flex;align-items:center;gap:10px;min-width:0}
.metric-dot {width:9px;height:9px;border-radius:50%;flex:0 0 9px}
.bulb-dot {background:#e7b157}
.issue-dot {background:#d8e0e9}
.quick-metric strong {font-size:22px;display:block;font-weight:730;line-height:1.1;font-variant-numeric:tabular-nums}
.quick-metric span:last-child {display:block;font-size:10px;color:var(--soft);margin-top:5px;white-space:nowrap}
.stats-rule {height:1px;background:var(--stroke);margin:22px 0 16px}
.record-row {display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted);padding:6px 0}
.record-row strong {color:var(--text);font-variant-numeric:tabular-nums;font-size:13px}
.record-row small {font-size:10px}
.rules-card h2 {margin-bottom:11px}
.rules-intro {color:var(--muted);font-size:12px;line-height:1.65;margin:0 0 19px}
.rule-entry {display:flex;align-items:flex-start;gap:15px;padding:12px 0;border-top:1px solid var(--stroke)}
.rule-entry:last-child {padding-bottom:0}
.rule-number {font-size:11px;color:var(--accent-rich);font-weight:800;letter-spacing:.3px;padding-top:3px;min-width:21px}
.rule-entry p {font-size:12px;color:var(--muted);line-height:1.6;margin:0}
.rule-entry strong {color:var(--text);font-weight:750}
.tip-card {display:flex;gap:13px;border:1px solid #f5e7c7;background:#fff7e7;border-radius:15px;padding:18px;color:#635335}
.tip-mark {background:#fbecc7;color:#ba8a36;display:grid;place-items:center;flex:0 0 32px;height:32px;border-radius:9px}
.tip-mark svg {width:17px;height:17px}
.tip-card strong {font-size:12px}
.tip-card p {font-size:11px;line-height:1.6;margin:5px 0 0;color:#85765e}
.site-footer {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:29px 0 27px;color:var(--text);font-size:13px;font-weight:800;letter-spacing:-.2px}
.site-footer>span:last-child {font-size:9px;font-weight:780;color:#a1aab7;letter-spacing:1.5px}
.footer-muted {font-size:9px;color:var(--soft);letter-spacing:1px;font-weight:720;margin-left:12px}
.toast {position:fixed;z-index:11;bottom:24px;left:50%;transform:translate(-50%,20px);opacity:0;pointer-events:none;max-width:min(92vw,520px);width:max-content;padding:13px 19px;background:var(--navy);box-shadow:0 10px 28px rgba(14,27,45,.22);color:white;font-weight:640;font-size:12px;line-height:1.5;text-align:center;border-radius:12px;transition:opacity .2s,transform .2s}
.toast.visible {opacity:1;transform:translate(-50%,0)}
.modal-layer {position:fixed;inset:0;background:rgba(18,31,49,.58);z-index:12;display:flex;align-items:center;justify-content:center;padding:16px;backdrop-filter:blur(5px)}
.dialog {width:min(100%,425px);padding:36px 30px 27px;text-align:center;border-radius:23px;background:var(--card);border:1px solid var(--stroke);box-shadow:0 28px 90px rgba(6,18,34,.18)}
.dialog-illustration {width:72px;height:72px;margin:0 auto 18px;background:var(--amber-dim);border-radius:23px;display:grid;place-items:center;color:var(--accent-rich)}
.dialog-illustration svg {width:34px;height:34px;stroke-width:1.6}
.dialog .aside-eyebrow {justify-content:center}
.dialog h2 {font-size:27px;letter-spacing:-.9px;margin:11px 0}
.dialog p {font-size:13px;color:var(--muted);line-height:1.7;max-width:300px;margin:0 auto 18px}
.dialog-result {border-top:1px solid var(--stroke);border-bottom:1px solid var(--stroke);margin:22px 0 25px;padding:16px 0;color:var(--text);font-weight:780;font-size:13px;font-variant-numeric:tabular-nums}
.dialog-actions {display:flex;gap:9px;margin-top:18px}
.primary-btn,.secondary-btn {border:1px solid var(--navy);background:var(--navy);border-radius:11px;color:white;padding:12px 15px;font-size:12px;font-weight:750;display:inline-flex;justify-content:center;align-items:center;gap:8px;flex:1}
.primary-btn svg {width:16px;height:16px}
.primary-btn:hover {filter:brightness(1.12)}
.secondary-btn {background:var(--card);border-color:var(--stroke);color:var(--muted)}
.secondary-btn:hover {color:var(--text);background:var(--surface)}

[data-theme="dark"] {color-scheme: dark;--bg:#151c28;--card:#202b3b;--text:#f1f3f8;--muted:#a4b1c1;--soft:#79899b;--stroke:#324051;--surface:#263244;--navy:#111b2a;--board-empty:#2b394b;--board-bg:#131f2d;--amber-light:#61502c;--amber-dim:#453823;--blue:#b4c9ec;--ring-track:#344153;--card-shadow:0 8px 34px rgba(0,0,0,.06)}
[data-theme="dark"] .difficulty-group {background:#1b2532}
[data-theme="dark"] .difficulty-btn:hover:not(.active) {background:#283547}
[data-theme="dark"] .difficulty-btn.active {background:#334154}
[data-theme="dark"] .new-game-btn {background:#e3ad56;border-color:#e3ad56;color:#152130}
[data-theme="dark"] .brand-mark {background:#e2ab4c}
[data-theme="dark"] .brand-spark,[data-theme="dark"] .brand-spark:before,[data-theme="dark"] .brand-spark:after {background:#25334a}
[data-theme="dark"] .cell.white:hover {background:#33485b}
[data-theme="dark"] .cell.white.lit:hover {background:#705b32}
[data-theme="dark"] .cell.white.conflict {background:#864642!important}
[data-theme="dark"] .cell.white.conflict .bulb-art {color:#ffc9c6}
[data-theme="dark"] .cell.white .bulb-art {color:#ffce6b}
[data-theme="dark"] .cell.wall {background:#101b2a}
[data-theme="dark"] .cell.wall.over {background:#a34b54}
[data-theme="dark"] .progress-track {background:#344153}
[data-theme="dark"] .progress-ring {background:conic-gradient(var(--accent) 0deg,var(--accent) 0deg,#344153 0deg)}
[data-theme="dark"] .pause-cover {background:rgba(28,40,57,.96)}
[data-theme="dark"] .pause-cover-icon {background:#463b27}
[data-theme="dark"] .tip-card {background:#383223;border-color:#55472c;color:#f0d69d}
[data-theme="dark"] .tip-mark {background:#4f412b;color:#e6ba64}
[data-theme="dark"] .tip-card p {color:#b8a887}
[data-theme="dark"] .status-pill.solved .status-dot {background:#9fb7e3}
@media(max-width:980px) {
  .site-shell {padding:0 25px}
  .main-layout {grid-template-columns:minmax(0,1fr) 270px;gap:18px}
  .game-card {padding:18px 17px}
  .stats-card,.rules-card {padding:21px 17px}
  .progress-ring {width:114px;height:114px;flex-basis:114px}
  .progress-ring-center {width:89px;height:89px}
  .progress-ring-center>span {font-size:30px}
  .progress-hero {gap:12px}
  .quick-metric strong {font-size:19px}
  .action-btn {padding:6px 4px}
  .mode-btn {padding:9px}
}
@media(max-width:730px) {
  .site-shell {max-width:640px;padding:0 18px}
  .site-header {height:76px}
  .header-caption {display:none}
  .main-layout {display:flex;flex-direction:column;gap:18px;padding-top:27px}
  .game-column,.side-column {width:100%}
  h1 {font-size:clamp(31px,7vw,39px);margin-top:12px}
  .difficulty-row {margin-top:23px}
  .game-card {padding:18px 20px 20px}
  .side-column {display:grid;grid-template-columns:1fr 1fr;align-items:stretch;gap:12px;padding-top:0}
  .stats-card {grid-column:1/-1}
  .rules-card,.tip-card {grid-column:1/-1}
  .stats-card,.rules-card {padding:22px 23px}
  .progress-ring {width:126px;height:126px;flex-basis:126px}
  .progress-ring-center {width:101px;height:101px}
  .quick-metrics {gap:22px}
  .progress-hero {gap:28px}
  .site-footer {padding:25px 0}
}
@media(max-width:440px) {
  .site-shell {padding:0 11px}
  .site-header {padding:0 7px}
  .main-layout {padding-top:23px}
  .intro-head {padding:0 7px}
  h1 {font-size:34px;letter-spacing:-1.5px}
  .intro-copy {font-size:12px}
  .difficulty-row {gap:8px;margin:23px 0 13px}
  .difficulty-group {gap:0;padding:4px}
  .difficulty-btn {padding:9px 8px;font-size:11px}
  .difficulty-btn span {font-size:9px;margin-left:1px}
  .new-game-btn {padding:11px 10px;font-size:11px}
  .new-game-btn svg {width:14px;height:14px}
  .game-card {padding:14px 11px 16px;border-radius:15px}
  .game-card-top {padding:2px 2px 0;margin-bottom:14px}
  .board-identity {gap:7px}
  .board-tag {font-size:10px}
  .status-pill {font-size:10px}
  .timer-group {gap:5px}
  .timer-value {font-size:13px}
  .timer-control {width:25px;height:25px;margin-left:1px}
  .puzzle-board {gap:1.5px;padding:2px;border-radius:7px}
  .board-bottom {margin-top:16px;padding:0 3px}
  .control-card {padding:14px 11px}
  .control-topline {padding:0 3px}
  .control-help {font-size:9px}
  .control-body {gap:7px}
  .mode-picker {padding:3px}
  .mode-btn {padding:9px 8px;font-size:11px;gap:4px}
  .mode-btn svg {width:15px;height:15px}
  .control-divider {height:28px}
  .action-buttons {gap:0}
  .action-btn {padding:6px 3px}
  .action-btn svg {width:17px;height:17px}
  .action-btn span {font-size:9px}
  .stats-card,.rules-card {padding:19px 17px}
  .progress-hero {gap:24px}
  .site-footer>span:last-child {display:none}
}
@media(prefers-reduced-motion:reduce) {*,*:before,*:after {animation:none!important;transition:none!important}}

.disabled-board .white {cursor:default!important}
