:root {
  --u: min(1vh, 0.5625vw);
  --font: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --gold: #ffc94a;
  --orange: #ff7a1a;
  --navy: #0d1233;
  --ink: #1a0b02;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
#app { position: fixed; inset: 0; overflow: hidden; font-family: var(--font); color: #fff; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* outlined display text */
.outline, .panel-title, .result-head, .timer, .name, .btn span, #combo, #callout, #banner, .vs-name, .vs-mark, .vs-stage, #mash, #ult-ready, #title-prompt {
  font-weight: 900;
  -webkit-text-stroke: 0;
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink),
    0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink),
    3px 4px 0 rgba(0,0,0,0.6);
}

#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 5; }
#letterbox .lb { position: absolute; left: 0; right: 0; height: 0; background: #000; transition: height 0.35s ease; z-index: 4; pointer-events: none; }
#letterbox .top { top: 0; } #letterbox .bottom { bottom: 0; }
#letterbox.on .lb { height: 11%; }

/* ---------- panels & buttons ---------- */
.panel {
  position: relative;
  border: calc(var(--u) * 3.2) solid transparent;
  border-image: url(assets/ui-panel.webp) var(--panel-slice, 150) fill / calc(var(--u) * 3.2) stretch;
  padding: calc(var(--u) * 2.4) calc(var(--u) * 3);
  filter: drop-shadow(0 calc(var(--u)*1) calc(var(--u)*2) rgba(0,0,0,0.6));
}
.panel.noart { border-image: none; background: linear-gradient(180deg, rgba(22,28,70,0.94), rgba(10,12,36,0.94)); border: 3px solid var(--gold); border-radius: 14px; }
.panel-title { font-size: max(18px, calc(var(--u) * 5)); color: var(--gold); text-align: center; letter-spacing: 0.04em; margin-bottom: calc(var(--u) * 1.5); }
.sub-title { font-size: max(14px, calc(var(--u) * 3.2)); color: #ffe7b0; margin: calc(var(--u) * 1.6) 0 calc(var(--u) * 1); font-weight: 900; }

.btn {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 44px; min-width: 44px;
  border: calc(var(--u) * 1.6) solid transparent;
  border-image: url(assets/ui-button.webp) var(--btn-slice, 120) fill / calc(var(--u) * 1.6) stretch;
  padding: 0 calc(var(--u) * 3);
  color: #fff; font-family: var(--font); font-weight: 900;
  transition: transform 0.12s cubic-bezier(.3,1.6,.5,1), filter 0.12s;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.45));
}
.btn.noart { border-image: none; background: linear-gradient(180deg, #ffb13a, #e8460f); border: 3px solid #ffe08a; border-radius: 12px; }
.btn span { pointer-events: none; }
.btn:hover, .btn.focus { transform: scale(1.06); filter: drop-shadow(0 4px 0 rgba(0,0,0,0.45)) brightness(1.18) drop-shadow(0 0 10px rgba(255,200,80,0.9)); }
.btn:active, .btn.pressed { transform: scale(0.93); }
.btn.big { height: max(48px, calc(var(--u) * 11)); font-size: max(17px, calc(var(--u) * 4.6)); min-width: calc(var(--u) * 34); }
.btn.small { height: max(44px, calc(var(--u) * 8.5)); font-size: max(14px, calc(var(--u) * 3.2)); }
.btn.round { width: max(48px, calc(var(--u) * 11)); height: max(48px, calc(var(--u) * 11)); padding: 0; font-size: max(20px, calc(var(--u) * 5)); }
.btn.disabled { filter: grayscale(0.8) brightness(0.7); }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; z-index: 10; }
.screen.dim { background: rgba(5, 6, 20, 0.55); display: flex; align-items: center; justify-content: center; }
.screen.dim.hidden { display: none; }

/* title */
#title { overflow: hidden; background: #0b1030; }
.title-art { position: absolute; inset: -3%; background: url(assets/title-bg.webp) center/cover no-repeat; animation: titlezoom 18s ease-in-out infinite alternate; }
@keyframes titlezoom { from { transform: scale(1.0); } to { transform: scale(1.06) translateX(-1%); } }
#title-logo { position: absolute; left: 4%; top: 6%; width: 50%; max-height: 38%; object-fit: contain; object-position: left top; animation: logoin 0.7s cubic-bezier(.3,1.5,.5,1) both, logofloat 3.2s 0.8s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5)); }
@keyframes logoin { from { transform: scale(0.4) translateY(-30%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes logofloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.2%); } }
#title-prompt { position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; font-size: max(16px, calc(var(--u) * 4.4)); color: #fff6d8; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.96); } }
.corner-btn {
  all: unset; box-sizing: border-box; position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  width: 50px; height: 50px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: rgba(13, 18, 51, 0.55); border: 2px solid rgba(255, 201, 74, 0.75); color: var(--gold);
  transition: transform 0.12s;
}
.corner-btn svg { width: 26px; height: 26px; }
.corner-btn em { position: absolute; right: 56px; font-style: normal; font-size: 13px; color: #ffe7b0; font-weight: 900; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.corner-btn:active { transform: scale(0.9); }

/* prep */
#prep { background: #070a1e; overflow: hidden; }
.prep-bg { position: absolute; inset: 0; background: url(assets/title-bg.webp) center/cover; filter: brightness(0.38) saturate(1.2) blur(2px); transform: scale(1.05); }
#prep-hero { position: absolute; left: 1%; bottom: -4%; height: 104%; object-fit: contain; animation: herohover 3s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(255,190,80,0.55)); }
@keyframes herohover { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.5%); } }
.prep-panel { position: absolute; right: calc(5% + env(safe-area-inset-right)); top: 13%; width: 54%; max-height: 82%; animation: panelin 0.3s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes panelin { from { transform: translateX(12%) scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.route { display: flex; gap: calc(var(--u) * 1.5); justify-content: center; }
.route .stage { flex: 1; text-align: center; position: relative; padding: calc(var(--u)*0.8); border-radius: 10px; background: rgba(0,0,0,0.35); border: 2px solid rgba(255,255,255,0.15); }
.route .stage img { width: 100%; height: calc(var(--u) * 16); object-fit: cover; object-position: top; border-radius: 6px; background: radial-gradient(circle, #3a2a60, #120a24); }
.route .stage.locked img { filter: brightness(0.15); }
.route .stage.done img { filter: grayscale(1) brightness(0.6); }
.route .stage.current { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,201,74,0.7); }
.route .stage .st-n { font-size: max(12px, calc(var(--u) * 2.6)); color: var(--gold); font-weight: 900; }
.route .stage .st-name { font-size: max(12px, calc(var(--u) * 2.6)); font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auras { display: flex; gap: calc(var(--u) * 1.5); justify-content: center; }
.aura-chip {
  all: unset; box-sizing: border-box; cursor: pointer; flex: 1; min-height: 44px; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: calc(var(--u) * 0.8) 2px;
  border-radius: 10px; background: rgba(0,0,0,0.35); border: 2px solid rgba(255,255,255,0.15); transition: transform 0.12s;
}
.aura-chip img, .aura-chip .dot { width: calc(var(--u) * 9); height: calc(var(--u) * 9); min-width: 30px; min-height: 30px; object-fit: contain; }
.aura-chip .dot { border-radius: 50%; }
.aura-chip .lbl { font-size: max(12px, calc(var(--u) * 2.4)); font-weight: 900; text-align: center; line-height: 1.1; }
.aura-chip .price { font-size: max(12px, calc(var(--u) * 2.3)); color: #ffe08a; display: flex; align-items: center; gap: 2px; }
.aura-chip .price img { width: 1.2em; height: 1.2em; min-width: 0; min-height: 0; }
.aura-chip.sel { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,201,74,0.8); background: rgba(255,170,40,0.18); }
.aura-chip.locked img { filter: brightness(0.55) grayscale(0.4); }
.aura-chip.focus, .aura-chip:hover { transform: scale(1.06); }
.prep-actions { display: flex; justify-content: center; align-items: center; gap: calc(var(--u) * 3); margin-top: calc(var(--u) * 2.4); }
.gold-chip { position: absolute; left: calc(2% + env(safe-area-inset-left)); top: 3%; display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 6px; border-radius: 999px; background: rgba(10,12,36,0.75); border: 2px solid rgba(255,201,74,0.7); font-weight: 900; font-size: max(16px, calc(var(--u) * 3.6)); z-index: 2; }
.gold-chip img { width: max(24px, calc(var(--u) * 5.5)); height: max(24px, calc(var(--u) * 5.5)); object-fit: contain; }

/* VS */
#vs { background: #000; overflow: hidden; }
.vs-side { position: absolute; top: 0; bottom: 0; width: 56%; overflow: hidden; }
.vs-side.left { left: 0; background: linear-gradient(120deg, #ff8a1a, #b82a00); clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%); animation: vsl 0.45s cubic-bezier(.2,1.3,.5,1) both; }
.vs-side.right { right: 0; background: linear-gradient(240deg, #5a2aff, #14063a); clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%); animation: vsr 0.45s cubic-bezier(.2,1.3,.5,1) both; }
.vs-side img { position: absolute; bottom: -8%; height: 112%; filter: drop-shadow(0 0 20px rgba(0,0,0,0.6)); }
.vs-side.left img { left: 8%; }
.vs-side.right img { right: 8%; }
@keyframes vsl { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes vsr { from { transform: translateX(100%); } to { transform: none; } }
.vs-name { position: absolute; bottom: 8%; font-size: max(22px, calc(var(--u) * 7)); }
.vs-side.left .vs-name { left: 6%; }
.vs-side.right .vs-name { right: 6%; }
.vs-mark { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: calc(var(--u) * 24); color: var(--gold); font-style: italic; animation: vsslam 0.5s 0.35s cubic-bezier(.3,1.8,.5,1) both; }
@keyframes vsslam { from { transform: translate(-50%, -50%) scale(4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.vs-stage { position: absolute; left: 0; right: 0; top: 6%; text-align: center; font-size: max(18px, calc(var(--u) * 5)); color: #fff; animation: logoin 0.4s 0.6s both; }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
#hud .bar { position: absolute; top: calc(var(--u) * 2.2); display: flex; align-items: center; gap: calc(var(--u) * 1.2); width: 36%; }
#hud .bar.p1 { left: calc(var(--u) * 2.5 + env(safe-area-inset-left)); }
#hud .bar.p2 { right: calc(76px + env(safe-area-inset-right)); width: 33%; }
.portrait { width: calc(var(--u) * 12); height: calc(var(--u) * 12); min-width: 40px; min-height: 40px; border-radius: 50%; overflow: hidden; border: 3px solid var(--gold); background: radial-gradient(circle, #ffb34a, #a3280a); flex: none; box-shadow: 0 2px 6px rgba(0,0,0,0.6); }
.p2 .portrait { background: radial-gradient(circle, #8a5aff, #2a0a5a); }
.portrait img { width: 100%; height: 300%; object-fit: cover; object-position: top; transform: scale(1.0); }
#hud .bars { flex: 1; display: flex; flex-direction: column; gap: calc(var(--u) * 0.7); }
#hud .p2 .bars { align-items: flex-end; }
#hud .name { font-size: max(14px, calc(var(--u) * 3.2)); line-height: 1; }
.hp { position: relative; width: 100%; height: calc(var(--u) * 3.6); min-height: 12px; background: rgba(10,6,20,0.8); border: 2px solid #fff3; transform: skewX(-18deg); overflow: hidden; border-radius: 3px; }
.p2 .hp { transform: skewX(18deg); }
.hp-fill, .hp-lag { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; }
.p2 .hp-fill, .p2 .hp-lag { left: auto; right: 0; }
.hp-lag { background: #ff3a2a; transition: width 0.6s 0.3s ease; }
.hp-fill { background: linear-gradient(180deg, #fff27a, #ffb21a 55%, #e86a00); }
.hp-fill.low { background: linear-gradient(180deg, #ff9a7a, #ff3a1a 55%, #a80a00); }
.ki { display: flex; gap: 4px; width: 70%; }
.ki i { flex: 1; height: calc(var(--u) * 2); min-height: 8px; background: rgba(10,6,20,0.8); border: 1px solid #fff4; position: relative; overflow: hidden; transform: skewX(-18deg); }
.p2 .ki i { transform: skewX(18deg); }
.ki i b { position: absolute; inset: 0; width: 0; background: linear-gradient(180deg, #bff4ff, #38a8ff); }
.ki i.full b { background: linear-gradient(180deg, #fff, #7fe0ff); box-shadow: 0 0 8px #7fe0ff; }
.ki.max i b { animation: kimax 0.4s infinite alternate; }
@keyframes kimax { from { filter: brightness(1); } to { filter: brightness(1.6); } }
.timer { position: absolute; left: 50%; top: calc(var(--u) * 1.6); transform: translateX(-50%); font-size: max(24px, calc(var(--u) * 8)); color: #fff; min-width: 2.2em; text-align: center; }
.timer.low { color: #ff5a3a; }
#combo { position: absolute; left: calc(var(--u) * 3 + env(safe-area-inset-left)); top: 24%; font-size: max(20px, calc(var(--u) * 7)); color: var(--gold); font-style: italic; opacity: 0; transform-origin: left center; }
#combo.show { animation: comboin 0.18s cubic-bezier(.3,1.8,.5,1) both; opacity: 1; }
@keyframes comboin { from { transform: scale(1.6); } to { transform: scale(1); } }
#callout { position: absolute; left: 0; right: 0; top: 22%; text-align: center; font-size: max(20px, calc(var(--u) * 6)); color: #bff4ff; opacity: 0; }
#callout.show { animation: callout 1.2s ease both; }
@keyframes callout { 0% { opacity: 0; transform: scale(1.5); } 12% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
#mash { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: max(24px, calc(var(--u) * 8)); color: #fff; display: none; }
#mash.on { display: block; animation: mash 0.18s infinite alternate; }
@keyframes mash { from { transform: scale(1); color: #fff; } to { transform: scale(1.1); color: var(--gold); } }
#ult-ready { position: absolute; left: calc(var(--u) * 3 + env(safe-area-inset-left)); top: calc(var(--u) * 17); font-size: max(13px, calc(var(--u) * 2.8)); color: #bff4ff; display: none; }
#ult-ready.on { display: block; animation: pulse 0.9s infinite; }
#subtitle { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); max-width: 46%; text-align: center; font-size: max(14px, calc(var(--u) * 3.4)); font-weight: 900; padding: 6px 16px; background: rgba(0,0,0,0.55); border-radius: 8px; opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 30; text-shadow: 0 2px 2px #000; }
#subtitle.on { opacity: 1; }
#banner { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: calc(var(--u) * 20); color: var(--gold); font-style: italic; pointer-events: none; opacity: 0; z-index: 6; letter-spacing: 0.04em; }
#banner.show { animation: banner 1.4s cubic-bezier(.3,1.6,.5,1) both; }
#banner.hold { animation: bannerhold 0.5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes banner { 0% { opacity: 0; transform: translateY(-50%) scale(3); } 18% { opacity: 1; transform: translateY(-50%) scale(1); } 80% { opacity: 1; transform: translateY(-50%) scale(1.04); } 100% { opacity: 0; transform: translateY(-50%) scale(1.2); } }
@keyframes bannerhold { 0% { opacity: 0; transform: translateY(-50%) scale(3); } 100% { opacity: 1; transform: translateY(-50%) scale(1); } }

/* results */
.result-panel { width: min(62%, calc(var(--u) * 110)); text-align: center; animation: popin 0.3s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes popin { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.result-head { font-size: max(30px, calc(var(--u) * 11)); font-style: italic; line-height: 1.1; }
.result-head.win { color: var(--gold); }
.result-head.lose { color: #ff6a5a; }
.result-sub { font-size: max(14px, calc(var(--u) * 3.4)); color: #ffe7b0; font-weight: 900; margin: calc(var(--u) * 1) 0 calc(var(--u) * 1.6); }
.rows { display: flex; flex-direction: column; gap: calc(var(--u) * 0.8); margin: 0 auto calc(var(--u) * 2); width: 86%; }
.rows .row { display: flex; justify-content: space-between; align-items: center; font-size: max(14px, calc(var(--u) * 3.4)); font-weight: 900; padding: 2px 10px; background: rgba(0,0,0,0.3); border-radius: 6px; animation: rowin 0.25s both; }
.rows .row.total { font-size: max(18px, calc(var(--u) * 4.6)); color: var(--gold); background: rgba(255,170,40,0.15); }
.rows .row img { width: 1.4em; height: 1.4em; vertical-align: middle; object-fit: contain; }
@keyframes rowin { from { transform: translateX(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
.result-actions { display: flex; justify-content: center; align-items: center; gap: calc(var(--u) * 3); }
.ko-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--u) * 2); }
.ko-actions .btn { min-width: calc(var(--u) * 36); }
.ko-actions .btn img { width: 1.5em; height: 1.5em; object-fit: contain; }
.help-panel { width: min(80%, calc(var(--u) * 140)); max-height: 92%; overflow: auto; animation: popin 0.3s cubic-bezier(.3,1.6,.5,1) both; }
.help-rows { display: grid; grid-template-columns: auto 1fr; gap: calc(var(--u) * 0.8) calc(var(--u) * 2.4); font-size: max(13px, calc(var(--u) * 3)); margin-bottom: calc(var(--u) * 2); }
.help-rows .k { color: var(--gold); font-weight: 900; white-space: nowrap; }
.help-rows .d { color: #fff; }
@media (max-height: 520px) {
  .help-panel { width: min(96%, calc(var(--u) * 178)); max-height: 96%; }
  .help-rows { font-size: 12px; line-height: 1.25; gap: 2px 12px; margin-bottom: 6px; }
}

/* intro */
#intro { position: absolute; inset: 0; z-index: 40; background: #000 url(assets/title-bg.webp) center/cover; }
#intro video { width: 100%; height: 100%; object-fit: cover; background: transparent; }
/* charge bar, ki deny */
#charge-bar { position: absolute; left: 50%; bottom: 27%; transform: translateX(-50%); width: min(36%, calc(var(--u) * 64)); display: none; text-align: center; }
#charge-bar.on { display: block; }
.cb-label, .confirm-name, .sc-name, .stage-desc { font-weight: 900; text-shadow: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 2px 3px 0 rgba(0,0,0,0.6); }
.cb-label { font-size: max(14px, calc(var(--u) * 3.2)); color: #dff6ff; }
.cb-track { height: max(12px, calc(var(--u) * 2.6)); background: rgba(10,6,20,0.85); border: 2px solid var(--gold); border-radius: 999px; overflow: hidden; margin-top: 4px; transform: skewX(-18deg); }
.cb-fill { height: 100%; width: 0; background: linear-gradient(90deg, #2a7aff, #bff4ff); }
#charge-bar.full .cb-fill { background: linear-gradient(90deg, #ff6a10, #ffe14a, #fff); animation: kimax 0.12s infinite alternate; }
#charge-bar.full .cb-label { color: var(--gold); animation: pulse 0.3s infinite; }
#charge-bar.burst { width: min(48%, calc(var(--u) * 86)); }
#charge-bar.burst .cb-fill { background: linear-gradient(90deg, #4ad8ff, #ffffff, #ffe14a); animation: kimax 0.18s infinite alternate; }
#charge-bar.burst .cb-label { color: #bff4ff; animation: pulse 0.45s infinite; white-space: nowrap; }
#charge-bar.heavy { width: min(48%, calc(var(--u) * 86)); }
#charge-bar.heavy .cb-fill { background: linear-gradient(90deg, #c8160a, #ff7a2a); }
#charge-bar.heavy.full .cb-fill { background: linear-gradient(90deg, #ff2a10, #ffd04a, #fff); animation: kimax 0.1s infinite alternate; }
#charge-bar.heavy .cb-label { white-space: nowrap; color: #ffb27a; }
#charge-bar.heavy.full .cb-label { color: var(--gold); }
.ki.deny i { background: rgba(255, 40, 30, 0.9); box-shadow: 0 0 10px #ff3020; }

/* prep: mode tabs, stage cards, opponents */
.prep-panel { top: 3%; max-height: 94%; width: 56%; }
.mode-tabs { display: flex; gap: calc(var(--u) * 2); justify-content: center; margin-bottom: calc(var(--u) * 1.4); }
.mode-tabs .tab { flex: 1; max-width: 48%; filter: grayscale(0.75) brightness(0.6) drop-shadow(0 4px 0 rgba(0,0,0,0.45)); }
.mode-tabs .tab.on { filter: drop-shadow(0 4px 0 rgba(0,0,0,0.45)) drop-shadow(0 0 8px rgba(255,200,80,0.85)); }
.mode-tabs .tab.on span { color: var(--gold); }
.route .stage img { height: calc(var(--u) * 13); }
.stage-cards { display: flex; gap: calc(var(--u) * 1.2); }
.sc-pick { all: unset; box-sizing: border-box; cursor: pointer; flex: 1; min-width: 0; position: relative; height: max(56px, calc(var(--u) * 14)); border-radius: 8px; overflow: hidden; border: 2px solid rgba(255,255,255,0.2); background: #111 center / cover no-repeat; transition: transform 0.12s; }
.sc-pick .sc-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 3px 3px; font-size: max(11px, calc(var(--u) * 2.4)); text-align: center; line-height: 1.1; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.85)); }
.sc-pick.sel { border-color: var(--gold); box-shadow: 0 0 10px rgba(255,201,74,0.9); }
.sc-pick.focus, .sc-pick:hover { transform: scale(1.05); }
.stage-desc { font-size: max(12px, calc(var(--u) * 2.5)); color: #ffe7b0; text-align: center; margin-top: calc(var(--u) * 0.8); }
.enemy-row { display: flex; align-items: center; gap: calc(var(--u) * 1.5); margin-top: calc(var(--u) * 1); }
.enemy-row .sub-title { margin: 0; white-space: nowrap; }
.enemies { display: flex; gap: calc(var(--u) * 1.2); flex: 1; min-width: 0; }
.enemy-chip { all: unset; box-sizing: border-box; cursor: pointer; flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: max(46px, calc(var(--u) * 10)); padding: 0 4px; border-radius: 10px; background: rgba(0,0,0,0.35); border: 2px solid rgba(255,255,255,0.15); transition: transform 0.12s; }
.enemy-chip .face { width: max(34px, calc(var(--u) * 8)); height: max(34px, calc(var(--u) * 8)); border-radius: 50%; overflow: hidden; flex: none; border: 2px solid #a080ff; background: radial-gradient(circle, #8a5aff, #2a0a5a); }
.enemy-chip .face img { width: 100%; height: 300%; object-fit: cover; object-position: top; }
.enemy-chip span { font-size: max(11px, calc(var(--u) * 2.3)); font-weight: 900; line-height: 1.05; overflow: hidden; }
.enemy-chip.sel { border-color: var(--gold); box-shadow: 0 0 10px rgba(255,201,74,0.85); background: rgba(255,170,40,0.18); }
.enemy-chip.focus, .enemy-chip:hover { transform: scale(1.05); }
/* unlocks: locked opponent, conditions, clear notes */
.enemy-chip.locked { filter: grayscale(0.85) brightness(0.7); border-style: dashed; }
.enemy-chip.locked .face { position: relative; border-color: #777; background: #222; }
.enemy-chip .face .lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.1em; background: rgba(0,0,0,0.45); }
.enemy-cond { text-align: center; }
/* free battle has more rows: tighten them so the panel fits a landscape phone */
#free-box .sc-pick { height: max(46px, calc(var(--u) * 12)); }
#free-box:not(.hidden) ~ .sub-title { margin: calc(var(--u) * 0.8) 0 calc(var(--u) * 0.5); }
#free-box:not(.hidden) ~ .auras .aura-chip img, #free-box:not(.hidden) ~ .auras .aura-chip .dot { width: calc(var(--u) * 7); height: calc(var(--u) * 7); min-width: 26px; min-height: 26px; }
#free-box:not(.hidden) ~ .prep-actions { margin-top: calc(var(--u) * 1.4); }
@media (max-width: 960px) { .enemy-row .sub-title { display: none; } .enemy-chip { gap: 3px; padding: 0 3px; } }
.enemy-cond.hidden { display: none; }
.enemy-cond, .stage-desc.enemy-cond { font-size: max(11px, calc(var(--u) * 2.1)); color: #ffd98a; font-weight: 800; margin: 2px 0 0; line-height: 1.2; text-shadow: 0 1px 0 var(--ink), 0 0 3px var(--ink); }
.st-cond { display: block; margin-top: 2px; font-size: max(10px, calc(var(--u) * 1.8)); line-height: 1.15; font-weight: 900; color: #ff9ab0; text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink); white-space: normal; }
.st-cond.ok { color: #9dffb0; }
.aura-chip .price.unlock { font-size: max(10px, calc(var(--u) * 1.75)); line-height: 1.1; white-space: normal; text-align: center; color: #ffd0d0; }
.clear-note { margin: calc(var(--u) * 0.8) auto 0; padding: 4px 12px; border-radius: 8px; font-weight: 900; font-size: max(13px, calc(var(--u) * 2.6)); text-align: center; color: #fff; background: rgba(20,10,40,0.55); text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); animation: notePop 0.45s cubic-bezier(.2,1.6,.4,1) both; }
.clear-note.unlock { color: var(--gold); border: 2px solid rgba(255,201,74,0.8); box-shadow: 0 0 12px rgba(255,201,74,0.5); }
.clear-note.stuck { color: #ff9ab0; border: 2px solid rgba(255,80,120,0.7); }
@keyframes notePop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
#hidden-hint { position: absolute; left: 50%; top: calc(var(--u) * 14); transform: translateX(-50%); font-weight: 900; font-size: max(12px, calc(var(--u) * 2.2)); letter-spacing: 0.08em; color: #ff8fb0; text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink), 0 0 8px rgba(255,40,90,0.8); animation: hintPulse 1.2s ease-in-out infinite; pointer-events: none; }
#hidden-hint.hidden { display: none; }
@keyframes hintPulse { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
.prep-actions .btn.round { font-size: max(20px, calc(var(--u) * 4.6)); }

/* purchase confirm */
#confirm { z-index: 20; }
/* the world-break cutscene: over the arena, the HUD and the flash; taps go through to the game (they skip it) */
#ultcut { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
#ultcut canvas { width: 100%; height: 100%; display: block; }
#subtitle { z-index: 8; }
.confirm-panel { width: min(54%, calc(var(--u) * 96)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 1.2); animation: popin 0.25s cubic-bezier(.3,1.6,.5,1) both; }
#confirm-icon { width: max(56px, calc(var(--u) * 16)); height: max(56px, calc(var(--u) * 16)); object-fit: contain; filter: drop-shadow(0 0 12px rgba(255,200,80,0.7)); }
.confirm-name { font-size: max(18px, calc(var(--u) * 5)); color: var(--gold); }
.confirm-msg { font-size: max(14px, calc(var(--u) * 3.3)); font-weight: 900; color: #fff3d8; }
.confirm-msg.warn { color: #ff7a6a; }
.confirm-gold { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: max(14px, calc(var(--u) * 3.3)); padding: 2px 12px 2px 4px; border-radius: 999px; background: rgba(0,0,0,0.35); }
.confirm-gold img { width: 1.6em; height: 1.6em; object-fit: contain; }
.confirm-panel .result-actions { margin-top: calc(var(--u) * 0.6); }

#btn-skip { position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); }
