/* Yosumi – Look „Washi & Hanko“: Papier, Tusche, Stempel. Referenz: docs/design/mockup.html */
@font-face{font-family:"Shippori Mincho";src:url(fonts/shippori-mincho-700.woff2) format("woff2");font-weight:500 900;font-style:normal;font-display:swap}
@font-face{font-family:"Zen Kaku Gothic New";src:url(fonts/zen-kaku-gothic-new-400.woff2) format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Zen Kaku Gothic New";src:url(fonts/zen-kaku-gothic-new-700.woff2) format("woff2");font-weight:700;font-style:normal;font-display:swap}

:root{
  --paper:#EFE7D6; --paper-hi:#F6F0E2; --ink:#1B1A17; --red:#D8412F; --indigo:#27456B; --pine:#4F7A5A; --ocker:#D9A441;
  --gold:#B8923A; --gold-hi:#E9D08C; --muted:#7A7263;
  --sheet:rgba(255,251,240,.56);            /* helles Papier über der Faser-Textur (≈ #F6F0E2) */
  --mincho:"Shippori Mincho","Hiragino Mincho ProN","Yu Mincho","Songti SC",Georgia,serif;
  --gothic:"Zen Kaku Gothic New","Hiragino Sans","Yu Gothic",-apple-system,"Segoe UI",system-ui,sans-serif;
  --gap:14px; --toph:52px; --tileh:78px; --barh:52px; --lift:-12px; --handgap:14px;
}
@media (max-height:760px){ :root{ --gap:10px; --tileh:68px; --barh:48px; --handgap:12px } }
@media (max-height:640px){ :root{ --gap:7px; --toph:44px; --tileh:56px; --barh:46px; --lift:-6px; --handgap:9px } }

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--paper);color:var(--ink);font-family:var(--gothic);overflow:hidden;overscroll-behavior:none;
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-text-size-adjust:100%;touch-action:manipulation}
button{font:inherit;color:inherit;border:0;background:none;padding:0;margin:0;cursor:pointer;touch-action:manipulation}
#paper{position:fixed;inset:0;width:100%;height:100%;z-index:0;pointer-events:none}
svg.defs{position:absolute}

.lbl{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);font-weight:400;white-space:nowrap}
.lbl.plain{text-transform:none;letter-spacing:.04em}
.num{font-family:var(--mincho);font-weight:700;font-variant-numeric:tabular-nums lining-nums}
.hanko{flex:none;display:inline-flex;align-items:center;justify-content:center;text-align:center;width:36px;height:36px;border-radius:5px 6px 5px 7px;
  background:var(--red);color:var(--paper-hi);font-family:var(--mincho);font-weight:700;font-size:13px;line-height:1.02;
  box-shadow:inset 0 0 0 1.5px rgba(246,240,226,.55),inset 0 0 0 3px var(--red);transform:rotate(-3deg)}
svg.ic{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

/* ---------- Aufbau ---------- */
#app{position:relative;z-index:1;display:flex;flex-direction:column;justify-content:center;gap:var(--gap);height:100vh;height:100dvh;max-width:430px;margin:0 auto;
  padding:calc(env(safe-area-inset-top,0px) + 6px) calc(env(safe-area-inset-right,0px) + 14px) calc(env(safe-area-inset-bottom,0px) + 6px) calc(env(safe-area-inset-left,0px) + 14px)}
body.over #app{visibility:hidden}

/* Kopf */
#top{flex:none;height:var(--toph);display:flex;align-items:center;gap:8px}
.scorebox{display:flex;flex-direction:column;line-height:1;flex:none}
.scorebox .num{position:relative;font-size:35px;line-height:.95;margin-top:3px;align-self:flex-start}
#score{display:inline-block}
#score.bump{animation:bump .5s both}
@keyframes bump{40%{transform:scale(1.22)}}
.gain{position:absolute;left:100%;top:1px;margin-left:7px;font-size:17px;color:var(--red);white-space:nowrap;display:none}
.gain.on{display:block;animation:pop .45s cubic-bezier(.2,1.6,.4,1) both}
@keyframes pop{from{opacity:0;transform:scale(.3)}}
.serie{margin-left:4px;display:flex;flex-direction:column;gap:9px;padding-bottom:2px;min-width:0;overflow:hidden;transition:opacity .2s}
#top.gaining .serie{opacity:0}
.pips{display:flex;gap:4px}
.pips i{flex:none;width:9px;height:9px;border-radius:50%;border:1.4px solid rgba(27,26,23,.4)}
.pips i.on{background:var(--gold);border-color:var(--gold)}
.rec{margin-left:auto;text-align:right;display:flex;flex-direction:column;line-height:1;flex:none}
.rec .num{font-size:19px;margin-top:5px}
.rb{flex:none;width:44px;height:44px;border-radius:50%;background:var(--paper-hi);box-shadow:0 1px 0 #fff inset,0 2px 5px rgba(60,40,10,.18),0 0 0 1px rgba(27,26,23,.1);
  display:flex;align-items:center;justify-content:center;font-family:var(--mincho);font-weight:700;font-size:19px}
.rb svg{width:22px;height:22px}
.rb.off .wave{display:none}.rb:not(.off) .mute{display:none}
.act:active,.rb:active,.btn:active{transform:scale(.96)}
/* drei runde Knöpfe (?, Musik, Ton) brauchen Platz: unter 420 px entfällt das Hanko, unter 360 px auch „Best“ */
@media (max-width:419px){ #top .hanko{display:none} .serie{margin-left:0} .pips{gap:3px} .pips i{width:7.5px;height:7.5px} }
@media (max-width:359px){ #top .rec{display:none} #top #help{margin-left:auto} .scorebox .num{font-size:30px} #top{gap:7px} }

/* Aufgaben */
#objs{flex:none;height:var(--tileh);display:flex;gap:8px}
#objs.thud{animation:thud .32s both}
@keyframes thud{25%{transform:translateY(3px)}60%{transform:translateY(-1.5px)}}
.tile{position:relative;flex:1;min-width:0;height:100%;border-radius:5px;background:var(--sheet);display:flex;align-items:center;justify-content:center;padding-top:6px;
  box-shadow:0 1px 0 rgba(255,255,255,.8) inset,0 0 0 1px rgba(110,90,55,.2),0 3px 7px rgba(60,40,10,.16)}
.tile svg{display:block;overflow:visible;height:auto;max-height:76%}
.tile.in{animation:tilein .42s cubic-bezier(.3,1.3,.5,1) both}
@keyframes tilein{from{opacity:0;transform:translateY(-16px) scale(.94)}}
.pts{position:absolute;right:-6px;top:-8px;min-width:25px;height:25px;padding:0 4px;border-radius:48% 52% 50% 50%/52% 47% 53% 48%;background:var(--red);color:var(--paper-hi);
  font-family:var(--mincho);font-weight:700;font-size:13.5px;line-height:25px;text-align:center;transform:rotate(5deg);font-variant-numeric:lining-nums;
  box-shadow:0 1px 2px rgba(120,30,10,.35);z-index:2}
.tile.glow{box-shadow:0 0 0 2px var(--gold),0 0 16px 3px rgba(201,160,70,.75),0 3px 7px rgba(60,40,10,.16);animation:glow 1.5s ease-in-out infinite}
@keyframes glow{50%{box-shadow:0 0 0 2px #B8923A,0 0 5px 1px rgba(201,160,70,.4),0 3px 7px rgba(60,40,10,.16)}}
.tile.done{box-shadow:0 0 0 2px var(--gold),0 3px 7px rgba(60,40,10,.16)}
.tile .hanko{position:absolute;left:50%;top:50%;width:40px;height:40px;margin:-17px 0 0 -20px;font-size:15.5px;transform:rotate(-9deg);opacity:.93;z-index:3;
  box-shadow:inset 0 0 0 2px rgba(246,240,226,.6),inset 0 0 0 4px var(--red),0 0 0 .5px rgba(216,65,47,.5);animation:seal .38s cubic-bezier(.2,1.5,.4,1) both}
@keyframes seal{from{opacity:0;transform:rotate(14deg) scale(2.6)}55%{opacity:1}}

/* Brett */
#stage{flex:none;position:relative;display:flex;justify-content:center}
#board{position:relative;flex:none;border-radius:5px;background:rgba(205,188,150,.33);
  box-shadow:inset 0 2px 7px rgba(70,50,15,.22),inset 0 0 0 1px rgba(90,70,40,.16),0 1px 0 rgba(255,255,255,.6)}
#bsvg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;display:block}
/* Andreas' Kalligrafie 四隅: blass und papiergetönt hinter dem Brett */
.kbg{position:absolute;inset:0;pointer-events:none}
.kbg::before{content:"";position:absolute;inset:7% 0;background:#4A3516;opacity:.075;
  -webkit-mask:url(img/kalligrafie.png) center/contain no-repeat;mask:url(img/kalligrafie.png) center/contain no-repeat}
.dropc{transform-box:fill-box;transform-origin:center;animation:dropc .5s cubic-bezier(.3,1.45,.5,1) both}
@keyframes dropc{from{opacity:0;transform:translateY(-14%) rotate(-9deg) scale(1.3)}35%{opacity:1}}
.bleed{transform-box:fill-box;transform-origin:center;opacity:0;animation:bleed .9s .12s ease-out both}
@keyframes bleed{0%{opacity:0;transform:scale(.3)}25%{opacity:.42}100%{opacity:0;transform:scale(1.5)}}
.erase{animation:erase .45s ease-out both}
@keyframes erase{to{opacity:0}}
.kin{stroke-dasharray:1;stroke-dashoffset:0;animation:draw .8s .5s cubic-bezier(.5,0,.2,1) both}
@keyframes draw{from{stroke-dashoffset:1}}
.kcell{animation:fadein .5s .55s both}
@keyframes fadein{from{opacity:0}}
#fxg.out{opacity:0;transition:opacity .35s}

#toast{position:absolute;z-index:26;left:50%;bottom:14%;transform:translateX(-50%);padding:9px 16px 10px;border-radius:4px;background:var(--paper-hi);color:var(--ink);font-weight:700;font-size:13.5px;white-space:nowrap;
  box-shadow:0 0 0 1.5px rgba(27,26,23,.55),0 8px 16px rgba(40,25,5,.2);opacity:0;transition:opacity .2s;pointer-events:none}
#toast.bad{color:#B8301F;box-shadow:0 0 0 1.5px var(--red),0 8px 16px rgba(120,30,10,.22)}
#toast.on{opacity:1}

/* Banner (Kombo/Serie) über dem Brett */
.banner{position:absolute;z-index:22;left:0;right:0;bottom:12px;height:60px;display:flex;align-items:center;justify-content:center;gap:14px;color:var(--paper-hi);white-space:nowrap;pointer-events:none;
  animation:wipe .55s cubic-bezier(.3,.8,.3,1) both}
.banner.up{bottom:auto;top:12px}
.banner svg{position:absolute;inset:0;width:100%;height:100%;z-index:-1}
.banner .k{font-family:var(--mincho);font-weight:700;font-size:25px;color:var(--gold-hi);letter-spacing:.02em}
.banner .s{font-family:var(--mincho);font-weight:700;font-size:19px}
.banner .p{font-size:12px;letter-spacing:.08em;color:#CFC5B0;text-transform:uppercase}
.banner i{width:1px;height:22px;background:rgba(233,208,140,.5)}
.banner.out{opacity:0;transition:opacity .3s}
@keyframes wipe{from{clip-path:inset(0 100% 0 0);opacity:.4}to{clip-path:inset(0 0 0 0)}}
@media (max-width:359px){ .banner{gap:9px} .banner .k{font-size:21px} .banner .s{font-size:16px} .banner .p{font-size:10.5px} }

/* Knöpfe */
#bar{flex:none;height:var(--barh);display:flex;gap:7px}
.act{position:relative;flex:1;min-width:0;height:100%;border-radius:9px;background:var(--paper-hi);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  box-shadow:0 1px 0 #fff inset,0 0 0 1px rgba(27,26,23,.1),0 2px 5px rgba(60,40,10,.15);font-size:10.5px;letter-spacing:.01em;color:var(--ink);white-space:nowrap}
.act svg{width:22px;height:22px;flex:none}
.act em{position:absolute;right:-4px;top:-7px;min-width:21px;height:21px;padding:0 5px;border-radius:999px;background:var(--ink);color:var(--paper-hi);font-style:normal;
  font-family:var(--mincho);font-weight:700;font-size:12px;line-height:21px;text-align:center;font-variant-numeric:lining-nums}
.act:disabled{color:rgba(27,26,23,.34);box-shadow:0 0 0 1px rgba(27,26,23,.08)}
.act:disabled em{background:#A69D8B}
.act.shake{animation:shake .35s}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}

/* Hand: Karten ohne Papierfläche – nur die Formen */
#handrow{flex:none;display:flex;align-items:center;gap:10px;margin-top:calc(var(--handgap) - var(--gap) + 6px)}
#hand{flex:1;min-width:0;display:flex;gap:5px}
.slot{position:relative;flex:1;min-width:0;max-width:56px;aspect-ratio:1;border-radius:6px;touch-action:none;cursor:grab}
.slot.gone{visibility:hidden}
.slot.hole{box-shadow:none}
.slot.hole::before{content:"";position:absolute;inset:0;border-radius:4px;border:1.4px dashed rgba(27,26,23,.28)}
.slot.hole .hc{visibility:hidden}
.hc{position:absolute;inset:0;border-radius:7px;transition:transform .22s cubic-bezier(.3,1.5,.5,1),box-shadow .2s;pointer-events:none}
.hc svg{width:100%;height:100%;display:block;overflow:visible;filter:drop-shadow(0 1.5px 1.2px rgba(60,40,10,.28))}
.slot.sel .hc{transform:translateY(var(--lift)) scale(1.07);box-shadow:0 0 0 1.4px rgba(27,26,23,.7)}
.slot.sel .hc svg{filter:drop-shadow(0 9px 6px rgba(60,40,10,.34))}
.slot.sel .hc::after{content:"";position:absolute;left:50%;bottom:-12px;width:6px;height:6px;margin-left:-3px;border-radius:50%;background:var(--red)}
#deck{position:relative;flex:none;width:50px;height:50px;margin-right:6px}
#deck i{position:absolute;inset:0;border-radius:6px;border:1.4px solid var(--ink)}
#deck i:nth-child(1){transform:translate(6px,6px);opacity:.22}
#deck i:nth-child(2){transform:translate(3px,3px);opacity:.45}
#deck b{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:20px}
#foot{flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;height:16px;margin-top:calc(8px - var(--gap))}
#foot .lbl{width:56px;text-align:center}
#hint{flex:1;min-width:0;font-size:11.5px;color:var(--muted);letter-spacing:.03em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#hint b{color:var(--pine);font-weight:700}
#hint.bad b{color:var(--red)}
@media (max-width:359px){ .hc{inset:2px} #hand{gap:3px} #handrow{gap:8px} #deck{width:40px;height:40px;margin-right:4px} #deck b{font-size:17px}
  #deck i:nth-child(1){transform:translate(4px,4px)} #deck i:nth-child(2){transform:translate(2px,2px)} #foot .lbl{width:44px} #objs{gap:6px} .act{font-size:10px} }

/* ---------- Schwebende Ebene: gezogene Karte, Chip, Pinselzahl ---------- */
#fx{position:fixed;inset:0;z-index:50;pointer-events:none}
/* Gezogene Karte: Rahmen 40 % Tusche, trübt ihre vier Felder milchig ein; ungültig rot */
.fly{position:absolute;left:0;top:0;border-radius:7px;background:rgba(250,246,236,.5);
  box-shadow:0 0 0 1.7px rgba(27,26,23,.4),0 16px 18px -8px rgba(50,30,5,.32);transform-origin:0 0;will-change:transform}
/* Unschärfe nur, solange die Karte auf dem Brett eingerastet ruht – nicht am frei bewegten Element */
.fly.snap{transition:transform .09s ease-out;box-shadow:0 0 0 1.7px rgba(27,26,23,.4),0 2px 5px rgba(50,30,5,.18);-webkit-backdrop-filter:blur(1.6px);backdrop-filter:blur(1.6px)}
.fly svg{width:100%;height:100%;display:block;overflow:visible;filter:drop-shadow(0 2px 1.5px rgba(50,30,5,.3))}
.fly.bad{background:rgba(250,236,228,.5);box-shadow:0 0 0 2.6px var(--red),0 0 18px rgba(216,65,47,.5),0 16px 18px -8px rgba(50,30,5,.32)}
.chip{position:absolute;left:0;top:0;display:flex;align-items:baseline;gap:7px;padding:6px 12px 7px;border-radius:999px;background:var(--ink);color:var(--paper-hi);font-size:12.5px;
  box-shadow:0 6px 14px rgba(40,25,5,.35);white-space:nowrap;animation:pop .22s cubic-bezier(.2,1.6,.4,1) both;transform-origin:50% 100%}
.chip b{font-family:var(--mincho);font-weight:700;font-size:18px;color:var(--gold-hi);line-height:1}
.chip span{color:var(--gold-hi);font-family:var(--mincho);font-weight:700;font-size:14px}
.brushnum{position:absolute;left:0;top:0;font-family:var(--mincho);font-weight:700;font-size:46px;line-height:1;color:var(--ink);opacity:0;white-space:nowrap;text-shadow:0 0 1px rgba(27,26,23,.5)}

/* ---------- Spielende ---------- */
#over{position:fixed;inset:0;z-index:40;display:none;overflow:auto;-webkit-overflow-scrolling:touch;
  padding:calc(env(safe-area-inset-top,0px) + 10px) 16px calc(env(safe-area-inset-bottom,0px) + 12px)}
#over.on{display:flex}
.ov{margin:auto;width:100%;max-width:398px;display:flex;flex-direction:column;align-items:stretch;text-align:center}
.newbest{font-family:var(--mincho);font-weight:700;font-size:13px;letter-spacing:.34em;text-indent:.34em;color:var(--gold);margin-top:8px;visibility:hidden}
#over.rec .newbest{visibility:visible;animation:pop .5s .9s cubic-bezier(.2,1.6,.4,1) both}
.ovscore{position:relative;align-self:center;width:220px;height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;margin:2px 0 4px}
.ovscore .ring{position:absolute;inset:0;width:100%;height:100%;overflow:visible;display:none}
#over.rec .ring{display:block;animation:fadein .7s .3s both}
#overScore{position:relative;--ovs:100px;font-size:calc(var(--ovs)*var(--k,1));line-height:1.1;letter-spacing:-.01em}
#overPrev{position:relative;margin-top:-4px}
.ovscore .hanko{position:absolute;right:-12px;bottom:28px;width:46px;height:46px;font-size:17px;transform:rotate(8deg);animation:seal .4s 1.1s cubic-bezier(.2,1.5,.4,1) both}
#flakes{position:absolute;inset:0;display:none}
#over.rec #flakes{display:block}
.flake{position:absolute;background:linear-gradient(135deg,#F0DDA0,#B8923A 60%,#9A7624);animation:twinkle 3.2s ease-in-out infinite}
@keyframes twinkle{50%{opacity:.35;transform:translateY(5px) rotate(18deg)}}
.ovrank{font-family:var(--mincho);font-weight:700;font-size:22px;letter-spacing:.02em}
.ovstats{font-size:11.5px;color:var(--muted);letter-spacing:.03em;margin-top:3px}
.ovhead{display:flex;justify-content:space-between;align-items:center;margin:12px 12px 4px}
.ovhead .plain{display:flex;align-items:center;gap:5px}
.dly{width:15px;height:15px;flex:none}
.hs{height:31px;margin-bottom:4px;display:flex;align-items:center;gap:9px;padding:0 12px;border-radius:5px;font-size:12.5px;color:#5C5548;box-shadow:0 1px 0 rgba(27,26,23,.08);text-align:left}
.hs .rk{width:20px;font-size:14px;color:var(--muted)}
.hs b{font-size:19px;color:var(--ink);min-width:40px}
.hs .dt{margin-left:auto;font-variant-numeric:tabular-nums}
.hs em{font-style:normal;font-size:9.5px;letter-spacing:.12em;text-transform:uppercase;color:#9A7624;font-weight:700}
.hs.cur{background:var(--sheet);box-shadow:0 0 0 1.5px var(--gold),0 4px 9px rgba(60,40,10,.16);color:var(--ink)}
.hs.cur .rk{color:var(--red)}
.btn{display:flex;align-items:center;justify-content:center;gap:9px;height:54px;border-radius:9px;font-family:var(--mincho);font-weight:700;font-size:18px;letter-spacing:.04em;
  background:var(--paper-hi);color:var(--ink);box-shadow:0 1px 0 #fff inset,0 0 0 1px rgba(27,26,23,.14),0 3px 7px rgba(60,40,10,.16)}
.btn.pri{background:var(--ink);color:var(--paper-hi);box-shadow:0 1px 0 rgba(255,255,255,.14) inset,0 8px 16px -4px rgba(27,26,23,.5)}
.btn svg{width:20px;height:20px}
#again{margin-top:12px}
.btnrow{display:flex;gap:8px;margin-top:10px}
.btnrow .btn{flex:1;font-size:16px}
@media (max-height:700px){
  .ovscore{width:150px;height:150px} #overScore{--ovs:66px} .ovscore .hanko{width:36px;height:36px;font-size:13px;bottom:16px}
  .ovrank{font-size:19px} .hs{height:27px;margin-bottom:3px} .hs b{font-size:17px} .ovhead{margin-top:8px} .btn{height:46px} #again{margin-top:8px} .btnrow{margin-top:8px} .newbest{margin-top:4px}
}
@media (max-height:600px){ .ovscore{width:118px;height:118px} #overScore{--ovs:54px} .hs{height:25px;margin-bottom:2px} .ovstats{font-size:10.5px} }

/* ---------- Regeln ---------- */
#rules{position:fixed;inset:0;z-index:60;background:rgba(27,26,23,.45);display:none;align-items:center;justify-content:center;padding:16px}
#rules.on{display:flex}
#rules .box{display:flex;flex-direction:column;background:var(--paper-hi);border-radius:6px;padding:18px;max-width:420px;max-height:92vh;max-height:92dvh;font-size:14px;line-height:1.42;
  box-shadow:0 0 0 1px rgba(110,90,55,.18),0 3px 0 #D8CCB2,0 18px 28px -10px rgba(60,40,10,.45)}
#rules h2{margin:0 0 6px;font-family:var(--mincho);font-weight:700;font-size:23px}
#rules ol{padding-left:20px;margin:8px 0}
#rules li{margin:6px 0}
#rules .btn{width:100%;margin-top:10px;height:50px}

/* ---------- Bildschirme: Intro, Startmenü, Bestenliste (über dem Papier, das Spiel liegt verborgen darunter) ---------- */
body:not([data-screen="game"]) #app{visibility:hidden}
.screen{position:fixed;inset:0;z-index:30;display:none;overflow:hidden;
  padding:calc(env(safe-area-inset-top,0px) + 10px) calc(env(safe-area-inset-right,0px) + 20px) calc(env(safe-area-inset-bottom,0px) + 10px) calc(env(safe-area-inset-left,0px) + 20px)}
body[data-screen="intro"] #intro,body[data-screen="menu"] #menu,body[data-screen="scores"] #scores{display:flex;animation:fadein .35s both}
.kimg{background:url(img/kalligrafie.png) center/contain no-repeat}
.wordmark{text-align:center;font-family:var(--mincho);font-weight:700;font-size:22px;letter-spacing:.62em;text-indent:.62em;color:var(--ink);white-space:nowrap}
.tagline{text-align:center;font-size:12.5px;letter-spacing:.16em;color:var(--muted);white-space:nowrap}

/* Intro: feste Bühne 390 px breit, als Ganzes eingepasst (--k) */
#intro{padding:0;cursor:pointer}
.istage{position:absolute;left:50%;top:50%;width:390px;transform:translate(-50%,-50%) scale(var(--k,1))}
.istage > *{position:absolute}
.istage .wordmark,.istage .tagline{left:0;right:0}
.istage .corner{width:16px;height:16px;border:1.5px solid rgba(27,26,23,.28)}
.i-st{width:56px;height:56px;animation:slam .36s cubic-bezier(.2,1.5,.4,1) both}
.i-st svg,.mst svg{width:100%;height:100%;display:block;overflow:visible}
@keyframes slam{from{opacity:0;transform:scale(2.5) rotate(-14deg);filter:blur(2px)}55%{opacity:1;filter:blur(0)}}
.i-bleed{width:78px;height:78px;border-radius:50%;opacity:0;filter:blur(9px);animation:ibleed .9s ease-out both}
@keyframes ibleed{0%{opacity:0;transform:scale(.3)}25%{opacity:.5}100%{opacity:0;transform:scale(1.5)}}
.i-sheetwrap{width:174px;height:174px;filter:drop-shadow(0 9px 9px rgba(50,30,5,.3)) drop-shadow(0 1px 1px rgba(50,30,5,.25));transform:rotate(45deg);animation:fall .8s 1.09s cubic-bezier(.3,.7,.3,1) both}
@keyframes fall{0%{opacity:0;transform:translate(-60px,-440px) rotate(8deg) scale(1.3)}12%{opacity:1}58%{transform:translate(0,0) rotate(49deg) scale(1)}76%{transform:translate(0,-7px) rotate(42.5deg) scale(1.015)}100%{transform:rotate(45deg)}}
.i-sheet{position:absolute;inset:0;background:rgba(246,240,226,.92);border-radius:3px;box-shadow:inset 0 0 0 1px rgba(110,90,55,.18)}
.i-ring{width:80px;height:80px;border-radius:50%;box-shadow:0 0 0 2px var(--gold),0 0 22px 4px rgba(201,160,70,.55);animation:pop .5s 1.9s cubic-bezier(.2,1.6,.4,1) both,ring 1.7s 2.4s ease-in-out infinite}
@keyframes ring{50%{transform:scale(1.1);box-shadow:0 0 0 2px #B8923A,0 0 8px 1px rgba(201,160,70,.3)}}
.i-kimg{animation:brush .8s cubic-bezier(.4,0,.2,1) both}
.short .i-kimg{animation-duration:.5s}
@keyframes brush{from{clip-path:inset(-10% -10% 110% -10%);filter:blur(4px);opacity:.3}to{clip-path:inset(-10% -10% -10% -10%);filter:blur(0)}}
.i-seal{width:34px;height:34px;font-size:9px;line-height:1.15;letter-spacing:.04em;transform:rotate(6deg);animation:seal .4s cubic-bezier(.2,1.5,.4,1) both}
.istage .wordmark span{display:inline-block;animation:rise .5s both}
@keyframes rise{from{opacity:0;transform:translateY(9px)}}
.i-late{animation:fadein .5s both}
.istage .skip{font-size:11px;letter-spacing:.1em;opacity:.7}

/* Startmenü */
#menu,#scores{justify-content:center}
.mn{width:100%;max-width:390px;height:100%;max-height:800px;margin:auto;display:flex;flex-direction:column;gap:8px}
.msheetwrap{flex:1;min-height:90px;display:flex;align-items:center;justify-content:center;padding:6px 0 4px}
.msheet{position:relative;height:100%;max-height:372px;aspect-ratio:236/318;background:var(--sheet);border-radius:4px;transform:rotate(-1.2deg);
  box-shadow:0 0 0 1px rgba(110,90,55,.18),0 3px 0 #D8CCB2,0 18px 28px -10px rgba(60,40,10,.35)}
.msheet .kimg{position:absolute;inset:10% 15%}
.mst{position:absolute;width:18%;aspect-ratio:1}
.mst.s0{left:4%;top:3%;transform:rotate(-6deg)}.mst.s1{right:4%;top:3%;transform:rotate(4deg)}
.mst.s2{left:4%;bottom:3%;transform:rotate(3deg)}.mst.s3{right:4%;bottom:3%;transform:rotate(-5deg)}
#menu .wordmark{font-size:24px;margin-top:4px}
#menu .tagline{margin-bottom:8px}
.btn small{font-family:var(--gothic);font-weight:400;font-size:11.5px;letter-spacing:.03em;opacity:.72}
.btn small:empty{display:none}
.btn.big{height:62px;flex-direction:column;gap:1px;flex:none}
.mn > .btn{flex:none;flex-direction:column;gap:1px}
.btn.left{flex-direction:row;justify-content:flex-start;padding:0 16px;gap:13px;text-align:left}
.btn.left .col{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0}
.btn.left .col > span{display:flex;align-items:center;gap:7px}
.hanko.round{width:40px;height:40px;border-radius:50%;font-size:15px;line-height:1;flex-direction:column;transform:none}
.hanko.round span{font-size:8px;font-family:var(--gothic);font-weight:700;letter-spacing:.08em}
.mrow{display:flex;align-items:center;gap:8px;flex:none}
.mrow .btn{flex:1;min-width:0;height:46px;font-size:15px;gap:7px;white-space:nowrap;padding:0;letter-spacing:.02em}
@media (max-width:419px){ .mrow .btn svg{display:none} }
.rb.sq{width:46px;height:46px;border-radius:9px}
#mBest{text-align:center;margin-top:2px}
@media (max-width:359px){ .mrow .btn{font-size:13px;letter-spacing:0} .mrow{gap:6px} .rb.sq{width:44px;height:46px} .btn small{font-size:10.5px} }
@media (max-height:640px){ .mn{gap:6px} .btn.big{height:54px} .mn > .btn{height:46px} #menu .wordmark{font-size:20px;margin-top:0} #menu .tagline{margin-bottom:2px;font-size:11px} .mn > .btn.big{height:54px} }

/* Bestenliste */
.sc{width:100%;max-width:398px;height:100%;margin:auto;display:flex;flex-direction:column;min-height:0}
.shead{font-family:var(--mincho);font-weight:700;font-size:23px;margin:8px 4px 10px}
.sgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.sgrid div{background:var(--sheet);border-radius:5px;padding:7px 2px 6px;text-align:center;box-shadow:0 0 0 1px rgba(110,90,55,.18)}
.sgrid b{display:block;font-size:21px;line-height:1.1}
.sgrid .lbl{font-size:8.5px;letter-spacing:.08em}
#scDaily{margin:10px 4px 0;font-size:12px;color:#5C5548;display:flex;align-items:center;gap:6px}
#scList{flex:1;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;padding:2px 2px 0}
#scList .none{padding:28px 0;text-align:center;color:var(--muted);font-size:13px}
#scBack{flex:none;margin-top:8px}

/* Spielende: Zusatzzeilen */
#overDaily{margin-top:10px;text-transform:none;letter-spacing:.03em;white-space:normal}
#shareText{display:none;margin-top:8px;width:100%;border:0;border-radius:5px;padding:9px 10px;font:inherit;font-size:13px;text-align:center;color:var(--ink);background:var(--sheet);
  box-shadow:0 0 0 1px rgba(110,90,55,.3);-webkit-user-select:text;user-select:text}
#shareText.on{display:block}
.btnrow .btn{min-width:0;white-space:nowrap;gap:7px}
@media (max-width:359px){ .btnrow .btn{font-size:14.5px;letter-spacing:.02em} }

/* ---------- Tutorial: läuft auf dem echten Spielfeld mit kleinem Brettausschnitt ---------- */
#tuthead,#tline,#tutNext{display:none}
body.tut #top,body.tut #bar,body.tut #foot,body.tut #deck{display:none}
body.tut #tuthead{display:block;flex:none}
#tuthead .tt{display:flex;justify-content:space-between;align-items:center;font-family:var(--mincho);font-weight:700;font-size:23px}
#tutSkip{min-height:44px;padding:0 4px 0 20px;letter-spacing:.08em}
.steps{display:flex;gap:7px;align-items:center;margin-top:2px}
.steps i{width:22px;height:4px;border-radius:2px;background:rgba(27,26,23,.16)}
.steps i.d{background:var(--gold)}.steps i.a{background:var(--ink);width:34px}
.steps .lbl{margin-left:8px}
body.tut #tline{display:block;flex:none;text-align:center;font-family:var(--mincho);font-weight:700;font-size:21px;line-height:1.25;letter-spacing:.01em}
#tline em{font-style:normal;color:var(--red)}
#tline small{display:block;margin-top:6px;font-family:var(--gothic,inherit);font-weight:400;font-size:15px;line-height:1.35;color:var(--ink);opacity:.8}
/* Tutorial: auf die Aufgabe oben zeigen */
.tile.tutpoint{box-shadow:0 0 0 2px var(--red),0 0 14px 2px rgba(216,65,47,.45);animation:tutpoint 1.2s ease-in-out infinite}
@keyframes tutpoint{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@media (prefers-reduced-motion:reduce){.tile.tutpoint{animation:none}}
body.tut #tutNext{display:flex;flex:none}
#tutNext:disabled{opacity:.45}
body.tut #bsvg{overflow:hidden}
body.tut .tile:empty{visibility:hidden}
body.tut #handrow{margin-top:0;justify-content:center;min-height:72px}
body.tut #hand{flex:none;justify-content:center}
body.tut .slot{flex:none;width:72px;max-width:none}
body.tut .slot.gone{display:none}
body.tut .slot.sel .hc{transform:none}
body.tut .slot.sel .hc::after{display:none}
@media (max-width:359px){ body.tut #tline{font-size:18px} body.tut .slot{width:60px} body.tut #handrow{min-height:60px} #tuthead .tt{font-size:20px} }
@media (max-height:640px){ body.tut #tutNext{height:46px} body.tut .slot{width:56px} body.tut #handrow{min-height:56px} }
.touch{position:absolute;left:0;top:0;width:46px;height:46px;border-radius:50%;background:radial-gradient(circle at 40% 35%,rgba(255,255,255,.55),rgba(27,26,23,.2) 70%);
  box-shadow:0 0 0 1.5px rgba(27,26,23,.4),0 0 0 9px rgba(27,26,23,.07),0 8px 14px rgba(40,25,5,.3);pointer-events:none}

/* ---------- Regelkarte: kurz und bebildert ---------- */
.rc{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:9px;margin:10px 0 4px}
.rc > div{display:flex;align-items:center;gap:12px;font-size:13.5px;line-height:1.35}
.rc svg{flex:none;width:66px;height:44px;overflow:visible}
.rc b{font-weight:700}
.rcfoot{flex:none;font-size:11.5px;color:var(--muted);letter-spacing:.02em;margin-top:8px;text-align:center}
#rules .btnrow{flex:none}
#rules .btnrow .btn{height:50px;margin-top:6px}
@media (max-width:359px){ #rules .box{padding:14px} .rc{gap:6px} .rc > div{font-size:12.5px;gap:10px} .rc svg{width:54px;height:36px} }

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition:none!important}
}
