/* Scoped route themes: reading surfaces stay opaque over decorative motifs. */
body[data-game]{--text:#eeeef0;--muted:#bfc5cb;--line:color-mix(in srgb,var(--accent) 28%,var(--bg));--heading:Georgia,serif;--radius:8px;background-color:var(--bg);background-image:var(--motif);background-attachment:fixed}
body[data-game] :is(h1,h2,h3,.masthead-title>a,.directory-box h2,.toc strong,.infobox h2,.note strong){font-family:var(--heading)}
body[data-game] a:hover{color:var(--secondary)}
body[data-game] :is(a,button,input,summary):focus-visible{outline-color:var(--secondary)}
body[data-game] .site-header{background:var(--bg);border-color:var(--line)}
body[data-game] .site-header button{background:var(--accent);color:var(--bg)}
body[data-game] .site-header form{border-color:var(--accent)}
body[data-game] .game-masthead{background-color:var(--bg);background-image:var(--motif);border-bottom:3px solid var(--accent);min-height:310px}
body[data-game] .masthead-art{left:auto;width:46%;opacity:.34;object-fit:contain;padding:18px 7% 18px 0;mask-image:linear-gradient(90deg,transparent,#000 45%);object-position:right center}
body[data-game] .wiki-masthead:after{background:linear-gradient(90deg,var(--bg),transparent 90%)}
body[data-game] .masthead-title{text-align:left;width:min(1392px,100%);margin:auto;padding:48px 34px 30px}
body[data-game] .masthead-title>a{color:var(--accent);max-width:76%;font-size:clamp(30px,3.5vw,50px)}
body[data-game] .masthead-title>span{color:var(--secondary)}
body[data-game] .masthead-title small{font:700 12px/1.4 Arial,sans-serif;letter-spacing:5px;margin-top:16px;color:var(--secondary)}
body[data-game] .wiki-nav{justify-content:flex-start;width:min(1392px,100%);padding-left:34px;padding-right:34px}
body[data-game] :is(.wiki-nav>a,.nav-menu summary,.nav-menu>div,.topic-primary,.topic-links>a,.toc,.edition-scope,.reference-table,.note,.infobox,.rail-panel){background:var(--surface);border-color:var(--line);border-radius:var(--radius)}
body[data-game] :is(.wiki-nav>a,.nav-menu summary){color:var(--text)}
body[data-game] :is(.nav-menu>div a,.guide-row,.infobox dl>div,.article-tabs,footer){border-color:var(--line)}
body[data-game] :is(.nav-menu>div a:hover,.nav-menu summary:hover,.topic-primary:hover,.topic-links>a:hover){background:color-mix(in srgb,var(--surface) 80%,var(--accent));border-color:var(--accent)}
body[data-game] :is(.page-heading h1,.article-layout h1,.article-section h2,.sources h2,.directory-box h2,.infobox h2){color:var(--accent);border-color:var(--line)}
body[data-game] :is(.page-heading p,.lead,.guide-row p,.note p,.edition-scope,.infobox dd,.sources p){color:var(--text)}
body[data-game] :is(.eyebrow,.breadcrumbs a,.article-meta,.guide-row small,.infobox dt,.row-number){color:var(--secondary)}
body[data-game] :is(.edition-scope strong,.note strong,.article-tabs .active){color:var(--accent)}
body[data-game] .article-tabs .active{border-color:var(--accent)}
body[data-game] :is(.infobox h2,.wide-link,.reference-table caption,.reference-table th){background:color-mix(in srgb,var(--surface) 80%,var(--bg));color:var(--accent)}
body[data-game] :is(.reference-table td,.reference-table th){border-color:var(--line)}
body[data-game] .spoiler-note{background:var(--surface);color:var(--secondary);border-color:var(--secondary)}
body[data-game] :is(.infobox>img,.rail-game img){background:var(--bg)}
body[data-game] :is(.wiki-panel,.content-grid>article){border-radius:var(--radius);box-shadow:0 12px 35px #0002}
body[data-game] .ad{background:color-mix(in srgb,var(--bg) 94%,white);border-color:var(--line)}
body[data-game] .ad :is(span,div,small){color:#abb1b7}
/* Pokédex panels: bright trim, inset screens, and compact system labels. */
body[data-theme=dex]{--heading:'Trebuchet MS',Arial,sans-serif;--radius:14px}
[data-theme=dex] .game-masthead{border-bottom-width:8px}
[data-theme=dex] .directory-box{padding:16px;border:1px solid var(--line);border-top:5px solid var(--accent);border-radius:14px;background:var(--bg)}
[data-theme=dex] .directory{grid-template-columns:repeat(2,minmax(0,1fr))}
[data-theme=dex] .infobox{border-top:6px solid var(--accent)}
[data-theme=dex] .masthead-title>span:before{content:'● ● ●';margin-right:18px;letter-spacing:6px;color:var(--accent)}
/* Fantasy manuscripts and gothic chapter dividers. */
body[data-theme=legend],body[data-theme=gothic]{--heading:'Cinzel',Georgia,serif;--radius:2px}
[data-theme=legend] .wiki-panel,[data-theme=gothic] .wiki-panel{outline:1px solid var(--line);outline-offset:-8px}
[data-theme=legend] .directory-box h2:before{content:'◆';display:block;font-size:14px;margin-bottom:9px;color:var(--secondary)}
[data-theme=gothic] .directory-box{border:1px solid var(--line);border-radius:70px 70px 3px 3px;padding:30px 14px 14px}
[data-theme=gothic] .masthead-title>a{text-shadow:0 3px 0 #000,0 0 24px #e1a1d330}
/* Sea charts and breezy island menus. */
body[data-theme=sea]{--heading:'Trebuchet MS',Arial,sans-serif;--radius:18px}
[data-theme=sea] .directory-box h2{border-bottom-style:dashed}
[data-theme=sea] .topic-primary{border-left:5px solid var(--secondary)}
[data-theme=sea] .masthead-title>a{font-style:italic}
/* Toy-box panels and paper tabs. */
body[data-theme=play]{--heading:'Trebuchet MS',Arial,sans-serif;--radius:16px;background-size:42px 42px}
[data-theme=play] .topic-primary,[data-theme=play] .topic-links>a{box-shadow:0 4px 0 var(--bg);border-width:2px}
[data-theme=play] .directory-box:nth-child(3n+1) h2{border-color:#ee8a84}
[data-theme=play] .directory-box:nth-child(3n+2) h2{border-color:#8fdba3}
[data-theme=play] .directory-box:nth-child(3n) h2{border-color:#f1d278}
body[data-theme=paper]{--heading:Georgia,serif;--radius:2px}
[data-theme=paper] .directory-box{padding:16px;border:1px dashed var(--accent);box-shadow:5px 5px 0 var(--bg)}
[data-theme=paper] .topic-primary{border-width:2px;transform:rotate(-1deg)}
/* Village noticeboards and farm journals. */
body[data-theme=cozy]{--heading:Georgia,serif;--radius:20px}
[data-theme=cozy] .wiki-panel,[data-theme=cozy] .content-grid>article{border:3px double var(--line)}
[data-theme=cozy] .directory-box{padding:18px;background:var(--bg);border-radius:18px;border:1px dashed var(--line)}
[data-theme=cozy] .masthead-title>a{font-style:italic}
/* RPG menus and clockwork archives. */
body[data-theme=crystal]{--heading:'Trebuchet MS',Arial,sans-serif;--radius:7px}
[data-theme=crystal] .directory-box{border:2px ridge var(--line);padding:16px;background:linear-gradient(145deg,var(--surface),var(--bg))}
[data-theme=crystal] .topic-primary:before{content:'›';margin-right:9px;color:var(--secondary)}
body[data-game=kingdom-hearts-ii]{background-size:47px 47px}
body[data-theme=clock]{--heading:Georgia,serif;--radius:3px}
[data-theme=clock] .directory-box{border-top:3px double var(--accent);padding-top:18px}
[data-theme=clock] .toc{border:3px double var(--line)}
/* Pixel atlases and tactical terminals. */
body[data-theme=pixel]{--heading:'Courier New',monospace;--radius:0px;background-size:24px 24px}
[data-theme=pixel] .topic-primary,[data-theme=pixel] .toc{box-shadow:4px 4px 0 var(--bg);border-width:2px}
[data-theme=pixel] .directory-box h2{border-bottom:4px double var(--accent)}
body[data-theme=terminal]{--heading:'Courier New',monospace;--radius:0px}
[data-theme=terminal] .masthead-title>a{text-transform:uppercase;font-weight:700}
[data-theme=terminal] .directory-box{border:1px solid var(--line);border-left:3px solid var(--accent);padding:15px}
[data-theme=terminal] .directory-box h2{text-align:left;font-size:16px;letter-spacing:1px}
[data-theme=terminal] .article-meta,[data-theme=terminal] .masthead-title>span{font-family:monospace}
[data-theme=terminal] .topic-primary,[data-theme=terminal] .topic-links>a{justify-content:flex-start;text-align:left}
body[data-game=metal-gear-solid-2]{background-size:32px 32px}
@media(max-width:850px){body[data-game] .masthead-title>a{max-width:85%}.directory{gap:18px}}
@media(max-width:600px){body[data-game] .game-masthead{min-height:260px}body[data-game] .masthead-title{padding:32px 18px 24px}body[data-game] .masthead-title>a{font-size:30px;max-width:100%}body[data-game] .masthead-art{width:70%;opacity:.17;padding-right:10px}body[data-game] .wiki-nav{padding-left:15px;padding-right:15px}body[data-game] .directory{grid-template-columns:1fr}body[data-game] .directory-box:last-child{grid-column:auto}body[data-game] .masthead-title>span{font-size:11px;letter-spacing:1.5px}[data-theme=dex] .masthead-title>span:before{display:none}}
