
:root {
  --paper: #FBFAF5; --rule: #A9C8EC; --margin: #E8707A; --ink: #2B2B2B;
  --red: #E53B3B; --orange: #F58A1F; --yellow: #FFD23F; --green: #57B94A; --blue: #2F7DE1; --purple: #8B5BD6; --brown: #8A5A3B;
  --px: 3px; --pxl: 3px; --pxm: 3px; --pxs: 2px;
  --hand: 'Patrick Hand', 'Segoe Print', 'Comic Sans MS', 'Chalkboard SE', cursive;
  --title: 'Gochi Hand', 'Patrick Hand', 'Segoe Print', 'Comic Sans MS', cursive;
  --line: 32px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font-family: var(--hand); font-size: 20px; line-height: 1.15; overscroll-behavior: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
img.pi, canvas.pa { image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: -moz-crisp-edges; display: block; }
.pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); flex: none; }
canvas.pa { width: calc(var(--cw) * var(--px)); height: calc(var(--ch) * var(--px)); flex: none; }


#app { position: fixed; inset: 0; }
#page {
  position: absolute; inset: 0; overflow: hidden; background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px), var(--rule) var(--line));
  background-position: 0 14px;
}
#page::before { content: ''; position: absolute; top: 0; bottom: 0; left: 20px; width: 2px; background: var(--margin); opacity: .85; z-index: 0; }
#col { position: absolute; inset: 0; margin: 0 auto; max-width: 1000px; padding: max(6px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom)) 30px; display: flex; flex-direction: column; z-index: 1; }
#topbar { flex: none; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 2px 0 6px; }
#topbar .spacer { flex: 1; }
#topTeam { display: none; }
#screens { flex: 1 1 0; min-height: 0; position: relative; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; gap: 10px; min-height: 0; }
.screen.on { display: flex; }
.doodle { position: absolute; width: 30px; height: 30px; z-index: 0; pointer-events: none; opacity: .95; background: no-repeat center / contain; }
.doodle.d1 { left: 2px; top: 10px; transform: rotate(-12deg); } .doodle.d2 { right: 6px; top: 12px; transform: rotate(10deg); }
.doodle.d3 { left: 0; bottom: 14px; transform: rotate(8deg); } .doodle.d4 { right: 4px; bottom: 16px; transform: rotate(-14deg); }


[data-cr] { position: relative; isolation: isolate; }
[data-cr] > svg.cr { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: -1; }
.cr .bv { visibility: hidden; }
.cr .bv, canvas.bv { animation: boil .66s steps(1, end) infinite; }
.cr .bv1, canvas.bv1 { animation-delay: -.22s; } .cr .bv2, canvas.bv2 { animation-delay: -.44s; }
@keyframes boil { 0% { visibility: visible; } 33.34% { visibility: hidden; } 100% { visibility: hidden; } }
.cr .shade { opacity: 0; transition: opacity .06s; }
[data-cr]:active .shade, [data-cr].pressed .shade { opacity: .9; }
.noboil .cr .bv, .noboil canvas.bv { animation: none; } .noboil .cr .bv0, .noboil canvas.bv0 { visibility: visible; }
@media (prefers-reduced-motion: reduce) { .cr .bv, canvas.bv { animation: none; } .cr .bv0, canvas.bv0 { visibility: visible; } }


.chipbtn { width: calc(16 * var(--pxs) + 6px); height: calc(16 * var(--pxs) + 6px); min-width: 44px; min-height: 44px; border: 0; background: transparent; padding: 0; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); --px: var(--pxs); flex: none; transition: transform .08s; }
.chipbtn .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.chipbtn:active { transform: scale(.94, .9) rotate(-2deg); }
.chipbtn[aria-pressed="true"] { opacity: .85; }
.btn { border: 0; background: transparent; min-height: 54px; padding: 8px 22px; font-family: var(--title); font-size: 27px; line-height: 1; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .08s; text-decoration: none; }
.btn .pi { --px: var(--pxs); width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.btn.big { min-height: 66px; font-size: 32px; padding: 10px 28px; }
.btn.small { min-height: 46px; font-size: 22px; padding: 6px 16px; }
.btn:active, .mv:active, .ub:active, .tile:active, .ucard:active, .pick-card:active, .door:active, .listbtn:active, .tab:active { transform: scale(.97, .93) translateY(2px) rotate(-.4deg); }
.btn:disabled, .btn.off { opacity: .55; filter: saturate(.5); }
.btn:focus-visible, .chipbtn:focus-visible, .mv:focus-visible, .ub:focus-visible, .tile:focus-visible, .ucard:focus-visible, .pick-card:focus-visible, .door:focus-visible, .listbtn:focus-visible, .tab:focus-visible, input:focus-visible { outline: 3px dashed var(--blue); outline-offset: 3px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
h2, .h { font-family: var(--title); font-weight: 400; font-size: 34px; line-height: 1; margin: 0; }
.sub { font-size: 20px; opacity: .85; }


#screen-battle { gap: 8px; --cw: 116; --ch: 118; justify-content: space-between; }
.scene { position: relative; flex: 1 1 0; min-height: 250px; background: #E9F2DA; overflow: hidden; border-radius: 12px; }
.scenebg { position: absolute; inset: 0; overflow: hidden; }
.scenebg canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.frame { position: absolute; inset: -1px; z-index: 9; pointer-events: none; }
.frame > svg.cr { z-index: 9; }
.slot { position: absolute; width: calc(var(--cw) * var(--px)); height: calc(var(--ch) * var(--px)); z-index: 3; }
.mon, .mon-in, .mon-bob, .mon-flip { position: absolute; inset: 0; }
.mon { z-index: 1; }
.mon canvas { width: 100%; height: 100%; }
.mon .flash { position: absolute; inset: 0; opacity: 0; }
.slot.hurt .flash { opacity: 1; animation: whiteflash .5s steps(1, end); }
.slot.hurt .mon-in { animation: shakeit .5s steps(1, end); }
@keyframes whiteflash { 0% { opacity: 1; } 20% { opacity: 0; } 40% { opacity: 1; } 60% { opacity: 0; } 100% { opacity: 0; } }
@keyframes shakeit { 0% { transform: translateX(calc(var(--px) * -2)); } 25% { transform: translateX(calc(var(--px) * 2)); } 50% { transform: translateX(calc(var(--px) * -1)); } 75% { transform: translateX(var(--px)); } 100% { transform: none; } }
.slot[data-idle="float"] .mon-bob { animation: bobf 1.1s steps(1, end) infinite; }
.slot[data-idle="sway"] .mon-bob { animation: bobs .8s steps(1, end) infinite; }
.slot[data-idle="hop"] .mon-bob { animation: bobh .6s steps(1, end) infinite; }
.slot[data-idle="stomp"] .mon-bob { animation: bobs 1s steps(1, end) infinite; }
@keyframes bobf { 0% { transform: translateY(0); } 50% { transform: translateY(calc(var(--px) * -2)); } }
@keyframes bobs { 0% { transform: translateY(0); } 50% { transform: translateY(calc(var(--px) * -1)); } }
@keyframes bobh { 0% { transform: translateY(0); } 33% { transform: translateY(calc(var(--px) * -1)); } 66% { transform: translateY(0); } 80% { transform: translateY(calc(var(--px) * -2)); } }
.slot.lowhp .mon-bob { animation-duration: .35s; }
.slot.guarded::after { content: ''; position: absolute; left: var(--rl, 6%); right: var(--rr, 6%); top: var(--rt, 18%); bottom: var(--rb, 0); border-radius: 50%; border: 4px solid var(--blue); box-shadow: 0 0 0 2px rgba(255, 255, 255, .6) inset; opacity: .85; z-index: 4; pointer-events: none; transform: rotate(-3deg); animation: shieldspin 2.4s steps(6, end) infinite; }
@keyframes shieldspin { 0% { transform: rotate(-3deg) scale(1); } 50% { transform: rotate(3deg) scale(1.02); } }
.slot.phase2 { filter: saturate(1.25); }
.stfx { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; z-index: 5; }
.stfx .sf { position: absolute; left: 50%; top: 12%; display: flex; gap: 0; transform: translateX(-50%); }
.stfx .sf .pi { --px: inherit; width: calc(16 * var(--px)); height: calc(16 * var(--px)); animation: stf 1s steps(2, end) infinite; }
.stfx .sf .pi:nth-child(2) { animation-delay: -.33s; } .stfx .sf .pi:nth-child(3) { animation-delay: -.66s; }
@keyframes stf { 0% { transform: translateY(0); } 50% { transform: translateY(calc(var(--px) * -2)); } }

.pw { position: absolute; z-index: 6; width: var(--plw, 154px); display: flex; flex-direction: column; gap: 4px; --px: var(--pxs); }
.pw.foe { left: 8px; top: 8px; align-items: flex-start; } .pw.pl { right: 8px; bottom: 8px; align-items: flex-end; }
.pw .tags, .pw .team { width: 100%; }
.pw.pl .tags, .pw.pl .team { justify-content: flex-end; }
.patch { position: absolute; z-index: 2; pointer-events: none; }
.patch > svg.cr { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plate { position: relative; width: 100%; min-width: 0; background: var(--paper); border-radius: 10px; padding: 4px 8px 5px 5px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 6px; min-height: 60px; }
.plate .por { width: calc(20 * var(--px) + 4px); height: calc(20 * var(--px) + 4px); display: flex; align-items: center; justify-content: center; flex: none; background: #F3EFE2; border-radius: 6px; box-shadow: inset 0 0 0 2px rgba(43, 43, 43, .8); }
.plate .por canvas { --cw: 20; --ch: 20; }
.plate .who { min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 3px; }
.plate .pn { font-size: 21px; line-height: 1.08; padding-bottom: 1px; overflow: hidden; max-height: 2.3em; overflow-wrap: normal; word-break: normal; }
.plate .hprow { display: flex; align-items: center; gap: 7px; }
.hpbar { position: relative; flex: 1; height: 15px; background: #E6E2D2; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 2px var(--ink); }
.hpbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: repeating-linear-gradient(-38deg, #57B94A 0 3px, #86D36E 3px 6px); transition: width .6s steps(10, end); border-right: 2px solid var(--ink); }
.hpbar i.mid { background: repeating-linear-gradient(-38deg, #F2B600 0 3px, #FFD23F 3px 6px); } .hpbar i.low { background: repeating-linear-gradient(-38deg, #E53B3B 0 3px, #F2736B 3px 6px); }
.plate .hpn { font-size: 24px; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.plate .qm { position: absolute; right: -6px; top: -10px; width: 44px; height: 44px; border: 0; background: transparent; padding: 0; z-index: 2; font-family: var(--title); font-size: 22px; opacity: 0; }
.ens { display: flex; gap: 4px; align-items: center; padding: 0 2px; min-height: 13px; }
.ens i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: #F4E9B0; display: block; }
.ens i.on { background: var(--yellow); box-shadow: inset -2px -2px 0 #D49A12; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { position: relative; width: calc(16 * var(--px) + 3px); height: calc(16 * var(--px) + 3px); min-width: 38px; min-height: 38px; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; padding: 0; }
.tag .pi { position: relative; }
.tag::before { content: ''; position: absolute; inset: -4px; }
.tag.arrow::after { content: ''; position: absolute; right: -2px; top: -2px; width: 14px; height: 14px; }
.tag .sm { position: absolute; right: -4px; bottom: -4px; width: calc(8 * var(--px)); height: calc(8 * var(--px)); min-width: 22px; min-height: 22px; background: var(--paper); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--ink); }
.tag .sm .pi { width: calc(8 * var(--px)); height: calc(8 * var(--px)); min-width: 18px; min-height: 18px; --px: inherit; }
.tag .lbl { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); font-size: 15px; background: var(--paper); border-radius: 8px; padding: 0 5px; white-space: nowrap; box-shadow: 0 0 0 1.5px var(--ink); display: none; }
.tag.sh { }
.team { display: flex; gap: 4px; }
.tm { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; position: relative; display: flex; align-items: center; justify-content: center; --px: var(--pxs); }
.tm canvas { --cw: 20; --ch: 20; }
.tm.on { }
.tm.ko { opacity: .4; filter: grayscale(1); }
.tm i { position: absolute; left: 6px; bottom: 1px; height: 5px; background: var(--green); border: 1.5px solid var(--ink); border-radius: 3px; max-width: 32px; }
.tm.ko i { display: none; }
.tag.intent { display: none; }
.slot.gone { visibility: hidden; }
#tagsB .tag[data-note^="hard:"] { display: none; }
.scene.dock #tagsB { padding-left: max(42px, calc(16 * var(--pxs) + 7px)); min-height: max(38px, calc(16 * var(--pxs) + 3px)); position: relative; }
.scene.dock #intent .il { display: none; }
.scene.dock #tagsB { flex-wrap: nowrap; } .scene.dock #tagsB .tag:nth-child(n+3) { display: none; }
#intent .il { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 2px); font-size: 18px; line-height: 1; white-space: nowrap; background: var(--paper); border-radius: 8px; padding: 1px 6px; box-shadow: 0 0 0 2px var(--ink); z-index: 2; }
#intent .il:empty { display: none; }
#intent.on { display: flex; position: absolute; z-index: 7; animation: intentbob 1.2s steps(1, end) infinite; flex: none; --px: var(--pxs); }

.tags { gap: 4px; }
#tagsA { flex-wrap: nowrap; } #tagsA .tag:nth-child(n+4) { display: none; }
#tagsB .tag:nth-child(n+7) { display: none; }
.scene.tight #tagsB .tag:nth-child(n+4) { display: none; }
.scene.tighter #tagsB .tag:nth-child(n+3) { display: none; }
.scene.tighter .pw.foe .por { display: none; }
.scene.squeeze #tagsA { display: none; }
.scene.tighter .pw.foe .tag { min-width: 34px; min-height: 34px; width: 34px; height: 34px; }
.scene.tighter .pw.foe .tag .sm { width: 16px; height: 16px; min-width: 16px; min-height: 16px; }
.moves.roomy { flex: 1 1 auto; max-height: calc(2 * 122px + 10px); grid-auto-rows: 1fr; align-content: stretch; }
.tag .ii { position: relative; z-index: 1; display: flex; }
@keyframes intentbob { 0% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.fxcv { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 8; pointer-events: none; }
.bursts { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.burst { position: absolute; animation: burstpop .52s steps(5, end) forwards; display: flex; align-items: center; justify-content: center; }
.burst svg { position: absolute; inset: 0; overflow: visible; }
.burst b { position: relative; font-family: var(--title); font-weight: 400; font-size: 30px; color: var(--red); text-shadow: 2px 0 var(--paper), -2px 0 var(--paper), 0 2px var(--paper), 0 -2px var(--paper); transform: rotate(-6deg); }
.burst path:last-child { stroke-dasharray: 520; stroke-dashoffset: 520; animation: scrawl .2s linear forwards; }
@keyframes scrawl { to { stroke-dashoffset: 0; } }
@keyframes burstpop { 0% { transform: scale(.35) rotate(-8deg); opacity: 1; } 35% { transform: scale(1.12) rotate(3deg); } 70% { transform: scale(1) rotate(0); opacity: 1; } 100% { transform: scale(1.06); opacity: 0; } }
.floaters { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.num { position: absolute; font-family: var(--title); font-size: 38px; line-height: 1; color: var(--red); white-space: nowrap; animation: rise .85s steps(8, end) forwards; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 rgba(43, 43, 43, .35); }
.num.heal { color: #8BE06E; } .num.crit { color: var(--yellow); font-size: 46px; } .num.lbl { font-size: 28px; color: #7FB6FF; } .num.super { color: var(--yellow); font-size: 30px; } .num.weak { color: #D8D8D8; font-size: 26px; }
.num.crit, .num.super, .num.weak, .num.lbl { -webkit-text-stroke-width: 6px; }
@keyframes rise { 0% { transform: translateY(8px) scale(.6); opacity: 1; } 25% { transform: translateY(-4px) scale(1.15); } 100% { transform: translateY(-34px) scale(1); opacity: 0; } }
.banner { position: absolute; z-index: 11; display: none; width: 150px; height: 120px; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.banner.on { display: flex; animation: burstpop2 .5s steps(5, end) both; }
.banner svg { position: absolute; inset: 0; overflow: visible; }
.banner b { position: relative; font-family: var(--title); font-weight: 400; font-size: 34px; line-height: 1; color: var(--red); text-shadow: 2px 0 var(--paper), -2px 0 var(--paper), 0 2px var(--paper), 0 -2px var(--paper); transform: rotate(-5deg); }
@keyframes burstpop2 { 0% { transform: scale(.4) rotate(-10deg); } 60% { transform: scale(1.1) rotate(2deg); } 100% { transform: scale(1) rotate(0); } }
.speed { position: absolute; z-index: 2; pointer-events: none; }

#msg { flex: none; min-height: 50px; display: flex; align-items: center; justify-content: center; padding: 6px 12px; font-size: 28px; text-align: center; white-space: nowrap; overflow: visible; margin: 0 18px; }
#msg .ch { white-space: pre; opacity: 0; animation: chin 0s steps(1, end) forwards; animation-delay: calc(var(--i) * var(--ct, 16ms)); }
#msg.done .ch { opacity: 1; animation: none; }
@keyframes chin { to { opacity: 1; } }
#msg.alert { animation: alertpulse .5s steps(1, end) 3; }
@keyframes alertpulse { 50% { transform: scale(1.04) rotate(-.6deg); } }
.moves { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 0 4px; }
.mv { position: relative; min-height: 96px; border: 0; background: transparent; padding: 6px 8px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; font-family: var(--hand); color: var(--ink); transition: transform .08s; min-width: 0; }
.mv .mi { flex: none; display: flex; position: relative; }
.mv .mi .pi { }
.mv .mn { flex: none; max-width: 100%; font-size: 28px; line-height: .9; overflow-wrap: normal; word-break: normal; }
.mv .co { position: absolute; right: 10px; top: 3px; display: flex; gap: 3px; z-index: 2; }
.mv .co i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: var(--yellow); display: block; box-shadow: inset -2px -2px 0 #D49A12; }
.mv .st { position: absolute; right: -8px; top: -12px; width: 38px; height: 38px; z-index: 3; animation: starbounce .9s steps(1, end) infinite; }
.mv .st svg { width: 100%; height: 100%; overflow: visible; }
.mv .ptr { position: absolute; left: -12px; top: -16px; width: 50px; height: 50px; z-index: 3; display: none; animation: arrowwig .7s steps(1, end) infinite; }
.mv .ptr svg { width: 100%; height: 100%; overflow: visible; }
.mv.hint .ptr { display: block; }
.mv .zz { position: absolute; right: 8px; bottom: 6px; z-index: 3; --px: var(--pxs); }
.mv .zz .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.mv.wk { }
.mv.wk .mi { opacity: .85; }
.mv .wkm { position: absolute; right: -6px; top: -8px; width: 34px; height: 34px; z-index: 3; background: var(--paper); border-radius: 50%; box-shadow: 0 0 0 2.5px var(--ink); display: flex; align-items: center; justify-content: center; }
.mv .wkm svg { width: 24px; height: 24px; }
.mv.noe { opacity: .58; filter: grayscale(.9); }
.mv.noe .mn { color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 5px #fff; }
.mv.noe:not(:has(.zz))::after { content: ''; position: absolute; right: 8px; bottom: 6px; width: 30px; height: 30px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 2 5 13h6l-1 9 8-12h-6z' fill='%23FFD23F' stroke='%232B2B2B' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M3 21 21 3' stroke='%23E53B3B' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 22px no-repeat; border-radius: 50%; box-shadow: 0 0 0 2.5px var(--ink); z-index: 3; }
.mv.noe .co i { background: #D8D2C0; box-shadow: none; }

#screen-battle.acting .mv, #screen-battle.acting .ub { opacity: .42; filter: grayscale(.85); animation: none; pointer-events: none; }
#screen-battle.acting .mv .st, #screen-battle.acting .mv .ptr { display: none; }
.mv.sup { animation: supbounce 1.4s steps(1, end) infinite; }
.mv.empty { opacity: .55; justify-content: center; }
.mv.zzbtn { grid-column: 1 / -1; justify-content: center; }
@keyframes starbounce { 0% { transform: translateY(0) rotate(8deg); } 50% { transform: translateY(-3px) rotate(-6deg); } }
@keyframes supbounce { 0% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes arrowwig { 0% { transform: translate(0, 0) rotate(-4deg); } 50% { transform: translate(3px, 3px) rotate(4deg); } }
.util { flex: none; display: flex; gap: 10px; padding: 0 4px; }
.ub { position: relative; flex: 1; min-height: 56px; border: 0; background: transparent; padding: 4px 8px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 23px; transition: transform .08s; min-width: 0; --px: var(--pxs); }
.ub .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.ub.noe { opacity: .5; }
.ub.pulse { animation: supbounce .6s steps(1, end) infinite; }
.ub.glow { }
.chipbtn.glow { animation: supbounce .8s steps(1, end) infinite; }


.hand { position: absolute; z-index: 30; pointer-events: none; width: 70px; height: 80px; animation: handtap 1s steps(1, end) infinite; }
.hand svg { width: 100%; height: 100%; overflow: visible; }
@keyframes handtap { 0% { transform: translate(0, 0); } 50% { transform: translate(6px, 8px); } }


#modalRoot { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.ovl { position: absolute; inset: 0; background: rgba(43, 43, 43, .28); display: flex; align-items: center; justify-content: center; padding: 14px; pointer-events: auto; animation: ovin .14s steps(2, end); overflow: auto; }
.ovl.low { align-items: flex-end; }
@keyframes ovin { from { opacity: 0; } }
.card { position: relative; width: min(100%, 460px); max-height: 100%; overflow: auto; background: var(--paper); padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center; transform: rotate(-.6deg); animation: cardin .22s steps(4, end); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, var(--rule) 29px, var(--rule) 30px); background-position: 0 14px; }
.card.wide { width: min(100%, 560px); }
.card::before { content: ''; position: absolute; left: 50%; top: -12px; width: 86px; height: 26px; transform: translateX(-50%) rotate(-3deg); background: rgba(255, 210, 63, .78); box-shadow: 0 0 0 1.5px rgba(43, 43, 43, .35); z-index: 3; }
.card h2 { margin-top: 4px; }
.card p { margin: 0; font-size: 21px; }
@keyframes cardin { from { transform: translateY(24px) rotate(-3deg); opacity: 0; } }
#noteRoot { position: absolute; inset: 0; z-index: 60; pointer-events: none; }
.note { position: absolute; width: min(270px, calc(100% - 20px)); background: #FFF2A8; padding: 12px 14px 12px; transform: rotate(-1.4deg); animation: notein .16s steps(3, end); pointer-events: auto; }
.note h3 { font-family: var(--title); font-weight: 400; font-size: 26px; margin: 0 0 4px; line-height: 1; }
.note p { margin: 2px 0 0; font-size: 19px; line-height: 1.12; }
.note::before { content: ''; position: absolute; left: 50%; top: -9px; width: 54px; height: 18px; transform: translateX(-50%) rotate(2deg); background: rgba(160, 200, 240, .8); box-shadow: 0 0 0 1.5px rgba(43, 43, 43, .3); }
@keyframes notein { from { transform: scale(.8) rotate(-4deg); opacity: 0; } }
.toast { position: absolute; left: 50%; top: 64px; transform: translateX(-50%) rotate(-1deg); z-index: 50; background: #FFF2A8; padding: 8px 18px; font-size: 22px; white-space: nowrap; max-width: calc(100% - 24px); animation: notein .16s steps(3, end); }
#wipe { position: absolute; inset: 0; z-index: 70; pointer-events: none; display: none; }
#wipe.on { display: block; }
#wipe i { position: absolute; left: 0; right: 0; height: 25.2%; background: #F6E58A; animation: wipeaway var(--wm, .4s) steps(6, end) forwards; border-bottom: 3px solid var(--ink); }
#wipe i:nth-child(1) { top: 0; animation-delay: 0s; } #wipe i:nth-child(2) { top: 25%; background: #CFE3F2; animation-delay: .03s; } #wipe i:nth-child(3) { top: 50%; background: #F6E58A; animation-delay: .06s; } #wipe i:nth-child(4) { top: 75%; background: #CFE3F2; animation-delay: .09s; }
@keyframes wipeaway { 0% { transform: translateX(0); } 100% { transform: translateX(105%); } }


.logo { text-align: center; font-family: var(--title); line-height: .9; margin: 4px 0 0; }
.logo b { display: block; font-weight: 400; font-size: clamp(46px, 13vw, 74px); color: var(--red); -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--yellow); transform: rotate(-2deg); }
.logo b:nth-child(2) { color: var(--blue); transform: rotate(1.5deg); margin-top: 4px; }
.pick-lead { font-family: var(--title); font-size: 30px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pick-row { flex: 0 1 380px; min-height: 0; margin: auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: stretch; padding: 4px 2px 10px; }
.pick-card { position: relative; border: 0; background: transparent; padding: 8px 4px 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; transition: transform .08s; --px: var(--pxs); }
.pick-card .art { flex: 1; min-height: 0; display: flex; align-items: flex-end; justify-content: center; --px: var(--pxx, 3px); }
.pick-card .nm { font-family: var(--title); font-size: 27px; line-height: 1; }
.pick-card .pi { --px: var(--pxs); width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.title-mon { flex: 1; min-height: 120px; display: flex; align-items: center; justify-content: center; position: relative; --px: var(--pxx, 3px); }
.title-mon .spb { position: relative; display: block; }
.title-mon .spb::after { content: ''; position: absolute; left: 50%; bottom: -10px; width: 130%; height: 22px; transform: translateX(-50%); border-radius: 50%; background: repeating-linear-gradient(-38deg, rgba(60, 100, 40, .55) 0 3px, rgba(60, 100, 40, .1) 3px 6px); border: 2px solid rgba(43, 43, 43, .3); z-index: -1; }
.title-menu { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; padding: 4px 4px 8px; }
.title-menu .btn { min-height: 58px; min-width: 0; padding: 8px 8px; gap: 6px; font-size: 24px; } .title-menu .btn.big { font-size: 30px; }
.title-menu .btn.big { grid-column: 1 / -1; }


.map-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.map-head .who { flex: 1 1 120px; min-width: 0; display: flex; align-items: center; gap: 8px; }
.map-head .chipbtn { order: 2; }
.map-head .wc { width: calc(20 * var(--pxs) + 8px); height: calc(20 * var(--pxs) + 8px); display: flex; align-items: center; justify-content: center; --px: var(--pxs); flex: none; background: var(--paper); border-radius: 8px; }
.map-head .wc canvas { --cw: 20; --ch: 20; }
.map-head b { font-family: var(--title); font-weight: 400; font-size: 28px; display: block; line-height: 1; min-width: 0; overflow-wrap: anywhere; }
.map-head .mteam { display: flex; gap: 6px; order: 3; flex: 0 0 100%; justify-content: flex-start; padding-left: 4px; }
.zones { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 12px 14px; padding: 4px 6px 4px; position: relative; }
.zone { position: relative; border: 0; background: var(--paper); min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 0; overflow: visible; }
.zone .zpic { position: absolute; inset: 3px; border-radius: 8px; background-size: cover; background-position: center bottom; opacity: .95; }
.zone.locked .zpic { filter: grayscale(.9) brightness(1.15); opacity: .55; }
.zone .zi { position: absolute; left: 6px; top: 4px; z-index: 2; display: flex; --px: var(--pxs); }
.zone .zi canvas { --cw: 20; --ch: 20; }
.zone .zt { position: relative; z-index: 2; margin: 0 4px 4px; padding: 3px 6px 4px; background: rgba(251, 250, 245, .92); border-radius: 8px; text-align: center; }
.zone .zn { font-family: var(--title); font-weight: 400; font-size: 19px; line-height: 1; display: block; white-space: nowrap; overflow: hidden; }
.zone .pips { display: flex; justify-content: center; gap: 4px; margin-top: 3px; }
.pip { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); display: flex; align-items: center; justify-content: center; position: relative; }
.pip.done { background: var(--green); } .pip.now { background: var(--yellow); animation: supbounce .8s steps(1, end) infinite; } .pip.boss { width: calc(9 * var(--pxs) + 10px); height: calc(6 * var(--pxs) + 10px); border-radius: 4px; background: #F6D26B; }
.pm { width: calc(var(--mw) * var(--px)); height: calc(var(--mh) * var(--px)); flex: none; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.pip .pm { --px: var(--pxs); }
.zone.cur { transform: rotate(-.8deg); }
.zone .ck { position: absolute; right: 6px; top: 4px; z-index: 3; background: var(--paper); border-radius: 50%; width: calc(8 * var(--pxs) + 16px); height: calc(8 * var(--pxs) + 16px); display: flex; align-items: center; justify-content: center; --px: var(--pxs); box-shadow: 0 0 0 2px var(--ink); }
.zone .ck .pm { --px: var(--pxs); }
.doors { flex: none; display: flex; gap: 8px; }
.door { flex: 1; min-height: 62px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 22px; padding: 4px 6px; min-width: 0; --px: var(--pxs); }
.door .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); } .door canvas { --cw: 20; --ch: 20; }
.door.used { opacity: .45; }
.map-foot { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.next-card { flex: none; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px; row-gap: 2px; padding: 6px 10px; background: var(--paper); min-height: 74px; }
.next-card .nc { grid-row: 1 / 3; }
.next-card .nc { display: flex; --px: var(--pxs); } .next-card .nc canvas { --cw: 20; --ch: 20; }
.next-card .nm { font-family: var(--title); font-size: 26px; line-height: 1; overflow-wrap: anywhere; min-width: 0; }
.next-card .meta { margin: 0 !important; }
.next-card .meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.next-card .meta .pi { --px: var(--pxs); width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.map-foot .btn.big { flex: none; }


.den-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.den-prev { flex: none; display: flex; align-items: center; gap: 10px; justify-content: center; min-height: 150px; }
.den-prev .cv { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; --px: var(--pxx, 4px); }
.den-prev .dctl { display: flex; flex-direction: column; gap: 8px; width: 54%; max-width: 250px; }
.namebox { display: flex; gap: 6px; align-items: center; }
.namebox input { flex: 1; min-width: 0; min-height: 46px; font-family: var(--title); font-size: 26px; background: #FFF6D8; border: 0; padding: 4px 10px; color: var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 2.5px var(--ink); }
.den-side { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.tabs { flex: none; display: flex; gap: 6px; }
.tab { flex: 1; min-height: 46px; border: 0; background: transparent; font-family: var(--title); font-size: 18px; padding: 2px 0; min-width: 0; }
.tab.on { }
.tiles { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-content: start; padding: 4px 4px 12px; --px: var(--pxs); }
.tile { position: relative; border: 0; background: transparent; padding: 4px 2px 3px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 84px; min-width: 0; }
.tile .tc { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; } .tile .tc canvas { --cw: 20; --ch: 20; }
.tile .tn { font-size: 18px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; max-width: 100%; }
.tile .lk { position: absolute; right: 2px; top: 2px; --px: var(--pxs); z-index: 2; } .tile .lk .pm { --px: var(--pxs); }
.tile.lockd .tc { opacity: .85; }
.tile .sw { width: 48px; height: 32px; border-radius: 6px; box-shadow: 0 0 0 2px var(--ink); display: block; }
.tile .none { font-size: 26px; }
.den-note { flex: none; font-size: 19px; opacity: .85; text-align: center; min-height: 22px; }
.sword { display: flex; border-radius: 6px; overflow: hidden; width: 52px; height: 34px; box-shadow: 0 0 0 2px var(--ink); } .sword i { flex: 1; display: block; }


.upg-mon { flex: none; display: flex; justify-content: center; align-items: flex-end; min-height: 100px; --px: var(--pxx, 3px); }
.upg-title { font-family: var(--title); font-size: 36px; text-align: center; line-height: 1; }
.upg-row { flex: 0 1 260px; min-height: 0; margin-bottom: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 8px 4px; align-items: stretch; --px: var(--pxs); }
.ucard { position: relative; border: 0; background: transparent; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; transition: transform .08s, opacity .2s; animation: cardpop .3s steps(4, end) both; animation-delay: calc(var(--i, 0) * .12s); }
.ucard .k { font-size: 17px; opacity: .75; line-height: 1; }
.ucard .ico { display: flex; align-items: center; justify-content: center; min-height: 64px; --px: var(--pxs); }
.ucard .ico canvas { --cw: 20; --ch: 20; }
.ucard .un { font-family: var(--title); font-size: 26px; line-height: 1; text-align: center; overflow-wrap: anywhere; }
.ucard .dots { display: flex; gap: 3px; } .ucard .dots i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: var(--yellow); }
.ucard .qm { position: absolute; right: 2px; bottom: 2px; width: 44px; height: 44px; border: 0; background: transparent; font-family: var(--title); font-size: 22px; padding: 0; opacity: .8; }
.ucard.chosen { transform: scale(1.06) rotate(1deg); } .ucard.fade { opacity: .25; transform: scale(.94); }
@keyframes cardpop { from { transform: translateY(30px) rotate(-5deg); opacity: 0; } }
.evo-h { font-family: var(--title); font-size: 32px; text-align: center; line-height: 1; }
.evo-stage { flex: 1; min-height: 140px; position: relative; display: flex; align-items: flex-end; justify-content: center; --px: var(--pxx, 3px); }
.evo-stage canvas.big { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); }
.evo-stage canvas.b { opacity: 0; }
.evo-stage.go canvas.a { animation: evoA var(--em, 2.4s) steps(1, end) forwards; } .evo-stage.go canvas.b { animation: evoB var(--em, 2.4s) steps(1, end) forwards; }
@keyframes evoA { 0% { opacity: 1; } 12% { opacity: 0; filter: brightness(8); } 20% { opacity: 1; filter: brightness(8); } 30% { opacity: 0; } 40% { opacity: 1; filter: brightness(8); } 50% { opacity: 0; } 100% { opacity: 0; } }
@keyframes evoB { 0%, 45% { opacity: 0; } 50% { opacity: 1; filter: brightness(8); } 60% { opacity: 1; filter: none; } 100% { opacity: 1; filter: none; } }
.evo-flash { position: absolute; inset: 0; pointer-events: none; }
.evo-stage.go .evo-flash { animation: evflash var(--em, 2.4s) steps(1, end); }
@keyframes evflash { 0%, 100% { background: transparent; } 20% { background: rgba(255, 255, 255, .85); } 30% { background: transparent; } 50% { background: rgba(255, 233, 122, .9); } 62% { background: transparent; } }
.forms { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: calc(106 * var(--pxs) + 96px); gap: 10px; padding: 4px; --px: var(--pxs); }
.forms.done { grid-template-columns: 1fr; grid-auto-rows: auto; justify-items: center; }
.forms .fprev { min-height: 70px; display: flex; align-items: flex-end; justify-content: center; --px: var(--pxs); } .forms .fprev canvas { }
.book-grid, .fame-grid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-content: start; padding: 4px 4px 10px; --px: var(--pxs); }
.fame-grid { grid-template-columns: repeat(2, 1fr); }
.bk, .fame-card { position: relative; background: var(--paper); padding: 6px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; text-align: center; }
.bk .cv, .fame-card .cv { min-height: 56px; display: flex; align-items: flex-end; justify-content: center; } .bk .cv canvas { --cw: 20; --ch: 20; }
.bk b, .fame-card b { font-family: var(--title); font-weight: 400; font-size: 17px; line-height: 1; overflow-wrap: anywhere; max-width: 100%; }
.bk.unk { opacity: .8; } .bk .fr { position: absolute; right: 2px; top: 2px; --px: var(--pxs); } .bk .fr .pm { --px: var(--pxs); }
.fame-card .cv { min-height: 120px; --px: var(--pxs); } .fame-card small { font-size: 17px; }
.foot-row { flex: none; display: flex; gap: 10px; justify-content: center; padding: 4px 0 6px; }
.empty-note { text-align: center; font-size: 22px; padding: 24px; }
.vs-row { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: auto; padding: 2px; }
.vsbox { flex: 1 0 auto; min-height: 150px; display: flex; flex-direction: column; background: var(--paper); padding: 8px; gap: 4px; }
.vsh { font-family: var(--title); font-size: 26px; line-height: 1; }
.vsbody { flex: 1; display: flex; flex-direction: row; align-items: stretch; gap: 6px; min-height: 0; }
.vsl .cv { --px: var(--pxx, 3px); }
.vsl { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.vsbody .cv { flex: 1; display: flex; align-items: flex-end; justify-content: center; --px: var(--pxs); min-height: 100px; }
.nmrow { display: flex; align-items: center; gap: 2px; }
.vsn { flex: 1; min-width: 0; text-align: center; font-family: var(--title); font-size: 22px; line-height: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cols { display: grid; grid-template-columns: repeat(2, 44px); grid-auto-rows: 44px; gap: 4px; align-content: center; }
.dot { width: 44px; height: 44px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; }
.dot i { position: relative; overflow: hidden; width: 30px; height: 30px; border-radius: 52% 48% 55% 45% / 48% 54% 46% 52%; display: block; box-shadow: 0 0 0 2.5px var(--ink); }
.dot i::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(-38deg, rgba(255, 255, 255, .42) 0 2px, transparent 2px 6px), repeating-linear-gradient(52deg, rgba(43, 43, 43, .14) 0 1px, transparent 1px 9px); } .dot.on i { box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px var(--yellow); }
.curtain { position: absolute; inset: 0; z-index: 20; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; text-align: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.listbtn { position: relative; border: 0; background: transparent; padding: 8px 12px; display: flex; align-items: center; gap: 10px; text-align: left; font-size: 23px; min-height: 56px; --px: var(--pxs); }
.listbtn .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); } .listbtn .tc { display: flex; } .listbtn .tc canvas { --cw: 20; --ch: 20; }
.listbtn .cnt { margin-left: auto; font-family: var(--title); font-size: 28px; }
.listbtn.off { opacity: .45; }
.wheel { position: relative; width: 100%; max-width: 330px; margin: 0 auto; aspect-ratio: 1; --px: var(--pxs); }
.wheel svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wnode { position: absolute; transform: translate(-50%, -50%); width: 78px; display: flex; flex-direction: column; align-items: center; gap: 0; border: 0; background: transparent; padding: 0; font-size: 20px; line-height: 1; }
.wnode .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); } .wnode span { background: var(--paper); border-radius: 8px; padding: 0 5px; box-shadow: 0 0 0 1.5px var(--ink); font-family: var(--title); font-size: 19px; }
.wnode.me span { background: var(--yellow); } .wnode.foe span { background: #F7A59C; }
.bf { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #FFF6D8; text-align: left; }
.bf .bfc { display: flex; --px: var(--pxs); } .bf .bfc canvas { --cw: 20; --ch: 20; }
.bf .t { flex: 1; font-family: var(--title); font-size: 24px; line-height: 1; }
.bf .t small { display: block; font-family: var(--hand); font-size: 17px; opacity: .8; margin-top: 2px; }
.grow { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.grow li { display: flex; align-items: center; gap: 8px; font-size: 20px; text-align: left; --px: var(--pxs); } .grow .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); } .grow canvas { --cw: 20; --ch: 20; }
.helpbits { display: flex; gap: 8px; justify-content: center; --px: var(--pxs); flex-wrap: wrap; }
.helpbits .tag { }
.hintrow { display: flex; align-items: center; gap: 8px; justify-content: center; --px: var(--pxs); font-size: 22px; background: #FFF6D8; padding: 6px 10px; }
.faint-art { display: flex; justify-content: center; --px: var(--pxx, 3px); filter: grayscale(.3); }
.vic-art { display: flex; justify-content: center; --px: var(--pxs); }


@media (min-width: 700px) {
  .moves { grid-template-columns: repeat(4, 1fr); } .mv { min-height: 100px; flex-direction: column; justify-content: center; gap: 4px; text-align: center; padding-top: 10px; } .mv .mn { flex: none; font-size: 28px; }
  .pick-row { gap: 18px; } .title-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); } .title-menu .btn.big { grid-column: 1 / -1; }
  .zones { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(4, 1fr); } .book-grid { grid-template-columns: repeat(6, 1fr); } .fame-grid { grid-template-columns: repeat(4, 1fr); }
  .den-main { flex-direction: row; } .den-prev { flex: 0 0 40%; flex-direction: column; align-items: center; justify-content: center; } .den-prev .dctl { width: 100%; max-width: 320px; } .den-side { flex: 1; }
  .vs-row { flex-direction: row; } .vsbox { flex: 1; }
  .plate .pn { font-size: 26px; } .plate .hpn { font-size: 28px; } #msg { font-size: 28px; min-height: 60px; }
  .upg-row { gap: 18px; } .ucard .un { font-size: 30px; }
}
@media (max-width: 380px) { .mv .mn { font-size: 22px; } .plate .pn { font-size: 21px; } #msg { font-size: 22px; } }
@media (max-height: 640px) { .mv { min-height: 70px; } .ub { min-height: 48px; } #msg { min-height: 46px; } }

.flipx { transform: scaleX(-1); }

@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(5, 1fr); } }


@media (min-aspect-ratio: 5/4) and (min-width: 600px) {
  #screen-battle.on { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 40%); grid-template-rows: 1fr auto auto auto 1fr; gap: 10px 14px; }
  #screen-battle .scene { grid-column: 1; grid-row: 1 / 6; align-self: center; min-height: 0; }
  #screen-battle #msg { grid-column: 2; grid-row: 2; min-height: 52px; font-size: 26px; margin: 0; padding: 4px 10px; }
  #screen-battle .moves { grid-column: 2; grid-row: 3; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; }
  #screen-battle .moves .mv { min-height: 120px; flex-direction: column; justify-content: center; text-align: center; gap: 2px; padding: 6px 6px 8px; }
  #screen-battle .moves .mv .mn { flex: none; font-size: 26px; }
  #screen-battle .util { grid-column: 2; grid-row: 4; }
}
@media (max-height: 520px) and (min-width: 600px) {
  #screen-battle .moves .mv { min-height: 56px; flex-direction: row; text-align: left; padding: 2px 8px; gap: 6px; }
  #screen-battle .moves .mv .mn { flex: 1; font-size: 21px; }
  #screen-battle #msg { min-height: 40px; font-size: 21px; }
  #screen-battle.on { gap: 6px 12px; }
  .mv { min-height: 56px; flex-direction: row; text-align: left; padding: 2px 8px; gap: 6px; }
  .mv .mn { flex: 1; font-size: 21px; }
  .ub { min-height: 46px; }
  #topbar { min-height: 46px; padding-bottom: 2px; }
  .chipbtn { width: 44px; height: 44px; }
  .plate { min-height: 56px; }
}
@media (max-height: 520px) and (min-width: 600px) {
  #screen-map.on { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto 1fr; gap: 6px 12px; }
  #screen-map .map-head { grid-column: 1 / 3; grid-row: 1; }
  #screen-map .zones { grid-column: 1; grid-row: 2 / 4; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  #screen-map .doors { grid-column: 2; grid-row: 2; }
  #screen-map .map-foot { grid-column: 2; grid-row: 3; align-self: start; gap: 6px; }
  #screen-map .door { min-height: 46px; } #screen-map .next-card { min-height: 56px; padding: 3px 8px; } #screen-map .btn.big { min-height: 50px; font-size: 28px; }
}
@media (max-height: 520px) and (min-width: 600px) {
  #screen-upgrade.on, #screen-evolve.on { display: grid; grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 6px 14px; }
  #screen-upgrade .upg-mon { grid-column: 1; grid-row: 1 / 3; --px: var(--pxs); align-self: end; min-height: 0; }
  #screen-upgrade .upg-title { grid-column: 2; grid-row: 1; font-size: 30px; }
  #screen-upgrade .upg-row { grid-column: 2; grid-row: 2; flex: none; grid-auto-rows: minmax(0, 1fr); margin: 0; min-height: 0; }
  .ucard .ico { min-height: 50px; } .ucard .un { font-size: 22px; }
  #screen-evolve .evo-h { grid-column: 1 / 3; } #screen-evolve .evo-stage { grid-column: 1; --px: var(--pxs); min-height: 0; } #screen-evolve .forms { grid-column: 2; grid-auto-rows: minmax(0, 1fr); min-height: 0; }
  #screen-evolve.on { grid-template-rows: auto 1fr; }
}
@media (max-height: 520px) and (min-width: 600px) {
  #screen-title.on { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 4px 20px; }
  #screen-title .logo { grid-column: 1; grid-row: 1; } #screen-title .logo b { font-size: 38px; display: inline; margin-right: 8px; }
  #screen-title .title-mon { grid-column: 1; grid-row: 2; --px: var(--pxs); min-height: 0; }
  #screen-title .title-menu { grid-column: 2; grid-row: 1 / 3; align-self: center; grid-template-columns: 1fr 1fr; }
  .pick-row { flex: 0 1 auto; }
}


.scene .pw, .scene #intent { --px: var(--pxm); }


#page.inbattle .chipbtn, #page.inbattle .btn, #page.inbattle .ub, #page.inbattle .tm, #page.inbattle .listbtn, #page.inbattle .door, #page.inbattle .mv, #page.inbattle .tag, #page.inbattle .card, #page.inbattle .helpbits, #page.inbattle .hintrow, #page.inbattle .grow, #page.inbattle .ucard, #page.inbattle .wheel { --px: var(--pxs); }
#page.inbattle .mv, #page.inbattle .ub { --px: var(--pxb); }
#page.inbattle .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
#page.inbattle .chipbtn { width: calc(16 * var(--px) + 6px); height: calc(16 * var(--px) + 6px); }
#page.inbattle #topbar { min-height: 0; padding: 0 0 4px; }
#page.inbattle .chipbtn .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
#page.inbattle .ub { min-height: calc(16 * var(--px) + 10px); }
#page.inbattle .tag .sm .pi { min-width: 0; min-height: 0; }


@media (max-width: 699px) and (min-height: 521px) {
  #screen-evolve .evo-stage { flex: 1 1 auto; min-height: 120px; }
  #screen-evolve .forms { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 10px; }
  #screen-evolve .forms .ucard { flex-direction: row; justify-content: flex-start; align-items: center; gap: 14px; padding: 8px 12px; min-height: 120px; }
  #screen-evolve .forms .fprev { flex: 0 0 auto; width: calc(84 * var(--px)); max-height: 128px; overflow: hidden; min-height: 0; align-items: flex-start; justify-content: center; }
  #screen-evolve .forms .un { flex: 1; font-size: 30px; display: flex; align-items: center; gap: 10px; justify-content: flex-start; text-align: left; }
  #screen-evolve .forms.done { grid-template-columns: 1fr; }
}
#page.inbattle .tm { width: calc(20 * var(--px) + 8px); height: calc(20 * var(--px) + 12px); align-items: flex-start; padding-top: 2px; }
#page.inbattle .tm i { left: calc((100% - 30px) / 2); bottom: 2px; }

@media (min-height: 521px) { .util.three .ub { flex-direction: column; gap: 0; padding: 3px 4px 4px; font-size: 21px; line-height: 1; } #page.inbattle .util.three .ub { min-height: calc(16 * var(--px) + 34px); } }


@media (max-width: 699px) and (min-height: 521px) {
  #screen-upgrade { justify-content: center; gap: 14px; }
  #screen-upgrade .upg-row { flex: 0 1 300px; margin-bottom: 0; }
}



#screen-intro.on { justify-content: center; gap: 14px; padding: 4px 4px 10px; }
.intro-card { flex: 0 1 auto; height: min(64%, 540px); min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 18px 12px 16px; background: var(--paper); cursor: pointer; margin: 0 4px; }
.intro-slot { flex: none; display: flex; justify-content: center; width: 100%; min-height: 0; }
.intro-art { display: flex; align-items: flex-end; justify-content: center; gap: 12px; --px: var(--pxl); max-width: 100%; }
.intro-art .ia-ico .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.intro-art.friends .ia-ico { align-self: center; animation: supbounce .9s steps(1, end) infinite; }
.intro-art.map { flex-direction: column; align-items: center; width: 100%; gap: 10px; }
.intro-art.map .ia-ico { order: 3; } .intro-art.map .intro-trail { width: 100%; order: 2; }
.intro-art.boss { align-items: flex-end; } .intro-art.boss .ia-ico { align-self: flex-start; animation: supbounce .9s steps(1, end) infinite; }
.intro-words { font-family: var(--title); font-size: clamp(32px, 8.4vw, 50px); line-height: 1.04; text-align: center; padding: 0 6px; }
.intro-dots { display: flex; gap: 12px; }
.intro-dots i { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper); display: block; }
.intro-dots i.on { background: var(--yellow); }
.intro-btns { flex: none; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 0 4px; }
.intro-btns .btn.big { flex: 1 1 auto; max-width: 340px; }
.intro-btns .btn.small { min-width: 96px; min-height: 52px; }


.trail { flex: none; display: flex; align-items: flex-end; gap: 6px; padding: 0 8px 0 6px; --px: var(--pxs); min-height: 56px; }
.trail canvas { --cw: 20; --ch: 20; }
.tdots { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: auto; align-items: end; height: 56px; padding-bottom: 8px; position: relative; }
.td { grid-row: 1; justify-self: center; align-self: end; width: 7px; height: 7px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); display: block; }
.td.done { background: var(--green); }
.td.boss { width: 14px; height: 14px; background: var(--yellow); border-width: 2.5px; }
.td.boss.done { background: var(--green); box-shadow: 0 0 0 2px var(--yellow); }
.td.now { opacity: 0; }
.tpin { grid-row: 1; justify-self: center; align-self: end; position: relative; width: 0; height: 0; z-index: 2; }
.tpin canvas { position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%); animation: pinhop 1.1s steps(1, end) infinite; }
.tend { flex: none; display: block; padding-bottom: 2px; } .tend.now canvas { animation: pinhop 1.1s steps(1, end) infinite; }
@keyframes pinhop { 0% { margin-bottom: 0; } 50% { margin-bottom: 4px; } }
.intro-trail { padding: 0; width: 100%; max-width: 560px; }
.intro-trail .tdots { height: calc(20 * var(--px) + 14px); }
.intro-trail .td { width: 14px; height: 14px; } .intro-trail .td.boss { width: 20px; height: 20px; }
.intro-art.map { --px: var(--pxl); }
.intro-art.map .ia-ico .pi { width: calc(16 * var(--pxl)); height: calc(16 * var(--pxl)); }

.map-head .wn { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.evo { display: flex; align-items: center; gap: 6px; --px: var(--pxs); }
.evo .eup { display: block; width: 24px; height: 24px; } .evo .eup svg { width: 100%; height: 100%; display: block; }
.ebar { flex: none; display: block; width: 96px; height: 14px; border: 3px solid var(--ink); border-radius: 8px; background: var(--paper); overflow: hidden; display: block; }
.ebar i { display: block; height: 100%; background: repeating-linear-gradient(135deg, var(--green) 0 5px, #8ADB7E 5px 8px); }

.tipbub { position: absolute; z-index: 31; max-width: calc(100% - 16px); padding: 8px 16px; font-family: var(--title); font-size: 24px; line-height: 1.05; text-align: center; background: var(--paper); pointer-events: none; }
.hand { z-index: 60; }

.mv .why { position: absolute; left: 34px; top: -22px; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 3px 6px 3px 4px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; --px: var(--pxs); pointer-events: none; }
.mv .why .pi { width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.mv .why .wt svg { width: 20px; height: 20px; display: block; } .mv .why .ws svg { width: 24px; height: 24px; display: block; margin-left: -2px; }
#screen-battle.acting .mv .why { display: none; }

.lesson { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 12px; background: #FFF6D8; --px: var(--pxs); margin: 4px 0; }
.lesson b { font-family: var(--title); font-weight: 400; font-size: 24px; margin-left: 6px; }
.lesson .lt svg { width: 22px; height: 22px; display: block; }
@media (max-height: 520px) and (min-width: 600px) {
  
  #screen-map .map-head { grid-column: 1; } #screen-map .trail { grid-column: 2; grid-row: 1; align-self: end; min-height: 50px; padding: 0 2px; } #screen-map .tdots { height: 50px; }
  .map-head .wn { flex-direction: row; align-items: center; gap: 8px; } .ebar { width: 64px; } .evo .eup { width: 18px; height: 18px; }
}
