:root {
  color-scheme: dark;
  --bg: #0c111a;
  --surface: #151d29;
  --border: #313c4d;
  --text: #f6eee0;
  --muted: #bec6d1;
  --accent: #f4c37e;
  font: 16px/1.55 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-underline-offset: .2em; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img { display: block; width: 100%; height: auto; }
h1, h2, h3 { margin: 0; line-height: 1.12; }
h1, h2 { font-family: Georgia, serif; font-weight: 500; }
h1 { font-size: clamp(2.4rem, 6vw, 4.7rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); letter-spacing: -.025em; }
p { margin: 0; color: var(--muted); }
.shell { width: min(1120px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -5rem; padding: .5rem; background: var(--surface); z-index: 3; }
.skip:focus { top: .5rem; }
.header { border-bottom: 1px solid var(--border); }
.bar, .footer { display: flex; justify-content: space-between; align-items: center; gap: .8rem 2rem; padding-block: 1rem; }
nav { display: flex; flex-wrap: wrap; gap: .5rem 1.35rem; }
nav a, .brand { color: var(--text); text-decoration: none; }
nav a:hover, .brand:hover { color: var(--accent); }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 740; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 5px; background: var(--accent); color: var(--bg); }
.intro { padding-top: clamp(1.9rem, 5vw, 3.5rem); }
.intro > p { margin: .65rem 0 1.4rem; max-width: 630px; }
.hero { min-height: clamp(360px, 40vw, 500px); display: grid; align-items: end; position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; isolation: isolate; background: var(--surface); }
.hero img, .game-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after, .game-cover::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #080c13eb, #080c1366 53%, #080c130b), linear-gradient(0deg, #080c13d9, transparent 68%); }
.hero-copy { padding: clamp(1.3rem, 4.5vw, 3.2rem); max-width: 480px; }
.hero-copy h2 { font-size: clamp(2.8rem, 6.6vw, 5.5rem); line-height: .93; margin: .65rem 0 .85rem; }
.hero-copy p { color: var(--text); }
.label { font-size: .75rem; font-weight: 720; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.primary { display: inline-flex; align-items: center; gap: .6rem; justify-content: center; min-height: 46px; padding: .65rem 1.1rem; color: #17110a; background: var(--accent); border: 1px solid transparent; border-radius: 7px; font: inherit; font-weight: 750; text-decoration: none; }
.primary:hover { background: #ffd8a5; }
.hero-copy .primary { margin-top: 1.35rem; }
.shelf { margin-top: 3rem; scroll-margin-top: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1rem; margin-top: 1.05rem; }
.card { display: block; color: inherit; text-decoration: none; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.card:hover { border-color: var(--accent); }
.card img { aspect-ratio: 16/9; object-fit: cover; background: #202a37; }
.card-copy { padding: .9rem 1rem 1.1rem; }
.card h3 { margin: .35rem 0; font-size: 1.08rem; }
.card h3 span { color: var(--accent); }
.card p { font-size: .9rem; }
.lower { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2rem 4rem; margin-top: 3.5rem; }
.faq details { border-bottom: 1px solid var(--border); padding: .8rem 0; }
.faq h2 { margin-bottom: .45rem; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq p { margin-top: .45rem; }
.footer { border-top: 1px solid var(--border); margin-top: 4rem; padding-block: 1.5rem; font-size: .9rem; }
.article { padding-top: 3rem; }
.article .reading, .game .reading { max-width: 700px; margin: 1.3rem 0 2rem; }
.reading h2 { margin-block: 1.5rem .6rem; }
.reading > h2:first-child { margin-top: 0; }
.reading p + p, .reading p + ul { margin-top: .85rem; }
.reading li { margin-bottom: .35rem; }
.game { padding-top: 1.8rem; }
.game h1 { margin: .4rem 0 1.1rem; }
.back { display: inline-block; }
.stage { position: relative; aspect-ratio: 5/3; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.stage:fullscreen { width: 100%; height: 100%; }
.stage iframe { width: 100%; height: 100%; border: 0; }
.game-cover, .loader { position: absolute; inset: 0; display: grid; place-items: center; isolation: isolate; }
.loader { display: none; }
.stage[data-gf-state="loading"] .loader { display: grid; }
.stage[data-gf-state] .game-cover { display: none; }
.game-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.game-actions button, .puzzle button:not(.primary) { color: var(--text); background: #202b3a; border: 1px solid var(--border); border-radius: 7px; padding: .55rem .8rem; min-height: 44px; }
.game-actions button:hover, .puzzle button:hover:not(:disabled) { border-color: var(--accent); }
.game-actions [aria-pressed="true"] { color: var(--accent); }
.hero-small .hero-copy h2 { font-size: clamp(2rem, 6vw, 4rem); }
.puzzle { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: clamp(1rem, 4vw, 2.4rem); }
.room-top, .room-bottom { display: flex; align-items: center; justify-content: space-between; gap: .65rem; flex-wrap: wrap; }
.spots { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin-block: 1rem; }
.findings { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; min-height: 80px; }
.findings form, .findings > button, .hint { margin-top: .7rem; }
.lock-row { display: flex; align-items: stretch; gap: .5rem; margin-top: .45rem; }
.lock-row input { width: 6rem; border: 1px solid var(--border); border-radius: 7px; padding: .4rem .6rem; background: var(--bg); color: var(--text); }
@media (max-width: 650px) {
  .shell { width: calc(100% - 32px); }
  .bar, .footer { flex-wrap: wrap; }
  .bar nav { font-size: .9rem; }
  .hero img { object-position: 64% center; }
  .lower { grid-template-columns: 1fr; }
  .footer { margin-top: 3rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Terminal pages use the same theme assets without restyling legacy routes. */
body.eg-terminal {
  --bg:#0d1315; --surface:#131c1e; --border:#365047; --text:#edf7f0; --muted:#b2c9bb; --accent:#c7fa83;
  --eg-ink:#15230c; --eg-panel:#172524; --eg-head:ui-monospace, "SFMono-Regular", Consolas, monospace;
  background:var(--bg); color:var(--text);
}
.eg-terminal [hidden] { display:none !important; }
.eg-terminal :focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.eg-terminal .header .bar { max-width:1248px; width:100%; padding:0 32px; min-height:72px; }
.eg-terminal .header .bar nav { gap:4px 22px; flex-wrap:wrap; }
.eg-terminal .header .bar nav a { min-height:44px; display:inline-flex; align-items:center; text-decoration:none; white-space:nowrap; }
.eg-terminal .header .bar nav a:hover { color:var(--accent); text-decoration:underline; }
.eg-terminal .gf-site-icon { inline-size:32px; block-size:32px; }
.eg-terminal .footer { max-width:1184px; }
.eg-terminal img { max-width:100%; }
.eg-shell { width:min(calc(100% - 64px),1184px); margin-inline:auto; }
.eg-shell :where(h1,h2,h3,p,figure,ol,dl) { margin:0; }
.eg-shell h1,.eg-shell h2 { color:var(--text); font-family:var(--eg-head); font-weight:720; line-height:1.09; letter-spacing:-.055em; }
.eg-shell h1 { font-size:clamp(42px,5vw,70px); max-width:17ch; }
.eg-shell h2 { font-size:clamp(25px,3.1vw,39px); }
.eg-shell h3 { font-size:18px; line-height:1.3; }
.eg-shell p { line-height:1.5; }
.eg-shell .eg-muted,.eg-muted { color:var(--muted); }
.eg-shell a { text-underline-offset:4px; }
.eg-feature { padding-top:34px; }
.eg-hero { display:grid; grid-template-columns:minmax(0,.86fr) minmax(0,1.14fr); align-items:stretch; gap:24px; }
.eg-copy { display:flex; flex-direction:column; justify-content:center; align-items:start; padding:16px 0 16px 19px; border-inline-start:1px solid var(--border); }
.eg-kicker { color:var(--accent); font:650 14px/1.3 var(--eg-head); text-transform:uppercase; letter-spacing:.05em; }
.eg-copy .eg-kicker { margin-bottom:10px; }
.eg-copy .eg-game-title { margin:19px 0 3px; font-size:21px; font-weight:760; }
.eg-copy h1 + .eg-muted { margin-top:13px; }
.eg-copy .eg-actions { margin-block:16px 9px; }
.eg-conditions { display:flex; flex-wrap:wrap; gap:3px 13px; color:var(--muted); font:500 14px/1.45 var(--eg-head); }
.eg-conditions span { white-space:nowrap; }
.eg-art { position:relative; min-height:352px; overflow:hidden; isolation:isolate; border:1px solid var(--border); border-radius:4px; background:var(--eg-panel); }
.eg-art img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.eg-art::before { content:""; position:absolute; z-index:1; inset:58% 0 0; background:linear-gradient(transparent,color-mix(in srgb,var(--bg) 84%,transparent)); }
.eg-art::after { content:""; position:absolute; z-index:1; inset:9px; border:1px solid color-mix(in srgb,var(--accent) 51%,transparent); pointer-events:none; }
.eg-art figcaption { position:absolute; z-index:2; bottom:20px; left:20px; color:var(--text); font:650 13px/1.2 var(--eg-head); }
.eg-shell .eg-button {
  display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:8px 13px; border-radius:4px;
  background:var(--surface); border:1px solid var(--border); color:var(--text); font:680 15px/1.28 system-ui,sans-serif;
  text-align:center; text-decoration:none; cursor:pointer;
}
.eg-shell .eg-button:hover { border-color:var(--accent); }
.eg-shell .eg-button.eg-primary { min-height:48px; padding-inline:16px; background:var(--accent); border-color:var(--accent); color:var(--eg-ink); }
.eg-shell .eg-button.eg-primary:hover { background:color-mix(in srgb,var(--accent) 80%,white); }
.eg-shell .eg-button:disabled { cursor:default; opacity:.62; }
.eg-actions,.eg-row { display:flex; flex-wrap:wrap; gap:8px 13px; align-items:center; }
.eg-row { justify-content:space-between; }
.eg-section { margin-block:46px; scroll-margin-top:14px; }
.eg-section-heading { margin-bottom:16px; }
.eg-catalog,.eg-related,.eg-steps { display:grid; gap:16px; grid-template-columns:repeat(3,minmax(0,1fr)); }
.eg-card,.eg-related-card { display:block; min-width:0; border:1px solid var(--border); overflow:hidden; background:var(--surface); border-radius:4px; text-decoration:none; }
.eg-card:hover,.eg-related-card:hover { border-color:var(--accent); }
.eg-card img,.eg-related-card img { display:block; width:100%; height:auto; aspect-ratio:16 / 9; object-fit:cover; background:var(--eg-panel); }
.eg-card > div { padding:13px 15px; }
.eg-card h3 { margin:5px 0 4px; color:var(--text); }
.eg-card p:not(.eg-kicker) { color:var(--muted); }
.eg-related { margin-top:15px; grid-template-columns:repeat(4,minmax(0,1fr)); }
.eg-related-card > :is(strong,span) { display:block; padding:0 12px; }
.eg-related-card > strong { margin:10px 0 2px; color:var(--text); }
.eg-related-card > span { margin-bottom:11px; color:var(--muted); font-size:14px; }
.eg-steps { list-style-position:inside; padding:0; margin:14px 0; }
.eg-steps li { background:var(--surface); border:1px solid var(--border); border-radius:4px; padding:13px; }
.eg-steps p { margin-top:4px; color:var(--muted); }
.eg-faq h2,.eg-feedback h2 { margin-bottom:12px; }
.eg-faq details { border-bottom:1px solid var(--border); padding:9px 0; }
.eg-faq summary { min-height:44px; padding-block:9px; cursor:pointer; font-weight:680; }
.eg-faq details p { color:var(--muted); max-width:68ch; padding-bottom:6px; }
.eg-faq > p { margin-top:12px; }
.eg-faq > .eg-actions { margin-top:14px; }
.eg-feedback { padding-block:14px; border-block:1px solid var(--border); }
.eg-feedback h2 { font-size:clamp(20px,3vw,25px); }
.eg-feedback form,.eg-feedback [data-eg-feedback-status] { margin-top:10px; }
.eg-shell :is(input,select) {
  min-height:44px; max-width:100%; padding:6px 9px; background:var(--bg); border:1px solid var(--border);
  color:var(--text); border-radius:4px; font:inherit;
}
.eg-feedback label,.eg-room form label { display:block; margin:8px 0 6px; }
.eg-feedback input { width:min(100%,340px); }
.eg-dialog { width:min(calc(100% - 24px),760px); max-height:calc(100dvh - 24px); overflow:auto; background:var(--bg); color:var(--text); padding:0; border:1px solid var(--border); border-radius:4px; }
.eg-dialog::backdrop { background:color-mix(in srgb,var(--bg) 86%,transparent); }
.eg-room-bar { position:sticky; top:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 14px; border-bottom:1px solid var(--border); background:var(--surface); }
.eg-room { padding:15px; }
.eg-room h2 { font-size:clamp(23px,4.5vw,34px); }
.eg-spots { display:flex; flex-wrap:wrap; gap:7px; margin:13px 0; }
.eg-findings { min-height:70px; border:1px solid var(--border); background:var(--surface); border-radius:4px; padding:12px; }
.eg-findings form,.eg-findings > button,.eg-findings > .eg-actions { margin-top:10px; }
.eg-room input[name="code"] { width:90px; }
.eg-room-bottom { margin-top:10px; }
.eg-hint { margin-top:9px!important; padding:8px 11px; border-inline-start:3px solid var(--accent); background:var(--eg-panel); }
.eg-game-panel { background:var(--eg-panel); border:1px solid var(--border); border-radius:4px; scroll-margin-top:10px; margin-block:24px 0; }
.eg-page { padding-top:18px; }
.eg-page-crumb { margin-top:12px; }
.eg-page-crumb + .eg-feature { padding-top:16px; }
.eg-crumb { display:flex; flex-wrap:wrap; gap:7px; align-items:center; margin-bottom:14px; color:var(--muted); font-size:14px; }
.eg-crumb a { display:inline-flex; align-items:center; min-height:44px; }
.eg-standalone { scroll-margin-top:10px; }
.eg-external h1 { margin-bottom:9px; }
.eg-stage { max-width:960px; margin-top:12px; aspect-ratio:16 / 9; background:var(--eg-panel); border-color:var(--border); }
.eg-stage .game-cover .eg-primary { position:absolute; inset:auto auto 14px 14px; transform:none; }
.eg-stage .game-cover img { width:100%; height:100%; object-fit:cover; }
.eg-stage .eg-exit-fullscreen { position:absolute; inset:8px 8px auto auto; z-index:3; }
.eg-game-tools,.eg-provider { margin-top:9px; }
.eg-phone-tip { display:none; }
.eg-reading { max-width:78ch; }
.eg-gameplay-image { display:block; width:min(100%,960px); height:auto; margin:15px auto; border:1px solid var(--border); border-radius:4px; }
.eg-table { margin-top:9px; border:1px solid var(--border); border-radius:4px; }
.eg-table-head,.eg-table-row {
  display:grid; grid-template-columns:1.48fr .96fr .88fr .83fr .72fr .9fr 56px;
  gap:10px; align-items:center; padding:9px 12px;
}
.eg-table-head { background:var(--surface); font-weight:680; }
.eg-table-row { border-top:1px solid var(--border); }
.eg-table-row > span { color:var(--muted); }
.eg-table :is(.eg-table-head,.eg-table-row > span) { font-size:14px; }
.eg-table-row h3 { font-size:16px; }
.eg-field-name { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.eg-filter .eg-button[aria-pressed="true"] { color:var(--eg-ink); background:var(--accent); border-color:var(--accent); }
.eg-ad { width:min(100%,960px); height:200px; margin-inline:auto; overflow:hidden; border:1px solid var(--border); border-radius:4px; background:var(--surface); }
.eg-ad-label { display:block; height:24px; padding-inline:10px; color:var(--muted); font:500 13px/24px var(--eg-head); }
.eg-ad-content { height:calc(100% - 24px); overflow:hidden; }
.eg-ad[data-preview] .eg-ad-content { display:grid; place-items:center; color:var(--muted); border-top:1px dashed var(--border); font:500 14px var(--eg-head); }
@media (max-width:767px) {
  .eg-shell { width:calc(100% - 32px); }
  .eg-terminal .header .bar { padding:6px 16px; flex-wrap:wrap; justify-content:space-between; min-height:0; gap:0; }
  .eg-terminal .header .bar nav { width:100%; justify-content:space-between; gap:0 8px; font-size:14px; }
  .eg-terminal .header .bar nav a { margin:0; padding:0; }
  .eg-terminal .header .brand { min-height:40px; }
  .eg-feature { padding-top:13px; }
  .eg-hero { grid-template-columns:1fr; gap:12px; }
  .eg-copy { padding:8px 0 3px 11px; }
  .eg-shell h1 { font-size:clamp(35px,8.7vw,48px); }
  .eg-shell h2 { font-size:clamp(23px,6vw,32px); }
  .eg-copy .eg-game-title { margin-top:10px; }
  .eg-copy .eg-actions { margin-block:10px 5px; }
  .eg-conditions { gap:3px 9px; }
  .eg-art { min-height:0; height:clamp(120px,44vw,270px); }
  .eg-section { margin-block:29px; }
  .eg-catalog,.eg-related { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .eg-card > div { padding:10px; }
  .eg-card .eg-kicker { font-size:13px; }
  .eg-steps { grid-template-columns:1fr; gap:7px; }
  .eg-table-head { display:none; }
  .eg-table-row { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 11px; }
  .eg-table-row:first-of-type { border-top:0; }
  .eg-table-row h3,.eg-table-row > .eg-button { grid-column:1 / -1; justify-self:start; }
  .eg-field-name { position:static; width:auto; height:auto; clip-path:none; display:block; color:var(--text); font-weight:660; }
  .eg-phone-tip { display:block; margin-top:6px!important; }
  .eg-ad { height:250px; }
}
@media (max-width:359px) {
  .eg-terminal .header .bar nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .eg-crumb { margin-bottom:8px; }
  .eg-catalog { grid-template-columns:1fr; }
}
