.header-actions{display:flex;align-items:center;gap:24px;min-width:0}
.theme-picker{position:relative;flex:none}
.theme-toggle{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--ink)}
.theme-toggle:hover,.theme-toggle[aria-expanded=true]{background:var(--wash)}
.theme-icon{width:19px;height:19px;flex:none}
.theme-toggle .theme-icon{display:none}
html:not([data-theme-preference]) .theme-toggle .theme-icon-light,html[data-theme-preference=light] .theme-toggle .theme-icon-light,html[data-theme-preference=dark] .theme-toggle .theme-icon-dark,html[data-theme-preference=system] .theme-toggle .theme-icon-system{display:block}
.theme-menu{position:absolute;z-index:20;right:0;top:calc(100% + 12px);width:176px;padding:6px;border:1px solid var(--line);border-radius:13px;background:var(--white);box-shadow:0 12px 36px #0002}
.theme-option{display:flex;align-items:center;gap:11px;width:100%;min-height:43px;padding:10px;border:0;border-radius:8px;background:transparent;text-align:left;font-size:13px;color:var(--ink)}
.theme-option:hover,.theme-option[aria-pressed=true]{background:var(--wash)}
.theme-option .theme-icon{width:17px;height:17px}
.theme-check{margin-left:auto;visibility:hidden}.theme-option[aria-pressed=true] .theme-check{visibility:visible}
@media(max-width:760px){.header-actions{gap:16px}}
@media(max-width:450px){.shell header{gap:10px}.header-actions{gap:12px}.theme-toggle{width:34px;height:34px}.header-actions nav{gap:12px}}
@media(max-width:350px){.header-actions{gap:8px}.header-actions nav{gap:9px}.shell header .brand{font-size:17px;gap:7px}.shell header .brand-mark{width:10px;height:10px}.theme-toggle{width:32px;height:32px}}

/* The light palette stays in the original styles; dark mode keeps its green tone. */
html[data-theme=dark]{color-scheme:dark;--paper:#17231f;--ink:#e0e7d9;--muted:#a8b6a8;--line:#3a4c40;--accent:#435d3e;--wash:#263a2e;--white:#1e2e25}
html[data-theme=dark] :is(.home-portal,.journal-category,.journal-empty,.entry-cover,.sample-notice){background:#22362a;border-color:#435b43}
html[data-theme=dark] .home-portal:first-child{background:#c5d6a4;color:#1a2b21;border-color:#c5d6a4}
html[data-theme=dark] .home-portal:hover{background:#304632}
html[data-theme=dark] .home-portal:first-child:hover{background:#d6e3ba}
html[data-theme=dark] :is(.entry-cover-type,.post-tags,.empty-mark){color:#b9ce9f}
html[data-theme=dark] :is(.nav-link:hover,.post-row:hover h2,.journal-entry:hover h2,.related-game:hover){color:#bed69b}
html[data-theme=dark] .button.filled:hover{background:#c4d5aa;color:#17231f}
html[data-theme=dark] .game-row:hover{background:#223329}
html[data-theme=dark] .game-window{background:#1e3026;border-color:var(--line)}
html[data-theme=dark] :is(.article-content pre,.article-content code){background:#23372b}
html[data-theme=dark] .article-content blockquote{background:#203527;border-color:#809b67}
html[data-theme=dark] .scorebox{background:#30442e}
html[data-theme=dark] .board2048{background:#3b503f}
html[data-theme=dark] .cell2048{background:#293b2d}
html[data-theme=dark] .tiles2048 :is(.tile2048[data-value="2"],.tile2048[data-value="4"],.tile2048[data-value="8"],.tile2048[data-value="16"]){color:#263b36}
html[data-theme=dark] .sound-toggle{border-color:var(--line)}
html[data-theme=dark] .sound-toggle:hover{background:var(--wash)}
html[data-theme=dark] .score-delta{color:#bed69b}
html[data-theme=dark] .memory-board .card-back{background:#304a39;border-color:#617852;color:#e5e7d2}
html[data-theme=dark] .memory-board .card-face{background:#344c3b;border-color:#617852;color:var(--ink)}
html[data-theme=dark] .memory-board .memory-card.matched .card-face{background:#415b39;box-shadow:inset 0 0 0 2px #78975e}
html[data-theme=dark] .game-overlay{background:#17231ff0}
html[data-theme=dark] .scene svg [stroke="#263b36"]{stroke:var(--ink)}
html[data-theme=dark] .scene svg [stroke="#cdd1c3"]{stroke:var(--line)}
