/* ============================================================================
   RETRO SHELF  ·  stylesheet
   ----------------------------------------------------------------------------
   A scrolling document: hero, a wooden bookcase with one shelf per engine
   (one CSS 3D game box per game), the bring-your-own-disc drawer and the
   credit tables. #player covers the whole window when a game runs; the
   game itself is in a child iframe. Fonts come from ../../lib/sci.css.
   Phone first: each shelf scrolls sideways with snap below 900 px.
     grep -n 'SHELF'  'BOX'  'BYO'  'TABLES'  'PLAYER'  'DIALOG'
     grep -n 'reduce'  (the reduced-motion rules)
   ========================================================================== */
[hidden]{display:none!important}
:root{
  --bg:#0b0907; --card:#0e1016; --card2:#151822;
  --ink:#ecebe6; --ink2:#c4c2ba; --dim:#8a8a90; --faint:#3b3d48;
  --line:rgba(255,255,255,0.08); --line2:rgba(255,255,255,0.16);
  --acc:#ffb347; --acc-bg:rgba(255,179,71,0.12); --acc-line:rgba(255,179,71,0.5);
  --serif:var(--sci-serif,'STIX Two Text',Georgia,serif);
  --sans:var(--sci-sans,Inter,system-ui,-apple-system,sans-serif);
  --mono:var(--sci-mono,ui-monospace,'SF Mono',Menlo,monospace);
  --top:52px;
  --sl:env(safe-area-inset-left,0px); --sr:env(safe-area-inset-right,0px); --sb:env(safe-area-inset-bottom,0px);
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
/* overflow-x stays on html only: on the body it breaks position:sticky. */
html{background:var(--bg);overflow-x:hidden;-webkit-text-size-adjust:100%}
body{background:radial-gradient(ellipse 90% 50% at 50% 0,#22170e,transparent 70%) no-repeat,var(--bg);color:var(--ink);font-family:var(--sans);font-size:15px;line-height:1.6;-webkit-font-smoothing:antialiased}
html.in-frame{--top:0px}
html.playing,html.playing body{overflow:hidden}
button,select,input{font-family:inherit;font-size:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
a{color:var(--acc);text-decoration:none}
@media (hover:hover){a:hover{text-decoration:underline}}
code,.mono{font-family:var(--mono);font-size:0.84em}

.topbar{position:fixed;top:0;left:0;right:0;height:52px;z-index:30;display:flex;align-items:center;gap:18px;
  padding:0 calc(20px + var(--sr)) 0 calc(20px + var(--sl));background:rgba(7,8,11,0.88);border-bottom:1px solid var(--line);pointer-events:none}
.brand{font:500 0.85rem/1 var(--sans);color:var(--dim);white-space:nowrap}
.pagetitle{font:400 1.1rem/1 var(--serif);color:var(--ink);margin-left:auto;white-space:nowrap}
html.in-frame .topbar{display:none}

main{max-width:1240px;margin:0 auto;padding:calc(var(--top) + 28px) calc(16px + var(--sr)) calc(48px + var(--sb)) calc(16px + var(--sl))}
.sec{margin:0 0 56px}
.kicker{font:600 0.72rem/1.2 var(--sans);letter-spacing:0.14em;text-transform:uppercase;color:var(--acc);margin-bottom:10px}
h1{font:400 clamp(2rem,6vw,3.4rem)/1.05 var(--serif);letter-spacing:-0.01em;margin-bottom:14px}
h2{font:400 1.6rem/1.2 var(--serif);margin-bottom:10px}
h3{font:600 0.95rem/1.3 var(--sans);margin:26px 0 8px;color:var(--ink2)}
.lead{font-size:1.05rem;color:var(--ink2);max-width:64ch}
.note{color:var(--dim);font-size:0.9rem;max-width:72ch;margin:8px 0 16px}
.status{color:var(--acc);font-size:0.9rem;min-height:1.4em;margin-top:8px}
.status.err{color:#ff7a6b}
.touch-note{margin-top:16px;padding:10px 14px;border:1px solid var(--acc-line);background:var(--acc-bg);border-radius:10px;color:var(--ink);font-size:0.92rem;max-width:64ch}
@media (hover:none) and (pointer:coarse){.kb-only{display:none}}

/* ---------------------------------------------------------------- SHELF */
/* The bookcase: oak side panels, a dark back panel lit by a warm lamp at
   the top of each bay, and a plank with a lit front edge under each row.
   The wood grain is SVG turbulence (no image file). main.js writes the box
   size into --bw --bh --bd --gap from shelf-art.js shelfLayout. */
:root{
  --bw:112px; --bh:149px; --bd:26px; --gap:22px;
  --oak:#6b4424; --oak2:#4a2e17; --oak3:#8a5a32; --backwood:#1d130c;
  --grain-h:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0035 0.11' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.06 0 0 0 0 0.02 0 0 0 1.1 -0.32'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --grain-v:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='640'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.11 0.0035' numOctaves='3' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.06 0 0 0 0 0.02 0 0 0 1.1 -0.32'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
.room{position:relative}
.touch-only{display:none}
@media (hover:none) and (pointer:coarse){.touch-only{display:inline}}
.bookcase{position:relative;margin:18px -6px 0;padding:14px 14px 0;border-radius:6px 6px 0 0;
  background:var(--grain-v),linear-gradient(90deg,var(--oak2),var(--oak) 12%,var(--oak3) 50%,var(--oak) 88%,var(--oak2));
  box-shadow:0 30px 60px -20px rgba(0,0,0,0.8),inset 0 2px 0 rgba(255,220,170,0.18)}
@media (min-width:560px){.bookcase{margin:22px 0 0;padding:18px 18px 0}}
.bookcase::before{content:"";position:absolute;left:0;right:0;top:0;height:10px;border-radius:6px 6px 0 0;background:linear-gradient(#a06a3c,#5a3a1e)}
.bay{position:relative;padding:44px 0 0;margin-bottom:16px;isolation:isolate;--pk:30px}
.bay .back{position:absolute;inset:0 0 var(--pk);z-index:-1;border-radius:2px;
  background:radial-gradient(ellipse 60% 70% at 50% -10%,rgba(255,196,120,0.30),rgba(255,170,90,0.08) 45%,transparent 75%),
    var(--grain-h),linear-gradient(var(--backwood),#120b07);
  box-shadow:inset 0 14px 22px -8px rgba(0,0,0,0.85),inset 10px 0 18px -10px rgba(0,0,0,0.9),inset -10px 0 18px -10px rgba(0,0,0,0.9)}
.plate{position:absolute;top:12px;left:50%;transform:translateX(-50%);z-index:2;margin:0;max-width:calc(100% - 24px);
  font:600 0.72rem/1 var(--sans);letter-spacing:0.06em;color:#2b1a08;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  padding:6px 12px;border-radius:3px;background:linear-gradient(#e9c77a,#b98d3e);box-shadow:0 1px 0 rgba(255,255,255,0.4) inset,0 2px 4px rgba(0,0,0,0.6)}
.plate small{font-weight:500;font-size:inherit;color:#4a3210}
.row{position:relative;z-index:1;list-style:none;display:flex;align-items:flex-end;gap:var(--gap);padding:26px calc(var(--gap) * 0.8) 0 calc(var(--gap) + var(--bd));
  overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-padding-left:calc(var(--gap) + var(--bd));overscroll-behavior-x:contain;
  scrollbar-width:thin;scrollbar-color:#5a3a1e transparent;-webkit-overflow-scrolling:touch}
.bookcase[data-mode="row"] .row{justify-content:center;scroll-snap-type:none}
.slot{position:relative;flex:none;display:flex;flex-direction:column;align-items:center;scroll-snap-align:start;padding-bottom:var(--pk)}
.plank{position:absolute;left:-14px;right:-14px;bottom:0;height:var(--pk);border-radius:2px;
  background:var(--grain-h),linear-gradient(#b07a46 0,#8a5a32 3px,#6b4424 9px,#3e2512);
  box-shadow:0 10px 14px -6px rgba(0,0,0,0.75),inset 0 1px 0 rgba(255,226,180,0.35)}
@media (min-width:560px){.plank{left:-18px;right:-18px}}
/* The label strip on the plank edge under each box. */
.tag{position:absolute;left:50%;bottom:4px;transform:translateX(-50%);display:block;max-width:calc(var(--bw) + 12px);
  padding:3px 7px;border-radius:2px;background:linear-gradient(#f4ead2,#d9caa6);box-shadow:0 1px 2px rgba(0,0,0,0.6);
  font:600 0.66rem/1.15 var(--sans);color:#2a1c0c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tag small{margin-left:5px;font:500 0.6rem/1.2 var(--mono);color:#6a5434}

/* ---------------------------------------------------------------- BOX */
/* A box is three faces in CSS 3D. --ry turns it to show the left spine;
   rotateX(-7deg) shows a little of the top. The light comes from the lamp
   above and to the left: the front has a sheen (.shine), the spine is
   darker and the top is lighter. */
.box{position:relative;display:block;width:var(--bw);height:var(--bh);padding:0;border:0;background:none;color:inherit;
  border-radius:3px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.box3d{position:absolute;inset:0;transform-style:preserve-3d;
  transform:perspective(1100px) translateZ(calc(var(--dz) * -1)) rotateX(-7deg) rotateY(var(--ry));
  transition:transform 0.38s cubic-bezier(.2,.8,.25,1)}
.face{position:absolute;display:block;background-color:var(--cb,#333);background-size:100% 100%;background-repeat:no-repeat;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.face.front{inset:0;transform:translateZ(calc(var(--bd) / 2));border-radius:1px 3px 3px 1px;overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,0.35)}
.face.spine{top:0;height:var(--bh);width:var(--bd);left:calc((var(--bw) - var(--bd)) / 2);background-color:var(--cd,#222);
  transform:rotateY(-90deg) translateZ(calc(var(--bw) / 2));filter:brightness(0.62)}
.face.top{left:0;width:var(--bw);height:var(--bd);top:calc((var(--bh) - var(--bd)) / 2);
  background:linear-gradient(90deg,var(--cd,#222),var(--cl,#888));transform:rotateX(90deg) translateZ(calc(var(--bh) / 2));filter:brightness(1.1)}
.shine{position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(115deg,rgba(255,240,210,0.26) 0%,rgba(255,240,210,0.06) 28%,transparent 45%,rgba(0,0,0,0.22) 100%),
    linear-gradient(180deg,rgba(255,210,150,0.12),transparent 30%,rgba(0,0,0,0.28))}
.face.plain{background-image:linear-gradient(160deg,var(--cl,#888),var(--cb,#333) 45%,var(--cd,#111))}
.plain-title{position:absolute;inset:12% 8% auto;font:400 1.05rem/1.1 var(--serif);color:var(--ci,#fff);text-align:center}
/* The contact shadow on the plank and the soft shadow on the back panel. */
.floor-shadow{position:absolute;left:-6%;right:-14%;bottom:-6px;height:14px;border-radius:50%;
  background:radial-gradient(ellipse at 40% 50%,rgba(0,0,0,0.75),transparent 70%);filter:blur(2px);transition:opacity 0.38s,transform 0.38s}
.box::after{content:"";position:absolute;left:8%;right:-18%;top:6%;bottom:2%;z-index:-1;border-radius:4px;
  background:rgba(0,0,0,0.55);filter:blur(10px);transform:translate(10px,-4px)}
@media (hover:hover){
  .box:hover .box3d{transform:perspective(1100px) translateY(-12px) translateZ(18px) rotateX(-5deg) rotateY(calc(var(--ry) * 0.45))}
  .box:hover .floor-shadow{opacity:0.45;transform:scaleX(0.85)}
}
.box:focus-visible{outline:none}
.box:focus-visible .box3d{transform:perspective(1100px) translateY(-12px) translateZ(18px) rotateX(-5deg) rotateY(calc(var(--ry) * 0.45))}
.box:focus-visible .face.front{box-shadow:0 0 0 3px var(--acc),0 0 22px 4px rgba(255,179,71,0.45)}
.box:active .box3d{transform:perspective(1100px) translateY(-6px) translateZ(8px) rotateX(-6deg) rotateY(calc(var(--ry) * 0.6))}
/* The box is out of the shelf while its pull-out view is open. */
.box.out .box3d{transform:perspective(1100px) translateY(-30px) translateZ(80px) rotateX(-4deg) rotateY(0deg);opacity:0;transition:transform 0.32s ease-in,opacity 0.32s ease-in}
.box.out .floor-shadow{opacity:0}

/* ---------------------------------------------------------------- BYO */
/* Bring your own disc is a drawer under the bookcase (a details element).
   The front is oak with a brass handle; inside is a dark console tray.
   Each system is a cartridge or a disc of our own drawing with the system
   name on its label; the radio input stays in the tab order (.sr). */
.drawer{border-radius:0 0 8px 8px;background:var(--grain-v),linear-gradient(90deg,var(--oak2),var(--oak) 12%,var(--oak3) 50%,var(--oak) 88%,var(--oak2));
  padding:0 14px 14px;margin:0 -6px;box-shadow:0 26px 50px -18px rgba(0,0,0,0.85)}
@media (min-width:560px){.drawer{margin:0;padding:0 18px 18px}}
.drawer-front{list-style:none;display:flex;align-items:center;gap:16px;min-height:96px;padding:16px 18px;cursor:pointer;border-radius:4px;
  background:var(--grain-h),linear-gradient(#9a6838,#734a26 40%,#5a3a1e);box-shadow:inset 0 1px 0 rgba(255,226,180,0.35),inset 0 -2px 0 rgba(0,0,0,0.4),0 4px 10px rgba(0,0,0,0.6);
  transition:transform 0.3s}
.drawer-front::-webkit-details-marker{display:none}
.drawer-front:focus-visible{outline:2px solid var(--acc);outline-offset:3px}
.drawer-label{flex:1;min-width:0}
.drawer-label h2{margin:0 0 4px;color:#fff1d8;text-shadow:0 1px 2px rgba(0,0,0,0.7);font-size:1.45rem}
.drawer-label small{display:block;color:#f1d7a8;font-size:0.86rem;line-height:1.35}
.handle{flex:none;width:74px;height:22px;border-radius:11px;background:linear-gradient(#f2d48a,#b98d3e 55%,#7a5a22);
  box-shadow:0 3px 6px rgba(0,0,0,0.6),inset 0 1px 0 rgba(255,255,255,0.6);position:relative}
.handle::after{content:"";position:absolute;left:12px;right:12px;top:8px;height:6px;border-radius:3px;background:rgba(60,36,10,0.55)}
@media (hover:hover){.drawer-front:hover{transform:translateY(2px)}}
.drawer[open] .drawer-front{border-radius:4px 4px 0 0}
.drawer-body{padding:18px 16px 16px;border-radius:0 0 6px 6px;background:linear-gradient(#141210,#0d0c0b);
  box-shadow:inset 0 10px 18px -8px rgba(0,0,0,0.9),inset 0 0 0 1px rgba(255,255,255,0.04)}
.drawer[open] .drawer-body{animation:drawerOut 0.35s ease-out both}
@keyframes drawerOut{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:none}}
.byo-grid{display:grid;grid-template-columns:1fr;gap:18px;margin:18px 0 8px}
@media (min-width:760px){.byo-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
.sys{border:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:12px;min-width:0}
.sys legend{padding:0 0 10px;font:600 0.8rem/1 var(--sans);color:var(--ink2)}
.sr{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.media{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 6px 8px;border-radius:10px;cursor:pointer;
  border:1px solid transparent;text-align:center;transition:background 0.2s,border-color 0.2s}
.media .name{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.media small{color:var(--dim);font:500 0.66rem/1.2 var(--mono)}
.media .shell{position:relative;display:flex;align-items:flex-end;justify-content:center;transition:transform 0.25s cubic-bezier(.2,.8,.25,1)}
/* Cartridge: a grey plastic shell with grip lines and a paper label. */
.media.cart .shell{width:76px;height:84px;padding:0 7px 10px;border-radius:6px 6px 3px 3px;
  background:repeating-linear-gradient(180deg,transparent 0 5px,rgba(0,0,0,0.18) 5px 6px) top/100% 18px no-repeat,linear-gradient(90deg,#55575e,#7d8088 30%,#6a6d75 70%,#4a4c52);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.3),0 4px 8px rgba(0,0,0,0.6)}
.media.cart .shell::after{content:"";position:absolute;left:14px;right:14px;bottom:-5px;height:6px;border-radius:0 0 2px 2px;background:#3a3c42}
.media.cart .lbl{display:flex;align-items:center;justify-content:center;width:100%;height:52px;padding:4px;border-radius:2px;
  background:linear-gradient(#f4ead2,#e2d4b0);color:#2a1c0c;font:700 0.66rem/1.15 var(--sans);box-shadow:inset 0 0 0 1px rgba(0,0,0,0.15)}
/* Disc: a silver disc with a printed ring. */
.media.disc .shell{width:84px;height:84px;align-items:center;border-radius:50%;
  background:radial-gradient(circle,#16161a 0 7%,#c9ccd4 7.5% 15%,transparent 15.5%),conic-gradient(from 30deg,#9aa0ab,#e6e9ef,#a9adb8,#f2f3f7,#9aa0ab,#dfe2e8,#9aa0ab);
  box-shadow:0 4px 10px rgba(0,0,0,0.6),inset 0 0 0 1px rgba(255,255,255,0.4)}
.media.disc .lbl{position:absolute;inset:auto 6px 10px;font:700 0.6rem/1.1 var(--sans);color:#1d1f26}
.media:has(input:checked){border-color:var(--acc-line);background:var(--acc-bg)}
.media:has(input:checked) .shell{transform:translateY(-6px)}
.media:has(input:focus-visible){outline:2px solid var(--acc);outline-offset:2px}
@media (hover:hover){.media:hover .shell{transform:translateY(-4px)}}
.byo-files{display:flex;flex-direction:column;gap:12px;min-width:0}
.pick{display:flex;flex-direction:column;gap:8px;border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:12px 14px;
  background:linear-gradient(#0a0a0a,#151413);box-shadow:inset 0 3px 8px rgba(0,0,0,0.8)}
.pick span{font:600 0.8rem/1 var(--sans);color:var(--ink2)}
.pick input{max-width:100%;color:var(--ink2);font-size:0.85rem}
.pick input::file-selector-button{margin-right:10px;min-height:40px;padding:8px 14px;border-radius:8px;border:1px solid var(--line2);background:#24211d;color:var(--ink);font:600 0.82rem/1 var(--sans);cursor:pointer}
.pick:focus-within{border-color:var(--acc-line)}
.pick small{color:var(--dim);font-size:0.78rem}
.own{display:flex;gap:10px;align-items:flex-start;font-size:0.9rem;color:var(--ink2);cursor:pointer}
.own input{margin-top:3px;width:20px;height:20px;flex:none;accent-color:var(--acc)}
.play-btn{align-self:flex-start;font:600 0.95rem/1 var(--sans);min-height:44px;padding:12px 20px;border-radius:10px;border:1px solid var(--acc-line);background:linear-gradient(#ffc56e,var(--acc));color:#1a1206;cursor:pointer}
.play-btn:disabled{opacity:0.4;cursor:not-allowed;filter:grayscale(0.6)}

/* ---------------------------------------------------------------- TABLES */
/* The credits are a printed manual sheet: cream paper, dark ink. */
.manual{position:relative;padding:22px 18px 18px;margin-left:-6px;margin-right:-6px;border-radius:4px;color:#2a2116;
  background:radial-gradient(ellipse at 20% 0,rgba(255,255,255,0.5),transparent 60%),linear-gradient(#f3ead6,#e7dbc0);
  box-shadow:0 18px 40px -12px rgba(0,0,0,0.8),inset 0 0 0 1px rgba(120,90,40,0.15)}
@media (min-width:560px){.manual{margin-left:0;margin-right:0;padding:30px 30px 24px}}
.manual h2{color:#1d160d}
.manual h3{color:#4a3a22}
.manual p,.manual .note{color:#4a3d2a}
.manual a{color:#8a3f0a;text-decoration:underline;text-decoration-color:rgba(138,63,10,0.35)}
.manual .tbl{overflow-x:auto;border:1px solid rgba(80,60,30,0.25);border-radius:4px;background:rgba(255,255,255,0.35)}
.manual table{border-collapse:collapse;width:100%;font-size:0.84rem}
.manual th,.manual td{padding:8px 10px;text-align:left;vertical-align:top;border-bottom:1px solid rgba(80,60,30,0.18)}
.manual th{font-weight:600;color:#3a2c18;background:rgba(120,90,40,0.12)}
.manual tr:last-child td{border-bottom:0}
.manual td .mono{color:#6a5a40;word-break:break-all}

/* ---------------------------------------------------------------- PLAYER */
/* The player: a slim dark top bar (a power LED, the title, the tools) over
   the stage. The game page in the iframe draws its own CRT bezel. On a
   phone the tools show icons only, each 44 px, and the title gets the
   rest of the bar. */
.player{position:fixed;inset:0;z-index:100;background:#050505;display:flex;flex-direction:column}
.player-bar{display:flex;align-items:center;gap:10px;min-height:52px;padding:6px calc(8px + var(--sr)) 6px calc(14px + var(--sl));flex:none;
  background:linear-gradient(#1b1815,#110f0d);border-bottom:1px solid rgba(255,220,170,0.1);box-shadow:0 2px 12px rgba(0,0,0,0.6)}
.player-led{flex:none;width:9px;height:9px;border-radius:50%;background:#7dff6a;box-shadow:0 0 8px #5aff44,0 0 2px #fff inset}
.player-title{flex:1;min-width:0;font:400 1.05rem/1.2 var(--serif);color:#fff1d8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.player-tools{display:flex;align-items:center;gap:6px;flex:none}
.player-bar button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:44px;min-height:40px;padding:8px 12px;
  font:500 0.82rem/1 var(--sans);border-radius:9px;border:1px solid rgba(255,255,255,0.12);background:#221f1b;color:var(--ink);cursor:pointer}
.player-bar button .ic{font-size:0.95rem;line-height:1;width:1em;text-align:center}
.player-bar button[aria-pressed="true"],.player-bar button[aria-expanded="true"]{border-color:var(--acc-line);background:var(--acc-bg);color:#ffe2b0}
#muteBtn[aria-pressed="true"] .ic{text-decoration:line-through;opacity:0.7}
.player-bar button:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.player-bar .exit{border-color:rgba(255,122,107,0.55);background:#2a1512;color:#ffc2b8}
@media (hover:hover){.player-bar button:hover{border-color:rgba(255,255,255,0.3)}.player-bar .exit:hover{background:#3a1a15}}
@media (max-width:760px){.player-bar .tx{display:none}.player-bar button{padding:8px;min-height:44px}.player-tools{gap:4px}}
@media (max-width:360px){#scanBtn{display:none}}
.help-panel{position:absolute;top:calc(58px + env(safe-area-inset-top,0px));right:calc(10px + var(--sr));z-index:3;width:min(420px,calc(100vw - 20px));
  padding:16px 18px 14px;border-radius:12px;background:rgba(20,17,14,0.97);border:1px solid rgba(255,220,170,0.18);box-shadow:0 18px 50px rgba(0,0,0,0.7)}
.help-panel h3{margin:0 0 8px;color:#ffe2b0}
.help-panel p{font-size:0.92rem;color:var(--ink2);margin:0 0 8px}
.help-panel .help-more{color:var(--dim);font-size:0.82rem}
.help-panel .ghost{min-height:40px}
.player-stage{position:relative;flex:1;min-height:0}
.player-stage iframe{position:absolute;inset:0;width:100%;height:100%;border:0;display:block;background:#050505}

/* ---------------------------------------------------------------- DIALOG */
/* The pull-out. The box comes off the shelf, turns to the front and
   floats under a spot light (.pull-stage). The back of the box (.pull-back)
   has the text and the Play button. Phones: the box sits above the text in
   one scrolling sheet. --c is the accent of the game. */
.info{margin:auto;width:min(880px,calc(100vw - 20px));max-width:none;max-height:calc(100dvh - 20px);padding:0;border:0;border-radius:14px;
  background:transparent;color:var(--ink);overflow:visible}
.info[open]{display:block}
.info::backdrop{background:radial-gradient(ellipse at 50% 30%,rgba(30,20,12,0.7),rgba(0,0,0,0.88));backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
.pull{display:grid;grid-template-columns:1fr;max-height:calc(100dvh - 20px);overflow:auto;overscroll-behavior:contain;border-radius:14px;
  background:linear-gradient(180deg,#17110c,#0e0b09);border:1px solid rgba(255,220,170,0.14);box-shadow:0 30px 80px rgba(0,0,0,0.7)}
@media (min-width:760px){.pull{grid-template-columns:minmax(0,0.85fr) minmax(0,1.15fr);overflow:hidden}}
.pull-stage{position:relative;display:flex;align-items:center;justify-content:center;min-height:250px;padding:30px 20px 24px;
  background:radial-gradient(ellipse 70% 60% at 50% 18%,rgba(255,214,150,0.28),transparent 70%),radial-gradient(ellipse 50% 14% at 50% 92%,rgba(0,0,0,0.6),transparent 70%)}
@media (min-width:760px){.pull-stage{min-height:460px}}
.pull-box{position:relative;--bw:150px;--bh:200px;--bd:36px;width:var(--bw);height:var(--bh);--ry:14deg}
@media (min-width:760px){.pull-box{--bw:220px;--bh:293px;--bd:50px}}
.pull-box .box3d{transform:perspective(1300px) rotateX(-4deg) rotateY(var(--ry));animation:pullTurn 0.7s cubic-bezier(.2,.8,.25,1) both}
/* A box has no right face, so the turn stays positive: it shows the
   front and a little of the spine on the left. */
.pull-box .face.spine{filter:brightness(0.55)}
.pull-glow{position:absolute;left:50%;bottom:16px;width:60%;height:18px;transform:translateX(-50%);border-radius:50%;background:radial-gradient(ellipse,rgba(0,0,0,0.7),transparent 70%)}
@keyframes pullTurn{
  0%{transform:perspective(1300px) translate3d(-40px,40px,-320px) rotateX(-10deg) rotateY(62deg);opacity:0}
  35%{opacity:1}
  100%{transform:perspective(1300px) rotateX(-4deg) rotateY(var(--ry))}
}
@media (hover:hover){.pull-stage:hover .box3d{transform:perspective(1300px) rotateX(-6deg) rotateY(calc(var(--ry) + 26deg));transition:transform 0.6s}}
.pull-back{position:relative;padding:22px 20px 20px;border-top:4px solid var(--c,var(--acc));min-width:0}
@media (min-width:760px){.pull-back{border-top:0;border-left:4px solid var(--c,var(--acc));padding:28px 28px 24px;overflow:auto;max-height:calc(100dvh - 20px)}}
.pull-back .kicker{margin:0 40px 6px 0;color:var(--c,var(--acc));filter:brightness(1.35)}
.pull-back h2{font:400 clamp(1.5rem,4vw,2.1rem)/1.1 var(--serif);padding-right:40px;margin-bottom:6px}
.pull-back h3{margin:16px 0 4px;font:600 0.74rem/1.2 var(--sans);letter-spacing:0.08em;text-transform:uppercase;color:var(--dim)}
.pull-back p{margin:4px 0;font-size:0.92rem;color:var(--ink2)}
.pull-back .by{color:var(--dim);font-size:0.86rem}
.pull-back .blurb{font-size:1rem;color:var(--ink);margin-top:12px}
.pull-back .mono{word-break:break-all;color:var(--dim);font-size:0.72rem;margin-top:10px}
.chips{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 4px}
.chips li{font:500 0.72rem/1 var(--sans);padding:6px 9px;border-radius:999px;border:1px solid var(--line2);color:var(--ink2);background:rgba(255,255,255,0.03)}
.pull-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:20px;position:sticky;bottom:-20px;padding:12px 0 4px;background:linear-gradient(transparent,#100c0a 30%)}
@media (min-width:760px){.pull-actions{bottom:-24px}}
.play-btn.big{font-size:1.05rem;padding:15px 30px;min-height:48px;border-radius:12px;box-shadow:0 6px 18px rgba(255,179,71,0.25),inset 0 1px 0 rgba(255,255,255,0.5)}
.play-btn:focus-visible,.ghost:focus-visible,.info .close:focus-visible{outline:2px solid #fff;outline-offset:3px}
.ghost{font:500 0.9rem/1 var(--sans);min-height:48px;padding:12px 18px;border-radius:12px;border:1px solid var(--line2);background:transparent;color:var(--ink2)}
.info .close{position:absolute;top:12px;right:12px;z-index:2;width:40px;height:40px;border-radius:10px;border:1px solid var(--line2);background:rgba(0,0,0,0.3);color:var(--ink);font-size:1rem}

/* ---------------------------------------------------------------- MOTION */
/* reduce: no lift, no turn, no pull-out animation; the states still show. */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition-duration:0.01ms!important;animation-duration:0.01ms!important;animation-iteration-count:1!important}
  .row{scroll-behavior:auto}
  .pull-box .box3d{animation:none}
  .drawer[open] .drawer-body{animation:none}
}
