/* The page frame starts at the viewport edge like every other page (the shell header measures against the body). */
body{margin:0}
/* Instance B №3: private Wave1 Rune Casting QA-only, source-isolated, cannot grant feature rights. */
/* OWNER DESIGN (13.11, supersedes R-17 "plain colour" and the 2.16 page-wide photo): the TABLE IS THE SCENE OF THE BOARD, not of the page. The table photo (art/runes) is the background of .rune-scene
   (the head, the stones and the meaning panel); everything else (title, steps, controls, footer) is in the page's own colour. No solid fill anywhere on the board: a translucent veil over the photo
   (--scene-veil) and a translucent meaning panel (--scene-panel) exist only to keep the text AA, the table shows through both. */
.rune-page {--rune-accent:#783a56;--rune-gold:#b89361;--rune-ink:#372b36;--rune-border:#d8bea0;--rune-soft:rgba(120,58,86,.05);--rune-gold-text:#6b4d22;
 --scene-ink:#f8eddb;--scene-gold:#e9c98f;--scene-veil:rgba(14,9,6,.34);--scene-panel:rgba(16,10,7,.55);--scene-line:rgba(233,201,143,.42);
 --rune-cut:#34200f;--rune-cut-lit:#ffeccb;--rune-cut-lit-a:.85;
 color:var(--rune-ink);min-height:calc(100dvh - 210px);padding:clamp(24px,4vw,62px) max(20px,calc((100vw - 1250px)/2));font-family:Georgia,'Times New Roman',serif}
[data-theme=dark] .rune-page,html.dark .rune-page,body.dark .rune-page{--rune-accent:#d4b17b;--rune-gold:#af926a;--rune-ink:#f2e4cf;--rune-border:#5d5260;--rune-soft:rgba(242,228,207,.05);--rune-gold-text:#dfc597;
 --scene-veil:rgba(10,7,5,.4);--scene-panel:rgba(12,8,5,.6);--rune-cut:#1f1209;--rune-cut-lit:#f4d9ae;--rune-cut-lit-a:.6}
.rune-page *{box-sizing:border-box}
.rune-kicker{color:var(--rune-gold-text);font-family:system-ui,sans-serif;font-size:.67rem;letter-spacing:.19em;font-weight:700;text-transform:uppercase}
.rune-page h1{font:normal clamp(2.3rem,5vw,4.4rem)/1.1 Georgia,serif;color:var(--rune-ink);margin:12px 0 16px}
.rune-intro{line-height:1.65;max-width:39ch;font-size:1.09rem}
.rune-surface{display:grid;grid-template-columns:minmax(0,.82fr) minmax(0,1.34fr);gap:clamp(16px,3vw,38px);align-items:start;margin-top:25px}
.rune-info{padding:28px 8px}
.rune-info h2{font-size:1.4rem;font-weight:normal;margin:36px 0 12px}
.rune-info p{line-height:1.7}
.rune-step{border-top:1px solid var(--rune-border);padding:15px 0;display:grid;grid-template-columns:38px 1fr;gap:8px;line-height:1.5}
.rune-step b{font-family:system-ui,sans-serif;font-size:.7rem;color:var(--rune-gold-text)}
.rune-preview{min-width:0}
/* The scene: table photo (836 px on small screens, 1672 from 900 px / 2x displays), the centre of the picture is empty on purpose. */
.rune-scene{position:relative;isolation:isolate;border-radius:18px;overflow:hidden;padding:clamp(16px,2.6vw,30px);color:var(--scene-ink);box-shadow:0 14px 40px #00000026;
 background-color:#1c120b}
/* The table photo does NOT depend on how tall the board is. It is two layers behind the content whose height is --rune-bg-h: the height the board has WITHOUT the extra a long meaning adds
   to the panel (set by wave21-runes.mjs, pinScenePhoto); the photo is cover-scaled to THAT box, so choosing a stone and showing its text never zooms or shifts it. A longer reading only
   adds board below the photo: a mirrored copy of the same photo continues it (the seam is continuous). Without the script --rune-bg-h is unset: one layer, the full board (as before). */
.rune-scene::before,.rune-scene::after{content:"";position:absolute;inset-inline:0;top:0;height:var(--rune-bg-h,100%);z-index:-1;pointer-events:none;
 background-image:linear-gradient(var(--scene-veil),var(--scene-veil)),var(--rune-bg);background-size:cover;background-position:center;background-repeat:no-repeat}
.rune-scene::after{display:none;top:var(--rune-bg-h);transform:scaleY(-1)}
.rune-scene[style*="--rune-bg-h"]::after{display:block}
.rune-board-head{display:flex;justify-content:space-between;align-items:baseline;gap:14px;border-bottom:1px solid var(--scene-line);padding-bottom:12px}
.rune-board-head strong{font-size:.68rem;text-transform:uppercase;letter-spacing:.16em;color:var(--scene-gold)}
.rune-board-head small{color:var(--scene-gold);font-family:system-ui,sans-serif;font-size:.65rem}
.rune-stage{min-height:clamp(230px,24vw,330px);display:grid;align-items:center;justify-items:center;margin-block:12px}
.rune-board{width:100%;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:clamp(6px,1.5vw,18px);}
.rune-tile{border:0;background:transparent;color:var(--scene-ink);padding:5px;display:flex;flex-direction:column;align-items:center;gap:6px;width:clamp(100px,30%,230px);cursor:pointer;font:inherit;min-width:0}
.rune-position{font:600 .68rem system-ui,sans-serif;white-space:normal;text-align:center;min-height:1.8em;text-shadow:0 1px 3px #000c}
.rune-stone{position:relative;width:min(100%,200px);aspect-ratio:3/4;filter:brightness(1.07) saturate(1.06) drop-shadow(0 8px 7px rgb(0 0 0/.5));background-image:url('./art/runes/stone-1.webp');background-size:100% 100%;background-repeat:no-repeat;display:grid;place-items:center;transition:transform .28s ease}
.rune-stone[data-stone="2"]{background-image:url('./art/runes/stone-2.webp')}
.rune-stone[data-stone="3"]{background-image:url('./art/runes/stone-3.webp')}
.rune-stone[data-stone="4"]{background-image:url('./art/runes/stone-4.webp')}
.rune-stone[data-stone="5"]{background-image:url('./art/runes/stone-5.webp')}
.rune-stone[data-stone="6"]{background-image:url('./art/runes/stone-6.webp')}
.rune-glyph{display:block;width:50%;aspect-ratio:24/32}
.rune-mark{display:block;width:100%;height:100%;overflow:visible}
.rune-cut,.rune-cut-lit{fill:none;stroke-width:3.7;stroke-linecap:round;stroke-linejoin:round}   /* a deep groove with a light lower edge, readable at phone size (same shapes, thicker cut) */
.rune-cut{stroke:var(--rune-cut)}
.rune-cut-lit{stroke:var(--rune-cut-lit);stroke-opacity:var(--rune-cut-lit-a)}
.rune-tile[data-revealed=false] .rune-glyph{visibility:hidden}
.rune-tile[data-revealed=false] .rune-stone{transform:rotate(-8deg);opacity:.8}
.rune-tile:nth-child(2)[data-revealed=false] .rune-stone{transform:rotate(11deg)}
.rune-tile:nth-child(3)[data-revealed=false] .rune-stone{transform:rotate(-5deg)}
.rune-label{font:600 .8rem system-ui,sans-serif;min-height:1.25em;text-shadow:0 1px 3px #000c}
.rune-status{font:.86rem/1.6 system-ui,sans-serif;text-align:center;min-height:3em;max-width:55ch;color:var(--rune-ink)}
.rune-switch{display:flex;gap:10px;justify-content:center;align-items:center;padding:12px 0}
.rune-switch button,.rune-actions button{font:600 .88rem system-ui,sans-serif;cursor:pointer;color:var(--rune-ink);background:transparent;border:1px solid var(--rune-border);border-radius:10px;padding:11px 16px}
.rune-switch button[aria-pressed=true]{background:var(--rune-soft);border-color:var(--rune-accent);box-shadow:inset 0 0 0 1px var(--rune-accent)}
.rune-actions{display:grid;grid-template-columns:1fr auto;gap:8px}
.rune-actions button:first-child{background:var(--rune-accent);color:white;border-color:var(--rune-accent)}
[data-theme=dark] .rune-actions button:first-child,html.dark .rune-actions button:first-child{color:#161922}
/* The control row (wave21-runes.mjs moves the switch and the actions into the scene, right under the stones): ONE row, the button system of ui-kit.css (docs/design/BUTTON_SYSTEM_SPEC.md):
   the segment (secondary look, the pressed one filled with a soft gold), Cast runes = primary gold, Reset = secondary. The scene is dark in both themes, so the row reads the dark-theme values of the tokens. */
.rune-scene .rune-controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 14px;margin-block:4px 2px;
 --btn-primary-bg:#e0ae55;--btn-primary-hover:#ebbf6e;--btn-primary-active:#cf9c45;--btn-primary-ink:#1b1208;--btn-secondary-line:var(--scene-gold);--btn-secondary-hover:rgba(233,201,143,.16)}
.rune-scene .rune-controls .rune-switch,.rune-scene .rune-controls .rune-actions{display:flex;flex-wrap:nowrap;gap:8px;padding:0;margin:0}
.rune-scene .rune-controls .rune-switch{gap:0;border:var(--btn-bw) solid var(--btn-secondary-line);border-radius:var(--btn-radius);overflow:hidden}
.rune-scene .rune-controls button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:var(--btn-h);padding:var(--btn-py) var(--btn-px);border-radius:var(--btn-radius);font:var(--btn-fw) var(--btn-fs)/var(--btn-lh) system-ui,sans-serif;text-align:center;white-space:normal;overflow-wrap:anywhere}
.rune-scene .rune-controls .rune-switch button{border:0;border-radius:0;color:var(--scene-ink);background:transparent;padding-inline:14px}
.rune-scene .rune-controls .rune-switch button+button{border-inline-start:var(--btn-bw) solid var(--btn-secondary-line)}
.rune-scene .rune-controls .rune-switch button[aria-pressed=true]{background:var(--btn-secondary-hover);box-shadow:inset 0 -3px 0 var(--btn-primary-bg);color:var(--scene-ink)}
.rune-scene .rune-controls .rune-actions button:first-child{border:var(--btn-bw) solid var(--btn-primary-bg);background:var(--btn-primary-bg);color:var(--btn-primary-ink)}
.rune-scene .rune-controls .rune-actions button:first-child:hover:not(:disabled){background:var(--btn-primary-hover);border-color:var(--btn-primary-hover)}
.rune-scene .rune-controls .rune-actions button:last-child{border:var(--btn-bw) solid var(--btn-secondary-line);background:transparent;color:var(--scene-ink)}
.rune-scene .rune-controls .rune-actions button:last-child:hover:not(:disabled){background:var(--btn-secondary-hover)}
.rune-scene .rune-controls button:focus-visible{outline:3px solid var(--scene-gold);outline-offset:2px}
.rune-scene .rune-controls button:disabled{opacity:.45;cursor:not-allowed}
.rune-page button:focus-visible,.rune-page a:focus-visible,.rune-page summary:focus-visible{outline:3px solid var(--rune-gold);outline-offset:3px}
.rune-page button:disabled{cursor:not-allowed;opacity:.5}
.rune-note-guard{border:1px solid var(--rune-border);padding:12px 15px;border-radius:10px;font: .78rem/1.5 system-ui,sans-serif;background:var(--rune-soft)}
.rune-catalogue{margin-top:35px;border-top:1px solid var(--rune-border);padding-top:18px}
.rune-catalogue summary{cursor:pointer;font:600 .8rem system-ui,sans-serif}
.rune-catalogue ul{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px 12px;list-style:none;padding:12px 0;margin:0;font: .8rem system-ui,sans-serif}
.rune-catalogue li{display:flex;align-items:center;gap:8px}
.catalogue-glyph{display:inline-grid;place-items:center;width:20px;height:27px;flex:0 0 20px;color:var(--rune-gold)}
.rune-mark-small{display:block;width:100%;height:100%;overflow:visible}
.rune-mark-small .rune-cut{fill:none;stroke:currentColor;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round}
.rune-mark-small .rune-cut-lit{display:none}
.rune-after{margin-top:24px;font:.78rem/1.6 system-ui,sans-serif;color:var(--rune-ink)}
.rune-after button{margin-top:10px}
#runeState{min-height:1.4em}
.rune-note-banner{font:.72rem/1.4 system-ui,sans-serif;padding:8px 12px;border-radius:8px;border:1px dashed var(--rune-border);margin:22px 0 0;}
@media(max-width:900px){.rune-page{padding:24px 16px}
.rune-surface{grid-template-columns:1fr}
.rune-info{padding:0}
/* A phone: title and intro, then THE BOARD with its controls, then the steps and the note (same content, board first: the main action is on the first screen). */
.rune-info{display:contents}
.rune-info>*{order:2}
.rune-info>.rune-kicker,.rune-info>h1,.rune-info>.rune-intro{order:0}
.rune-preview{order:1}
.rune-intro{max-width:none;font-size:1rem;line-height:1.5;margin:0}
.rune-page h1{margin:6px 0 8px}
.rune-info h2{margin-top:24px}
.rune-catalogue ul{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:480px){.rune-page{padding:18px 10px}
.rune-scene{padding:14px 8px}
.rune-surface{gap:8px}
.rune-catalogue ul{grid-template-columns:repeat(2,minmax(0,1fr))}
.rune-board{gap:2px}
.rune-tile{width:32%;padding:0}
.rune-position{font-size:.56rem}
.rune-tile .rune-stone{width:100%}
.rune-glyph{width:52%}
.rune-actions{grid-template-columns:1fr auto}
.rune-actions button{padding:10px 10px;font-size:.76rem}
.rune-board-head small{max-width:120px;text-align:end}
.rune-switch{gap:5px}
.rune-switch button{padding:10px 8px;font-size:.78rem}
/* the one control row fits a 390 phone: tighter paddings, the same height (44) and tokens */
.rune-scene .rune-controls{gap:8px 6px}
.rune-scene .rune-controls .rune-switch button{padding-inline:9px;font-size:.82rem}
.rune-scene .rune-controls .rune-actions{gap:6px}
.rune-scene .rune-controls .rune-actions button{padding-inline:11px;font-size:.82rem}}
@media(prefers-reduced-motion:reduce){.rune-page *, .rune-stone{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Table scene art (owner-approved, public/explore/art/runes): the background of the BOARD only. */
.rune-scene{--rune-bg:url('./art/runes/runes-bg-836.webp')}
@supports (background-image:image-set(url('a.webp') 1x)){.rune-scene{--rune-bg:image-set(url('./art/runes/runes-bg-836.webp') 1x,url('./art/runes/runes-bg-1672.webp') 2x)}}
@media(min-width:900px){.rune-scene,.rune-scene:is(*){--rune-bg:url('./art/runes/runes-bg-1672.webp')}}
/* The meaning panel lies ON the table: a translucent layer for the text contrast, the table shows through (no solid fill). Specificity beats explore-extras.css, which loads later. */
.rune-page .rune-scene .wave21-rune-reading{background:var(--scene-panel);border:1px solid var(--scene-line);color:var(--scene-ink);margin:14px 0 0}
.rune-page .rune-scene .wave21-rune-reading h3{color:var(--scene-gold)}
.rune-page .rune-scene .wave21-rune-reading small{color:var(--scene-ink);opacity:.82}
.rune-page .rune-scene button:focus-visible{outline-color:var(--scene-gold)}
@media(hover:hover){.rune-tile:hover .rune-stone{transform:translateY(-3px)}}
