/* Gibbix player. Geometry from the approved mockups (canvas "Gibbix — макеты сайта", Р-23):
   phone 390×844 — Game-Round, Game-Question, Game-Number, Game-Answer, Game-Results;
   computer 1440×900 — Game-Desktop. Colours of cards/text come from the pack palette (theme.json);
   answer buttons, peach accents and the dark overlay are engine-wide. */

@font-face{font-family:Fredoka;font-weight:500;font-display:swap;src:url("../core/fonts/fredoka-500.b7c38d9f0c5c.woff2") format("woff2")}
@font-face{font-family:Fredoka;font-weight:600;font-display:swap;src:url("../core/fonts/fredoka-600.37be95cae21a.woff2") format("woff2")}
@font-face{font-family:Fredoka;font-weight:700;font-display:swap;src:url("../core/fonts/fredoka-700.7f793a98dfc3.woff2") format("woff2")}
@font-face{font-family:Inter;font-weight:400;font-display:swap;src:url("../core/fonts/inter-400.f34b21ec255f.woff2") format("woff2")}
@font-face{font-family:Inter;font-weight:500;font-display:swap;src:url("../core/fonts/inter-500.fa0d9de641bc.woff2") format("woff2")}
@font-face{font-family:Inter;font-weight:600;font-display:swap;src:url("../core/fonts/inter-600.497f868d563b.woff2") format("woff2")}

:root{
  --bg:#FFF4F7; --surface:#FFFFFF; --surface2:#FBE7EF; --line:#E6C3D3; --text:#2A0E22; --text2:#6B4A5E;
  --accent:#7A1F5C; --accent-ink:#FFFFFF; --ok:#16775A; --bad:#C0392B;
  --peach:#FF9E7A; --shade:rgba(42,14,34,.55); --top-sub:#F0D9E3; --soft-line:#F0D9E3;
  --head:Fredoka, sans-serif; --body:Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --opt-a:#FFB088; --opt-b:#7FD8CF; --opt-c:#FF94B8; --opt-d:#C4B3FF;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:var(--body);color:var(--text);background:var(--text);-webkit-text-size-adjust:100%;overscroll-behavior:none}
button,input{font:inherit;color:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
img{display:block}
.vh{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
:focus-visible{outline:3px solid var(--peach);outline-offset:2px}

/* ---------- stage: pack background + dark shade ---------- */
/* the stage is the visible area (Sh-46): in Safari 100vh is taller than what shows between its bars, so dynamic
   viewport units; browsers without them get the visible height from app.js (--vvh) */
.stage{position:fixed;left:0;right:0;top:0;bottom:auto;height:100vh;height:var(--vvh,100vh);overflow:hidden;background:var(--text) var(--bg-tall,none) center/cover no-repeat}
@supports (height:100dvh){.stage{height:100dvh}}
.stage::before{content:"";position:absolute;inset:0;background:var(--shade)}
.frame{position:relative;height:100%;max-width:480px;margin:0 auto;padding:calc(16px + env(safe-area-inset-top,0px)) 20px calc(24px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:14px}
.frame.intro{padding-bottom:calc(28px + env(safe-area-inset-bottom,0px))}
.scroll{overflow-y:auto;-webkit-overflow-scrolling:touch}

/* ---------- top: leave · title · sound, progress bar ---------- */
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#FFFFFF;flex:none}
.rbtn{flex:none;width:44px;height:44px;border:0;border-radius:22px;background:rgba(255,255,255,.18);display:inline-flex;align-items:center;justify-content:center;color:#FFFFFF;text-decoration:none;padding:0}
.rbtn svg{width:20px;height:20px}
.rbtn .lt{display:none}
.ttl{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0;text-align:center}
.ttl b{font-family:Fredoka,sans-serif;font-weight:600;font-size:17px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ttl span{font-size:13px;color:var(--top-sub)}
.spacer44{width:44px;flex:none}
.bar{flex:none;height:8px;border-radius:4px;background:rgba(255,255,255,.25)}
.bar i{display:block;height:8px;border-radius:4px;background:var(--peach);transition:width .4s ease}

/* ---------- centre block: the only part that moves ---------- */
.mid{margin:auto 0}
.card{background:var(--surface);color:var(--text);border-radius:26px;overflow:hidden;display:flex;flex-direction:column;position:relative}

/* round intro (Game-Round) */
.rcard{border-radius:28px}
.rcard img{width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;background:var(--surface2)}
.rcard .in{padding:22px 22px 24px;display:flex;flex-direction:column;gap:12px}
.chip{align-self:flex-start;padding:6px 12px;border-radius:999px;background:var(--surface2);color:var(--accent);font-size:12px;font-weight:600;letter-spacing:.8px;text-transform:uppercase}
.rcard h1{margin:0;font-family:Fredoka,sans-serif;font-weight:700;font-size:38px;line-height:1.05}
.rcard .sub{font-family:Fredoka,sans-serif;font-weight:500;font-size:19px;color:var(--text2)}
.rcard .say{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:16px;background:var(--bg)}
.rcard .say svg{flex:none;margin-top:1px;width:20px;height:20px;color:var(--text2)}
.rcard .say p{margin:0;font-size:15px;line-height:1.5}
.rcard .meta{font-size:14px;color:var(--text2)}
.rcard.final{background:var(--text);color:#FFFFFF}
.rcard.final .sub,.rcard.final .meta,.rcard.final .say svg{color:#E6C3D3}
.rcard.final .say{background:rgba(255,255,255,.1)}
.rcard.final .chip{background:var(--peach);color:var(--text)}
.two{flex:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.two .go2{width:100%;height:60px;border-radius:18px;font-family:Fredoka,sans-serif;font-size:22px}

/* big buttons */
.go{flex:none;height:60px;border:0;border-radius:18px;background:var(--accent);color:var(--accent-ink);display:flex;align-items:center;justify-content:center;gap:10px;font-family:Fredoka,sans-serif;font-weight:600;font-size:22px;text-decoration:none;width:100%}
.go.peach{background:var(--peach);color:var(--text)}
.go.next{height:58px;font-size:21px}
.frame.ans .go.next{margin-top:auto}
.go svg{width:20px;height:20px}
.go:disabled{opacity:.55;cursor:default}
.go2{height:48px;border-radius:14px;border:2px solid var(--line);background:var(--surface);color:var(--text);display:flex;align-items:center;justify-content:center;font-weight:600;font-size:15px;text-decoration:none}

/* question (Game-Question) */
/* the picture of a picture question is the question itself: never cropped. On a short screen it gets smaller as a
   whole — still 4:3, in the middle of the card — so that the question and the four answers fit (Sh-46 p. 3) */
.qcard{flex:0 1 auto;min-height:0;container-type:inline-size}
.qcard img.qimg{flex:0 1 auto;height:75cqw;min-height:120px;width:auto;max-width:100%;aspect-ratio:4/3;align-self:center;object-fit:cover;background:var(--surface2)}
.qtext{padding:16px 18px 18px;font-family:var(--head);font-weight:600;font-size:22px;line-height:1.25}
.qhead{padding:20px;display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.qhead .qtext{padding:0;font-size:23px}
.ring{flex:none;width:60px;height:60px;border-radius:30px;position:relative;display:flex;align-items:center;justify-content:center}
.ring svg{position:absolute;inset:0;width:60px;height:60px}
.ring b{position:relative;font-family:Fredoka,sans-serif;font-weight:700;font-size:22px}
.ring.onimg{position:absolute;top:12px;right:12px;background:var(--surface);box-shadow:0 2px 10px rgba(42,14,34,.25)}
.reading{display:inline-flex;align-items:center;gap:8px;padding:7px 12px;border-radius:999px;background:var(--text);color:#FFFFFF;font-size:13px;font-weight:500}
.reading svg{width:16px;height:16px;color:var(--peach)}
.reading.onimg{position:absolute;top:12px;left:12px}
.reading.intext{margin:0 18px 14px;align-self:flex-start}
.listen{margin:0 18px 18px;align-self:flex-start;display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 14px;border-radius:999px;border:2px solid var(--line);background:var(--bg);font-size:14px;font-weight:600;color:var(--accent)}
.listen svg{width:18px;height:18px}
.opts{flex:none;display:flex;flex-direction:column;gap:10px}
.opt{height:64px;border-radius:16px;border:2px solid #2A0E22;display:flex;align-items:center;gap:14px;padding:0 18px;font:600 17px Inter,sans-serif;color:#2A0E22;text-align:left;width:100%}
.opt .sh{width:18px;height:18px;flex:none;display:inline-flex;align-items:center;justify-content:center}
.sh svg{display:block;width:14px;height:14px;fill:currentColor}
.opt .tx{min-width:0;overflow:hidden;text-overflow:ellipsis}
.opt .key{display:none}
.o0{background:var(--opt-a)} .o1{background:var(--opt-b)} .o2{background:var(--opt-c)} .o3{background:var(--opt-d)}
.opt:disabled{cursor:default}
.opts.locked .opt:not(.picked){opacity:.45}

/* number (Game-Number) */
.ncard{border-radius:26px;padding:20px;gap:18px;background:var(--surface);display:flex;flex-direction:column}
.ncard .qhead{padding:0}
.ncard label{font-size:14px;font-weight:600;color:var(--text2)}
.nbox{display:flex;align-items:center;height:78px;border-radius:18px;border:3px solid var(--accent);background:var(--bg);padding:0 20px;gap:10px}
.nbox input{flex-grow:1;min-width:0;border:0;background:transparent;font-family:Fredoka,sans-serif;font-weight:600;font-size:36px;color:var(--text);outline:none;padding:1px 2px}
.nbox span{flex:none;white-space:nowrap;font-family:Fredoka,sans-serif;font-weight:600;font-size:24px;color:var(--text2)}
.ncard .go{height:58px;font-size:21px}
.nhint{font-size:13px;color:var(--bad)}
.nhint:empty{display:none}
.ncard.pin{margin-bottom:auto}

/* answer + fact (Game-Answer) */
.verdict{flex:none;background:var(--surface);border-radius:24px;padding:16px;display:flex;flex-direction:column;gap:10px}
.vh1{display:flex;align-items:center;gap:10px}
.vh1 .dot{width:32px;height:32px;border-radius:16px;display:inline-flex;align-items:center;justify-content:center;flex:none}
.vh1 .dot svg{width:18px;height:18px}
.vh1 b{font-family:Fredoka,sans-serif;font-weight:700;font-size:24px;flex:none}
.vh1 .you{display:none;margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600}
.vh1 .you.bad{color:var(--bad)} .vh1 .you.ok{color:var(--ok)}
.is-ok .dot{background:var(--ok)} .is-ok b{color:var(--ok)}
.is-bad .dot{background:var(--bad)} .is-bad b{color:var(--bad)}
.row{height:52px;border-radius:14px;color:#FFFFFF;display:flex;align-items:center;gap:12px;padding:0 16px;font-weight:600;font-size:16px}
.row.ok{background:var(--ok)} .row.bad{background:var(--bad)}
.row .sh{width:18px;height:18px;flex:none;display:inline-flex;align-items:center;justify-content:center}
.row .tx{flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row small{font-size:13px;font-weight:500;flex:none}
.row>svg{width:20px;height:20px;flex:none}
.explain{margin:0;font-size:15px;line-height:1.5;color:var(--text2)}
.nums{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.nums div{border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.nums span{font-size:13px}
.nums div{min-width:0}
.nums b{display:block;font-family:Fredoka,sans-serif;font-weight:700;font-size:26px;white-space:nowrap;overflow:hidden}
.nums .mine{background:var(--surface2)} .nums .mine span{color:var(--text2)}
.nums .mine.bad b{color:var(--bad)} .nums .mine.ok b{color:var(--ok)}
.nums .right{background:var(--ok);color:#FFFFFF}
/* the fact card (Sh-46): the text always gets its full height; the picture takes what is left between the verdict and
   Next — as wide as the card, from 4:3 down to 16:9, cropped around the centre. If even 16:9 does not leave room,
   the card scrolls, with a soft fade at the bottom as the sign that there is more (class .scrolls from app.js) */
.fcard{border-radius:24px;flex:0 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;container-type:inline-size}
.fcard img{flex:0 1 auto;width:100%;height:75cqw;min-height:max(56.25cqw,120px);object-fit:cover;object-position:50% 50%;background:var(--surface2)}
.fcard .fact{flex:none}
/* Sh-47 p. 2: a fact picture is either 4:3…16:9 (at least 120 px on a narrow card) or not there at all — when the
   text leaves it less, app.js hides it (.noimg) and only the text stays; scrolling only if even the text alone does not fit */
.fcard.noimg img{display:none}
.fcard.scrolls{-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - 36px),transparent)}
.fact{padding:14px 16px 16px;display:flex;gap:12px;align-items:flex-start}
.bulb{flex:none;width:36px;height:36px;border-radius:18px;background:var(--peach);display:inline-flex;align-items:center;justify-content:center;color:#2A0E22}
.bulb svg{width:20px;height:20px}
.fact p{margin:0;font-size:16px;line-height:1.5}

/* results (Game-Results) */
.res{background:var(--surface);border-radius:28px;padding:24px 22px;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
.res .lab{font-size:13px;font-weight:600;letter-spacing:1px;text-transform:uppercase;color:var(--text2)}
.res .score{font-family:Fredoka,sans-serif;font-weight:700;font-size:56px;line-height:1;color:var(--accent)}
.res .score span{font-size:28px;color:var(--text)}
.res .cor{font-size:16px;font-weight:500}
/* the row of result dots — ALWAYS one row (0.9.4, Sh-111): a dot 10 px, a gap 5 px (20 dots, the most — 295 px); on a
   narrower card dots and gaps shrink together, a dot not under 8 px. The width comes from the card (container query);
   the app draws the same (GameScreen.Dots). Where container queries are missing: 10 px, still one row. */
.dotsw{container-type:inline-size;align-self:stretch;display:flex;justify-content:center;margin:4px 0}
.dots{--d:clamp(8px,calc(100cqw / (1.5 * var(--n) - .5)),10px);display:flex;flex-wrap:nowrap;gap:calc(var(--d,10px) / 2)}
.dots i{flex:none;width:var(--d,10px);height:var(--d,10px);border-radius:50%;background:var(--ok)}
.dots i.x{background:var(--bad)}
.tier{padding:8px 16px;border-radius:999px;background:var(--peach);font-family:Fredoka,sans-serif;font-weight:600;font-size:22px;color:#2A0E22}
.res p{margin:0;font-size:16px;color:var(--text2)}
.box{background:var(--surface);border-radius:28px;padding:20px;display:flex;flex-direction:column;gap:14px}
.box h2{margin:0;font-family:Fredoka,sans-serif;font-weight:600;font-size:22px}
.cert{align-self:center;width:282px;height:352px;border-radius:18px;overflow:hidden;border:1px solid var(--soft-line);box-shadow:0 6px 20px rgba(42,14,34,.12);background:var(--bg)}
.cert canvas{width:280px;height:350px;display:block}
.box label{font-size:14px;font-weight:600;color:var(--text2)}
.box input[type=text]{height:48px;border-radius:14px;border:2px solid var(--line);background:var(--bg);padding:0 14px;font:500 16px Inter,sans-serif;color:var(--text);width:100%}
.box .note{margin:0;font-size:12px;line-height:1.4;color:var(--text2)}
.box .go{height:56px;font-size:20px}
.box .pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.box .go2{width:100%;background:var(--surface)}
.facts{gap:12px}
/* push prompt on the results (Sh-56 p. 1): a box like the others, bell in a 44 px circle, two equal buttons */
.pushbox .pushrow{display:flex;align-items:center;gap:12px;min-height:48px}  /* 0.9.8: one text (Sh-188 p. 3) — in one line on a computer; the row keeps the height of two lines, the prompt stays 150 px */
.pushbox .bell{flex:none;width:44px;height:44px;border-radius:22px;background:var(--surface2);color:var(--accent);display:flex;align-items:center;justify-content:center}
.pushbox .bell svg{width:22px;height:22px}
.pushbox h2{font-size:19px;line-height:24px}
.pushbox p{margin:0;font-size:16px;line-height:22px;font-weight:600}
.pushbox .go2.pushyes{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.pushbox .go2:disabled{opacity:.55;cursor:default}
.pushbox.done .bell{background:var(--ok,#1F8A5B);color:#FFFFFF}
/* 0.9.8 (Sh-186, Sh-188): the strip during the first quiz — 56 px, part of the bottom block over Next (one frame gap
   between them); 0.9.8a (Sh-189 p. 2.1): the fact stays right under the verdict as on every answer screen (Sh-73) —
   the free space goes between the fact and the strip, the fact does not move when the strip comes */
.ipush{flex:none;height:56px;box-sizing:border-box;padding:0 10px;display:flex;flex-direction:row;align-items:center;gap:8px}
.ipush .bell{flex:none;width:32px;height:32px;border-radius:16px;background:var(--surface2);color:var(--accent);display:flex;align-items:center;justify-content:center}
.ipush .bell svg{width:16px;height:16px}
.ipush p{flex:1;min-width:0;margin:0;font-size:14px;line-height:18px;font-weight:600}
.ipush .go2.pushyes{flex:none;width:auto;height:36px;min-height:36px;padding:0 14px;font-size:14px;background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.ipush .go2:disabled,.ipush .px:disabled{opacity:.55;cursor:default}
/* the visible ✕ is 36×36, the tap zone 44×44 (Sh-188 p. 1): 4 px more on each side, the layout does not change */
.ipush .px{position:relative;flex:none;width:36px;height:36px;border:0;border-radius:18px;background:transparent;color:var(--text);display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer}
.ipush .px::after{content:"";position:absolute;inset:-4px}
.ipush .px svg{width:18px;height:18px}
.ipush.done .bell{background:var(--ok,#1F8A5B);color:#FFFFFF}
.frame.ans.withpush .ipush{margin-top:auto}
.frame.ans.withpush .go.next{margin-top:0}
.fl[hidden]{display:none}
.fl{display:flex;gap:12px;align-items:flex-start;padding-top:12px;border-top:1px solid var(--soft-line)}
.fl img{flex:none;width:84px;height:63px;border-radius:10px;object-fit:cover;background:var(--surface2)}
.fl div{display:flex;flex-direction:column;gap:3px;min-width:0}
.fl .q{font-size:12px;font-weight:600;display:flex;align-items:center;gap:4px;min-width:0}
.fl .q span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fl .q svg{width:12px;height:12px;flex:none}
.fl .q.ok{color:var(--ok)} .fl .q.bad{color:var(--bad)}
.fl .t{font-size:14px;line-height:1.45}
.more{height:48px;border-radius:14px;border:0;background:var(--surface2);font:600 15px Inter,sans-serif;color:var(--accent)}
.resframe{height:auto;min-height:100%;gap:16px;padding-bottom:32px}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--text);color:#FFFFFF;padding:10px 16px;border-radius:12px;font-size:14px;z-index:9;box-shadow:0 4px 16px rgba(0,0,0,.25)}

/* simple states */
.msg{background:var(--surface);border-radius:28px;padding:28px 24px;display:flex;flex-direction:column;gap:14px;text-align:center}
.msg h1{margin:0;font-family:Fredoka,sans-serif;font-weight:700;font-size:30px}
.msg p{margin:0;color:var(--text2);line-height:1.5}
.adpause{color:#FFFFFF;text-align:center;font-family:Fredoka,sans-serif;font-weight:600;font-size:20px}

/* ---------- computer (Game-Desktop, 1440×900) ---------- */
@media (min-width:1024px) and (min-height:600px){
  .stage{background-image:var(--bg-wide,var(--bg-tall,none))}
  .frame{max-width:none;padding:28px 48px 40px;gap:20px}
  .top{gap:16px}
  .rbtn.leave{width:auto;height:44px;padding:0 18px 0 12px;gap:8px;font-weight:500;font-size:15px}
  .rbtn.leave .lt{display:inline}
  .ttl b{font-size:22px}
  .ttl span{font-size:14px}
  .bar{max-width:1100px;width:100%;margin:0 auto}
  .desk{flex-grow:1;display:flex;align-items:center;justify-content:center;min-height:0}
  .dcard{width:1100px;max-width:100%;background:var(--surface);border-radius:32px;overflow:hidden;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .dcard .pic{position:relative;background:var(--surface2);min-height:412px}
  /* 0.9.5: the picture fills its half absolutely — its own 4:3 does not stretch the row when it loads (was +0.5 px) */
  .dcard .pic img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
  .dcard .pane{padding:32px 36px;display:flex;flex-direction:column;gap:18px;min-width:0}
  .dcard .qrow{display:flex;align-items:flex-start;gap:20px}
  .dcard .qrow .qtext{flex-grow:1;padding:0;font-size:30px;line-height:1.2}
  .dcard .ring{width:68px;height:68px}
  .dcard .ring svg{width:68px;height:68px}
  .dcard .ring b{font-size:26px}
  .dcard .reading{align-self:flex-start}
  .dcard .reading.onimg{position:absolute}
  .dcard .opts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:auto}
  .dcard .opt{height:72px;border-radius:18px;font-size:18px;gap:12px}
  .dcard .opt .key{display:inline;margin-left:auto;font-size:13px;font-weight:600;color:rgba(42,14,34,.55)}
  .dcard .tip{font-size:13px;color:var(--text2)}
  .dcard .vh1{gap:12px}
  .dcard .row .sh{width:auto}
  .dcard .vh1 .dot{width:40px;height:40px;border-radius:20px}
  .dcard .vh1 .dot svg{width:22px;height:22px}
  .dcard .vh1 b{font-size:32px}
  .dcard .row{height:60px;border-radius:16px;font-size:18px;padding:0 18px}
  .dcard .explain{font-size:16px}
  .dcard .row>svg{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .dcard .dfact{display:flex;gap:14px;align-items:flex-start;padding:18px;border-radius:20px;background:var(--bg)}
  .dcard .dfact .bulb{width:40px;height:40px;border-radius:20px}
  .dcard .dfact .bulb svg{width:22px;height:22px}
  .dcard .dfact p{margin:0;font-size:18px;line-height:1.5}
  .dcard .go{height:60px;font-size:22px;margin-top:auto}
  .dcard .nbox{margin-top:0}
  .dcard.rd .pane{justify-content:center}
  .dcard .ipush{border:1.5px solid var(--surface2)}
  .dcard .pane.withpush .ipush{margin-top:auto}
  .dcard .pane.withpush .go{margin-top:0}
  .dcard.rd h1{margin:0;font-family:Fredoka,sans-serif;font-weight:700;font-size:44px;line-height:1.05}
  .dcard.final{background:var(--text);color:#FFFFFF}
  .resframe .rgrid{display:grid;grid-template-columns:400px 400px;gap:16px;justify-content:center;align-items:stretch}
  .resframe .rcol{display:flex;flex-direction:column;gap:16px}
  /* bottoms on one line (Sh-32): the facts column is at least as tall as the left one; when all facts are open the
     left column stays at the top of the screen */
  .resframe .rcol:first-child{align-self:start;position:sticky;top:16px}
  .resframe .rcol:last-child .facts{flex:1}
  .resframe .facts .more{margin-top:auto}
  .resframe .rgrid.measure{align-items:start}
  .resframe .rgrid.measure .facts{flex:none}
  .resframe .rgrid.measure .rcol:first-child{position:static}
  .resframe{max-width:none}
}
/* ---------- styleguide frame (format 13): not clickable; results grow to their full height ---------- */
.sgframe #app{pointer-events:none}
.sgframe .stage.scroll{position:relative;min-height:100vh;overflow:visible}
.sgcert{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;background:var(--text)}
.sgcert canvas{display:block;max-width:100%;max-height:100%;width:auto;height:auto;aspect-ratio:1080/1350;border-radius:16px;box-shadow:0 12px 40px rgba(0,0,0,.35)}
/* Sh-47 p. 1: the answer screen on a short phone screen (up to 739 px high; the computer layout is not touched).
   Tighter spacing; «Your answer» moves from its own row into the verdict line («You chose: …» / «You said: …»).
   Fact and explanation type stay as they are. */
@media (max-width:1023px) and (max-height:739px), (max-height:599px){
  .frame.ans{padding:calc(10px + env(safe-area-inset-top,0px)) 20px calc(14px + env(safe-area-inset-bottom,0px));gap:8px}
  .ans .fact{padding:12px 16px}
  .ans .nums div{padding:8px 14px;gap:0}
  .ans .verdict{padding:12px;gap:8px}
  .ans .vh1 .dot{width:28px;height:28px;border-radius:14px}
  .ans .vh1 b{font-size:22px}
  .ans .row{height:44px}
  .ans .row.bad,.ans .nums .mine{display:none}
  .ans .nums{grid-template-columns:minmax(0,1fr)}
  .ans .vh1 .you{display:block}
  .ans .go.next{height:52px}
  /* Sh-50: on a short screen the fact picture may go down to 2:1 (from 740 px up — 16:9, as before) */
  .ans .fcard img{min-height:max(50cqw,120px)}
}
/* Sh-47 p. 3: a picture question up to 600 px high — the answers in a 2×2 grid (A B / C D), same gap both ways,
   up to two lines of text, every button as tall as the tallest; a question with an answer that needs a third line
   keeps the column (.col, set by app.js) */
@media (max-width:1023px) and (max-height:600px), (max-height:599px){
  .opts.pq:not(.col){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:10px}
  .opts.pq:not(.col) .opt{height:auto;min-height:52px;padding:8px 12px;gap:10px;font-size:15px}
  .opts.pq:not(.col) .opt .tx{line-height:20px;overflow:visible;overflow-wrap:anywhere}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* 0.9.5 (Sh-124): a picture still on its way — its muted average colour over exactly its box, out in 180 ms */
.ph{position:absolute;display:block;pointer-events:none;background:var(--surface2);opacity:1;transition:opacity .18s ease}
.ph.out{opacity:0}
