@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root{color-scheme:dark;--bg:#100e11;--panel:#19161a;--ink:#faf4ed;--muted:#c1b7c0;--accent:#ff7540;--line:#ffffff28;--hue:0deg;--radius:12px;--display:'Barlow Condensed',Impact,sans-serif}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:1rem}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 'Space Grotesk',system-ui,sans-serif}
button,select{font:inherit}
button,select,a{touch-action:manipulation}
a{color:inherit;text-decoration:none}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
.wrap{width:min(1240px,calc(100% - 64px));margin-inline:auto}
.top{display:flex;align-items:center;justify-content:space-between;min-height:76px;gap:20px}
.brand{font-size:clamp(1.18rem,3vw,1.65rem);font-weight:700;letter-spacing:-.07em;white-space:nowrap}
.brand span,.brand small{color:var(--accent)}
.brand-mark{display:inline-grid;place-items:center;border:1px solid var(--line);border-radius:9px;width:35px;height:35px;margin-right:5px;font-size:1.2rem}
nav,.actions{display:flex;gap:24px;align-items:center}
nav a,footer>a:last-child{color:var(--muted)}
nav a:hover,footer a:hover{color:var(--accent)}
.primary,.outline{display:inline-flex;align-items:center;justify-content:center;min-height:45px;padding:9px 18px;border-radius:var(--radius);font-weight:700;font-size:.94rem}
.primary{background:var(--accent);color:#170d0b;border:1px solid var(--accent)}
.outline{background:#120f176b;color:var(--ink);border:1px solid var(--line)}
.primary:hover,.outline:hover{filter:brightness(1.18);box-shadow:0 0 20px color-mix(in srgb,var(--accent),transparent 77%)}
.hero{min-height:555px;display:grid;align-items:center;position:relative;overflow:hidden;isolation:isolate;border-block:1px solid var(--line);background:#100d15}
.hero-art{position:absolute;inset:0;z-index:-2;background:url(cabinet.png) right 51% / auto 153% no-repeat;filter:hue-rotate(var(--hue)) saturate(var(--sat,1));}
body:not([data-world=neon-arcade]) .hero-art{filter:none;background-size:auto 110%}
body[data-world=pixel-quest],body[data-world=cozy-corner]{--display:Georgia,serif}
body[data-world=orbital-command],body[data-world=glitch-lab]{--display:ui-monospace,monospace}
body:is([data-world=pixel-quest],[data-world=cozy-corner],[data-world=orbital-command],[data-world=glitch-lab]) h1{font-size:clamp(3rem,7.1vw,6.7rem)}
body[data-world=cozy-corner] h1{text-transform:none}
body[data-world=rhythm-district] .tile{background:repeating-radial-gradient(ellipse at center,#ffffff18 0 1px,transparent 2px 16px),#23102c}
body[data-world=monster-motel] .tile{background:radial-gradient(ellipse at center,#46176a,#0e0918 75%)}
body[data-world=midnight-drift] .tile{background:repeating-linear-gradient(110deg,#ffffff13 0 2px,transparent 2px 23px),linear-gradient(140deg,#130a18,#4c1444)}
.hero::after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#100d15 0%,#100d15ef 22%,#100d1590 42%,transparent 68%),linear-gradient(0deg,#100d15d1,transparent 35%);pointer-events:none}
.hero-content{padding-block:60px 69px}
.eyebrow{margin:0 0 12px;color:var(--accent);font-size:.875rem;font-weight:700;letter-spacing:.15em;text-transform:uppercase}
.hero .eyebrow{display:inline-flex;align-items:center;gap:10px}
.hero .eyebrow::before{content:'';width:19px;height:2px;background:currentColor}
h1,h2,h3,p{margin-top:0}
h1,h2,h3{font-family:var(--display);line-height:.95}
h1{max-width:720px;margin-bottom:22px;font-size:clamp(4rem,8.4vw,8.1rem);font-weight:900;letter-spacing:-.025em;text-transform:uppercase}
h1 span{display:block;color:var(--accent)}
.intro{max-width:390px;color:#e0d6df;font-size:1.1rem;margin-bottom:28px}
.worlds{border-bottom:1px solid var(--line);background:var(--panel)}
.world-inner{display:flex;align-items:center;gap:18px;padding-block:16px}
.world-inner label{font-weight:700;white-space:nowrap}
.world-buttons{display:flex;gap:6px;overflow:auto;padding:5px 4px;scrollbar-color:var(--accent) transparent}
.world-buttons button,select{white-space:nowrap;border:1px solid var(--line);background:var(--bg);color:var(--ink);padding:6px 10px;border-radius:var(--radius);font-size:.875rem}
.world-buttons button[aria-pressed=true]{background:var(--accent);color:#170d0b;border-color:var(--accent)}
select{display:none;appearance:none;padding-right:35px;background:linear-gradient(45deg,transparent 50%,var(--ink) 50%) calc(100% - 17px) 54% / 5px 5px no-repeat,linear-gradient(135deg,var(--ink) 50%,transparent 50%) calc(100% - 12px) 54% / 5px 5px no-repeat,var(--bg)}
.rooms{padding-block:65px 54px}
.section-head{display:flex;align-items:end;justify-content:space-between;gap:15px;margin-bottom:25px}
h2{margin-bottom:0;font-size:clamp(2.75rem,5vw,4.25rem);text-transform:uppercase}
.section-head>p,.challenge p:last-child{color:var(--muted);margin-bottom:0}
.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.card{display:flex;flex-direction:column;text-align:left;padding:0;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;color:var(--ink);background:var(--panel)}
.card:hover{border-color:var(--card-color)}
.tile{width:100%;min-height:160px;display:grid;place-items:center;position:relative;overflow:hidden;background:radial-gradient(ellipse at 50% 98%,color-mix(in srgb,var(--card-color),#101018 44%),transparent 78%),repeating-linear-gradient(135deg,#ffffff0b 0 1px,transparent 1px 15px),#110f1a;color:var(--card-color)}
.tile::before,.tile::after{content:'';position:absolute;width:120px;height:120px;border:1px solid currentColor;opacity:.27;transform:rotate(35deg)}
.tile::after{width:160px;height:160px}
.tile b{font:800 4.8rem/1 var(--display);text-shadow:0 0 32px currentColor}
.card-copy{display:grid;gap:9px;width:100%;padding:18px 20px 21px}
.card-copy strong{font:800 2rem/.95 var(--display);text-transform:uppercase}
.card-copy small{font-size:.93rem;color:var(--muted)}
.play-label{color:var(--card-color);font-size:.875rem;font-weight:700}
.challenge{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:28px;border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(110deg,color-mix(in srgb,var(--accent),var(--panel) 88%),var(--panel))}
.challenge h2{margin-bottom:12px}
footer{display:flex;justify-content:space-between;gap:10px;align-items:center;padding-block:35px}
dialog{width:min(535px,calc(100% - 32px));max-height:90dvh;overflow:auto;padding:24px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);color:var(--ink)}
dialog::backdrop{background:#07050cce;backdrop-filter:blur(6px)}
.game-header,.game-stats{display:flex;justify-content:space-between;gap:10px}
.game-header{align-items:start;margin-bottom:18px}
.game-header h2{font-size:2.7rem}
.game-stats{font-weight:700;color:var(--accent);margin-bottom:12px}
.board{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;max-width:330px}
.board[hidden]{display:none}
.cell{min-height:44px;height:min(8vh,64px);border:1px solid var(--line);border-radius:var(--radius);background:var(--bg);color:var(--ink);font-size:1.1rem;font-weight:700}
.cell.active{background:var(--accent);color:#160e17}
.cell:disabled{opacity:.45}
.cell.active:disabled{opacity:1}
#result{min-height:1.5em;margin:10px 0}
body[data-layout=center] .hero-content{text-align:center}
body[data-layout=center] .hero :is(h1,.intro){margin-inline:auto}
body[data-layout=center] .actions{justify-content:center}
body[data-layout=center] .hero::after{background:radial-gradient(ellipse,#0a0b18e8 15%,#0a0b18a8 60%,#0a0b1850)}
body[data-layout=split] .hero-art{left:37%;background-size:cover}
body[data-layout=split] .hero::after{background:linear-gradient(90deg,#100d15 35%,#100d1500 77%)}
body[data-layout=editorial] .hero-content{padding-block:100px 45px;align-self:end}
body[data-layout=editorial] .hero::after{background:linear-gradient(0deg,#0d100fe8 10%,#0d100f10 86%),linear-gradient(90deg,#0d100fe0,transparent)}
body[data-layout=editorial] .cards{grid-template-columns:1.4fr 1fr 1fr}
body[data-layout=matrix] .hero::after{background:repeating-linear-gradient(transparent 0 4px,#0003 4px 5px),linear-gradient(90deg,#090f10 18%,#090f10a0 52%,transparent)}
body[data-layout=matrix] .tile::before,body[data-layout=matrix] .tile::after{border-radius:50%}
@media(max-width:880px){.world-buttons{display:none}.world-inner select{display:block;min-width:0;max-width:100%}.world-inner{justify-content:space-between}.hero-art{background-size:auto 118%}.section-head{align-items:start;flex-direction:column}}
@media(max-width:600px){.wrap{width:calc(100% - 32px)}.top{min-height:62px}.top nav{display:none}.top .outline,.actions :is(button,a){padding-inline:12px}.actions{gap:8px;flex-wrap:wrap}.hero{min-height:570px;align-items:end}.hero-content{padding-block:190px 30px}.hero-art,body[data-layout=split] .hero-art{left:0;background-size:auto 75%;background-position:70% top}.hero::after,body[data-layout=split] .hero::after,body[data-layout=editorial] .hero::after{background:linear-gradient(0deg,#100d15 15%,#100d15e0 36%,transparent 72%)}.cards,body[data-layout=editorial] .cards{grid-template-columns:1fr}.rooms{padding-block:45px 30px}.challenge{align-items:start;flex-direction:column}.world-inner label{white-space:normal}.world-inner select{max-width:58%}footer{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
@media(max-width:600px){body:not([data-world=neon-arcade]) .hero-art{background-size:auto 74%;background-position:68% top}}
