:root{
  --night:#0B1030; --indigo:#161E4D; --lake:#1B2A5C; --washi:#F4EAD6; --washi-2:#E3D3B4; --ink:#2A2238;
  --gold:#E8B85C; --gold-hi:#FFE3A1; --vermilion:#D2412F; --jade:#4E9B7E;
  --fiber:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.012 .32' numOctaves='3' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .95  0 0 0 0 .85  0 0 0 .35 -.05'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>");
  --paper:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .4  0 0 0 0 .3  0 0 0 0 .2  0 0 0 .16 0'/></filter><rect width='100%' height='100%' filter='url(%23p)'/></svg>");
}
*{box-sizing:border-box; margin:0; padding:0}
[hidden]{display:none!important}
html,body{height:100%}
body{
  min-height:100dvh; display:grid; place-items:center; overflow:hidden;
  font-family:"Zen Kaku Gothic New",sans-serif; color:var(--washi);
  -webkit-tap-highlight-color:transparent; -webkit-user-select:none; user-select:none;
  overscroll-behavior:none;
  background-color:#0A0E2A;
  background-image:
    radial-gradient(circle at 100% 150%,#0A0E2A 24%,#141B45 24% 28%,#0A0E2A 28% 36%,#141B45 36% 40%,transparent 40%),
    radial-gradient(circle at 0 150%,#0A0E2A 24%,#141B45 24% 28%,#0A0E2A 28% 36%,#141B45 36% 40%,transparent 40%),
    radial-gradient(circle at 50% 100%,#141B45 10%,#0A0E2A 10% 23%,#141B45 23% 30%,#0A0E2A 30% 43%,#141B45 43% 50%,#0A0E2A 50% 63%,#141B45 63% 71%,transparent 71%),
    radial-gradient(circle at 100% 50%,#141B45 5%,#0A0E2A 5% 15%,#141B45 15% 20%,#0A0E2A 20% 29%,#141B45 29% 34%,#0A0E2A 34% 44%,#141B45 44% 49%,transparent 49%),
    radial-gradient(circle at 0 50%,#141B45 5%,#0A0E2A 5% 15%,#141B45 15% 20%,#0A0E2A 20% 29%,#141B45 29% 34%,#0A0E2A 34% 44%,#141B45 44% 49%,transparent 49%);
  background-size:96px 48px;
}
button{font:inherit; color:inherit; cursor:pointer}
button:focus-visible{outline:.6cqw solid var(--gold-hi); outline-offset:.6cqw}

/* ---------- STAGE: portrait column, centred on wide screens ---------- */
.stage{
  position:relative; width:min(100vw,60dvh,520px); height:100dvh;
  overflow:hidden; container-type:size; touch-action:none;
  background:
    radial-gradient(circle at 50% 54%,rgba(232,184,92,.34) 0,rgba(232,184,92,.1) 26cqw,transparent 60cqw),
    radial-gradient(ellipse 120% 70% at 50% 54%,var(--lake) 0,var(--indigo) 55%,var(--night) 100%);
  box-shadow:0 0 0 1px rgba(232,184,92,.25),0 40px 100px rgba(0,0,0,.6);
}
@media (min-width:600px){
  .stage{box-shadow:0 0 0 1px rgba(232,184,92,.25),0 0 0 14px #0A0E2A,0 0 0 15px rgba(232,184,92,.35),0 40px 100px rgba(0,0,0,.6)}
}

/* ---------- POND ---------- */
.water{position:absolute; inset:0; overflow:hidden; pointer-events:none}
.water::after{content:""; position:absolute; inset:0; background:var(--fiber) 0 0/100% 100%; opacity:.45; mix-blend-mode:screen}
.water::before{
  content:""; position:absolute; left:50%; top:54%; width:240cqw; height:240cqw; margin:-120cqw 0 0 -120cqw; border-radius:50%;
  background:repeating-radial-gradient(circle,transparent 0 5.6cqw,rgba(244,234,214,.05) 5.6cqw 5.9cqw);
  transform:scaleY(.82);
}
.moon{position:absolute; right:10cqw; top:30cqh; width:22cqw; height:6cqw; border-radius:50%;
  background:repeating-linear-gradient(180deg,rgba(255,240,200,.5) 0 .6cqw,transparent .6cqw 1.4cqw);
  filter:blur(.3cqw); animation:shimmer 4s ease-in-out infinite alternate}
@keyframes shimmer{to{transform:scaleX(1.25) translateX(-1cqw); opacity:.6}}
.pad{position:absolute; width:var(--s); height:var(--s); left:var(--l); top:var(--t); transform:rotate(var(--r,0deg)); opacity:.9}
.pad svg{width:100%; height:100%; display:block}
.petal{position:absolute; width:2.6cqw; height:1.6cqw; border-radius:50% 50% 50% 50%/80% 80% 20% 20%; background:#F2B8B0; opacity:.75; animation:float 9s ease-in-out infinite alternate}
@keyframes float{to{transform:translate(3cqw,-2cqw) rotate(80deg)}}
.mote{position:absolute; width:.9cqw; height:.9cqw; border-radius:50%; background:var(--gold-hi); box-shadow:0 0 1.6cqw .6cqw rgba(255,214,120,.45); animation:blink 3.4s ease-in-out infinite, drift 12s ease-in-out infinite alternate}
@keyframes blink{0%,100%{opacity:.1}45%,60%{opacity:.8}}
@keyframes drift{to{translate:4cqw -6cqw}}

/* ---------- LANTERN ---------- */
.shrine{position:absolute; left:50%; top:54%; width:0; height:0; z-index:3; pointer-events:none}
.shrine .ripple{position:absolute; width:46cqw; height:46cqw; left:-23cqw; top:-23cqw; border-radius:50%; border:.35cqw solid rgba(255,227,161,.45); animation:ripple 6s ease-out infinite}
.shrine .ripple:nth-child(2){animation-delay:2s}.shrine .ripple:nth-child(3){animation-delay:4s}
@keyframes ripple{0%{transform:scale(.7); opacity:0}15%{opacity:1}100%{transform:scale(1.55); opacity:0}}
.halo{position:absolute; width:56cqw; height:56cqw; left:-28cqw; top:-28cqw; border-radius:50%;
  background:radial-gradient(circle,rgba(255,214,120,.55),rgba(255,180,80,.18) 40%,transparent 70%);
  animation:flicker 2.6s ease-in-out infinite; transition:opacity .6s}
@keyframes flicker{0%,100%{opacity:.9; transform:scale(1)}20%{opacity:.75; transform:scale(.97)}45%{opacity:1; transform:scale(1.03)}70%{opacity:.82}}
.lotus{position:absolute; width:36cqw; height:36cqw; left:-18cqw; top:-18cqw; filter:drop-shadow(0 1.4cqw 2cqw rgba(0,0,0,.45)); transition:filter .6s}
.lotus .flame{animation:flicker 1.3s ease-in-out infinite; transform-origin:50px 50px}
.stage[data-lives="2"] .halo{opacity:.7}
.stage[data-lives="1"] .halo{opacity:.4}
.stage[data-lives="1"] .lotus .flame{animation-duration:.5s}
.stage[data-lives="0"] .halo,.stage[data-lives="0"] .lotus .flame{opacity:0; animation:none}
.stage[data-lives="0"] .lotus{filter:drop-shadow(0 1.4cqw 2cqw rgba(0,0,0,.45)) grayscale(.6) brightness(.6)}
.shrine.hurt .lotus{animation:hurt .6s ease-out}
@keyframes hurt{0%{transform:scale(1)}15%{transform:scale(.88) rotate(-6deg); filter:drop-shadow(0 0 4cqw rgba(210,65,47,.9))}45%{transform:scale(1.04) rotate(3deg)}100%{transform:scale(1)}}

/* ---------- VISITORS ---------- */
.layer,.fx{position:absolute; inset:0; pointer-events:none}
.layer{z-index:5}
.fx{z-index:8}
.foe{position:absolute; left:0; top:0; will-change:transform,opacity; opacity:0}
.foe::before{
  content:""; position:absolute; left:0; top:0; width:80%; aspect-ratio:2.2; transform:translate(-50%,-10%);
  border-radius:50%; background:radial-gradient(closest-side,rgba(3,6,24,.5),transparent);
}
.foe .sprite{position:absolute; left:0; top:0; width:100%}
.foe svg{display:block; width:100%; height:auto; overflow:visible}
.foe.wrong svg{animation:shake .36s ease-in-out}
@keyframes shake{20%{transform:translateX(-6%) rotate(-6deg)}40%{transform:translateX(6%) rotate(5deg)}60%{transform:translateX(-4%)}80%{transform:translateX(3%)}}
.foe.pending::after{
  content:""; position:absolute; left:0; top:0; width:80%; aspect-ratio:1; transform:translate(-50%,-50%);
  border-radius:50%; border:.6cqw solid var(--gold-hi); box-shadow:0 0 2cqw rgba(255,214,120,.8);
  animation:pend .42s ease-out forwards;
}
@keyframes pend{from{opacity:1; scale:.6}to{opacity:0; scale:1.25}}
.foe.snuffed{transition:none}
.foe.snuffed .sprite svg{animation:snuff .6s ease-in forwards}
@keyframes snuff{to{transform:scale(.1) rotate(160deg); opacity:0; filter:brightness(2) sepia(1)}}

/* folded-paper life: flaps, paddles, tails */
svg [class^="a-"]{transform-box:fill-box}
.a-tail{transform-origin:100% 50%; animation:tail .45s ease-in-out infinite alternate}
@keyframes tail{from{transform:rotate(-12deg) scaleY(1)}to{transform:rotate(12deg) scaleY(.85)}}
.a-wing{transform-origin:50% 100%; animation:wing .8s ease-in-out infinite alternate}
@keyframes wing{to{transform:scaleY(.6)}}
.a-paddle{transform-origin:center; animation:paddle 1s ease-in-out infinite alternate}
.a-paddle.b{animation-direction:alternate-reverse}
@keyframes paddle{from{transform:rotate(-14deg)}to{transform:rotate(14deg)}}
.a-buzz{transform-origin:center; animation:buzz .07s linear infinite alternate}
@keyframes buzz{to{transform:scaleY(.55)}}
.a-flutter{transform-origin:center; animation:flut .2s ease-in-out infinite alternate}
@keyframes flut{to{transform:scaleX(.7)}}
.a-flap{transform-origin:50% 30%; animation:flap .3s ease-in-out infinite alternate}
@keyframes flap{to{transform:scaleY(.5)}}
.a-flap-s{transform-origin:20% 50%; animation:paddle .6s ease-in-out infinite alternate}
.a-walk{transform-origin:center; animation:walk .25s ease-in-out infinite alternate}
.a-walk.b{animation-direction:alternate-reverse}
@keyframes walk{from{transform:rotate(-18deg)}to{transform:rotate(18deg)}}
.a-row{transform-origin:0 50%; animation:paddle .5s ease-in-out infinite alternate}
.a-stalk{transform-origin:0 100%; animation:paddle 2s ease-in-out infinite alternate}
.a-glow{transform-origin:center; animation:glow 1.4s ease-in-out infinite}
@keyframes glow{50%{opacity:.35; transform:scale(.8)}}
.a-blink{transform-origin:center; animation:eyes 4s steps(1) infinite}
@keyframes eyes{0%,92%,100%{transform:scaleY(1)}94%{transform:scaleY(.1)}}
.a-wingL,.a-wingR{transform-origin:50% 0; animation:paddle 1.6s ease-in-out infinite alternate}
.a-wingR{animation-direction:alternate-reverse}
@media (prefers-reduced-motion:reduce){
  .a-tail,.a-wing,.a-paddle,.a-buzz,.a-flutter,.a-flap,.a-flap-s,.a-walk,.a-row,.a-stalk,.a-glow,.a-blink,.a-wingL,.a-wingR,.mote,.petal,.moon,.shrine .ripple{animation:none}
}

/* feedback */
.pop{
  position:absolute; transform:translate(-50%,-50%); font:800 6cqw/1 "Shippori Mincho B1"; color:var(--gold-hi);
  text-shadow:0 0 2cqw rgba(232,184,92,.8),0 .3cqw 0 rgba(0,0,0,.4); animation:pop .9s ease-out forwards; white-space:nowrap;
}
.pop.great{font-size:7.4cqw; color:#FFF6D8}
.pop.close{font-size:4.8cqw; color:#F2B8B0}
@keyframes pop{0%{opacity:0; translate:0 1cqw; scale:.6}20%{opacity:1; scale:1.1}100%{opacity:0; translate:0 -9cqw; scale:1}}
.touch-ripple{position:absolute; width:12cqw; height:12cqw; margin:-6cqw 0 0 -6cqw; border-radius:50%; border:.4cqw solid rgba(244,234,214,.5); animation:touch .6s ease-out forwards}
@keyframes touch{from{transform:scale(.2); opacity:1}to{transform:scale(1.4); opacity:0}}

/* ---------- HUD ---------- */
.hud-top,.hud-bottom{position:absolute; left:0; right:0; z-index:20; transition:opacity .4s, translate .4s}
.hud-top{top:0; padding:calc(env(safe-area-inset-top) + 4cqw) 6cqw 0; display:grid; grid-template-columns:1fr auto; gap:2.4cqw 4cqw; pointer-events:none}
.hud-left{display:flex; gap:3cqw; align-items:center}
.brand-seal{writing-mode:vertical-rl; background:var(--vermilion); color:var(--washi); font:800 5cqw/1 "Shippori Mincho B1"; padding:1.4cqw .9cqw; border-radius:.8cqw; filter:url(#rough)}
.brand-seal.small{font-size:3.6cqw; padding:1cqw .7cqw}
.night small,.kept small{display:block; font:400 2.2cqw/1 "Zen Kaku Gothic New"; letter-spacing:.24em; text-transform:uppercase; color:rgba(244,234,214,.6)}
.night b{display:block; font:800 9cqw/1.05 "Shippori Mincho B1"; color:var(--washi)}
.kept{text-align:right}
.kept b{display:block; font:700 9cqw/1.05 "Shippori Mincho B1"; color:var(--gold-hi); text-shadow:0 0 3cqw rgba(232,184,92,.5); font-variant-numeric:tabular-nums}
.hud-row{grid-column:1/-1; display:flex; align-items:center; gap:3cqw}
.moons{display:flex; gap:1.6cqw}
.moons i{width:3.6cqw; height:3.6cqw; border-radius:50%; background:#2A3266; transition:background .3s, box-shadow .3s}
.moons i.full{background:var(--gold); box-shadow:0 0 2cqw rgba(232,184,92,.8)}
.moons i.now{background:radial-gradient(circle at 70% 50%,var(--gold) 0 45%,#2A3266 47%); outline:.35cqw solid var(--gold-hi); outline-offset:.5cqw}
.candles{margin-left:auto; display:flex; gap:2.6cqw; align-items:flex-end; height:9cqw}
.candle{position:relative; width:1.8cqw; height:4.6cqw; background:linear-gradient(90deg,#E9DCC2,#FFF6E4 40%,#D8C8A8); border-radius:.3cqw .3cqw .2cqw .2cqw}
.candle::before{content:""; position:absolute; left:50%; bottom:100%; width:2.2cqw; height:3.6cqw; margin-left:-1.1cqw;
  border-radius:50% 50% 50% 50%/60% 60% 40% 40%; background:radial-gradient(ellipse at 50% 75%,#fff 0 20%,var(--gold-hi) 35%,#FF9A3C 75%);
  box-shadow:0 0 2.4cqw rgba(255,190,90,.8); animation:flicker 1.1s ease-in-out infinite; transform-origin:50% 100%}
.candle.out::before{background:none; box-shadow:none; border-left:.35cqw solid rgba(244,234,214,.35); border-radius:50%; width:1.6cqw; animation:none; transform:skewX(-14deg)}
.candle.relit::before{animation:relight .8s ease-out, flicker 1.1s ease-in-out .8s infinite}
@keyframes relight{from{transform:scale(0)}60%{transform:scale(1.6)}to{transform:scale(1)}}
.hud-bottom{bottom:0; padding:0 6cqw calc(env(safe-area-inset-bottom) + 5cqw); display:flex; align-items:flex-end; justify-content:space-between; pointer-events:none}
.best{font:italic 500 3.2cqw/1 "Shippori Mincho B1"; color:rgba(244,234,214,.7)}
.best b{font-style:normal; color:var(--gold)}
.fan{
  pointer-events:auto; width:13cqw; height:13cqw; border-radius:50%; border:0; display:grid; place-items:center; color:var(--ink);
  background:var(--washi) var(--paper); box-shadow:0 0 0 .8cqw rgba(244,234,214,.15),0 1.6cqw 3cqw rgba(0,0,0,.5);
}
.fan svg{width:6cqw; height:6cqw}
.stage[data-mode="title"] .hud-top,.stage[data-mode="title"] .hud-bottom,
.stage[data-mode="help"] .hud-top,.stage[data-mode="help"] .hud-bottom,
.stage[data-mode="scores"] .hud-top,.stage[data-mode="scores"] .hud-bottom{opacity:0; translate:0 -3cqw; pointer-events:none}
.stage:not([data-mode="play"]) .fan{visibility:hidden}

/* ---------- SCREENS ---------- */
.screen{position:absolute; inset:0; z-index:30; display:none}
.stage[data-mode="title"] #screen-title,
.stage[data-mode="card"] #screen-card,
.stage[data-mode="help"] #screen-help,
.stage[data-mode="scores"] #screen-scores{display:flex}

/* title */
.title{flex-direction:column; justify-content:space-between; padding:calc(env(safe-area-inset-top) + 8cqw) 7cqw calc(env(safe-area-inset-bottom) + 7cqw);
  background:linear-gradient(180deg,rgba(11,16,48,.75),transparent 28%,transparent 60%,rgba(11,16,48,.9) 80%)}
.title-head{display:flex; gap:3.4cqw; align-items:flex-start; animation:rise .9s cubic-bezier(.2,.8,.2,1) both}
.title-intro{display:grid; gap:3cqw}
.title-intro .lede{font-size:3cqw; line-height:1.4}
.brand-seal.big{font-size:7cqw; padding:2cqw 1.3cqw}
.title h1{font:800 14cqw/.9 "Shippori Mincho B1"; letter-spacing:-.01em; color:var(--washi); text-shadow:0 1cqw 4cqw rgba(0,0,0,.5)}
.title h1 span{display:block; font:500 2.8cqw/1 "Zen Kaku Gothic New"; letter-spacing:.36em; color:var(--gold); margin-top:3cqw; text-transform:uppercase}
.title-foot{display:grid; gap:5cqw; animation:rise .9s cubic-bezier(.2,.8,.2,1) .15s both}
.lede{font:italic 500 3.6cqw/1.5 "Shippori Mincho B1"; color:rgba(244,234,214,.85); max-width:80cqw}
@keyframes rise{from{opacity:0; transform:translateY(4cqw)}}
.menu{display:grid; gap:3cqw}
.menu-row{display:grid; grid-template-columns:1fr 1fr; gap:3cqw}

/* washi slip buttons with hanko seals */
.btn{display:flex; align-items:stretch; gap:2cqw; border:0; background:none; text-align:left; transition:transform .15s}
.btn:active{transform:scale(.97)}
.btn .seal{
  width:16cqw; flex:none; background:var(--vermilion); color:var(--washi); border-radius:1.6cqw; display:grid; place-items:center;
  filter:url(#rough); box-shadow:0 0 0 .3cqw rgba(210,65,47,.25); position:relative;
}
.btn .seal::before{content:""; position:absolute; inset:1.1cqw; border:.35cqw solid rgba(244,234,214,.85); border-radius:.8cqw}
.btn .seal svg{width:8cqw; height:8cqw}
.btn .slip{
  flex:1; background:var(--washi); color:var(--ink); padding:3cqw 4cqw; display:grid; align-content:center;
  background-image:var(--fiber); background-blend-mode:multiply; clip-path:polygon(0 0,100% 3%,98% 100%,2% 96%);
}
.btn .slip b{font:800 5cqw/1 "Shippori Mincho B1"}
.btn .slip i{font:italic 500 2.8cqw/1.3 "Shippori Mincho B1"; color:#6B5A48; margin-top:.8cqw}
.btn.primary .slip b{font-size:7cqw; color:var(--vermilion)}
.btn.primary{min-height:19cqw}
.menu-row .slip{padding:3cqw 3.4cqw}
.menu-row .slip b{font-size:4.4cqw}
.install-btn{border:.3cqw solid rgba(232,184,92,.5); background:rgba(232,184,92,.06); color:var(--gold-hi); padding:2cqw 3cqw; font:700 3.2cqw/1.2 "Shippori Mincho B1"; text-align:left}
.install-btn span{float:right; font:italic 500 2.6cqw/1.4 "Shippori Mincho B1"; color:var(--gold)}
.install-status{font-size:3cqw; color:var(--gold-hi)}
.install-btn:disabled{opacity:.6; cursor:wait}
#difficultyBadge{color:var(--gold); letter-spacing:.08em; margin-left:1cqw}

/* modal cards */
.card-screen{align-items:center; justify-content:center; padding:6cqw; background:rgba(8,11,36,.55); -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px)}
.card{
  width:100%; max-height:100%; overflow:auto; color:var(--ink); padding:7cqw 6cqw 6cqw; position:relative;
  background:var(--washi) var(--fiber); background-blend-mode:multiply;
  clip-path:polygon(0 1%,100% 0,99% 99%,1% 100%);
  box-shadow:0 4cqw 8cqw rgba(0,0,0,.5); animation:unfold .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes unfold{from{opacity:0; transform:translateY(5cqw) rotate(-1.5deg) scale(.96)}}
.card .eyebrow{font:700 2.4cqw/1 "Zen Kaku Gothic New"; letter-spacing:.3em; text-transform:uppercase; color:var(--vermilion)}
.card h2{font:800 11cqw/1 "Shippori Mincho B1"; margin:2cqw 0 1cqw}
.card .sub{font:italic 500 3.4cqw/1.45 "Shippori Mincho B1"; color:#5B4A3A}
.card .facts{display:flex; gap:2cqw; flex-wrap:wrap; margin:4cqw 0}
.card .facts span{font:700 2.6cqw/1 "Zen Kaku Gothic New"; letter-spacing:.06em; padding:1.6cqw 2.4cqw; border:.3cqw solid rgba(42,34,56,.25); border-radius:5cqw}
.card .facts span.hot{background:var(--vermilion); color:var(--washi); border-color:var(--vermilion)}
.card .actions{display:grid; gap:2.6cqw; margin-top:5cqw}
.card .actions .btn .slip{background-color:#FBF4E6; box-shadow:inset 0 0 0 .3cqw rgba(42,34,56,.12)}
.card .actions .btn.primary .seal{width:14cqw}
.card .big-score{font:800 16cqw/1 "Shippori Mincho B1"; color:var(--vermilion); margin:3cqw 0 1cqw; font-variant-numeric:tabular-nums}
.card .stamp{display:inline-block; margin-top:2cqw; padding:1.4cqw 2.6cqw; border:.5cqw solid var(--vermilion); color:var(--vermilion); font:800 3.4cqw/1 "Shippori Mincho B1"; transform:rotate(-6deg); filter:url(#rough); animation:stamp .5s cubic-bezier(.3,1.6,.5,1) .3s both}
@keyframes stamp{from{transform:rotate(-6deg) scale(2.4); opacity:0}}

/* newcomer showcase on the night card */
.newcomer{display:grid; grid-template-columns:30cqw 1fr; gap:4cqw; align-items:center; margin-top:4cqw; padding-top:4cqw; border-top:.3cqw dashed rgba(42,34,56,.25)}
.newcomer .eyebrow{display:block; margin-bottom:1.4cqw}
.newcomer h3{font:800 6cqw/1.05 "Shippori Mincho B1"}
.newcomer p{font:italic 500 3cqw/1.4 "Shippori Mincho B1"; color:#5B4A3A; margin-top:1.4cqw}
.gesture-tag{display:inline-flex; align-items:center; gap:1.6cqw; margin-top:2.4cqw; font:800 3.6cqw/1 "Shippori Mincho B1"; color:var(--vermilion)}
.gesture-tag .mini-seal{width:8cqw; height:8cqw; display:grid; place-items:center; background:var(--vermilion); color:var(--washi); border-radius:1cqw; filter:url(#rough)}
.gesture-tag .mini-seal svg{width:5.4cqw; height:5.4cqw}

.art{position:relative; aspect-ratio:1; border-radius:50%; display:grid; place-items:center; overflow:hidden;
  background:radial-gradient(circle at 50% 45%,#22306A,#141B45 70%); box-shadow:inset 0 0 0 .5cqw rgba(232,184,92,.4)}
.art svg{width:76%; height:auto; overflow:visible; transform:rotate(var(--turn,0deg))}
.art.tall svg{width:60%}

/* animated finger showing the gesture */
.demo{position:absolute; inset:0; pointer-events:none}
.demo::before{content:""; position:absolute; left:50%; top:50%; width:20%; height:20%; margin:-10% 0 0 -10%; border-radius:50%;
  background:rgba(255,251,234,.9); box-shadow:0 0 0 1.4cqw rgba(255,251,234,.25),0 0 3cqw rgba(255,227,161,.8); opacity:0}
.demo[data-g="tap"]::before{animation:d-tap 1.6s ease-out infinite}
.demo[data-g="double-tap"]::before{animation:d-dbl 1.8s ease-out infinite}
.demo[data-g="flick-left"]::before{--dx:-60%; --dy:0%; animation:d-flick 1.6s cubic-bezier(.2,.8,.3,1) infinite}
.demo[data-g="flick-right"]::before{--dx:60%; --dy:0%; animation:d-flick 1.6s cubic-bezier(.2,.8,.3,1) infinite}
.demo[data-g="flick-up"]::before{--dx:0%; --dy:-60%; animation:d-flick 1.6s cubic-bezier(.2,.8,.3,1) infinite}
.demo[data-g="flick-down"]::before{--dx:0%; --dy:60%; animation:d-flick 1.6s cubic-bezier(.2,.8,.3,1) infinite}
.demo[data-g="scrub"]::before{animation:d-scrub 2s ease-in-out infinite}
.demo[data-g="scrub-vertical"]::before{animation:d-scrub-vertical 2s ease-in-out infinite}
@keyframes d-tap{0%,20%{opacity:0; transform:scale(1.6)}30%{opacity:1; transform:scale(.8)}50%{opacity:1; transform:scale(1)}70%,100%{opacity:0}}
@keyframes d-dbl{0%,10%{opacity:0; transform:scale(1.6)}18%{opacity:1; transform:scale(.8)}28%{opacity:.4; transform:scale(1.1)}36%{opacity:1; transform:scale(.8)}55%{opacity:1; transform:scale(1)}70%,100%{opacity:0}}
@keyframes d-flick{0%,15%{opacity:0; translate:0 0}25%{opacity:1; translate:0 0}55%{opacity:1; translate:calc(var(--dx)*4) calc(var(--dy)*4)}70%,100%{opacity:0; translate:calc(var(--dx)*4.6) calc(var(--dy)*4.6)}}
@keyframes d-scrub{0%,10%{opacity:0; translate:0 0}20%{opacity:1; translate:0 0; transform:scale(.85)}45%{translate:-160% 0}75%{opacity:1; translate:160% 0}90%,100%{opacity:0; translate:160% 0}}
@keyframes d-scrub-vertical{0%,10%{opacity:0; translate:0 0}20%{opacity:1; translate:0 0; transform:scale(.85)}45%{translate:0 -160%}75%{opacity:1; translate:0 0}90%,100%{opacity:0; translate:0 0}}

/* ---------- SHEETS (guide & scores) ---------- */
.sheet{flex-direction:column; background:linear-gradient(180deg,rgba(11,16,48,.97),rgba(16,22,60,.97)); animation:sheet .35s cubic-bezier(.2,.8,.2,1)}
@keyframes sheet{from{opacity:0; transform:translateY(4cqw)}}
.sheet-head{display:flex; justify-content:space-between; align-items:flex-start; gap:4cqw; padding:calc(env(safe-area-inset-top) + 6cqw) 6cqw 4cqw; border-bottom:.3cqw solid rgba(232,184,92,.25)}
.sheet-head h2{font:800 9cqw/1 "Shippori Mincho B1"}
.sheet-head h2 span{display:block; font:italic 500 3cqw/1.3 "Shippori Mincho B1"; color:var(--gold); margin-top:1.6cqw}
.close{flex:none; width:11cqw; height:11cqw; border-radius:50%; border:0; background:var(--washi); color:var(--ink); display:grid; place-items:center}
.close svg{width:5cqw; height:5cqw}
.sheet-body{flex:1; overflow:auto; padding:4cqw 6cqw calc(env(safe-area-inset-bottom) + 8cqw); touch-action:pan-y; -webkit-overflow-scrolling:touch}
.set-title{display:flex; align-items:baseline; justify-content:space-between; gap:3cqw; margin:4cqw 0 3cqw; font:800 5cqw/1 "Shippori Mincho B1"; color:var(--washi)}
.set-title small{font:400 2.4cqw/1.3 "Zen Kaku Gothic New"; letter-spacing:.14em; text-transform:uppercase; color:var(--gold); text-align:right}
.difficulty{margin:4cqw 0 5cqw; padding:4cqw; border:.3cqw solid rgba(232,184,92,.4); background:rgba(232,184,92,.06)}
.difficulty h3{font:800 5cqw/1 "Shippori Mincho B1"; color:var(--gold-hi); margin-bottom:3cqw}
.difficulty-options{display:grid; grid-template-columns:1fr 1fr; gap:2cqw; margin-bottom:3cqw}
.difficulty-options button{border:.3cqw solid rgba(244,234,214,.25); padding:2.6cqw; background:transparent; font:800 4cqw/1 "Shippori Mincho B1"}
.difficulty-options button[aria-pressed="true"]{background:var(--washi) var(--paper); color:var(--vermilion); border-color:var(--washi)}
.difficulty-options button:disabled{cursor:not-allowed; opacity:.65}
.difficulty p{font:500 3cqw/1.5 "Zen Kaku Gothic New"; color:rgba(244,234,214,.8)}
.visitors{list-style:none; display:grid; gap:3cqw}
.visitor{display:grid; grid-template-columns:22cqw 1fr; gap:4cqw; align-items:center; padding:3cqw; border-radius:2cqw; background:rgba(244,234,214,.06); box-shadow:inset 0 0 0 .3cqw rgba(244,234,214,.08)}
.visitor h3{font:800 5cqw/1.05 "Shippori Mincho B1"; color:var(--washi)}
.visitor p{font:italic 500 2.9cqw/1.4 "Shippori Mincho B1"; color:rgba(244,234,214,.75); margin-top:1.2cqw}
.visitor .gesture-tag{color:var(--gold-hi); margin-top:1.6cqw; font-size:3.4cqw}
.visitor .when{display:inline-block; margin-top:1.6cqw; font:700 2.2cqw/1 "Zen Kaku Gothic New"; letter-spacing:.16em; text-transform:uppercase; color:var(--gold)}
.visitor.locked .art{filter:grayscale(1) brightness(.55); opacity:.6}
.visitor.locked h3,.visitor.locked p,.visitor.locked .gesture-tag{color:rgba(244,234,214,.38)}
.visitor.locked .mini-seal{background:#4A4F6E}
.visitor.locked .when{color:rgba(244,234,214,.5)}
.visitor .when.new{background:var(--vermilion); color:var(--washi); padding:1cqw 1.8cqw; border-radius:5cqw}

.scores{list-style:none; display:grid; gap:2cqw; counter-reset:rank}
.scores li{display:grid; grid-template-columns:9cqw 1fr auto; align-items:center; gap:3cqw; padding:3cqw 3.4cqw; border-radius:2cqw; background:rgba(244,234,214,.06)}
.scores li::before{counter-increment:rank; content:counter(rank); font:800 5cqw/1 "Shippori Mincho B1"; color:var(--gold)}
.scores li:first-child{background:rgba(232,184,92,.16); box-shadow:inset 0 0 0 .3cqw rgba(232,184,92,.5)}
.scores li.me{box-shadow:inset 0 0 0 .4cqw var(--vermilion)}
.scores b{font:700 6cqw/1 "Shippori Mincho B1"; color:var(--gold-hi); font-variant-numeric:tabular-nums}
.scores small{display:block; font:400 2.4cqw/1.3 "Zen Kaku Gothic New"; letter-spacing:.08em; color:rgba(244,234,214,.6); text-align:right}
.empty{font:italic 500 3.6cqw/1.5 "Shippori Mincho B1"; color:rgba(244,234,214,.7); padding:8cqw 0; text-align:center}
.card .scores li{background:rgba(42,34,56,.06)}
.card .scores li::before{color:var(--vermilion)}
.card .scores b{color:var(--ink); font-size:5cqw}
.card .scores small{color:#6B5A48}
.card .scores li:first-child{background:rgba(232,184,92,.25); box-shadow:none}
.card .scores li.me{box-shadow:inset 0 0 0 .4cqw var(--vermilion)}

/* ---------- ROTATE PROMPT (landscape phones) ---------- */
.rotate{position:absolute; inset:0; z-index:60; display:none; place-items:center; text-align:center; background:var(--night); color:var(--washi)}
.rotate svg{width:20cqh; height:20cqh; color:var(--gold); animation:turn 2.4s ease-in-out infinite}
.rotate p{font:700 5cqh/1.4 "Shippori Mincho B1"; margin-top:4cqh}
@keyframes turn{0%,30%{transform:rotate(-90deg)}60%,100%{transform:rotate(0)}}
@media (orientation:landscape) and (max-height:540px){
  .stage{width:100vw}
  .rotate{display:grid}
}
