:root { --bg:#faf8f5; --fg:#1a1a1a; --muted:#8a8a8a; --line:#e4e0da; --hover:#efebe5; --panel:#f3efe9; --accent:#e5484d; --ok:#1a7f37;
        --sq:#fff; --blk:#1f1f1f; --word:#ffe9a8; --sel:#ffc94a; --pen:#8a8a8a; --wrong:#d1242f; --rev:#3e63dd; --gridline:#1f1f1f; color-scheme:light dark }
@media (prefers-color-scheme: dark) { :root { --bg:#111; --fg:#f2f2f2; --muted:#808080; --line:#262626; --hover:#1d1d1d; --panel:#171717; --ok:#3fb950;
        --sq:#2b2b2b; --blk:#050505; --word:#3b3215; --sel:#7a5a00; --pen:#8c8c8c; --wrong:#ff6b6b; --rev:#7f9cff; --gridline:#5a5a5a } }
* { box-sizing:border-box; margin:0 }
body { background:var(--bg); color:var(--fg); font:16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-size-adjust:100%;
       display:flex; flex-direction:column; min-height:100vh; min-height:100dvh }
body > #app { flex:1 1 auto; width:100% }
#app { max-width:1180px; margin:0 auto; padding:clamp(16px,3vw,36px) clamp(16px,3vw,36px) 24px }
header { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:6px 20px; margin-bottom:14px }
h1 { font-size:clamp(1.6rem,4vw,2.4rem); letter-spacing:-.03em }
h1 span { color:var(--accent) }
h1 a { color:inherit; text-decoration:none }
.tag { color:var(--muted); font-size:.95rem }
button, input, select, textarea { font:inherit; color:inherit }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px }
.hidden { display:none !important }
.sr { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap }

.seg { display:inline-flex; border:1px solid var(--line); border-radius:10px; padding:3px; gap:2px; background:var(--bg) }
.seg button { font-size:.92rem; color:var(--muted); background:none; border:0; border-radius:7px; padding:6px 12px; cursor:pointer }
.seg button:hover { color:var(--fg) }
.seg button[aria-pressed="true"] { background:var(--fg); color:var(--bg) }
.go { font-weight:600; color:#fff; background:var(--accent); border:0; border-radius:10px; padding:8px 16px; cursor:pointer; font-size:.95rem; text-decoration:none; display:inline-block }
.go:hover { filter:brightness(1.07) }
.ghost { font-size:.92rem; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:6px 12px; cursor:pointer; color:var(--fg); text-decoration:none; display:inline-flex; align-items:center; gap:6px; white-space:nowrap }
.ghost:hover { background:var(--hover) }
.danger { color:var(--wrong) }
.hint { font-size:.83rem; color:var(--muted) }

.pick { display:flex; flex-wrap:wrap; gap:10px 16px; align-items:center; justify-content:space-between; margin-bottom:14px }
.more { display:flex; flex-wrap:wrap; gap:8px; align-items:center }
.date input { background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:5px 8px; font-size:16px; min-height:36px }

.game { border:1px solid var(--line); border-radius:14px; background:var(--panel); padding:12px }
.bar { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; justify-content:space-between; margin-bottom:10px }
.ttl { display:flex; flex-direction:column; min-width:0 }
.ttl b { font-size:1.02rem }
.ttl span { color:var(--muted); font-size:.85rem }
.ctl { display:flex; flex-wrap:wrap; gap:6px; align-items:center }
.tbtn { font-size:.9rem; background:var(--bg); border:1px solid var(--line); border-radius:9px; padding:5px 10px; cursor:pointer; list-style:none; user-select:none; -webkit-user-select:none; min-height:34px; display:inline-flex; align-items:center }
.tbtn::-webkit-details-marker { display:none }
.tbtn:hover { background:var(--hover) }
#timer { font-variant-numeric:tabular-nums; min-width:4.2em; justify-content:center }
#pencil[aria-pressed="true"] { background:var(--fg); color:var(--bg); border-color:var(--fg) }
.menu { position:relative }
.menu[open] > summary { background:var(--hover) }
.pop { position:absolute; right:0; top:calc(100% + 4px); z-index:30; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:6px; min-width:12.5em; box-shadow:0 8px 24px rgba(0,0,0,.14); display:flex; flex-direction:column; gap:2px }
.pop button { text-align:left; background:none; border:0; border-radius:7px; padding:7px 10px; cursor:pointer; font-size:.92rem }
.pop button:hover, .pop button:focus-visible { background:var(--hover) }
.pop .opt { display:flex; gap:8px; align-items:center; padding:7px 10px; font-size:.88rem; border-top:1px solid var(--line); margin-top:4px; cursor:pointer }
.pop .opt input { accent-color:var(--accent); width:16px; height:16px }

.board { display:grid; grid-template-columns:minmax(0, 560px) minmax(0,1fr); gap:18px; align-items:start }
@media (max-width:860px) { .board { grid-template-columns:minmax(0,1fr) } }
.gridcol { min-width:0; max-width:560px; width:100%; margin:0 auto }
.gridwrap { position:relative; container-type:inline-size; width:100% }
#grid { display:grid; width:100%; background:var(--gridline); border:2px solid var(--gridline); gap:1px; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; touch-action:manipulation; outline-offset:3px; -webkit-tap-highlight-color:transparent }
#grid.free { background:transparent; border:0 }
.c { position:relative; background:var(--sq); aspect-ratio:1; display:flex; align-items:center; justify-content:center; cursor:pointer; min-width:0; overflow:hidden }
.c.b { background:var(--blk); cursor:default }
.c.e { background:transparent; cursor:default }
#grid.free .c:not(.e) { outline:1px solid var(--gridline) }
.c .n { position:absolute; left:2px; top:0; font-size:var(--nfs); line-height:1.1; color:var(--fg); opacity:.85; pointer-events:none }
.c .l { font-size:var(--lfs); font-weight:600; line-height:1; pointer-events:none; text-transform:uppercase; margin-top:.12em }
.c.w { background:var(--word) }
.c.s { background:var(--sel) }
.c.p .l { color:var(--pen); font-weight:400 }
.c.x .l { color:var(--wrong) }
.c.x::after { content:""; position:absolute; inset:0; background:linear-gradient(to top right, transparent calc(50% - 1px), var(--wrong) calc(50% - 1px), var(--wrong) calc(50% + 1px), transparent calc(50% + 1px)); opacity:.7; pointer-events:none }
.c.r::before { content:""; position:absolute; right:0; top:0; border:solid transparent; border-width:0 var(--tri) var(--tri) 0; border-right-color:var(--rev); pointer-events:none }
.c.r .l { color:var(--rev) }
.c.k .l { color:var(--ok) }
.paused { position:absolute; inset:0; background:color-mix(in srgb, var(--panel) 96%, transparent); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; border-radius:6px; z-index:5 }
.paused p { font-size:1.2rem; font-weight:600 }

.cluebar { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:stretch; margin-top:10px; background:var(--word); border-radius:10px; min-height:52px }
.cluebar .nav { background:none; border:0; font-size:1.6rem; line-height:1; padding:0 14px; cursor:pointer; color:var(--fg); touch-action:manipulation }
.cluebar .cur { padding:8px 4px; font-size:.98rem; display:flex; align-items:center; gap:8px; overflow-wrap:anywhere }
.cluebar .cur b { flex:none; font-size:.85rem }

.kbd { display:none; margin-top:10px; gap:6px; flex-direction:column; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; touch-action:manipulation }
.kbd.on { display:flex }
.kbd .kr { display:flex; gap:5px; justify-content:center }
.kbd button { flex:1 1 0; max-width:44px; min-width:0; height:46px; border:0; border-radius:7px; background:var(--bg); box-shadow:0 1px 0 var(--line); font-size:1.08rem; font-weight:600; cursor:pointer; padding:0; touch-action:manipulation; color:var(--fg) }
.kbd button.wide { flex:1.6 1 0; max-width:66px; font-size:.95rem }
.kbd button:active { background:var(--hover) }
.kbd button[aria-pressed="true"] { background:var(--fg); color:var(--bg) }

.lists { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; min-width:0; max-height:var(--lh, 600px) }
@media (max-width:860px) { .lists { max-height:none; margin-top:14px } }
@media (max-width:520px) { .lists { grid-template-columns:minmax(0,1fr) } }
.lists section { min-width:0; display:flex; flex-direction:column; max-height:inherit }
.lists h2 { font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:600; padding:4px 6px 6px; border-bottom:1px solid var(--line) }
.lists ol { list-style:none; padding:4px 0 0; overflow:auto; overscroll-behavior:contain }
@media (max-width:860px) { .lists ol { overflow:visible } }
.lists li { display:grid; grid-template-columns:2.2em minmax(0,1fr); gap:4px; padding:5px 6px; border-radius:7px; cursor:pointer; font-size:.94rem; border-left:4px solid transparent; overflow-wrap:anywhere }
.lists li b { text-align:right; padding-right:4px }
.lists li:hover { background:var(--hover) }
.lists li.cross { border-left-color:var(--word) }
.lists li.on { background:var(--word) }
.lists li.done { color:var(--muted) }

dialog { border:1px solid var(--line); border-radius:14px; background:var(--bg); color:var(--fg); padding:20px; width:min(440px, calc(100vw - 32px)); max-height:calc(100dvh - 32px) }
dialog::backdrop { background:rgba(0,0,0,.4) }
dialog h2 { font-size:1.2rem; margin-bottom:8px }
dialog .row { display:flex; gap:8px; justify-content:flex-end; margin-top:16px }
dialog .row.wrap { flex-wrap:wrap }
.file { position:relative; overflow:hidden }
.file input { position:absolute; inset:0; opacity:0; cursor:pointer; font-size:16px }
.stats { display:grid; gap:14px }
.stats h3 { font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:600; margin-bottom:6px }
.stats dl { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px }
.stats dl div { background:var(--panel); border-radius:9px; padding:8px; text-align:center }
.stats dt { font-size:.75rem; color:var(--muted) }
.stats dd { font-size:1.15rem; font-weight:700; margin:0; font-variant-numeric:tabular-nums }

.faq { margin-top:30px; max-width:46em }
.faq h2 { font-size:1.15rem; letter-spacing:-.01em; margin:22px 0 6px }
.faq p { opacity:.88; font-size:.95rem; margin-top:8px }
.faq a { color:var(--accent) }

#toast { position:fixed; left:50%; bottom:max(16px, env(safe-area-inset-bottom)); transform:translateX(-50%); background:var(--fg); color:var(--bg); padding:8px 8px 8px 14px; border-radius:10px; font-size:.9rem; z-index:40; max-width:calc(100vw - 32px); width:max-content; display:flex; align-items:center; gap:10px }
#toast button { background:none; border:1px solid currentColor; color:inherit; border-radius:7px; padding:3px 10px; cursor:pointer; font-size:.85rem; font-weight:600 }
#toast button:empty { display:none }

/* gripe network badge (same on every site) */
.gn-wrap { display:flex; flex-direction:column; align-items:center; gap:10px; padding:18px 16px 22px }
.gn-terms { color:var(--muted,#8a8a8a); font:.8rem/1.3 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; text-decoration:none; text-align:center }
.gn-terms:hover { color:var(--accent,#e5484d); text-decoration:underline }
.gn { display:inline-flex; align-items:center; gap:10px; padding:6px 6px 6px 14px; border:1px solid var(--line,#e4e0da); border-radius:999px;
      background:var(--panel,var(--hover,#f3efe9)); color:var(--fg,#1a1a1a); text-decoration:none;
      font:500 .9rem/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; transition:border-color .15s, transform .15s }
.gn:hover { border-color:var(--accent,#e5484d); transform:translateY(-1px) }
.gn:focus-visible { outline:2px solid var(--accent,#e5484d); outline-offset:2px }
.gn-dot { width:8px; height:8px; border-radius:50%; background:var(--accent,#e5484d); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent,#e5484d) 22%, transparent) }
.gn b { color:var(--accent,#e5484d); font-weight:700 }
.gn-more { padding:5px 11px; border-radius:999px; background:var(--accent,#e5484d); color:#fff; font-size:.8rem; font-weight:600; white-space:nowrap }
@media (prefers-reduced-motion: reduce) { .gn { transition:none } .gn:hover { transform:none } }

@media print {
  body { background:#fff; color:#000 }
  header .tag, .pick, .bar .ctl, .cluebar, .kbd, .faq, .gn-wrap, [aria-label="Related tools"], #toast { display:none !important }
  .game { border:0; padding:0; background:none }
  .board { grid-template-columns:1fr; }
  .gridcol { max-width:420px }
  .lists { max-height:none; grid-template-columns:1fr 1fr; font-size:10pt }
  .lists ol { overflow:visible }
  .c, .c.w, .c.s { background:#fff !important } .c.b { background:#000 !important } .c .l { color:transparent !important }
}
