:root {
  --surface: #fff;
  --soft: #e7e1d2;
  --key: #d8d5cd;
  --key-shadow: #b9b5ac;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #eef1f7;
  --paper: #161a23;
  --surface: #232936;
  --soft: #2d3442;
  --line: #4a5364;
  --blue: #87a4ff;
  --key: #3a4250;
  --key-shadow: #20252e;
  color-scheme: dark;
}

:root[data-contrast="true"] {
  --green: #f5793a;
  --yellow: #85c0f9;
}

body { transition: background-color .2s, color .2s; }
.site-nav { height:46px; background:#111827; color:#f7f7f5; display:flex; align-items:center; padding:0 max(12px,calc((100vw - 960px)/2)); gap:20px; border-bottom:3px solid var(--blue); }
.site-nav a { text-decoration:none; color:#aeb5c2; }
.site-name { flex:none; font-size:11px; font-weight:900; letter-spacing:1.5px; }
.site-name span { color:var(--blue); }
.puzzle-links { height:100%; display:flex; align-items:stretch; flex:1; }
.puzzle-links a { display:flex; align-items:center; padding:0 13px; font-size:10px; font-weight:800; letter-spacing:1px; text-transform:uppercase; }
.puzzle-links a:hover,.puzzle-links a.current { color:white; background:rgba(255,255,255,.08); }
.display-controls { display:flex; gap:4px; }
.display-controls button { width:32px; height:32px; border:0; border-radius:50%; background:transparent; color:#c8ced8; cursor:pointer; font-size:18px; }
.display-controls button:hover,.display-controls button[aria-pressed="true"] { background:rgba(255,255,255,.12); color:white; }
:root[data-theme="dark"] .tile { border-color:var(--line); background:color-mix(in srgb,var(--surface) 48%,transparent); }
:root[data-theme="dark"] .row.active .tile { border-color:#858fa1; background:var(--surface); }
:root[data-theme="dark"] .key { background:var(--key); box-shadow:0 2px 0 var(--key-shadow); }
:root[data-theme="dark"] .mini-word i { background:var(--surface); }
:root[data-theme="dark"] .today { background:var(--soft); }
:root[data-theme="dark"] .tile.correct { background:var(--green); border-color:transparent; }
:root[data-theme="dark"] .tile.present { background:var(--yellow); border-color:transparent; }
:root[data-theme="dark"] .tile.absent { background:var(--gray); border-color:transparent; }
:root[data-theme="dark"] .brand-logo { filter:brightness(2.4) saturate(.9); }
:root[data-theme="dark"] .turn { color:#111827; }
.archive-button { font-size:18px; }
.archive-modal { text-align:left; }
.archive-modal h1 { margin-bottom:8px; }
.archive-intro { margin:0 0 18px; color:color-mix(in srgb,var(--ink) 65%,transparent); }
.archive-list { border-top:1px solid var(--line); }
.archive-entry { width:100%; display:flex; justify-content:space-between; align-items:center; padding:14px 4px; border:0; border-bottom:1px solid var(--line); background:transparent; text-align:left; }
.archive-entry span { display:flex; align-items:baseline; gap:14px; }
.archive-entry b { color:var(--blue); font-size:15px; }
.archive-entry small { font-size:12px; font-weight:700; }
.archive-entry em { color:var(--blue); font-size:10px; font-style:normal; font-weight:900; letter-spacing:1px; text-transform:uppercase; }
.archive-entry:disabled { color:var(--ink); opacity:1; cursor:default; }

@media (max-width:650px) {
  .site-nav { padding:0 8px; gap:5px; }
  .site-name { font-size:8px; }
  .puzzle-links { overflow-x:auto; }
  .puzzle-links a { font-size:8px; padding:0 8px; }
  .display-controls button { width:28px; }
}
