/* ═══════════════════════════════════════════════════════════
   JOSS PAPER AR · Prototype Design System
   Style: Low-poly 3D × Traditional Ink Brush (SCRUM-6 · locked 2026-09-24)
   Session 3 exploratory mockup — NOT production code
   ═══════════════════════════════════════════════════════════ */
:root{
  /* ── Locked palette (SCRUM-6) ── */
  --cinnabar:#C23B22; --cinnabar-soft:#D9644B; --cinnabar-deep:#9A2B18;
  --gold:#D4AF37; --gold-bright:#F0C75E; --gold-deep:#A8862A;
  --azurite:#4A6FA5; --azurite-light:#8FB0D0; --azurite-deep:#31506F;
  --malachite:#0E9B78; --malachite-deep:#07795C;
  --ink:#1A1A1A; --ink-soft:#4A463F; --ink-faint:rgba(26,26,26,.35);
  --paper:#F5F0E8; --paper-deep:#EAE2D2; --paper-edge:#D9CFBA;
  --flame-core:#FFF3D6; --flame-mid:#FFD98A; --flame-orange:#FF9A3C; --flame-deep:#E5531F;
  /* ── Type (big & readable for 40–50s) ── */
  --font-display:'Songti SC','Noto Serif SC','STSong','SimSun',Georgia,serif;
  --font-body:'PingFang SC','Noto Sans SC','Microsoft YaHei',system-ui,-apple-system,'Segoe UI',sans-serif;
  --r-lg:22px; --r-md:14px; --r-sm:10px;
}
*{box-sizing:border-box;margin:0;padding:0}
button{font-family:inherit}

body{
  min-height:100vh; color:var(--paper);
  background:
    radial-gradient(900px 620px at 18% -12%, #2A2320 0%, transparent 60%),
    radial-gradient(900px 700px at 112% 118%, #241C18 0%, transparent 55%),
    #171412;
  display:flex; flex-direction:column; align-items:center;
  padding:30px 16px 48px;
  font-family:var(--font-body);
}

/* ── Prototype header (outside phone) ── */
.proto-head{text-align:center; max-width:960px; margin-bottom:20px}
.proto-head h1{font-family:var(--font-display); font-size:26px; letter-spacing:.5px; color:var(--paper)}
.proto-head h1 .zh{color:var(--gold-bright)}
.proto-head .tagline{margin-top:8px; font-size:13px; color:#C9BFA9}
.style-chip{display:inline-flex; align-items:center; gap:8px; margin-top:12px;
  padding:7px 14px; border-radius:999px; font-size:12px; letter-spacing:.3px;
  border:1px solid rgba(212,175,55,.45); color:var(--gold-bright); background:rgba(212,175,55,.08)}
.jump{display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:14px}
.jump button{font:inherit; font-size:12px; padding:7px 13px; border-radius:999px; cursor:pointer;
  border:1px solid rgba(245,240,232,.25); background:rgba(245,240,232,.06); color:#EDE6D8; transition:.2s}
.jump button:hover{border-color:var(--gold); color:var(--gold-bright)}
.jump button.is-current{border-color:var(--gold); color:var(--gold-bright); background:rgba(212,175,55,.14)}

/* ── PUBLIC DEMO CHROME (published copy) ──────────────────────────────────────
   ⚠️ SURFACE POLICY FOR THIS FILE. The page surrounds the phone on a DARK
   background (#171412) and the camera/burn/tablet surfaces are dark too, so
   brand gold PASSES there — tokens.css explicitly allows a brand value on
   --surface-camera. On the CREAM screens (home · sheet · league · reward ·
   transform) every text colour uses its -text token instead.
   The on-dark usages are therefore deliberate and enumerated in the gate
   (`npm run check:site` → ON_DARK_DEMO_SELECTORS), which fails if an entry
   there goes stale. Do not "fix" them to a -text token: #77632F on #121418 is
   dark-on-dark, and the aim sight, throw guide, swipe chevron and score pop
   would disappear into the fire. ── */
.demo-back{margin:0 0 10px; font-size:12.5px}
.demo-back a{color:#EDE6D8; text-decoration:none; border-bottom:1px solid rgba(245,240,232,.3)}
.demo-back a:hover{opacity:.75}
.demo-foot{max-width:640px; margin:26px auto 0; text-align:center; font-size:12.5px; line-height:1.7; color:#C9BFA9}
.demo-foot strong{color:#EDE6D8}
.demo-foot a{color:#EDE6D8}
.demo-foot .credit{font-size:11.5px; opacity:.85; margin-top:10px}

/* ── Phone frame ── */
.phone{position:relative; width:390px; height:844px; flex:none; border-radius:46px;
  background:#0B0A09; border:10px solid #26211D; overflow:hidden;
  box-shadow:0 30px 80px rgba(0,0,0,.6), 0 0 0 2px #3A322B inset}
.notch{position:absolute; top:0; left:50%; transform:translateX(-50%); z-index:60;
  width:150px; height:26px; background:#26211D; border-radius:0 0 16px 16px}
.screens{position:absolute; inset:0}

/* ── Screen base ── */
.screen{position:absolute; inset:0; display:flex; flex-direction:column; overflow:hidden;
  opacity:0; pointer-events:none; transform:translateY(14px) scale(.985);
  transition:opacity .35s ease, transform .35s ease}
.screen.is-active{opacity:1; pointer-events:auto; transform:none}
.no-anim .screen{transition:none}

/* rice-paper texture for paper screens */
.paper-tex{position:absolute; inset:0; pointer-events:none; opacity:.5; mix-blend-mode:multiply;
  background-image:
    repeating-linear-gradient(0deg, rgba(120,100,70,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120,100,70,.04) 0 1px, transparent 1px 4px)}

/* ── Buttons (ink outline + faceted fills) ── */
.btn{font:inherit; border:2.5px solid var(--ink); cursor:pointer; border-radius:var(--r-md);
  padding:16px 22px; font-size:18px; font-weight:700; letter-spacing:.2px;
  transition:transform .15s ease, filter .2s ease}
.btn:active{transform:translateY(1px) scale(.99)}
.btn-primary{color:#FFF8E8;
  background:conic-gradient(from 210deg at 30% 25%, var(--cinnabar-soft) 0 18%, var(--cinnabar) 18% 55%, var(--cinnabar-deep) 55% 78%, var(--cinnabar) 78% 100%);
  box-shadow:0 4px 0 var(--cinnabar-deep), 0 12px 26px rgba(194,59,34,.35)}
.btn-ghost{background:transparent; border-color:var(--ink); color:var(--ink)}
.btn-big{padding:20px 28px; font-size:21px; border-radius:18px}

.icon-btn{width:44px; height:44px; border-radius:14px; cursor:pointer; font-size:18px;
  border:2.5px solid var(--ink); background:var(--paper-deep); color:var(--ink)}

.streak-chip{display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:999px;
  background:rgba(194,59,34,.1); border:2px solid rgba(194,59,34,.55);
  color:var(--cinnabar-text); font-weight:700; font-size:14px}

/* ── Faceted fills (low-poly feel) ── */
.facet-jade{background:conic-gradient(from 80deg, #23B98F 0 25%, var(--malachite) 25% 55%, var(--malachite-deep) 55% 78%, var(--malachite) 78% 100%)}
/* ── ① Home / Shrine ── */
#screen-home{background:var(--paper); align-items:center; padding:54px 20px 0}
.home-top{width:100%; display:flex; align-items:flex-start; justify-content:space-between; z-index:2}
.app-title h2{font-family:var(--font-display); font-size:30px; line-height:1.1; color:var(--ink)}
.app-title h2 .zh{color:var(--cinnabar-text)}
.app-title p{font-size:11px; letter-spacing:2.5px; text-transform:uppercase; color:var(--ink-soft); margin-top:3px}
.tribute-panel{margin-top:24px; text-align:center; z-index:2}
.tribute-label{font-size:12px; letter-spacing:3px; text-transform:uppercase; color:var(--ink-soft)}
.tribute-points{font-family:var(--font-display); font-size:64px; line-height:1.08; color:var(--ink); margin-top:4px}
.tribute-panel .streak-chip{margin-top:8px}

.shrine-art{flex:1; min-height:0; width:100%; display:flex; align-items:center; justify-content:center; padding-top:2px; z-index:1}
.shrine-art svg{height:100%; max-height:252px; width:auto}
.tablet-txt{font-family:var(--font-display); font-size:19px; font-weight:600; fill:var(--gold); text-anchor:middle}
/* tablets are built from the user's own input; the ghost ＋ slot is positioned by renderAltar */
.tablet-slot{cursor:pointer}
.tablet-slot:focus{outline:none}
.tablet-slot.is-new .tablet-body{animation:tabletLand .5s cubic-bezier(.2,.9,.3,1.35) both}
@keyframes tabletLand{from{opacity:0; transform:translateY(-18px) scale(.88)} to{opacity:1; transform:none}}
/* no-anim (deep links, screenshot probes) must kill the landing too, or a tablet
   placed in that instant is captured mid-fade. Specificity is spelled out so this
   wins over .tablet-slot.is-new .tablet-body rather than depending on file order. */
.no-anim .tablet-slot.is-new .tablet-body,
.no-anim .tablet-body{animation:none}
#addTabletSlot{cursor:pointer; pointer-events:all}
#addTabletSlot.is-hidden{display:none}
#addTabletSlot:focus{outline:none}
.ghost-plus{animation:ghostPulse 2.2s ease-in-out infinite}
/* the floor is .75, not .5: on an empty altar the ＋ is the only thing that says
   what to do, and at half opacity it disappeared against the incense behind it */
@keyframes ghostPulse{0%,100%{opacity:.75} 50%{opacity:1}}
.shrine-caption{text-align:center; font-size:12px; color:var(--ink-soft); z-index:2; margin:-2px 0 2px}

.lantern{position:absolute; top:86px; width:54px; z-index:1}
.lantern-l{left:16px}
.lantern-r{right:16px}
.lantern::before{content:''; display:block; width:2px; height:16px; background:var(--ink); margin:0 auto}
.lantern i{display:block; width:54px; height:66px; position:relative;
  background:conic-gradient(from 40deg at 35% 30%, var(--cinnabar-soft) 0 22%, var(--cinnabar) 22% 52%, var(--cinnabar-deep) 52% 76%, var(--cinnabar) 76% 100%);
  clip-path:polygon(50% 0,100% 26%,100% 74%,50% 100%,0 74%,0 26%);
  filter:drop-shadow(0 5px 8px rgba(154,43,24,.35))}
.lantern i::after{content:''; position:absolute; inset:5px;
  clip-path:polygon(50% 0,100% 26%,100% 74%,50% 100%,0 74%,0 26%);
  background:linear-gradient(160deg, rgba(255,255,255,.22), transparent 55%)}
.lantern::after{content:''; display:block; width:8px; height:22px; margin:2px auto 0;
  background:var(--gold); clip-path:polygon(0 0,100% 0,72% 100%,28% 100%)}

.home-cta{width:100%; display:flex; flex-direction:column; align-items:center; gap:9px; margin-top:14px; z-index:2}
.home-cta .btn{width:100%}

/* ── ① The ancestor sheet: where the shrine gets built ── */
.sheet-scrim{position:absolute; inset:0; z-index:60; background:rgba(26,26,26,.42);
  opacity:0; transition:opacity .28s ease}
.sheet-scrim.is-open{opacity:1}
.sheet{position:absolute; left:0; right:0; bottom:0; z-index:61; background:var(--paper);
  border-top:2.5px solid var(--ink); border-radius:24px 24px 0 0; padding:12px 20px 22px;
  box-shadow:0 -20px 44px rgba(26,26,26,.3); transform:translateY(104%);
  transition:transform .32s cubic-bezier(.32,.72,.24,1); max-height:88%; overflow-y:auto;
  scrollbar-width:none}
.sheet::-webkit-scrollbar{display:none}
.sheet.is-open{transform:none}
.no-anim .sheet,.no-anim .sheet-scrim{transition:none}
.sheet-grab{width:44px; height:4px; border-radius:99px; background:rgba(26,26,26,.2); margin:0 auto 12px}
.sheet-close{position:absolute; top:12px; right:14px; width:36px; height:36px; border-radius:50%;
  border:2px solid var(--ink); background:transparent; color:var(--ink); font-size:15px; cursor:pointer;
  line-height:1}
.sheet-title{font-family:var(--font-display); font-size:21px; color:var(--ink); padding-right:40px}
.sheet-sub{font-size:12.5px; color:var(--ink-soft); margin-top:4px}
.sheet-body{display:flex; gap:14px; margin-top:16px; align-items:flex-start}
.sheet-fields{flex:1; min-width:0}
.field{display:block; margin-bottom:13px}
.field > span,.field legend{display:block; font-size:11px; letter-spacing:1.6px; text-transform:uppercase;
  color:var(--ink-soft); margin-bottom:6px; padding:0}
.field b{color:var(--cinnabar-text); font-weight:800}
.field input{width:100%; font:inherit; font-size:21px; text-align:center; padding:11px 10px;
  border:2.5px solid var(--ink); border-radius:14px; background:#FBF7EE; color:var(--ink)}
.field input::placeholder{color:rgba(26,26,26,.24)}
.field input:focus{outline:3px solid rgba(212,175,55,.6); outline-offset:1px}
.relation{border:0; margin:0; padding:0}
.chips{display:flex; flex-wrap:wrap; gap:6px}
.chip{font:inherit; font-size:13px; padding:9px 12px; border-radius:999px; cursor:pointer;
  border:2px solid var(--ink); background:#FBF7EE; color:var(--ink)}
.chip.is-on{background:var(--gold); border-color:var(--gold-deep); font-weight:800}
.sheet-preview{width:96px; flex:none; text-align:center; padding-top:2px}
.sheet-preview svg{width:96px; height:auto; display:block}
.preview-cap{font-size:10px; line-height:1.35; color:var(--ink-soft); margin-top:6px}
.sheet-hint{font-size:11.5px; color:var(--ink-soft); margin-top:4px}
.sheet-actions{display:flex; gap:10px; margin-top:14px}
.sheet-actions .btn{flex:1; font-size:16px; padding:16px 12px}
.sheet-actions .btn[hidden]{display:none}
.cta-hint{font-size:13px; color:var(--ink-soft)}

.mini-league{width:100%; display:flex; align-items:center; gap:12px; margin-top:14px; padding:12px 16px;
  background:var(--paper-deep); border:2.5px solid var(--ink); border-radius:var(--r-md); cursor:pointer; z-index:2}
.mini-rank{font-family:var(--font-display); font-size:24px; color:var(--gold-text)}
.mini-info{display:flex; flex-direction:column; text-align:left}
.mini-info strong{font-size:15px; color:var(--ink)}
.mini-info span{font-size:12px; color:var(--ink-soft)}
.mini-move{margin-left:auto; font-size:13px; font-weight:800; color:var(--malachite-text)}

.tabbar{width:100%; display:flex; gap:8px; margin-top:14px; padding:10px 12px 20px;
  border-top:2.5px solid var(--ink); background:var(--paper-deep)}
.tab{flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; cursor:pointer;
  font-size:12px; font-weight:700; color:var(--ink-soft); background:none; border:none;
  padding:8px 0; border-radius:12px; transition:.2s}
.tab-ico{font-size:19px}
.tab.is-active{color:var(--cinnabar-text); background:rgba(194,59,34,.09)}
/* ── Camera-view screens (capture + burn) ── */
.s-cam{background:#121418}
.cam-bg{position:absolute; inset:0; filter:blur(2px)}
.capture-bg{background:
  radial-gradient(340px 260px at 78% 20%, rgba(238,232,214,.22), transparent 70%),
  radial-gradient(420px 320px at 16% 66%, rgba(120,140,170,.2), transparent 70%),
  radial-gradient(300px 240px at 60% 88%, rgba(60,45,35,.55), transparent 75%),
  radial-gradient(120% 90% at 50% 0%, #3E4754 0%, #262C36 45%, #14171C 100%)}
.cam-noise{position:absolute; inset:0; opacity:.5; mix-blend-mode:screen;
  background-image:repeating-linear-gradient(115deg, rgba(255,255,255,.02) 0 2px, transparent 2px 5px)}
.s-cam::after{content:''; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(120% 100% at 50% 45%, transparent 55%, rgba(0,0,0,.55) 100%)}

.cam-top{position:absolute; top:36px; left:16px; right:16px; z-index:6;
  display:flex; align-items:center; justify-content:space-between}
.cam-back{width:42px; height:42px; border-radius:50%; cursor:pointer; font-size:24px; line-height:1;
  border:2.5px solid rgba(245,240,232,.55); background:rgba(20,17,15,.5); color:var(--paper)}
.cam-back.ink{border-color:var(--ink); background:var(--paper); color:var(--ink)}
.cam-pill{font-size:12px; letter-spacing:2px; color:#FFD9C9; padding:6px 12px; border-radius:999px;
  background:rgba(154,43,24,.55); border:2px solid rgba(255,154,60,.6)}
.cam-battery{font-size:12px; color:rgba(245,240,232,.7)}

.frame-guide{position:absolute; inset:158px 42px 272px; z-index:5}
.corner{position:absolute; width:36px; height:36px; border:4px solid var(--gold)}
.corner.tl{top:0; left:0; border-right:0; border-bottom:0; border-radius:10px 0 0 0}
.corner.tr{top:0; right:0; border-left:0; border-bottom:0; border-radius:0 10px 0 0}
.corner.bl{bottom:0; left:0; border-right:0; border-top:0; border-radius:0 0 0 10px}
.corner.br{bottom:0; right:0; border-left:0; border-top:0; border-radius:0 0 10px 0}
/* the viewfinder is a camera: it shows the REAL object, so this is a photograph
   (assets/car-real.jpg — see assets/CREDITS.md), not the mesh. The photo is
   1.79:1 and the box is 1.96:1, so `cover` crops a sliver of sky. */
.frame-ghost{position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:250px; height:136px; border:2.5px dashed rgba(245,240,232,.4); border-radius:16px;
  overflow:hidden;
  background:#2A2F36 url("assets/car-real.jpg") center 58%/cover no-repeat;
  box-shadow:0 12px 16px rgba(0,0,0,.45)}
.detect-chip{position:absolute; left:50%; top:-38px; transform:translateX(-50%); white-space:nowrap;
  padding:6px 12px; border-radius:999px; font-size:12px; letter-spacing:.4px;
  background:rgba(20,17,15,.62); border:1.5px solid rgba(212,175,55,.55); color:var(--gold-bright)}

.cam-copy{position:absolute; left:0; right:0; bottom:206px; text-align:center; color:var(--paper); z-index:6}
.cam-copy h3{font-family:var(--font-display); font-size:24px; text-shadow:0 2px 8px rgba(0,0,0,.5)}
.cam-copy p{font-size:14px; margin-top:4px; color:rgba(245,240,232,.78)}

.cam-controls{position:absolute; left:0; right:0; bottom:36px; z-index:6;
  display:flex; align-items:center; justify-content:center; gap:38px}
.shutter{width:84px; height:84px; border-radius:50%; cursor:pointer; padding:0;
  border:5px solid var(--paper); background:transparent; display:flex; align-items:center; justify-content:center}
.shutter span{width:62px; height:62px; border-radius:50%;
  background:conic-gradient(from 40deg, var(--cinnabar-soft) 0 25%, var(--cinnabar) 25% 55%, var(--cinnabar-deep) 55% 80%, var(--cinnabar) 80% 100%)}
.control-btn{width:52px; height:52px; border-radius:16px; cursor:pointer; font-size:20px;
  background:rgba(20,17,15,.55); border:2.5px solid rgba(245,240,232,.5); color:var(--paper)}

.shutter-flash{position:absolute; inset:0; background:#FFF8E8; opacity:0; pointer-events:none; z-index:50}
.shutter-flash.is-flashing{animation:flash .6s ease}
@keyframes flash{0%{opacity:0} 18%{opacity:.95} 100%{opacity:0}}

/* ── Shared sub-header for paper screens ── */
.sub-top{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:40px 18px 10px; z-index:2}
.sub-top h3{font-family:var(--font-display); font-size:17px; color:var(--ink); white-space:nowrap}
.sub-spacer{width:44px; flex:none}
/* ── ③ Transform: compare slider ── */
#screen-transform{background:var(--paper)}
.compare{position:relative; margin:8px 18px 0; flex:1; min-height:0; border-radius:18px; overflow:hidden;
  --split:50%;
  border:3px solid var(--ink); background:var(--paper-deep); box-shadow:0 14px 30px rgba(26,26,26,.18); z-index:2}
.compare svg{display:block; width:100%; height:100%}
/* before = the photo the app received, at the SAME scale as the offering beside
   it: `assets/car-real-panel.jpg` is the same photograph padded to the cartoon
   stage's exact aspect (243:177.1), so `contain` lands it in precisely the same
   band the D stage occupies — same width, same centre, no zoom, no blur. */
.compare-before{position:absolute; inset:0; clip-path:inset(0 calc(100% - var(--split)) 0 0);
  transition:clip-path .9s cubic-bezier(.4,0,.2,1);
  background:url("assets/car-real-panel.jpg") center/contain no-repeat}
/* after = the offering on rice paper, the app's own stage look */
.compare-after{position:absolute; inset:0; clip-path:inset(0 0 0 var(--split));
  transition:clip-path .9s cubic-bezier(.4,0,.2,1);
  background:
    radial-gradient(circle 3px at 21% 27%, rgba(26,26,26,.12), rgba(26,26,26,0) 100%),
    radial-gradient(circle 4px at 79% 71%, rgba(26,26,26,.1), rgba(26,26,26,0) 100%),
    radial-gradient(58% 42% at 50% 45%, #FBF7EE 0%, var(--paper) 62%, var(--paper-deep) 100%)}
.compare-inner{position:absolute; inset:0}
.compare-handle{position:absolute; top:0; bottom:0; left:var(--split); width:5px; margin-left:-2.5px; cursor:ew-resize;
  background:var(--gold); border-left:2px solid var(--ink); border-right:2px solid var(--ink);
  transition:left .9s cubic-bezier(.4,0,.2,1)}
.compare.is-dragging .compare-before, .compare.is-dragging .compare-after,
.compare.is-dragging .compare-handle{transition:none}
.compare-handle span{position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:var(--paper); border:3px solid var(--ink); font-size:19px; color:var(--ink);
  box-shadow:0 4px 10px rgba(0,0,0,.25)}
.compare-tag{position:absolute; top:12px; padding:5px 10px; border-radius:8px; font-size:11px;
  letter-spacing:1.5px; font-weight:800; border:2px solid var(--ink)}
.tag-before{left:12px; background:rgba(245,240,232,.92); color:var(--ink)}
.tag-after{right:12px; background:var(--gold); color:var(--ink)}
.compare.is-revealed::after{content:''; position:absolute; inset:0; pointer-events:none; z-index:5;
  background:linear-gradient(115deg, transparent 30%, rgba(240,199,94,.55) 50%, transparent 70%);
  animation:sweep .9s ease .15s both}
@keyframes sweep{0%{transform:translateX(-120%); opacity:0}30%{opacity:1}100%{transform:translateX(120%); opacity:0}}

.transform-overlay{position:absolute; inset:0; z-index:40; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:14px; background:rgba(245,240,232,.95);
  opacity:0; pointer-events:none; transition:opacity .45s ease}
.transform-overlay.is-playing{opacity:1; pointer-events:auto}
.brush-ring{width:92px; height:92px; border-radius:50%; border:7px solid rgba(26,26,26,.12);
  border-top-color:var(--cinnabar); border-right-color:var(--gold); animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.tf-title{font-family:var(--font-display); font-size:26px; color:var(--ink)}
.tf-sub{font-size:14px; color:var(--ink-soft)}

.transform-copy{margin:14px 24px 0; text-align:center; z-index:2}
.transform-copy h4{font-family:var(--font-display); font-size:17px; color:var(--ink)}
.transform-copy p{font-size:13px; color:var(--ink-soft); margin-top:4px; line-height:1.5}
.transform-actions{display:flex; gap:12px; padding:14px 20px 26px; z-index:2}
.transform-actions .btn{flex:1; font-size:16px; padding:16px 10px}
/* ── ④ Burn ritual ── */
#screen-burn{background:#121418}
.burn-bg{background:
  radial-gradient(320px 280px at 50% 66%, rgba(255,154,60,.24), transparent 70%),
  radial-gradient(120% 90% at 50% 0%, #3A3F4A 0%, #23272F 45%, #121418 100%)}

.fire-zone{position:absolute; left:50%; bottom:300px; transform:translateX(-50%); width:230px; z-index:4;
  display:flex; flex-direction:column; align-items:center}
.fire-glow{position:absolute; bottom:-60px; width:300px; height:300px; border-radius:50%;
  background:radial-gradient(circle, rgba(255,154,60,.55) 0%, rgba(229,83,31,.28) 45%, transparent 70%);
  animation:pulseGlow 2.6s ease-in-out infinite}
.fire{position:relative; width:144px; z-index:2; transform-origin:50% 100%; animation:flicker 1.6s ease-in-out infinite}
.fire-body{display:block; transform-origin:50% 100%}
.fire svg{display:block; width:100%; height:auto}
.flame-mid{transform-origin:50% 100%; animation:flicker2 1.1s ease-in-out infinite}
.flame-inner{transform-origin:50% 100%; animation:flicker2 .8s ease-in-out infinite reverse}
.ember-bed{width:184px; margin-top:-14px; z-index:3}
.particles{position:absolute; bottom:50px; left:50%; z-index:1}
.particles i{position:absolute; width:9px; height:9px; background:var(--flame-mid);
  clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%); opacity:0; animation:emberRise 3s linear infinite}
.particles i:nth-child(1){left:-48px; --dx:-18px; animation-delay:0s}
.particles i:nth-child(2){left:26px; --dx:14px; animation-delay:.5s; animation-duration:3.4s}
.particles i:nth-child(3){left:-12px; --dx:-8px; animation-delay:1.1s; animation-duration:2.7s}
.particles i:nth-child(4){left:52px; --dx:22px; animation-delay:1.6s; animation-duration:3.6s}
.particles i:nth-child(5){left:-64px; --dx:-26px; animation-delay:2.1s; animation-duration:2.9s}
.particles i:nth-child(6){left:8px; --dx:4px; animation-delay:2.6s; animation-duration:3.2s}

@keyframes flicker{0%,100%{transform:scaleY(1) scaleX(1)}50%{transform:scaleY(1.06) scaleX(.97)}}
@keyframes flicker2{0%,100%{transform:scaleY(1)}50%{transform:scaleY(1.12)}}
@keyframes pulseGlow{0%,100%{opacity:.75; transform:scale(1)}50%{opacity:1; transform:scale(1.08)}}
@keyframes emberRise{0%{opacity:0; transform:translate(0,0) scale(.5)}12%{opacity:.9}
  100%{opacity:0; transform:translate(var(--dx,8px),-230px) scale(.15)}}

/* The fire's answer to a throw is written into the DOM the moment the offering
   leaves the hand (is-flaring / is-smoldering) and waits for it on the CSS clock —
   the same 620 ms the flight takes. The flare rides .fire-body, so .fire keeps
   breathing while a throw is in the air, and the state on screen is inspectable
   without waiting for the animation. */
.fire.is-flaring .fire-body{animation:flare .9s ease .62s both}
.fire-glow.is-flaring{animation:flareGlow .9s ease .62s both}
.fire.is-smoldering .fire-body{animation:smolder .8s ease .56s both}
@keyframes flare{0%{transform:scaleY(1)}30%{transform:scaleY(1.45) scaleX(1.18)}100%{transform:scaleY(1)}}
@keyframes flareGlow{0%{opacity:.8; transform:scale(1)}30%{opacity:1; transform:scale(1.5)}100%{opacity:.8; transform:scale(1)}}
/* a graze on the coals: the fire takes the offering, but only just */
@keyframes smolder{0%{transform:scale(1)}35%{transform:scaleY(1.14) scaleX(1.06)}65%{transform:scaleY(.97)}100%{transform:scale(1)}}

/* ── the aim sight ──
   A throw is graded where it crosses the mouth line — the line the guide's tip
   points at. app.js paints this sight from the very geometry it grades with: a
   dashed line across the pit's mouth, a tick at the flame's own edge (×1.5) and a
   shorter one inside the flame's heart (×2.0). It sits BENEATH the fire (z-index 3
   against the fire-zone's 4), so the flame genuinely stands in the target's way —
   what you can see of the fire is what the offering has to hit. */
.aim-sight{position:absolute; inset:0; width:100%; height:100%; z-index:3; pointer-events:none}
.aim-sight .sight-line{stroke:var(--gold-bright); stroke-width:3; stroke-dasharray:2 10; opacity:.34}
.aim-sight .sight-tick{stroke:var(--gold); stroke-width:3; stroke-linecap:round; opacity:.5}
.aim-sight .sight-tick.is-heart{stroke:var(--gold-bright); opacity:.72}

/* the ladder the fire grades by — app.js writes it from the bands it scores with */
.burn-ladder{position:absolute; left:50%; bottom:252px; transform:translateX(-50%); width:340px;
  text-align:center; font-size:12px; line-height:1.55; z-index:20;
  color:rgba(245,240,232,.78); text-shadow:0 2px 6px rgba(0,0,0,.6)}
.burn-ladder b{color:var(--gold-bright); font-size:12.5px}

/* the live readout while a finger is down: what letting go right now is worth */
.aim-live{position:absolute; left:50%; bottom:520px; transform:translateX(-50%); z-index:36;
  padding:8px 16px; border-radius:999px; white-space:nowrap; text-align:center;
  font-size:14px; font-weight:700; letter-spacing:.3px;
  background:rgba(18,20,24,.75); border:2px solid var(--gold); color:var(--gold-bright);
  box-shadow:0 6px 18px rgba(0,0,0,.45)}
.aim-live[data-tier="graze"]{border-color:var(--flame-orange); color:var(--flame-mid)}
.aim-live[data-tier="miss"]{border-color:rgba(245,240,232,.5); color:rgba(245,240,232,.78)}
.aim-live[hidden]{display:none}

.throw-layer{position:absolute; inset:0; z-index:30}
/* The offering is held to the LEFT of the fire — 133px is its own centre line (the
   −50% shift below), because the throw is now aimed: you throw across at the fire
   rather than up from underneath it. app.js measures this box for the aim's origin. */
.held-object{position:absolute; left:133px; bottom:110px; width:132px; cursor:grab; touch-action:none;
  transform:translateX(-50%); transition:transform .3s ease}
.held-object.is-dragging{transition:none; cursor:grabbing}
/* The flight is driven by app.js, frame by frame, along the very curve the dotted
   guide draws — so no transition may fight it… */
.held-object.is-flying{transition:none}
/* …and the glide back to the hand after a miss is a transition, on purpose */
.held-object.is-returning{transition:transform .55s cubic-bezier(.3,.7,.3,1)}
/* consumed by the flame, or left charring on the coals */
.held-object.is-consumed{animation:consumed .3s ease forwards}
.held-object.is-charring{animation:charring .5s ease forwards}
/* an offering that fell in the dirt is not burned, and does not look it */
.held-object[data-tier="miss"] svg{filter:drop-shadow(0 10px 14px rgba(0,0,0,.35)) brightness(.72) saturate(.7)}
@keyframes consumed{from{opacity:1}to{opacity:0}}
@keyframes charring{from{opacity:1}to{opacity:.16; filter:brightness(.4) saturate(.5)}}
.held-object svg{display:block; width:100%; height:auto; filter:drop-shadow(0 10px 14px rgba(0,0,0,.35))}
.held-shadow{position:absolute; bottom:-8px; left:50%; transform:translateX(-50%);
  width:120px; height:15px; border-radius:50%; background:rgba(0,0,0,.4)}
.throw-guide{position:absolute; inset:0; width:100%; height:100%; z-index:1; pointer-events:none;
  transition:opacity .25s ease}
.throw-guide.is-hidden{opacity:0}
.throw-guide .guide-path{stroke:var(--gold-bright); stroke-width:3.4; stroke-linecap:round;
  stroke-dasharray:2 11; opacity:.5; animation:guideFlow 1.35s linear infinite}
.throw-guide .guide-tip{fill:var(--gold-bright); opacity:.55}
@keyframes guideFlow{to{stroke-dashoffset:-26}}

.swipe-hint{position:absolute; left:50%; bottom:26px; transform:translateX(-50%); text-align:center;
  color:var(--paper); cursor:pointer; width:300px; transition:opacity .3s ease}
/* the invitation steps aside while the offering is in the air (or resting in the dirt) */
.swipe-hint.is-hidden{opacity:0; pointer-events:none}
.swipe-hint .chev{display:block; font-size:26px; line-height:1; color:var(--gold-bright); animation:chevBounce 1.3s ease-in-out infinite}
.swipe-hint p{font-size:13px; margin-top:4px; color:rgba(245,240,232,.85); text-shadow:0 2px 6px rgba(0,0,0,.5)}
@keyframes chevBounce{0%,100%{transform:translateY(0); opacity:.7}50%{transform:translateY(-7px); opacity:1}}

.score-pop{position:absolute; left:50%; bottom:480px; z-index:35; pointer-events:none;
  transform:translateX(-50%) translateY(18px); opacity:0; text-align:center;
  color:var(--gold-bright); text-shadow:0 3px 0 rgba(0,0,0,.35), 0 0 24px rgba(255,154,60,.65)}
.score-pop b{display:block; font-family:var(--font-display); font-size:40px; font-weight:700; line-height:1.05}
.score-pop span{display:block; margin-top:3px; font-family:var(--font-body); font-size:13px;
  font-weight:700; letter-spacing:1.4px; color:var(--flame-mid); text-shadow:0 2px 6px rgba(0,0,0,.55)}
.score-pop.is-shown{animation:floatUp 1.5s ease forwards}
/* a miss is not celebrated: the number is muted, because the fire did not take it */
.score-pop.is-miss b{color:rgba(245,240,232,.7); text-shadow:0 3px 0 rgba(0,0,0,.35)}
.score-pop.is-miss span{color:rgba(245,240,232,.62); letter-spacing:1px}
@keyframes floatUp{0%{opacity:0; transform:translateX(-50%) translateY(18px) scale(.8)}
  25%{opacity:1; transform:translateX(-50%) translateY(-6px) scale(1.08)}
  70%{opacity:1; transform:translateX(-50%) translateY(-34px) scale(1)}
  100%{opacity:0; transform:translateX(-50%) translateY(-60px) scale(.96)}}
/* ── ⑤ Reward ── */
#screen-reward{background:var(--paper)}
.reward-hero{margin:16px 20px 6px; text-align:center; z-index:2}
.reward-label{font-size:12px; letter-spacing:3px; text-transform:uppercase; color:var(--ink-soft)}
.reward-points{font-family:var(--font-display); font-size:76px; line-height:1.08; color:var(--ink)}
.reward-underline{width:150px; height:8px; margin:6px auto 0;
  background:var(--gold); clip-path:polygon(0 30%,100% 0,96% 70%,4% 100%)}
/* the aim the throw earned, above the streak */
.aim-badge{display:inline-flex; align-items:center; gap:6px; margin-top:12px; padding:7px 14px;
  border-radius:999px; font-weight:700; font-size:14px;
  background:rgba(212,175,55,.12); border:2px solid rgba(212,175,55,.6); color:var(--gold-deep)}
.reward-hero .streak-chip{margin-top:10px}

.reward-card{margin:18px 20px 0; background:var(--paper); border:3px solid var(--ink);
  border-radius:var(--r-lg); padding:8px 18px; z-index:2; box-shadow:0 10px 24px rgba(26,26,26,.12)}
.reward-row{display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:13px 0; border-bottom:2px dashed var(--paper-edge); font-size:16px; color:var(--ink-soft);
  opacity:0; transform:translateY(10px); transition:opacity .4s ease, transform .4s ease}
.reward-row.is-shown{opacity:1; transform:none}
.reward-row b{color:var(--ink); font-size:17px}
.reward-total{display:flex; justify-content:space-between; align-items:center; padding:14px 0 8px;
  font-size:19px; font-weight:800; color:var(--cinnabar-text);
  opacity:0; transform:translateY(10px); transition:opacity .4s ease, transform .4s ease}
.reward-total.is-shown{opacity:1; transform:none}
.reward-total b{font-size:22px}

.reward-actions{margin-top:auto; display:flex; gap:12px; padding:16px 20px 26px; z-index:2}
.reward-actions .btn{flex:1; font-size:15px; padding:16px 10px}

/* ── ⑥ Leaderboard ── */
#screen-league{background:var(--paper)}
.league-head{display:flex; align-items:center; gap:14px; margin:6px 20px 14px; z-index:2}
.tier-wrap{position:relative; width:70px; height:70px; flex:none}
.tier-wrap::before{content:''; position:absolute; inset:0;
  clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%); background:var(--ink)}
.tier-badge{position:absolute; inset:3px; display:flex; align-items:center; justify-content:center;
  clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.tier-badge span{color:#FFF8E8; font-weight:800; font-size:11px; letter-spacing:1.5px; text-shadow:0 1px 2px rgba(0,0,0,.4)}
.league-meta strong{font-size:17px; color:var(--ink)}
.league-meta p{font-size:12.5px; color:var(--ink-soft); margin-top:2px}

.league-list{list-style:none; flex:1; overflow-y:auto; padding:0 20px 6px; scrollbar-width:none}
.league-list::-webkit-scrollbar{display:none}
.league-row{display:flex; align-items:center; gap:12px; background:#FBF7EE; border:2.5px solid var(--ink);
  border-radius:var(--r-md); padding:11px 13px; margin-bottom:10px}
.league-row.in-zone{background:#F8F1DC}
.league-row.is-you{border-color:var(--gold-deep); background:#FDF8E7; box-shadow:0 0 0 3px rgba(212,175,55,.4)}
.lr-rank{font-family:var(--font-display); font-size:19px; width:26px; text-align:center; color:var(--ink)}
.in-zone .lr-rank{color:var(--gold-text)}
/* the user's own row once a throw has lifted them into the promotion zone */
.league-row.is-you.in-zone .lr-rank{background:var(--gold); color:var(--ink); border-radius:7px}
/* and the row they just took over: a short lift + gold flash, once */
.league-row.is-moved{animation:leagueMove 1s cubic-bezier(.3,0,.2,1) both}
@keyframes leagueMove{
  0%{transform:translateY(16px) scale(.985); background:rgba(212,175,55,.34)}
  60%{transform:translateY(-2px); background:rgba(212,175,55,.18)}
  100%{transform:none; background:transparent}}
.lr-avatar{width:40px; height:40px; border-radius:50%; flex:none; display:flex; align-items:center;
  justify-content:center; color:#FFF8E8; font-weight:700; font-size:16px; border:2.5px solid var(--ink)}
.lr-name{font-size:15px; font-weight:600; color:var(--ink)}
.lr-name em{font-style:normal; font-size:11px; color:var(--malachite-text); margin-left:6px; font-weight:800}
.lr-points{margin-left:auto; font-weight:800; font-size:15px; color:var(--ink)}
.league-divider{list-style:none; text-align:center; font-size:11px; letter-spacing:2px;
  padding:12px 0 4px;
  color:var(--gold-text); text-transform:uppercase; margin:2px 0 10px}
.league-note{padding:0 24px 18px; font-size:11.5px; color:var(--ink-soft); text-align:center}

/* ── Toast ── */
.toast{position:fixed; left:50%; bottom:44px; z-index:99; padding:12px 20px; border-radius:999px;
  background:var(--ink); color:var(--paper); font-size:14px; opacity:0; pointer-events:none;
  transform:translateX(-50%) translateY(16px); transition:opacity .3s ease, transform .3s ease}
.toast.is-shown{opacity:1; transform:translateX(-50%) translateY(0)}

/* ── Responsive review helper ── */
@media (max-height:980px){
  body{padding-top:12px}
  .phone{transform:scale(.86); transform-origin:top center; margin-bottom:-118px}
}
