/* MiddleWord.org — "midnight library" theme */
:root {
  --ink-0: #070914;
  --ink-1: #0c1024;
  --ink-2: #131938;
  --ink-3: #1c2350;
  --line: rgba(232, 201, 140, 0.16);
  --line-2: rgba(232, 201, 140, 0.32);
  --paper: #f4ead7;
  --text: #e9e4d8;
  --muted: #a9a6b8;
  --gold: #f0b94d;
  --gold-2: #ffd98a;
  --coral: #ff7a59;
  --mint: #43d9a3;
  --sky: #6aa8ff;
  --violet: #a68bff;
  --h0: #39406b; --h1: #4f7dd6; --h2: #9a7bff; --h3: #ff9a3d; --h4: #ff5a4e; --h5: #43d9a3;
  --radius: 16px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--ink-0); color: var(--text);
  font: 16px/1.65 var(--sans); overflow-x: hidden;
  background-image:
    radial-gradient(1200px 600px at 50% -10%, rgba(240, 185, 77, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 30%, rgba(166, 139, 255, 0.07), transparent 60%),
    linear-gradient(180deg, var(--ink-1), var(--ink-0) 60%);
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40; backdrop-filter: blur(14px) saturate(140%);
  background: rgba(7, 9, 20, 0.72); border-bottom: 1px solid var(--line);
}
.head-in { display: flex; align-items: center; gap: 18px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--paper); font: 700 1.22rem/1 var(--serif); letter-spacing: -0.01em; }
.logo svg { width: 34px; height: 34px; flex: none; }
.logo em { font-style: normal; color: var(--gold); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 8px 12px; border-radius: 999px; transition: color .2s, background .2s; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--paper); background: rgba(240, 185, 77, 0.1); }
.head-btns { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; transition: border-color .2s, background .2s; }
.icon-btn:hover { border-color: var(--gold); background: rgba(240, 185, 77, 0.08); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .nav { position: fixed; inset: 62px 0 auto 0; flex-direction: column; padding: 12px 16px 20px; background: rgba(7, 9, 20, 0.97); border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform .3s; margin: 0; }
  .nav.open { transform: none; }
  .nav a { padding: 12px 14px; font-size: 1rem; }
  .menu-btn { display: grid; }
  .head-btns { margin-left: auto; }
}

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; padding: 34px 0 10px; text-align: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; opacity: 0.55; mask-image: linear-gradient(180deg, #000 30%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%); }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font: 600 0.78rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(7, 9, 20, 0.5); }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
h1, h2, h3 { font-family: var(--serif); color: var(--paper); line-height: 1.15; letter-spacing: -0.015em; }
.hero h1 { font-size: clamp(2rem, 5.4vw, 3.6rem); margin: 16px 0 8px; font-weight: 800; }
.hero h1 .gold { background: linear-gradient(90deg, var(--gold-2), var(--gold), var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { max-width: 640px; margin: 0 auto; color: #cfcadb; font-size: 1.05rem; }
.hero.compact { padding: 26px 0 4px; }
.hero.compact h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }

/* ---------- buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font: 700 0.95rem/1 var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .15s, box-shadow .2s, background .2s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1a1205; box-shadow: 0 8px 24px -8px rgba(240, 185, 77, .6), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-gold:hover { color: #1a1205; box-shadow: 0 10px 30px -6px rgba(240, 185, 77, .8); }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--paper); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(240,185,77,.1); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--text); font: 600 0.82rem/1 var(--sans); cursor: pointer; transition: background .2s, border-color .2s; }
.chip:hover:not(:disabled) { border-color: var(--gold); }
.chip:disabled { opacity: .4; cursor: default; }
.chip.on { background: var(--gold); color: #1a1205; border-color: var(--gold); }
.link-btn { background: none; border: 0; color: var(--gold-2); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }

/* ---------- game ---------- */
.game-shell { position: relative; margin: 18px auto 0; width: min(640px, 100% - 24px); }
.game { background: linear-gradient(180deg, rgba(28, 35, 80, .72), rgba(12, 16, 36, .9)); border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05); backdrop-filter: blur(8px); min-height: 520px; }
.g-loading { display: flex; gap: 12px; align-items: center; justify-content: center; min-height: 480px; color: var(--muted); font-family: var(--mono); font-size: .9rem; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.g-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.g-label { font: 600 0.78rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.g-pips { display: flex; gap: 4px; align-items: center; order: 3; width: 100%; }
.pip { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); transition: background .3s; }
.pip.used { background: var(--h0); }
.pip.heat-1 { background: var(--h1); } .pip.heat-2 { background: var(--h2); } .pip.heat-3 { background: var(--h3); } .pip.heat-4 { background: var(--h4); } .pip.heat-5 { background: var(--h5); }
.pip-n { flex: none; margin-left: 8px; font: 600 .78rem/1 var(--mono); color: var(--muted); }
.g-actions { display: flex; gap: 6px; }
.g-stage { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.ruler { position: relative; border-radius: 10px; background: rgba(0,0,0,.25); border: 1px solid var(--line); min-height: 320px; }
.ruler-track span { position: absolute; left: 0; right: 0; text-align: center; font: 600 9px/1 var(--mono); color: rgba(233,228,216,.38); text-transform: uppercase; transform: translateY(-1px); }
.ruler-band { position: absolute; left: 3px; right: 3px; border-radius: 6px; background: linear-gradient(180deg, rgba(240,185,77,.55), rgba(255,122,89,.45)); box-shadow: 0 0 18px rgba(240,185,77,.6); transition: top .6s cubic-bezier(.2,.8,.2,1), height .6s cubic-bezier(.2,.8,.2,1); }
.ruler-hits i { position: absolute; left: -3px; right: -3px; height: 2px; background: var(--h0); transition: top .4s; }
.ruler-hits i.heat-1 { background: var(--h1); } .ruler-hits i.heat-2 { background: var(--h2); } .ruler-hits i.heat-3 { background: var(--h3); } .ruler-hits i.heat-4 { background: var(--h4); } .ruler-hits i.heat-5 { background: var(--h5); }
.board { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bound { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; border-radius: 12px; background: rgba(244,234,215,.06); border: 1px dashed var(--line-2); }
.bound-tag { font: 600 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); width: 34px; }
.bound-word { font: 700 1.25rem/1.2 var(--serif); color: var(--paper); letter-spacing: .01em; overflow-wrap: anywhere; }
.g-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.g-row { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'w d' 'dir d' 'heat heat'; column-gap: 12px; padding: 10px 14px 12px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); overflow: hidden; }
.g-row.fresh { animation: rowIn .45s cubic-bezier(.2,.9,.3,1.2); }
@keyframes rowIn { from { opacity: 0; transform: translateY(var(--from, 10px)) scale(.97); } }
.g-before .g-row.fresh { --from: -10px; }
.g-word { grid-area: w; font: 700 1.08rem/1.25 var(--serif); color: var(--paper); overflow-wrap: anywhere; }
.g-dir { grid-area: dir; font: 500 .74rem/1.3 var(--mono); color: var(--muted); }
.g-dist { grid-area: d; align-self: center; font: 700 1.05rem/1 var(--mono); color: var(--paper); }
.g-heat { grid-area: heat; height: 3px; margin-top: 8px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; }
.g-heat i { display: block; height: 100%; border-radius: 3px; background: var(--h0); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.g-row.heat-1 .g-heat i { background: var(--h1); } .g-row.heat-2 .g-heat i { background: var(--h2); } .g-row.heat-3 .g-heat i { background: var(--h3); } .g-row.heat-4 .g-heat i { background: var(--h4); } .g-row.heat-5 .g-heat i { background: var(--h5); }
.g-row.heat-4 { border-color: rgba(255,90,78,.35); } .g-row.heat-3 { border-color: rgba(255,154,61,.25); }
.slot { position: relative; margin: 4px 0; padding: 16px 16px 14px; border-radius: 16px; text-align: center; cursor: text; background: radial-gradient(120% 140% at 50% 0%, rgba(240,185,77,.18), rgba(240,185,77,.03) 60%); border: 1.5px solid rgba(240,185,77,.55); box-shadow: 0 0 0 4px rgba(240,185,77,.06), 0 0 40px -10px rgba(240,185,77,.6); }
.slot-word { font: 800 clamp(1.6rem, 6vw, 2.2rem)/1.15 var(--serif); color: #fff; letter-spacing: .02em; min-height: 1.2em; overflow-wrap: anywhere; }
.slot-word.empty .slot-prefix { color: rgba(255,217,138,.55); }
.slot-word.empty:not(:has(.slot-prefix:not(:empty)))::before { content: '?'; color: rgba(255,217,138,.6); }
.caret { display: inline-block; width: 2px; height: .9em; margin-left: 2px; vertical-align: -0.08em; background: var(--gold); animation: blink 1s steps(2) infinite; }
.slot.done .caret { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.slot-meta { margin-top: 6px; font-size: .84rem; color: #cfcadb; }
.slot-meta b { color: var(--gold-2); }
.slot-meta em { font-style: normal; color: var(--paper); font-weight: 600; }
.slot-hints { color: var(--muted); }
.slot.won { border-color: var(--mint); background: radial-gradient(120% 140% at 50% 0%, rgba(67,217,163,.22), rgba(67,217,163,.03) 60%); box-shadow: 0 0 50px -10px rgba(67,217,163,.7); }
.slot.won .slot-word { animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
.slot.done:not(.won) { border-color: var(--coral); background: rgba(255,122,89,.08); box-shadow: none; }
@keyframes pop { 0% { transform: scale(.7); } 100% { transform: none; } }
.slot.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.g-form { display: flex; gap: 8px; margin-top: 14px; }
.g-input { flex: 1; min-width: 0; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.3); color: #fff; font: 600 1rem/1 var(--sans); }
.g-input::placeholder { color: rgba(233,228,216,.4); }
.g-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240,185,77,.18); }
.kbd { display: none; margin-top: 12px; user-select: none; }
.kbd-row { display: flex; gap: 5px; justify-content: center; margin-bottom: 6px; }
.key { flex: 1; max-width: 44px; height: 50px; border: 0; border-radius: 8px; background: rgba(244,234,215,.12); color: var(--paper); font: 700 1rem/1 var(--sans); text-transform: uppercase; cursor: pointer; touch-action: manipulation; }
.key:active { background: rgba(240,185,77,.35); }
.key-wide { flex: 1.6; max-width: 70px; font-size: .72rem; }
@media (pointer: coarse) {
  .kbd { display: block; position: sticky; bottom: 0; z-index: 5; margin: 12px -12px -12px; padding: 10px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(10, 13, 30, .96); border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; }
  .g-form { display: none; }
}
.g-done-note { margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; font-size: .9rem; background: rgba(67,217,163,.08); border: 1px solid rgba(67,217,163,.3); }
@media (max-width: 520px) {
  .game { padding: 12px; border-radius: 18px; }
  .g-stage { grid-template-columns: 22px 1fr; gap: 8px; }
  .ruler-track span { font-size: 7px; }
  .bound { padding: 10px 12px; }
  .bound-word { font-size: 1.1rem; }
  .game-shell { width: calc(100% - 16px); margin-top: 12px; }
  .hero.compact { padding: 16px 0 0; }
  .hero.compact .eyebrow { display: none; }
  .hero.compact h1 { margin: 4px 0 6px; }
  .hero p.lead { font-size: .95rem; line-height: 1.5; }
  .hero { padding-top: 20px; }
  .toolbar { margin-top: 10px; gap: 6px; }
  .g-row { padding: 8px 12px 10px; }
  .ruler { min-height: 260px; }
}

/* ---------- toolbars ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 16px auto 0; }
.toolbar .sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.blitz-timer { font: 700 1rem/1 var(--mono); color: var(--coral); padding: 7px 12px; border: 1px solid var(--coral); border-radius: 999px; }
.unl-stats { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 12px; color: var(--muted); font-size: .86rem; }
.unl-stats b { color: var(--paper); font-family: var(--mono); }

/* ---------- toasts & dialogs ---------- */
#toasts { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 440px); }
.toast { background: var(--paper); color: #17120a; font-weight: 700; font-size: .92rem; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); text-align: center; animation: toastIn .25s ease-out; transition: opacity .35s, transform .35s; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
dialog { border: 1px solid var(--line-2); border-radius: 22px; padding: 0; background: linear-gradient(180deg, #161c42, #0c1024); color: var(--text); width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 40px); box-shadow: 0 40px 120px -20px #000; }
dialog::backdrop { background: rgba(3, 4, 12, .72); backdrop-filter: blur(4px); }
dialog[open] { animation: dlgIn .3s cubic-bezier(.2,.9,.3,1.1); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.dlg-in { padding: 26px 24px 22px; position: relative; }
.dlg-x { position: absolute; top: 12px; right: 12px; }
.dlg-in h2 { margin: 0 0 12px; font-size: 1.5rem; }
.dlg-h3 { font-size: 1rem; margin: 18px 0 8px; }
.res-kicker { margin: 0; font: 600 .78rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); text-align: center; }
.dlg-in .res-word { text-align: center; font-size: 2.6rem; margin: 14px 0 6px; text-transform: lowercase; }
.res-line { text-align: center; margin: 0 0 12px; color: #cfcadb; }
.res-share { font: 1rem/1.5 var(--mono); white-space: pre-wrap; text-align: center; background: rgba(0,0,0,.3); border-radius: 12px; padding: 12px; margin: 0 0 14px; }
.res-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.res-look, .res-next { text-align: center; font-size: .88rem; color: var(--muted); margin: 14px 0 0; }
.res-next b { font-family: var(--mono); color: var(--paper); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stat-grid b { display: block; font: 800 1.7rem/1.1 var(--serif); color: var(--paper); }
.stat-grid span { font-size: .74rem; color: var(--muted); }
.dist-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font: 600 .8rem/1 var(--mono); }
.dist-row span { width: 18px; text-align: right; color: var(--muted); }
.dist-row i { display: block; font-style: normal; text-align: right; padding: 4px 6px; border-radius: 4px; background: linear-gradient(90deg, var(--violet), var(--gold)); color: #120d05; }
.help-steps { padding-left: 0; list-style: none; counter-reset: s; }
.help-steps li { position: relative; padding-left: 38px; margin-bottom: 12px; counter-increment: s; }
.help-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1a1205; font: 800 .82rem/1 var(--mono); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- content ---------- */
main { display: block; }
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--line); }
.sec-kicker { font: 600 .76rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; }
.section h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0 0 16px; }
.section h3, .h3 { font-size: 1.22rem; margin: 26px 0 8px; }
.prose p, .prose li { color: #d6d1de; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--paper); }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--gold-2); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 20px; }
.card { position: relative; padding: 22px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(28,35,80,.5), rgba(12,16,36,.6)); border: 1px solid var(--line); transition: transform .25s, border-color .25s; text-decoration: none; color: inherit; display: block; }
a.card:hover { transform: translateY(-3px); border-color: var(--line-2); color: inherit; }
.card h3 { margin: 10px 0 6px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; }
.card .ico { font-size: 1.5rem; }
.card .go { display: inline-block; margin-top: 12px; color: var(--gold-2); font-weight: 700; font-size: .9rem; }
.example { margin: 18px 0; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.example-row { display: grid; grid-template-columns: 44px 1fr 1fr auto; gap: 10px; padding: 10px 14px; align-items: center; border-bottom: 1px solid var(--line); font-size: .92rem; }
.example-row:last-child { border-bottom: 0; }
.example-row.head { background: rgba(240,185,77,.08); font: 700 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.example-row b { font-family: var(--serif); color: var(--paper); font-size: 1.02rem; }
.example-row .mono { text-align: right; }
.bars { display: grid; gap: 5px; margin: 18px 0; }
.bar { display: grid; grid-template-columns: 22px 1fr 64px; gap: 10px; align-items: center; font: 600 .82rem/1 var(--mono); }
.bar i { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--violet), var(--gold)); }
.bar span:last-child { color: var(--muted); text-align: right; }
.faq details { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: rgba(255,255,255,.02); }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; color: var(--paper); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--gold); font: 700 1.2rem/1 var(--mono); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 18px 16px; color: #d6d1de; }
.faq details > div p { margin: 0 0 8px; }
.callout { padding: 16px 18px; border-radius: 14px; border-left: 3px solid var(--gold); background: rgba(240,185,77,.07); margin: 18px 0; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; text-decoration: none; color: var(--text); }
.toc a:hover { border-color: var(--gold); }
.crumbs { font-size: .84rem; color: var(--muted); margin: 18px 0 0; }
.crumbs a { color: var(--muted); }
.updated { font-size: .84rem; color: var(--muted); }

/* ---------- archive ---------- */
.arc-month h3 { margin: 26px 0 10px; font-size: 1.1rem; }
.arc-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.arc-day { padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: border-color .2s, transform .15s; }
.arc-day:hover { border-color: var(--gold); transform: translateY(-2px); }
.arc-day b { font: 700 .95rem/1 var(--mono); color: var(--paper); }
.arc-day span { font-size: .72rem; color: var(--muted); }
.arc-day.won { border-color: rgba(67,217,163,.6); background: rgba(67,217,163,.1); }
.arc-day.lost { border-color: rgba(255,122,89,.5); background: rgba(255,122,89,.08); }
.arc-day.started { border-style: dashed; border-color: var(--gold); }
.arc-day.cur { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- forms: solver / custom ---------- */
.panel { padding: 22px; border-radius: 20px; background: linear-gradient(180deg, rgba(28,35,80,.6), rgba(12,16,36,.8)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font: 600 .76rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 7px; }
.field .g-input, .field select { width: 100%; }
select.g-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.solve-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 18px 0; }
.solve-card { padding: 14px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.solve-card span { display: block; font-size: .76rem; color: var(--muted); }
.solve-card b { font: 800 1.35rem/1.25 var(--serif); color: var(--paper); overflow-wrap: anywhere; }
.solve-card.hot { border-color: var(--gold); background: rgba(240,185,77,.08); }
.word-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wc { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); font: 500 .86rem/1.2 var(--sans); cursor: pointer; }
.wc:hover { border-color: var(--gold); color: #fff; }
.warn { color: #ffc2b0; }
.copy-row { display: flex; gap: 8px; margin: 10px 0; }

/* ---------- footer ---------- */
.site-foot { margin-top: 40px; padding: 40px 0 30px; border-top: 1px solid var(--line); background: rgba(0,0,0,.25); font-size: .9rem; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 26px; }
.foot-grid h2 { font-size: .8rem; font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 6px; }
.foot-grid a { color: var(--text); text-decoration: none; }
.foot-grid a:hover { color: var(--gold-2); }
.foot-note { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .8rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
