/* Dungeons and Gorillas: "Field Guide" theme. Self-contained: no external fonts, images or imports.
   Served under a strict CSP (style-src 'self'), so pages use classes only: no style attributes. */
:root{--pine:#121f1b;--pine2:#192b23;--deep:#0c1713;--gold:#f6c567;--gold2:#ffe099;--cream:#fbf3df;--ink:#1d2b22;--muted:#4d5e51;--mist:#c6d3bd;--paper:#fffaeb;--max:1280px;--body:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;--display:Georgia,Cambria,"Times New Roman",serif;--radius:14px}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-padding-top:90px}
@media (prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}
body{margin:0;color:var(--cream);font:16px/1.55 var(--body);background:var(--deep)}
a{color:inherit;text-underline-offset:.18em}
img,svg{max-width:100%;display:block}
img{height:auto}
::selection{background:var(--gold);color:var(--deep)}
:focus-visible{outline:3px solid #e5a725;outline-offset:3px}
button{font:inherit;color:inherit;cursor:pointer}
h1,h2,h3,p{margin:0}
h1,h2,h3{line-height:1.08;text-wrap:balance}
h1,h2{font-family:var(--display);font-weight:700}
h2{font-size:clamp(30px,4.4vw,53px);letter-spacing:-.04em}
p+p{margin-top:1em}
.wrap{width:min(calc(100% - 68px),var(--max));margin-inline:auto}
.skip{position:fixed;z-index:100;top:8px;left:8px;transform:translateY(-200%);background:var(--cream);color:var(--ink);padding:10px 14px;border-radius:6px;font-weight:700}
.skip:focus{transform:none}
.sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.eyebrow{font-size:.73rem;text-transform:uppercase;font-weight:800;letter-spacing:.16em;display:flex;align-items:center;gap:9px;line-height:1.35;color:var(--gold)}
.eyebrow:before{content:"";width:18px;height:2px;background:currentColor;opacity:.6;flex:none}
.ico{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;display:inline-block;vertical-align:middle}
.row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.button{display:inline-flex;gap:10px;align-items:center;justify-content:center;padding:13px 17px;border:1px solid transparent;border-radius:9px;font-weight:800;text-decoration:none;min-height:48px;line-height:1.3;text-align:center}
.button .ico{width:18px;height:18px}
.button-primary{background:var(--gold);color:#263023;box-shadow:0 5px 18px #0002}
.button-primary:hover{background:#ffe0a0}
.button-outline{border-color:#8f9a84;background:#18251fd9;color:var(--cream)}
.button-outline:hover{background:#27382a}
.button-subtle{color:var(--pine);border-color:#96a58c;background:var(--paper)}
.button-subtle:hover{background:#ecf1df}
.button.big{font-size:1.15rem;padding:15px 28px}

/* header */
.topbar{position:sticky;top:0;z-index:20;background:#112019f5;border-bottom:1px solid #455345}
.topinner{min-height:75px;display:flex;align-items:center;justify-content:space-between;gap:18px}
.brand{display:inline-flex;align-items:center;gap:10px;font-family:var(--display);font-weight:700;font-size:1.24rem;line-height:.95;text-decoration:none;white-space:nowrap}
.brand img{width:35px;height:35px;border-radius:9px}
.brand small{display:block;font-family:var(--body);font-size:.6rem;letter-spacing:.18em;font-weight:800;margin-top:6px;color:var(--gold);text-transform:uppercase}
.topnav{display:flex;align-items:center;gap:23px}
.topnav a{color:#e9f0e3;font-size:.9rem;font-weight:680;text-decoration:none;padding:6px 0}
.topnav a:hover,.topnav a[aria-current=page]{color:var(--gold)}
.topinner>.button{min-height:42px;padding:8px 13px;font-size:.88rem}
.menu-toggle{display:none;color:var(--cream);border:1px solid #6b7669;background:transparent;padding:8px;border-radius:6px;min-width:44px;min-height:44px;align-items:center;justify-content:center}

/* home hero */
.hero{position:relative;isolation:isolate;min-height:clamp(570px,53vw,780px);display:grid;align-items:center;background:#26392a;overflow:hidden;border-bottom:1px solid #57664d}
.hero-img{position:absolute;inset:0;z-index:-2;width:100%;height:100%;max-width:none;object-fit:cover;object-position:center 54%}
.hero:after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#0b1712 0%,#0c1714ec 23%,#0c1714bc 43%,#0c17142b 77%),linear-gradient(0deg,#0b1712b0,transparent 32%)}
.hero-in{padding:88px 0 76px;position:relative}
.hero .eyebrow{margin-bottom:20px}
.hero h1{font-size:clamp(57px,8.6vw,115px);line-height:.9;letter-spacing:-.06em;max-width:820px;text-shadow:0 3px 46px #08120e7d}
.hero h1 em{font-style:normal;color:var(--gold2);display:block;margin-top:.1em}
.hero p{margin-top:24px;max-width:460px;color:#edf3df;font-size:clamp(16px,1.6vw,20px)}
.hero .row{margin-top:28px}
.meta{display:flex;flex-wrap:wrap;align-items:center;column-gap:14px;row-gap:8px;color:#e8efdf;font-size:.82rem;margin-top:26px;padding:0;list-style:none}
.meta li+li:before{content:"\2022";margin-right:14px;color:var(--gold)}
.plate{color:#f7e6bc;font-size:.68rem;letter-spacing:.16em;text-transform:uppercase;font-weight:800;text-shadow:0 1px 6px #000}
.hero .plate{position:absolute;right:0;bottom:34px}

/* stats */
.stats{border-bottom:1px solid #465644;background:#1a2c22}
.statgrid{display:grid;grid-template-columns:repeat(4,1fr);margin-block:0;padding:0;list-style:none}
.stat{padding:22px 20px 21px;border-right:1px solid #415342;display:flex;align-items:center;gap:12px}
.stat:last-child{border-right:0}
.stat strong{font-family:var(--display);font-size:2rem;color:var(--gold);line-height:1}
.stat span{font-size:.9rem;font-weight:750;color:#dce8d9}

/* sections */
.sect{padding:clamp(54px,7.5vw,98px) 0}
.sect-tight{padding:42px 0}
.sect-head{display:flex;gap:30px;justify-content:space-between;align-items:end;margin-bottom:28px}
.sect-head .eyebrow{margin-bottom:9px}
.sect-head p{max-width:460px;color:#c4d0bd;font-size:.97rem}
.feature-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}
.feature{position:relative;isolation:isolate;text-decoration:none;display:flex;min-height:310px;flex-direction:column;justify-content:flex-end;padding:22px;border-radius:var(--radius);overflow:hidden;background:#2a4230;border:1px solid #5d6c55}
.feature img{position:absolute;inset:0;z-index:-2;width:100%;height:100%;max-width:none;object-fit:cover;transition:transform .22s}
.feature:after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,#101e17fa 4%,#101e1799 42%,#101e1712 85%)}
.feature:hover img{transform:scale(1.045)}
.feature h3{font:700 28px/1.05 var(--display);margin:.32em 0;letter-spacing:-.02em}
.feature p{color:#e8efde;font-size:.92rem;max-width:290px}
.feature .arrow{margin-top:13px;color:var(--gold);font-size:.8rem;font-weight:800}
.fine{font-size:.85rem;color:#b9c8b4;margin-top:14px}
.facts{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin:30px 0 0;padding:0;list-style:none}
.facts li{padding:16px 18px;border:1px solid #3f5142;border-radius:12px;background:#142419}
.facts h3{font:700 1.15rem/1.2 var(--display);color:var(--gold2);margin-bottom:6px}
.facts p{font-size:.92rem;color:#d4e0cd}
.skills-band{background:linear-gradient(110deg,#243b2b,#1c3125);border-block:1px solid #586d54}
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;padding:0;margin:24px 0 0;list-style:none}
.step{padding:18px;border:1px solid #5f715d;border-radius:12px;background:#152a1fb3;line-height:1.5;font-size:.96rem}
.step .badge{margin-bottom:10px}
.badge{display:inline-flex;color:#341f0d;background:#f2d7a0;padding:4px 8px;align-items:center;font-weight:800;border-radius:4px;font-size:.72rem}
.step strong{color:var(--gold2)}
.code{font-family:ui-monospace,Menlo,Consolas,monospace;background:#0c1713;color:var(--gold2);padding:.1em .4em;border-radius:4px;white-space:nowrap}
.strip-note{font-size:.9rem;color:#d4e3cc;margin-top:16px;max-width:90ch}
.strip-note a{color:var(--gold2)}
.band-actions{margin-top:18px}
.endcap{display:flex;justify-content:space-between;align-items:center;gap:24px;border:1px solid #637767;background:#1e3127;padding:26px;border-radius:var(--radius)}
.endcap p{color:var(--mist);margin-top:8px;max-width:62ch}
.endcap h2{font-size:30px}
.endcap a:not(.button){color:var(--gold2)}

/* footer */
.footer{border-top:1px solid #465548;background:#12211a;padding:35px 0 42px}
.foot-grid{display:grid;grid-template-columns:1fr 2fr;gap:28px}
.foot-grid nav{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:12px 18px;align-content:flex-start}
.foot-grid nav a{font-size:.9rem;color:#e1e9da;padding:4px 0}
.footnote{margin:18px 0 0;color:#b9c8b4;font-size:.8rem;max-width:90ch}
.footnote a{color:#e1e9da}

/* paper pages */
.paper{background:var(--cream);color:var(--ink);min-height:70vh}
.paper :focus-visible{outline-color:#1d2b22}
.paper .eyebrow{color:#6b4d1f}
.paper h1{font-size:clamp(40px,6vw,66px);letter-spacing:-.045em;margin:8px 0 13px}
.paper p,.paper li{color:#2b3d30}
.paper a:not(.button){color:#245535}
.doc-shell{padding:44px 0 64px}
.breadcrumb{display:flex;flex-wrap:wrap;align-items:center;gap:8px;color:#52634f;font-size:.82rem;margin-bottom:16px}
.breadcrumb a{font-weight:700;text-decoration:none}
.breadcrumb a:hover{text-decoration:underline}
.breadcrumb .divider{color:#6f7d67}
.note{border-left:4px solid #a7711f;background:#f4e4bd;padding:13px 16px;border-radius:0 10px 10px 0;color:#382913;margin:16px 0}
.paper .note,.paper .note p{color:#352b17}
.side-card{background:#fffaf0;border:1px solid #c5cdb2;border-radius:12px;padding:16px}
.side-card strong,.side-card summary{display:block;font-weight:800;font-size:.95rem;margin-bottom:6px}
.side-card summary{cursor:pointer}
.side-card a{display:block;text-decoration:none;font-weight:700;line-height:1.4;padding:6px 0;font-size:.92rem}
@media(max-width:1000px),(pointer:coarse){.side-card a{padding:12px 0}.side-card summary{padding:12px 0;margin:0}.breadcrumb a{padding:13px 2px;margin:-13px -2px}.foot-grid nav a{padding:12px 0}.topnav a{min-height:44px;display:inline-flex;align-items:center}.brand{min-height:44px}.topinner>.button{min-height:44px}.brand small{font-size:.7rem}.plate,#cover .plate{font-size:.72rem}.strip-note a,.endcap p a,.footnote a{padding-block:13px}}
.side-card a:hover{text-decoration:underline}
.side-card a[aria-current=page]{color:#1d2b22;border-left:3px solid #496d42;padding-left:8px}
.overview{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,280px);grid-template-areas:"main toc" "main support";grid-template-rows:auto 1fr;column-gap:32px;row-gap:14px;align-items:start}
.play-grid{grid-template-areas:"main support";grid-template-rows:auto;margin-top:26px}
.overview>.main{grid-area:main;min-width:0}
.overview>.toc{grid-area:toc;position:sticky;top:92px;max-height:calc(100vh - 110px);overflow:auto}
.overview>.support{grid-area:support}

/* reading layout for the legal pages */
article.legal{max-width:880px}
article.legal h1{font-size:clamp(36px,5.2vw,60px);margin:0 0 10px}
article.legal h2{font-size:clamp(24px,3.4vw,34px);margin:2em 0 .5em;letter-spacing:-.03em;padding-bottom:.25em;border-bottom:1px solid #c5cdb2}
article.legal h2.plain{border:0;margin:.2em 0 .4em;padding:0;font-size:clamp(22px,3vw,28px)}
article.legal h3{font-size:1.15rem;margin:1.6em 0 .5em;line-height:1.25}
article.legal p,article.legal li{max-width:76ch;line-height:1.6}
article.legal li+li{margin-top:4px}
article.legal ul,article.legal ol{padding-inline-start:1.35em}
article.legal .meta{display:block;color:var(--muted);font-size:.92rem;margin:0 0 16px;padding:0}
article.legal .box{background:#f1f4df;border:1px solid #b7c5a6;border-left:4px solid #496d42;border-radius:0 12px 12px 0;padding:6px 20px 10px;margin:16px 0}
.table-wrap{overflow:auto;border:1px solid #c2ccb3;border-radius:9px;max-width:100%;margin:14px 0 20px;background:#fff9e9}
.table-wrap table{border-collapse:collapse;width:100%;min-width:480px;font-size:.9rem;text-align:left}
.table-wrap td,.table-wrap th{padding:9px 11px;border-bottom:1px solid #d7dfc8;vertical-align:top;text-align:left}
.table-wrap th{background:#e2ecd4;font-weight:800;color:#2e4c35}
.table-wrap tr:last-child td,.table-wrap tr:last-child th{border-bottom:0}
.table-wrap tr:nth-child(even) td{background:#f6f3e4}
article.legal code{font-size:.88em;overflow-wrap:anywhere;background:#e9e4d3;border-radius:3px;padding:2px 4px}
article.legal a{overflow-wrap:anywhere}
.todo{background:#ffe099;color:#3a2a06;padding:0 .3em;border-radius:.3em;font-weight:700;box-decoration-break:clone;-webkit-box-decoration-break:clone}

/* play page */
.play-head{margin-bottom:12px}
.play-head p{max-width:70ch}
.stage{position:relative;width:100%;aspect-ratio:16/9;max-height:78vh;background:var(--deep);border-radius:var(--radius);overflow:hidden;border:1px solid #526b53;color:var(--cream);margin:18px 0}
.stage:fullscreen{max-height:none;border:0;border-radius:0;aspect-ratio:auto;height:100%!important;margin:0}
#game{position:absolute;inset:0;width:100%;height:100%;display:block;outline:none;touch-action:none;background:var(--deep)}
#cover{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px;background:linear-gradient(0deg,#0c1713f2,#0c1713b8),url("art-dungeon.jpg") center/cover,#192b23}
#cover img.cover-mark{width:56px;height:56px;border-radius:12px;margin-bottom:8px}
#cover h2{color:var(--cream);font-size:clamp(28px,5vw,48px);margin:.1em 0 .2em}
#bar{width:min(26rem,78%);height:.9rem;border-radius:.5rem;background:#ffffff2a;overflow:hidden;margin-top:.8rem;display:none}
#fill{width:0;height:100%;background:var(--gold);transition:width .2s}
#msg{margin:.7rem 0 0;min-height:1.4em;max-width:34rem;font-size:1rem;color:#edf3df}
#go{margin-top:.9rem}
#cover .plate{position:absolute;right:14px;bottom:10px;font-size:.62rem}
#cover .turn{display:none}
#cover noscript p{margin-top:.8rem;color:#ffe099}
#full{position:absolute;right:.6rem;top:.6rem;z-index:4;display:none;padding:.4rem .9rem;min-height:40px;font-size:.9rem;font-weight:700;color:var(--cream);background:#112019d9;border:1px solid #cdd8c3;border-radius:999px}
#warn{position:absolute;left:50%;top:.5rem;transform:translateX(-50%);max-width:90%;z-index:5;font-size:.9rem}
#warn div{margin:.2rem 0;padding:.4rem .7rem;border-radius:.5rem;background:#f3d36b;color:#1b1407}
#warn div.error{background:#c0392b;color:#fff}
#mobile{display:none}
.paper .section-title{font-size:clamp(26px,4vw,40px);margin:0 0 6px}
.paper .section-lead{max-width:70ch;margin-bottom:6px}
.paper .steps{margin-top:18px}
.paper .step{background:#fffaf0;border-color:#c5cdb2;color:#2b3d30}
.paper .step strong{color:#1d2b22}
.paper .code{background:#e9e4d3;color:#3b4232}
.paper .strip-note{color:#2b3d30}
.paper .strip-note a{color:#245535}
.paper .strip-note.note{color:#352b17}
.paper .small-print{font-size:.9rem;color:var(--muted);max-width:76ch}

/* 404 */
.lost{padding:clamp(70px,12vw,140px) 0;text-align:center;background:radial-gradient(ellipse at 50% 0,#2a4230,transparent 70%)}
.lost h1{font-size:clamp(40px,7vw,80px);letter-spacing:-.04em}
.lost p{margin-top:14px;color:var(--mist)}
.lost .row{justify-content:center;margin-top:26px}

@media(max-width:1000px){
.topnav{gap:14px}
.stat{padding-inline:11px}
.overview,.play-grid{grid-template-columns:1fr;grid-template-areas:"toc" "main" "support";grid-template-rows:auto}
.overview>.toc{position:static;max-height:none;overflow:visible}
.facts{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:760px){
html{scroll-padding-top:76px}
body{padding-bottom:env(safe-area-inset-bottom)}
.wrap{width:auto;margin-left:max(16px,env(safe-area-inset-left));margin-right:max(16px,env(safe-area-inset-right))}
.topinner{min-height:62px;gap:8px;flex-wrap:wrap;position:relative;padding-block:0}
.brand{font-size:1.02rem}
.brand img{width:32px;height:32px}
.brand small{font-size:.7rem}
.topinner>.button{font-size:.85rem;min-height:44px;padding:8px 14px;margin-left:auto}
.topnav{order:9;flex-basis:100%;flex-wrap:wrap;gap:6px 10px;padding:0 0 12px}
.topnav a{padding:8px 12px;background:#243c2f;border-radius:8px}
.js .menu-toggle{display:inline-flex;flex:none}
.js .topinner{flex-wrap:nowrap}
.brand{min-width:0}
.js .topnav{display:none;position:absolute;top:100%;left:calc(-1 * max(16px,env(safe-area-inset-left)));right:calc(-1 * max(16px,env(safe-area-inset-right)));flex-basis:auto;flex-direction:column;align-items:stretch;gap:0;background:#142820;padding:6px max(16px,env(safe-area-inset-right)) 14px max(16px,env(safe-area-inset-left));border-bottom:1px solid #496351;box-shadow:0 18px 30px #0008}
.js .topnav.is-open{display:flex}
.js .topnav a{min-height:52px;background:none;border-radius:0;border-bottom:1px solid #2c4337;font-size:1.05rem;padding:8px 2px}
.js .topnav a:last-child{border-bottom:0}
.hero{min-height:min(640px,calc(100svh - 62px));align-items:end}
.hero-img{object-position:69% center}
.hero:after{background:linear-gradient(0deg,#101e16 0%,#122119ef 31%,#14211933 62%,#1421190d 100%)}
.hero-in{padding:150px 0 30px}
.hero h1{font-size:clamp(46px,14.2vw,78px)}
.hero p{margin-top:14px;max-width:410px;font-size:1.02rem}
.hero .eyebrow{margin-bottom:12px}
.hero .row{margin-top:18px}
.meta{margin-top:16px;font-size:.86rem}
.hero .plate{display:none}
.statgrid{grid-template-columns:repeat(2,1fr)}
.stat{padding:14px 10px;border-top:1px solid #445444}
.stat:nth-child(2n){border-right:0}
.stat strong{font-size:1.6rem}
h2{font-size:clamp(28px,8.4vw,40px)}
.sect-head,.endcap{align-items:flex-start;flex-direction:column;gap:12px}
.feature-grid,.steps,.facts{grid-template-columns:1fr}
.feature{min-height:236px}
.foot-grid{grid-template-columns:1fr}
.foot-grid nav{justify-content:flex-start;gap:0 18px}
.footer{padding-bottom:calc(36px + env(safe-area-inset-bottom))}
.doc-shell{padding:24px 0 48px}
.paper h1{font-size:clamp(34px,10.4vw,50px)}
article.legal h1{font-size:clamp(32px,9.6vw,46px)}
.button{min-height:52px}
.step{padding:16px}
.note{padding:12px 14px}
.table-wrap{margin-inline:-2px}
.table-wrap table{min-width:520px}
.table-wrap td:first-child,.table-wrap th:first-child{position:sticky;left:0;background:#fff9e9;box-shadow:1px 0 0 #d7dfc8}
.table-wrap th:first-child{background:#e2ecd4}
.paper details.toc-list>summary{padding:12px 0}
/* play page on a phone */
.stage{aspect-ratio:auto;height:min(30rem,calc(100svh - 150px));min-height:21rem;margin:14px 0}
#cover{overflow:auto;justify-content:flex-start;padding:20px 18px 34px}
#cover .turn{display:block;margin:2px 0 4px;padding:8px 12px;border-radius:10px;background:#ffe0991f;border:1px solid #f6c56788;color:var(--gold2);font-size:.92rem;font-weight:700}
#go{flex:none;width:100%;max-width:22rem;min-height:64px;font-size:1.3rem;margin-top:1rem}
#msg{font-size:.98rem}
#mobile{font-size:.96rem}
.plate,#cover .plate{font-size:.72rem}
#full{min-height:44px;min-width:44px}
#cover h2{font-size:clamp(26px,7.6vw,36px)}
}
@media(max-width:560px){.hero .row .button,.band-actions .button,.endcap>.button{width:100%}}
@media(max-width:760px) and (orientation:landscape){
.turn{display:none!important}
}
/* a phone held sideways: slim static header, the game gets the screen */
@media(max-height:520px) and (orientation:landscape){
.topbar{position:static}
.topinner{min-height:56px}
.hero{min-height:0;align-items:center}
.hero-in{padding:30px 0}
.hero h1{font-size:clamp(40px,8vw,60px)}
.hero:after{background:linear-gradient(90deg,#0b1712 0%,#0c1714e0 40%,#0c17142b 85%)}
.hero-img{object-position:75% center}
.stage{height:calc(100svh - 16px);min-height:0;max-height:none}
.doc-shell{padding-top:14px}
.paper h1{font-size:clamp(28px,5vw,40px);margin:4px 0 8px}
.play-head{margin-bottom:4px}
}
@media(max-width:420px){
.topinner>.button .ico{display:none}
.topinner>.button{padding:5px 10px;max-width:92px;font-size:.78rem;line-height:1.15}
.brand{gap:7px;font-size:.96rem}
.brand small{letter-spacing:.1em}
}
@media(max-width:360px){
.hero h1{font-size:46px}
.meta{column-gap:8px}
.meta li+li:before{margin-right:7px}
.brand{font-size:.96rem}
}
@media(max-width:340px){.brand img{display:none}}
@media(prefers-reduced-motion:no-preference){#cover .turn{animation:nudge 2.4s ease-in-out 2}@keyframes nudge{50%{transform:translateX(4px)}}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
@media(forced-colors:active){.button,.feature,.step,.side-card{border:1px solid CanvasText}}
@media print{.topbar,.stage,.footer{display:none!important}.paper{background:#fff}}
