:root {
  /* brand: black / white / red */
  --bg: #0a0a0b; --bg2: #0f0f10; --panel: #141415; --panel2: #1c1c1e; --line: #2b2b2e;
  --txt: #f4f4f5; --dim: #9a9aa0;
  --red: #e7202b; --red-2: #ff3a44;
  /* legacy accent names remapped onto the brand so all components recolor */
  --green: #f4f4f5; --pink: #e7202b; --gold: #ffffff; --blue: #d0d0d4; --orange: #e7202b;
  --r-common: #8a8a90; --r-uncommon: #27c46b; --r-rare: #2e9bff; --r-epic: #b061ff; --r-legendary: #ffcb1e; --r-unique: #e7202b;
  --rad: 13px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; user-select: none; }
#app { position: fixed; inset: 0; overflow: hidden; }
button { font-family: inherit; cursor: pointer; color: inherit; border: none; background: none; appearance: none; -webkit-appearance: none; }

/* Mobile-only game: on a wide screen (PC) clamp to a phone frame so dev matches mobile */
@media (min-width: 700px) {
  html, body { background: #050507; }
  body { display: grid; place-items: center; }
  #app { position: relative; inset: auto; height: 94vh; aspect-ratio: 9 / 19.5; max-width: 96vw; width: auto;
    border-radius: 26px; overflow: hidden; box-shadow: 0 0 0 9px #161618, 0 24px 70px #000; }
}
.ic { display: inline-block; vertical-align: -0.18em; flex: none; }
.scene { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---------- boxing textures (UFC cage + grain), inline SVG, no asset files ---------- */
body { background:
  radial-gradient(130% 90% at 50% -10%, #1c1224 0%, #07080f 62%); }
.menu { background: transparent; position: absolute; }
.menu::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(120% 80% at 50% -10%, #2a1a3866 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cpolygon points='100,25 200,25 275,100 275,200 200,275 100,275 25,200 25,100' fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='2'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: cover, 300px 300px, 140px 140px;
  background-position: center, center, center;
  opacity: 0.9;
}
.menu > * { position: relative; z-index: 1; }

/* per-section background image (each menu shows its room) — kept bright, only the
   areas under text/buttons are darkened by the elements' own panels. */
.menu .section-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #0a0a0b; }
.menu .section-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.menu .section-bg--gacha img { object-position: center top; }

/* intro cinematic: coach full-bleed, no frame, story text at the bottom */
.intro { position: absolute; inset: 0; background: #000; overflow: hidden; }
.intro-coach { position: absolute; top: 0; left: 50%; transform: translateX(-50%); height: 74%; width: auto; max-width: 120%; object-fit: contain; object-position: top center; transition: opacity .3s; }
.intro.has-illus .intro-coach, .intro.has-illus .intro-portal { display: none; }
.intro-illus { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 1; }
.intro-skip { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 14px; z-index: 3; }
.intro-skip button { background: #0008; border: 1px solid var(--line); color: var(--dim); padding: 8px 14px; border-radius: 20px; font-weight: 700; }
.intro-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 60px 22px calc(env(safe-area-inset-bottom) + 26px); background: linear-gradient(180deg, transparent 0%, #000 26%); text-align: center; }
.intro-name { color: var(--gold); font-weight: 800; letter-spacing: 1px; margin-bottom: 8px; }
.intro-text { color: #eef2ff; font-size: 17px; line-height: 1.55; max-width: 520px; margin: 0 auto 16px; min-height: 92px; }
.intro-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 16px; }
.intro-dots i { width: 7px; height: 7px; border-radius: 50%; background: #39406a; transition: background .2s; }
.intro-dots i.on { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.intro-next { max-width: 320px; margin: 0 auto; }

/* character select — gym backdrop, big fighters, male preselected */
.charsel { align-items: center; justify-content: center; text-align: center; gap: 26px; padding: 20px; }
.cs-title { position: relative; z-index: 1; font-size: 23px; font-weight: 900; text-shadow: 0 2px 8px #000; }
.cs-stage { position: relative; z-index: 1; display: flex; gap: 6px; align-items: flex-end; justify-content: center; width: 100%; max-width: 540px; }
.cs-fighter { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; background: none; border: none; color: var(--txt); filter: drop-shadow(0 0 20px var(--red)) drop-shadow(0 6px 16px #000); transition: opacity .25s, filter .25s, flex .35s ease; }
.cs-fighter img { width: 100%; height: auto; max-height: 36vh; object-fit: contain; transition: max-height .35s ease; }
.cs-fighter span { font-weight: 800; font-size: 16px; }
.cs-fighter.off { flex: 0 0 0%; opacity: 0; pointer-events: none; }
.cs-fighter.off img { max-height: 0; }
.cs-fighter.on { flex: 1 1 100%; }
.cs-fighter.on img { max-height: 72vh; }
.cs-fighter.on span { display: none; }
.cs-confirm-row { position: relative; z-index: 1; width: 100%; max-width: 320px; min-height: 78px; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.cs-confirm-row.show { opacity: 1; pointer-events: auto; }
.cs-confirm-row p { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
/* Reusable SÍ/NO confirm buttons — black bg, white text at rest; a red circular fill
   ripples out from the exact tap point (like a drop hitting water) on press. */
.yn-btns { display: flex; gap: 10px; }
.yn-btn { position: relative; overflow: hidden; flex: 1; padding: 14px; border-radius: 12px; background: #000; border: 1px solid #ffffff33; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .5px; }
.yn-label { position: relative; z-index: 1; }
.yn-ripple { position: absolute; z-index: 0; border-radius: 50%; background: var(--red); transform: scale(0); opacity: .92; pointer-events: none; transition: transform .32s ease-out; }
.yn-ripple.show { transform: scale(1); }
.scroll { flex: 1; overflow-y: auto; padding: 14px 16px 96px; -webkit-overflow-scrolling: touch; }
h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: .3px; }
h3 { margin: 20px 0 10px; color: var(--red); font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 800; }
h4 { margin: 16px 0 8px; font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.hint { color: var(--dim); font-size: 13px; line-height: 1.55; margin: 8px 0; }
.hint.small { font-size: 11.5px; } code { background: #0008; padding: 1px 5px; border-radius: 5px; color: var(--blue); font-size: .92em; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 16px; padding-top: calc(env(safe-area-inset-top) + 14px); background: repeating-linear-gradient(90deg, #ffffff08 0 1px, transparent 1px 4px), linear-gradient(180deg, #2c2c31 0%, #161618 55%, #0b0b0d 100%); box-shadow: inset 0 1px 0 #ffffff2e, inset 0 -3px 6px #0008, 0 6px 16px #0007; }
.topbar .back { color: var(--txt); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--panel); }
.topbar .back:active { background: var(--panel2); }
.topbar h2 { flex: 1; }
/* one-handed layout: move the top bar to the bottom for bottom-nav screens */
.bar-bottom .topbar {
  order: 99; padding-top: 14px; padding-bottom: calc(env(safe-area-inset-bottom) + 14px);
  border: none;
  background:
    repeating-linear-gradient(90deg, #ffffff08 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #2c2c31 0%, #161618 16%, #0b0b0d 60%, #060607 100%);
  box-shadow: inset 0 1px 0 #ffffff2e, inset 0 2px 6px #ffffff10, inset 0 -3px 6px #000, 0 -8px 20px #000c;
}
.bar-bottom .topbar .back { background: linear-gradient(180deg, #303035, #141416); box-shadow: inset 0 1px 0 #ffffff22, 0 1px 2px #000; }
.bar-bottom .scroll { padding-bottom: 20px; }
.claim-all { position: absolute; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 80px); z-index: 6; display: inline-flex; align-items: center; gap: 6px; padding: 11px 18px; border-radius: 12px; font-weight: 900; font-size: 14px; border: 1px solid transparent; }
.claim-all.ready { background: linear-gradient(180deg, #ff3a44, #d40d18); color: #fff; box-shadow: 0 4px 14px #0009, 0 0 18px #ff2a36aa; animation: claimPulse 1.2s ease-in-out infinite; }
.claim-all.off { background: #1a1a1c; color: #5a5a5e; border-color: #2b2b2e; box-shadow: none; }
.claim-all.ready:active { transform: scale(.95); }
.claim-all.top-action { top: calc(env(safe-area-inset-top) + 72px); bottom: auto; }
@keyframes claimPulse { 0%, 100% { box-shadow: 0 4px 14px #0009, 0 0 14px #ff2a3680; } 50% { box-shadow: 0 4px 14px #0009, 0 0 24px #ff2a36cc; } }
.currency { display: inline-flex; gap: 11px; font-size: 13px; font-weight: 800; background: #000000aa; border: 1px solid #ffffff24; border-radius: 14px; padding: 5px 12px; }
.currency span { display: inline-flex; align-items: center; gap: 4px; }
.currency span:first-child { color: var(--gold); } .currency span:last-child { color: #ff5b6e; }

/* ---------- home ---------- */
.home { align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 24px; }
.home::before { display: none; } /* gym image replaces the cage texture here */
.home .gym-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #07080f; }
.gym-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.2); transition: opacity .55s ease, transform 3.6s cubic-bezier(.2,.6,.2,1); will-change: opacity, transform; }
.gym-layer.show { opacity: 1; }
.home .gym-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #0a0a0bcc 0%, #0a0a0b22 34%, #0a0a0b22 56%, #0a0a0be0 100%); transition: background .4s ease; }
.gym-layer { opacity: 0; }
.gym-layer.show { opacity: .95; }

/* official title image replaces the text logo */
.title-img { width: min(86%, 430px); max-height: 30vh; object-fit: contain; filter: drop-shadow(0 6px 22px #000) drop-shadow(0 0 16px #e7202b55); }
.home .lvl, .home .statline { text-shadow: 0 2px 8px #000; }
.home .hero-head { position: relative; }

/* swappable game-icon placeholders (img) + emoji fallback */
.gi { object-fit: contain; vertical-align: -0.2em; }
.gi-emoji { display: inline-block; line-height: 1; vertical-align: -0.12em; }

/* portal art on boot + behind the coach in the intro */
.boot-portal { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.boot-portal ~ * { position: relative; }
.intro-portal { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.intro-coach { z-index: 1; }
/* "step into the ring" transition when an option is tapped */
.home.stepping .gym-layer.show { transform: scale(1.85) !important; transition: transform .42s ease-in; }
.home.stepping .gym-bg::after { background: #07080f; }
.home.stepping .hero-head, .home.stepping .menu-grid, .home.stepping .foot { opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .3s ease, transform .3s ease; pointer-events: none; }
.hero-head { width: 100%; max-width: 460px; }
.logo { font-size: 38px; font-weight: 900; letter-spacing: 1px; line-height: .92;
  background: linear-gradient(95deg, var(--pink), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo span { display: block; font-size: 16px; letter-spacing: 8px; color: var(--blue); -webkit-text-fill-color: var(--blue); margin-top: 2px; }
.lvl { margin-top: 14px; font-weight: 700; font-size: 14px; }
.statline { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 10px; font-size: 15px; color: var(--dim); }
.statline span { display: inline-flex; align-items: center; gap: 5px; }
.statline .vt { color: var(--green); font-weight: 700; } .statline .flow { color: #ffe11a; font-weight: 800; }
.statline .atk { color: #ff3a44; font-weight: 700; } .statline .def { color: #2e9bff; font-weight: 700; }
.statline.oneline { flex-wrap: nowrap; gap: 10px; overflow: hidden; max-width: 100%; }
.statline.oneline .flow em { font-style: normal; display: inline-block; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.rank { color: var(--gold); font-weight: 800; letter-spacing: .5px; }
.hnick { color: #fff; font-weight: 800; }
.statline.res { font-size: 16px; font-weight: 700; }
.statline.oneline.res { flex-wrap: wrap; overflow: visible; }
.statline.res .r-coin { color: var(--gold); } .statline.res .r-gem { color: #2e9bff; } .statline.res .r-ticket { color: #e0b048; } .statline.res .r-energy { color: #ff5b6e; } .statline.res .r-ads { color: #e0b048; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 480px; }
.tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left;
  background: #141415e0; border: 1px solid var(--line); border-radius: var(--rad); font-weight: 700;
  color: var(--txt); transition: transform .08s, background .15s, border-color .15s; backdrop-filter: blur(2px); }
.tile .gi, .tile .gi-emoji { flex: none; }
.tile span { font-size: 14px; }
.tile:active { transform: scale(.97); border-color: var(--red); }
.tile.big { grid-column: 1 / -1; padding: 16px; justify-content: center; background: linear-gradient(100deg, #e7202b22, #141415e0); border-color: var(--red); }
.tile.big span { font-size: 17px; font-weight: 900; letter-spacing: .5px; }
.foot { color: var(--dim); font-size: 11px; }

/* home v2: full-body character + coach as a backdrop, buttons overlaid at the bottom */
.home { display: block; padding: 0; text-align: center; }
.home-title { position: absolute; top: calc(env(safe-area-inset-top) + 8px); left: 12px; width: auto; max-width: 52%; max-height: 11vh; object-fit: contain; z-index: 3; filter: drop-shadow(0 0 16px #e7202b66); }
.hero-art { position: absolute; inset: 0; z-index: 1; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.ha-coach { position: absolute; bottom: 16%; right: -21%; height: 70%; width: auto; object-fit: contain; z-index: 1; filter: drop-shadow(0 0 16px #000); }
.ha-player { position: relative; height: 88%; width: auto; object-fit: contain; object-position: bottom; z-index: 2; filter: drop-shadow(0 12px 30px #000); }
.home-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 0 12px calc(env(safe-area-inset-bottom) + 20px); background: linear-gradient(transparent, #07080f 32%); display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.home-info { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 4px; }
.home-info .lvl { font-size: 13px; font-weight: 700; }
.nav-main { position: relative; display: block; width: calc(100% + 24px); margin: 0 -12px; padding: 0; border: none; background: none; transition: transform .07s ease, filter .07s ease; filter: drop-shadow(0 4px 10px #000); }
.nav-bg { display: block; width: 100%; height: auto; }
.nav-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; font-weight: 900; font-size: 26px; letter-spacing: 1.5px; text-shadow: 0 2px 4px #000, 0 0 10px #0009; pointer-events: none; }
.nav-label .gi, .nav-label .gi-emoji { filter: drop-shadow(0 2px 3px #000); }
.nav-main:active { transform: translateY(3px) scale(.98); filter: drop-shadow(0 2px 6px #000) brightness(.92); }
.nav-row { display: flex; gap: 7px; }
.nav-chip { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 3px; border-radius: 11px; background: #141415e6; border: 1px solid var(--line); color: var(--txt); }
.nav-chip span { font-size: 10px; font-weight: 700; white-space: nowrap; }
.nav-chip.notify::after { content: ""; position: absolute; top: 5px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 7px var(--red); }
.nav-chip:active, .nav-main:active { transform: scale(.96); }

/* luchar hub */
.mode-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: 14px; background: #141415e6; border: 1px solid var(--line); color: var(--txt); margin-bottom: 10px; text-align: left; }
.mc-ic { display: grid; place-items: center; flex: none; color: var(--red); }
.mc-body { flex: 1; display: flex; flex-direction: column; } .mc-body b { font-size: 16px; } .mc-body small { color: var(--dim); font-size: 12px; }

/* wardrobe */
.skin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.skin-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--txt); }
.skin-card img { width: 100%; height: auto; max-height: 28vh; object-fit: contain; }
.skin-card span { font-weight: 700; font-size: 13px; }
.skin-card.on { border-color: var(--red); box-shadow: 0 0 14px #e7202b44; }
.skin-card.locked { opacity: .5; }
.sk-on { position: absolute; top: 8px; right: 8px; color: var(--green); }
.sk-frag { color: var(--gold); font-size: 11px; font-weight: 800; }

.home .home-top { position: absolute; top: calc(env(safe-area-inset-top) + 24px); right: 22px; z-index: 5; display: flex; flex-direction: row-reverse; align-items: center; gap: 2px; }
/* red light streak that grows to the left when open and retracts into the menu icon */
.home-top::before { content: ""; position: absolute; top: 50%; right: 0; transform: translateY(-50%); height: 60px; width: 18px; border-radius: 30px; background: linear-gradient(270deg, #e7202bcc 0%, #e7202b99 55%, #e7202b33 80%, #e7202b00 100%); opacity: 0; transition: width .42s cubic-bezier(.34,.9,.3,1), opacity .3s ease; z-index: 0; pointer-events: none; filter: blur(5px); }
.home-top.open::before { width: 250px; opacity: 1; }
.menu-toggle { position: relative; z-index: 2; width: 34px; height: 34px; padding: 0; border: none; background: none; transition: transform .42s cubic-bezier(.34,.9,.3,1); filter: drop-shadow(0 0 7px #e7202baa) drop-shadow(0 2px 4px #000); }
.menu-toggle img { width: 100%; height: 100%; object-fit: contain; display: block; }
.menu-toggle:active { transform: scale(.88); }
.menu-toggle.notify::after { content: ""; position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); z-index: 3; }
.home-top.open .menu-toggle { transform: rotate(180deg); }
.home-top.open .menu-toggle:active { transform: rotate(180deg) scale(.88); }
.home-icons { position: relative; z-index: 1; display: flex; flex-direction: row; align-items: center; gap: 1px; transform-origin: right center; transition: opacity .28s ease, transform .4s cubic-bezier(.34,.9,.3,1); }
.home-top:not(.open) .home-icons { opacity: 0; transform: translateX(22px) scale(.35); pointer-events: none; }
.home-top.open .home-icons { opacity: 1; transform: none; pointer-events: auto; }
.home-icon { position: relative; width: 47px; height: 47px; background: none; border: none; color: #fff; display: grid; place-items: center; }
.home-icon .gi, .home-icon .gi-emoji, .home-icon .ic { filter: drop-shadow(0 0 5px #e7202baa) drop-shadow(0 1px 3px #000); }
.home-icon:active { transform: scale(.92); }
.home-icon.notify::after { content: ""; position: absolute; top: 1px; left: 1px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 7px var(--red); }

/* fragments craft list */
.frag-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; background: #141415e6; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 11px; margin-bottom: 8px; }
.frag-row.r-common { border-left-color: var(--r-common); } .frag-row.r-uncommon { border-left-color: var(--r-uncommon); } .frag-row.r-rare { border-left-color: var(--r-rare); } .frag-row.r-epic { border-left-color: var(--r-epic); } .frag-row.r-legendary { border-left-color: var(--r-legendary); } .frag-row.r-unique { border-left-color: var(--r-unique); }
.frag-row.ready { border-color: var(--gold); box-shadow: 0 0 12px #ffd23b33; }
.reveal-ov { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #000d; opacity: 0; transition: opacity .25s ease; cursor: pointer; }
.reveal-ov.show { opacity: 1; }
.rv-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transform: scale(.7); transition: transform .3s cubic-bezier(.2,1.4,.4,1); }
.reveal-ov.show .rv-card { transform: scale(1); }
.rv-face { position: relative; width: 170px; height: 170px; display: grid; place-items: center; color: #fff; filter: drop-shadow(0 0 26px currentColor); animation: rvFloat 2.4s ease-in-out infinite; }
.rv-face svg, .rv-face img { width: 100%; height: 100%; }
.rv-face::before { content: ""; position: absolute; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(closest-side, currentColor 0%, transparent 72%); opacity: .35; animation: rvGlow 2.4s ease-in-out infinite; }
@keyframes rvFloat { 0%, 100% { transform: translateY(-8px) rotate(-4deg); } 50% { transform: translateY(8px) rotate(4deg); } }
@keyframes rvGlow { 0%, 100% { transform: scale(.9); opacity: .25; } 50% { transform: scale(1.12); opacity: .5; } }
.reveal-ov.r-common .rv-face { color: var(--r-common); } .reveal-ov.r-uncommon .rv-face { color: var(--r-uncommon); } .reveal-ov.r-rare .rv-face { color: var(--r-rare); }
.reveal-ov.r-epic .rv-face { color: var(--r-epic); } .reveal-ov.r-legendary .rv-face { color: var(--r-legendary); } .reveal-ov.r-unique .rv-face { color: var(--r-unique); }
.rv-name { font-size: 26px; font-weight: 900; color: #fff; text-shadow: 0 2px 10px #000; }
.rv-sub { font-size: 14px; color: #ffd23b; font-weight: 800; }
.rv-tap { margin-top: 18px; font-size: 12px; color: #ffffff99; letter-spacing: 1px; animation: rvTap 1.4s ease-in-out infinite; }
.rv-coach-wrap { position: relative; width: min(94%, 460px); margin-top: 130px; cursor: default; }
@keyframes rvTap { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
/* pull dialog (x1/x10) */
.pull-dialog .pd-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.pd-title { font-size: 17px; font-weight: 900; margin-bottom: 4px; }
.pd-opt { padding: 13px; border-radius: 12px; background: var(--red); color: #fff; font-weight: 900; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pd-opt.big { background: linear-gradient(180deg, #ffcb1e, #ff9a00); color: #2a1a00; }
.pd-opt:disabled { opacity: .4; }
.pd-cancel { padding: 10px; border-radius: 10px; background: none; color: var(--dim); font-weight: 700; }
/* x10 horizontal reveal */
.rvm-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.rvm-row { display: flex; gap: 12px; overflow-x: auto; max-width: 100%; padding: 8px 16px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.rvm-card { flex: 0 0 auto; width: 132px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--r-common); border-radius: 14px; }
.rvm-card.r-uncommon { border-left-color: var(--r-uncommon); } .rvm-card.r-rare { border-left-color: var(--r-rare); } .rvm-card.r-epic { border-left-color: var(--r-epic); } .rvm-card.r-legendary { border-left-color: var(--r-legendary); } .rvm-card.r-unique { border-left-color: var(--r-unique); }
.rvm-face { width: 78px; height: 78px; display: grid; place-items: center; color: #fff; }
.rvm-face svg { width: 100%; height: 100%; }
.rvm-name { font-size: 13px; font-weight: 800; text-align: center; }
.rvm-sub { font-size: 11px; color: #ffd23b; font-weight: 700; }
.rvm-ok { padding: 11px 30px; border-radius: 12px; background: var(--red); color: #fff; font-weight: 900; }
.fr-body { flex: 1; min-width: 0; } .fr-body b { font-size: 14px; }
.fr-side { flex: none; } .fr-craft { padding: 8px 14px; border-radius: 9px; background: var(--gold); color: #2a1f00; font-weight: 800; }
.fr-n { color: var(--dim); font-size: 12px; font-weight: 700; } .fr-have .ic { color: var(--green); }
.fr-have { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; color: var(--gold); } .fr-cop { color: var(--gold); font-weight: 800; font-size: 12px; }

/* nickname */
.nick-scene { align-items: center; justify-content: center; padding: 20px; }
.nick-box { position: relative; z-index: 1; width: 100%; max-width: 400px; background: #0b0e1aee; border: 1px solid var(--line); border-radius: 18px; padding: 22px; text-align: center; box-shadow: 0 16px 50px #0008; }
.nick-input { width: 100%; padding: 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); color: var(--txt); font-size: 16px; font-weight: 700; text-align: center; margin: 12px 0; outline: none; }
.nick-input:focus { border-color: var(--red); }
.opt-row .nick-input { margin: 0; flex: 1; text-align: left; font-size: 15px; }

/* options */
.opt-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.opt-row label { width: 78px; font-weight: 700; font-size: 14px; }
.opt-row input[type="range"] { flex: 1; accent-color: var(--red); }
.opt-row b { width: 34px; text-align: right; color: var(--dim); }
.opt-card { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin: 8px 0 12px; }
.opt-card small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.opt-btn { width: 100%; padding: 14px; border-radius: 11px; font-weight: 800; border: 1px solid var(--line); background: var(--panel); color: var(--txt); }
.opt-btn.ghostbtn { width: auto; opacity: .55; }
.opt-btn.danger { border-color: var(--red); color: var(--red); }
.opt-btn.login-off { width: 100%; margin-top: 10px; border: 1px solid var(--red); background: #1a0d0e; color: #ff5b6e; opacity: .55; }
.menu-block { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.menu-block > :last-child { margin-bottom: 0; }
.mb-title { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--red); margin-bottom: 10px; }
.mb-stat { font-size: 16px; font-weight: 800; } .mb-stat b { font-size: 22px; color: var(--gold); }

/* ---------- bars ---------- */
.bar { background: #0009; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.bar .fill { display: block; height: 100%; transition: width .25s ease; }
.bar.xp { height: 10px; margin-top: 8px; } .bar.xp .fill { background: linear-gradient(90deg, var(--gold), var(--pink)); }
.bar.tiny { height: 7px; margin: 7px 0; } .bar.tiny .fill { background: var(--blue); } .bar.tiny .fill.gold { background: var(--gold); }
.fill.c-green { background: var(--green); } .fill.c-orange { background: var(--orange); } .fill.c-blue { background: var(--blue); }

/* ---------- campaign ---------- */
.episode { margin-bottom: 20px; }
.ep-name { font-weight: 800; margin-bottom: 10px; color: var(--gold); font-size: 14px; }
.ep-enemies { display: flex; flex-direction: column; gap: 10px; }
.enemy-card { text-align: left; padding: 15px; border-radius: var(--rad); border: 1px solid var(--line); position: relative;
  background: linear-gradient(100deg, color-mix(in srgb, var(--c) 26%, var(--panel)), var(--panel)); color: var(--txt); transition: transform .08s; }
.enemy-card:active { transform: scale(.98); }
.enemy-card.locked { opacity: .4; filter: grayscale(.7); }
.enemy-card.beaten { border-color: var(--green); }
.ec-name { font-size: 18px; font-weight: 800; } .ec-title { color: var(--dim); font-size: 13px; }
.ec-stats { font-size: 11.5px; color: var(--dim); margin-top: 6px; }
.ec-badge { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 9px; background: #0007; display: grid; place-items: center; color: var(--txt); }
.enemy-card.beaten .ec-badge { color: var(--green); }

/* ---------- chapter levels ---------- */
.energy-pill { font-weight: 800; font-size: 13px; color: var(--txt); background: #141415cc; border: 1px solid var(--line); padding: 6px 10px; border-radius: 18px; white-space: nowrap; }
.lvl-list { display: flex; flex-direction: column; gap: 8px; }
.lvl-card { width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0; background: #14141599; border: 1px solid #ffffff1c; border-left: 4px solid #fff; border-radius: 11px; color: var(--txt); text-align: left; text-shadow: 0 1px 4px #000c, 0 0 2px #000; cursor: pointer; }
.lvl-card.locked, .lvl-card.noafford { cursor: default; }
.lvl-card.locked { opacity: .45; }
.lvl-card.beaten { border-color: var(--green); border-left-color: var(--green); }
.lvl-card.boss, .lvl-card.final { border-left: 6px solid var(--red); animation: bossPulse 1.5s ease-in-out infinite; }
.lvl-card.noafford { opacity: .4; }
.lc-auto { padding: 6px 10px; border-radius: 9px; background: none; border: 1px solid var(--gold); color: var(--gold); font-weight: 800; font-size: 11px; letter-spacing: .5px; }
.lc-auto:disabled { opacity: .4; }
@keyframes bossPulse { 0%, 100% { box-shadow: 0 0 0 transparent; } 50% { box-shadow: 0 0 18px #e7202b88, inset 0 0 10px #e7202b22; } }
.lc-song { display: inline-flex; align-items: center; gap: 4px; color: #ffd23b; font-size: 10px; margin-top: 2px; }
.camp-diff { position: relative; margin-bottom: 12px; }
.cd-toggle { padding: 8px 16px; border-radius: 20px; background: var(--red); color: #fff; font-weight: 800; font-size: 14px; }
.cd-menu { position: absolute; top: 112%; left: 0; z-index: 8; display: flex; flex-direction: column; gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 170px; box-shadow: 0 8px 22px #000b; }
.cd-menu[hidden] { display: none; }
.cd-opt { padding: 9px 12px; border-radius: 9px; background: none; color: var(--txt); font-weight: 700; text-align: left; display: flex; align-items: center; gap: 6px; }
.cd-opt.on { background: var(--red); color: #fff; }
.cd-opt:disabled { opacity: .45; }
.prefight .pf-meta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 10px 0 18px; font-size: 13px; color: var(--dim); }
.prefight .pf-meta b { color: var(--txt); }
.lc-n { width: 32px; text-align: center; font-weight: 900; font-size: 22px; color: #fff; flex: none; }
.lc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; } .lc-body b { font-size: 14px; } .lc-body small { color: var(--dim); font-size: 11px; }
.lc-cost { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 13px; color: var(--gold); flex: none; } .lc-cost.no { color: var(--red); }
.lc-badge { color: var(--dim); flex: none; }
.banner.ad { background: linear-gradient(120deg, #2a2a14, var(--panel)); border-color: var(--gold); }

/* gacha banners docked at the bottom */
.gacha-bottom { display: flex; gap: 8px; padding: 10px 12px calc(env(safe-area-inset-bottom) + 12px); background: linear-gradient(transparent, #07080f 40%); }
.gbanner { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border-radius: 12px; background: #141415ee; border: 1px solid var(--line); text-align: center; }
.gbanner b { font-size: 13px; font-weight: 900; letter-spacing: .5px; }
.gbanner small { font-size: 11px; color: var(--dim); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.gbanner.ad { border-color: var(--gold); } .gbanner.premium { border-color: var(--r-epic); }
.gbanner .pull-btn { width: 100%; padding: 9px 4px; font-size: 13px; }

/* ---------- training ---------- */
.tr-x10 { padding: 6px 12px; border-radius: 8px; background: var(--line); color: var(--dim); font-weight: 900; font-size: 12px; border: 2px solid transparent; transition: all .15s; }
.tr-x10.on { background: #ffcc00; color: #111; border-color: #fff8; box-shadow: 0 0 10px #ffcc0088; }
.tr-x10:disabled { opacity: .35; }
.train-row { position: relative; padding: 11px 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(74%, 360px); margin: 0 0 10px auto; }
.train-row.upok { animation: upPulse .5s ease; box-shadow: 0 0 22px #fff8, 0 0 8px #fff inset; }
.train-row.upok .bar .fill { box-shadow: 0 0 16px #fff; filter: brightness(1.4); }
@keyframes upPulse { 0% { transform: scale(1); } 32% { transform: scale(1.05); } 100% { transform: scale(1); } }
.up-pop { position: absolute; right: 16px; top: 6px; font-weight: 900; font-size: 24px; color: #fff; text-shadow: 0 0 12px #fff, 0 0 4px #fff; pointer-events: none; animation: upFloat .9s ease forwards; }
@keyframes upFloat { 0% { opacity: 0; transform: translateY(8px) scale(.7); } 22% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px) scale(1.15); } }
.train-row.c-green { background: color-mix(in srgb, #27c46b 16%, var(--panel)); border-color: #27c46b; }
.train-row.c-orange { background: color-mix(in srgb, #e7202b 16%, var(--panel)); border-color: #e7202b; }
.train-row.c-blue { background: color-mix(in srgb, #2e9bff 16%, var(--panel)); border-color: #2e9bff; }
.tr-head { display: flex; align-items: center; gap: 10px; }
.tr-ic { display: inline-flex; align-items: center; }
.tr-head .tr-btn { margin-left: auto; }
.train-row .fill.c-green { background: #27c46b; } .train-row .fill.c-orange { background: #e7202b; } .train-row .fill.c-blue { background: #2e9bff; }
.tr-val { display: flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 21px; margin-top: 2px; }
.tr-val span { font-size: 12px; font-weight: 700; color: var(--dim); }
.tr-val.c-green { color: #27c46b; } .tr-val.c-orange { color: #e7202b; } .tr-val.c-blue { color: #2e9bff; }
.tr-btn { padding: 6px 14px; border-radius: 8px; background: var(--green); color: #111; font-weight: 800; font-size: 13px; }
.tr-btn:disabled { background: var(--line); color: var(--dim); }
.tr-buy { display: flex; gap: 7px; margin-top: 10px; }
.tr-buy[hidden] { display: none; }
.tr-buy .bb { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 6px; border-radius: 9px; background: #0006; border: 1px solid var(--line); color: var(--txt); font-weight: 800; font-size: 13px; }
.tr-buy .bb:disabled { opacity: .4; }
.tr-prestige { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 10px; border-radius: 10px; background: #1c0f14; border: 1px solid var(--red); }
.tr-prestige-lbl { font-weight: 800; font-size: 13px; color: var(--red); text-transform: uppercase; letter-spacing: .5px; }
.tr-prestige-lbl.off { color: var(--dim); text-transform: none; letter-spacing: 0; }
.tr-prestige .bb { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border-radius: 9px; background: var(--red); border: none; color: #fff; font-weight: 800; font-size: 13px; }
.tr-prestige .bb:disabled { opacity: .45; background: var(--line); color: var(--dim); }
.train-scroll { display: flex; flex-direction: column; justify-content: flex-end; }
.seg-bar { display: flex; gap: 3px; margin: 9px 0; }
.seg-bar i { flex: 1; height: 10px; border-radius: 3px; background: #00000066; position: relative; overflow: hidden; }
.seg-bar i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--f, 0%); transition: width .3s ease; }
.seg-bar.c-green i::after { background: #27c46b; } .seg-bar.c-orange i::after { background: #e7202b; } .seg-bar.c-blue i::after { background: #2e9bff; }
.train-info { width: min(74%, 360px); margin: 14px 0 0 auto; }
.train-info p { display: flex; gap: 7px; align-items: flex-start; font-size: 11.5px; color: var(--dim); line-height: 1.45; margin-bottom: 8px; }
.train-info .ti-ic { flex-shrink: 0; margin-top: 1px; }

/* ---------- radio (menu music) ---------- */
.home-radio { position: absolute; top: calc(env(safe-area-inset-top) + 24px); left: 14px; z-index: 5; width: 47px; height: 47px; display: grid; place-items: center; padding: 0; background: none; border: none; filter: drop-shadow(0 0 7px #e7202baa) drop-shadow(0 2px 4px #000); }
.home-radio:active { transform: scale(.9); }
.radio-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; margin-bottom: 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--txt); }
.radio-row.on { border-color: var(--red); background: color-mix(in srgb, var(--red) 16%, var(--panel)); }
.radio-row.picked { animation: trackPick .5s cubic-bezier(.2,1.3,.4,1); }
@keyframes trackPick { 0% { transform: translateY(-16px) scale(.95); opacity: .25; } 55% { box-shadow: 0 0 24px #ff2a36aa; } 100% { transform: none; opacity: 1; } }
.radio-row.on .rr-meta b { color: var(--red); }
.radio-now { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; background: color-mix(in srgb, var(--red) 12%, var(--panel)); border: 1px solid var(--red); border-radius: 14px; }
.radio-pp { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff; }
.radio-pp:active { transform: scale(.92); }
.radio-now-meta { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.radio-now-meta b { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-now-meta small { color: var(--dim); font-size: 12px; }
.radio-wave { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; }
.radio-wave.sm { height: 16px; gap: 2px; }
.radio-wave i { width: 3px; height: 30%; background: var(--red); border-radius: 2px; }
.radio-wave.on i { animation: wavebar .9s ease-in-out infinite; }
.radio-wave.on i:nth-child(2) { animation-delay: .15s; } .radio-wave.on i:nth-child(3) { animation-delay: .3s; }
.radio-wave.on i:nth-child(4) { animation-delay: .45s; } .radio-wave.on i:nth-child(5) { animation-delay: .6s; }
@keyframes wavebar { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.radio-toggle { width: 50px; height: 28px; padding: 3px; border-radius: 999px; background: #3a3a3e; border: none; display: inline-flex; align-items: center; transition: background .2s ease; }
.radio-toggle .rt-knob { width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0008; transition: transform .2s ease; }
.radio-toggle.on { background: var(--red); }
.radio-toggle.on .rt-knob { transform: translateX(22px); }

/* ---------- profile / carnet ---------- */
.carnet { display: flex; gap: 14px; padding: 16px; background: linear-gradient(135deg, #1c1c1e, #141415); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 16px; margin-bottom: 14px; }
.carnet-photo { width: 92px; height: 112px; flex: none; border-radius: 12px; overflow: hidden; background: #0006; display: grid; place-items: end center; }
.carnet-photo img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.carnet-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.carnet-name { font-size: 22px; font-weight: 900; }
.carnet-sub { font-size: 13px; color: var(--dim); } .carnet-sub b { color: var(--gold); }
.carnet-stats { display: flex; gap: 12px; font-weight: 800; font-size: 14px; margin-top: 4px; }
.carnet-stats span { display: inline-flex; align-items: center; gap: 4px; } .carnet-stats .vt { color: #27c46b; }
.carnet-song { font-size: 12px; color: var(--dim); display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; }
.pf-skins { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pf-skin { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--txt); }
.pf-skin.on { border-color: var(--red); }
.pf-skin img { width: 100%; height: 90px; object-fit: contain; object-position: center bottom; }
.pf-skin span { font-size: 11px; font-weight: 700; }
.pf-songs { display: flex; flex-direction: column; gap: 8px; }
.pf-song { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--txt); font-weight: 700; }
.pf-song.on { border-color: var(--red); color: #fff; }
.rr-meta { flex: 1; text-align: left; display: flex; flex-direction: column; }
.rr-meta b { font-weight: 800; } .rr-meta small { color: var(--dim); font-size: 12px; }
.rr-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--gold); }

/* ---------- collection (square grid + detail) ---------- */
.col-sq-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 6px 0 6px; }
.col-sq { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 5px 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--txt); }
.col-sq.locked { opacity: .5; }
.col-sq:not(:disabled):active { transform: scale(.94); }
.col-sq.r-common { border-color: #8a8a9066; } .col-sq.r-uncommon { border-color: #27c46b88; } .col-sq.r-rare { border-color: #2e9bff88; } .col-sq.r-epic { border-color: #b061ff88; } .col-sq.r-legendary { border-color: #ffcb1e99; } .col-sq.r-unique { border-color: #e7202b99; }
.cs-face { width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: none; }
.cs-face img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.cs-face img.gi { width: 60%; height: 60%; object-position: center; }
.cs-face svg { width: 58%; height: 58%; }
.cs-glyph { font-size: 30px; line-height: 1; }
.cs-ph { font-size: 30px; font-weight: 900; color: var(--dim); }
.cs-name { font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-rank { position: absolute; top: 4px; right: 5px; font-size: 11px; font-weight: 900; color: #fff; background: #000b; padding: 1px 6px; border-radius: 7px; }
.col-detail { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #000c; padding: 24px; opacity: 0; transition: opacity .2s ease; }
.col-detail[hidden] { display: none; }
.col-detail.show { opacity: 1; }
.cd-card { position: relative; width: 100%; max-width: 320px; background: var(--panel2); border: 1px solid var(--line); border-radius: 18px; padding: 20px; text-align: center; transform: scale(.7); transition: transform .26s cubic-bezier(.2,1.3,.4,1); }
.col-detail.show .cd-card { transform: scale(1); }
.cd-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; display: grid; place-items: center; background: #0006; border-radius: 9px; color: var(--txt); }
.cd-face { width: 62%; max-width: 180px; aspect-ratio: 1 / 1; margin: 8px auto 14px; display: grid; place-items: center; overflow: hidden; border-radius: 14px; background: none; animation: cdZoom .42s ease; }
.cd-face img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.cd-face img.gi { width: 72%; height: 72%; }
.cd-face .cs-glyph { font-size: 84px; } .cd-face .cs-ph { font-size: 64px; }
@keyframes cdZoom { 0% { transform: scale(.35); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.cd-name { font-size: 19px; font-weight: 900; }
.cd-rank { font-size: 13px; color: var(--gold); font-weight: 700; margin-top: 3px; }
.cd-desc { font-size: 12.5px; color: var(--dim); line-height: 1.5; margin-top: 10px; }
.col-sq.up { border-color: var(--red); box-shadow: 0 0 12px #ff2a3666; }
.col-sq.upok { animation: upPulse .5s ease; box-shadow: 0 0 20px #fff9; z-index: 2; }
.col-sq.up::after { content: "↑"; position: absolute; top: 4px; left: 5px; width: 18px; height: 18px; display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #fff; background: var(--red); border-radius: 50%; box-shadow: 0 0 8px #ff2a36; }
.cd-up { margin-top: 14px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 11px 14px; border-radius: 12px; background: linear-gradient(180deg, #ff3a44, #d40d18); color: #fff; font-weight: 900; font-size: 13px; box-shadow: 0 4px 14px #0009, 0 0 16px #ff2a3680; }
.cd-up:active { transform: scale(.96); }

/* ---------- item cards ---------- */
.item-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; border-radius: 12px; margin-bottom: 10px;
  background: var(--panel); border: 1px solid var(--line); border-left-width: 4px; color: var(--txt); }
.item-card.r-common { border-left-color: var(--r-common); } .item-card.r-uncommon { border-left-color: var(--r-uncommon); } .item-card.r-rare { border-left-color: var(--r-rare); }
.item-card.r-epic { border-left-color: var(--r-epic); } .item-card.r-legendary { border-left-color: var(--r-legendary); box-shadow: 0 0 18px #ffcb1e22; } .item-card.r-unique { border-left-color: var(--r-unique); box-shadow: 0 0 18px #e7202b22; }
.item-card.locked { opacity: .5; } .item-card.equipped { outline: 2px solid var(--green); outline-offset: -2px; }
.ic-lead { color: var(--blue); flex: none; } .item-card .ic-body { flex: 1; min-width: 0; }
.ic-top { display: flex; justify-content: space-between; gap: 8px; }
.ic-name { font-weight: 800; font-size: 14px; } .ic-rar { font-size: 10.5px; text-transform: uppercase; color: var(--dim); letter-spacing: .5px; }
.ic-desc { font-size: 12px; color: var(--dim); margin-top: 3px; }
.ic-state { font-size: 11px; font-weight: 800; color: var(--dim); flex: none; }
.item-card.equipped .ic-state { color: var(--green); }

/* ---------- equip slots ---------- */
.equip-scroll { display: flex; flex-direction: column; align-items: center; }
.equip-hero { width: 100%; flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; margin-bottom: 0; }
.equip-hero img { max-height: 72vh; max-width: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 10px 26px #000) drop-shadow(0 0 22px #e7202b40); }
.equip-stats { margin: 0 0 10px; }
.slot-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: nowrap; margin: 0 0 4px; width: 100%; }
.slot-chip { width: 58px; height: 58px; flex: 0 1 58px; border-radius: 13px; background: var(--bg2); border: 1px solid var(--line); color: #66666e; display: grid; place-items: center; }
.slot-chip.equipped { color: var(--txt); border-color: var(--red); box-shadow: 0 0 14px #e7202b44; }
.slot-chip.equipped.r-uncommon { border-color: var(--r-uncommon); box-shadow: 0 0 14px #27c46b44; }
.slot-chip.equipped.r-rare { border-color: var(--r-rare); box-shadow: 0 0 14px #2e9bff44; }
.slot-chip.equipped.r-epic { border-color: var(--r-epic); box-shadow: 0 0 14px #b061ff44; }
.slot-chip.equipped.r-legendary { border-color: var(--r-legendary); box-shadow: 0 0 16px #ffcb1e55; }
.slot-chip.equipped.r-unique { border-color: var(--r-unique); box-shadow: 0 0 16px #e7202b55; }
.slot-chip:active { transform: scale(.94); }
.slot-list { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 8px; }
.slot-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #141415e0; border: 1px solid var(--line); border-radius: 12px; color: var(--txt); text-align: left; }
.slot-row.flow { border-color: var(--red); }
.sl-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--bg2); color: var(--red); flex: none; }
.sl-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sl-meta b { font-size: 14px; } .sl-meta small { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-go { color: var(--dim); flex: none; }
.slot-row:active { border-color: var(--red); transform: scale(.99); }

/* ---------- songs ---------- */
.song-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #141415e0; border: 1px solid var(--line); border-radius: 12px; color: var(--txt); text-align: left; width: 100%; margin-bottom: 8px; }
.song-row.locked { opacity: .5; }
.sr-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--bg2); color: var(--blue); flex: none; }
.sr-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sr-meta b { font-size: 14px; } .sr-meta small { color: var(--dim); font-size: 12px; }
.sr-go { color: var(--dim); flex: none; }
.song-row:active { border-color: var(--red); transform: scale(.99); }

/* ---------- gacha ---------- */
.banner { padding: 16px; border-radius: var(--rad); margin-bottom: 12px; border: 1px solid var(--line); }
.banner.normal { background: linear-gradient(120deg, #16243e, var(--panel)); }
.banner.premium { background: linear-gradient(120deg, #2e1f4a, var(--panel)); border-color: var(--r-epic); }
.banner-title { font-size: 17px; font-weight: 800; } .banner-sub { color: var(--dim); font-size: 13px; margin: 5px 0 12px; }
.pull-btn { width: 100%; padding: 14px; border-radius: 11px; background: var(--gold); color: #2a1f00; font-weight: 800; font-size: 15px; }
.pull-btn:disabled { background: var(--line); color: var(--dim); }
.pull-pop { margin: 12px 0; padding: 14px; border-radius: 12px; background: var(--panel2); border-left: 4px solid var(--r-common); animation: pop .3s; }
.pull-pop.r-uncommon { border-left-color: var(--r-uncommon); } .pull-pop.r-rare { border-left-color: var(--r-rare); } .pull-pop.r-epic { border-left-color: var(--r-epic); } .pull-pop.r-legendary { border-left-color: var(--r-legendary); } .pull-pop.r-unique { border-left-color: var(--r-unique); }
.pp-name .ic { color: var(--gold); } .pp-name i { color: var(--dim); font-size: 12px; } .pp-sub { font-size: 13px; margin-top: 4px; color: var(--dim); } .crafted { color: var(--green); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.frag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.frag { display: flex; justify-content: space-between; gap: 6px; padding: 9px 11px; background: var(--panel); border-radius: 9px; font-size: 12px; border: 1px solid var(--line); }
.frag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .frag.owned { border-color: var(--green); } .frag b { color: var(--gold); }

/* ---------- challenges ---------- */
.chal { padding: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.chal.ready { border-color: var(--gold); } .chal.claimed { opacity: .5; }
.chal-text { font-weight: 700; font-size: 14px; } .chal-text i { color: var(--gold); font-size: 12px; }
.chal-foot { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--dim); }
.chal-foot .reward { margin-left: auto; color: var(--gold); display: inline-flex; align-items: center; gap: 4px; }
.chal-foot [data-claim] { padding: 7px 13px; border-radius: 9px; background: var(--red); color: #fff; font-weight: 800; }
.chal-foot .ic { color: var(--green); }

/* ---------- collection ---------- */
.col-list { display: flex; flex-direction: column; gap: 8px; }
.col-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: #141415e0; border: 1px solid var(--line); border-radius: 12px; }
.col-card.locked { opacity: .5; }
.cc-face { width: 46px; height: 46px; border-radius: 10px; background: var(--bg2); display: grid; place-items: center; font-size: 26px; flex: none; }
.cc-body { flex: 1; min-width: 0; } .cc-body b { font-size: 14px; } .cc-body small { display: block; color: var(--dim); font-size: 12px; }
.cc-rank { font-weight: 900; font-size: 22px; color: var(--gold); flex: none; min-width: 46px; text-align: center; text-shadow: 0 0 10px #ffd23b66; }
.col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.col-mini { display: flex; justify-content: space-between; gap: 6px; padding: 9px 11px; background: #141415e0; border: 1px solid var(--line); border-left-width: 4px; border-radius: 9px; font-size: 12px; }
.col-mini.locked { opacity: .45; } .col-mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .col-mini i { color: var(--dim); font-size: 10px; text-transform: uppercase; }
.col-mini.r-common { border-left-color: var(--r-common); } .col-mini.r-rare { border-left-color: var(--r-rare); } .col-mini.r-epic { border-left-color: var(--r-epic); } .col-mini.r-legendary { border-left-color: var(--r-legendary); }

/* ---------- ranking ---------- */
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--panel); border-radius: 10px; border: 1px solid var(--line); }
.rank-row.you { border-color: var(--pink); background: #ff5bd016; }
.rank-row .pos { width: 26px; font-weight: 800; color: var(--gold); } .rank-row .nm { flex: 1; font-weight: 700; font-size: 14px; }
.rank-row .sc { font-variant-numeric: tabular-nums; color: var(--blue); font-weight: 700; }

/* ---------- prefight ---------- */
.prefight { align-items: center; justify-content: center; padding: 20px; }
.prefight .back { position: absolute; top: calc(env(safe-area-inset-top) + 14px); left: 16px; width: 36px; height: 36px; border-radius: 10px; background: var(--panel); display: grid; place-items: center; }
.pf-card { width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; text-align: center; box-shadow: 0 16px 50px #0008; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diff-card { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.diff-card .dc-name { font-weight: 800; font-size: 14px; }
.diff-card .dc-ok { font-size: 10.5px; color: var(--gold); }
.diff-card .dc-lock { font-size: 10.5px; color: var(--dim); display: inline-flex; align-items: center; gap: 4px; line-height: 1.3; }
.diff-card.on { border-color: var(--gold); background: #ffd23b14; }
.diff-card.locked { opacity: .55; }
.pf-enemy { font-size: 26px; font-weight: 900; } .pf-title { color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.pf-photo { width: 150px; height: 150px; margin: 0 auto 8px; display: grid; place-items: center; }
.pf-photo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 20px #000); }
.pf-photo:empty, .pf-photo.empty { border: 2px dashed #ffffff33; border-radius: 16px; }

/* guided-tour spotlight (hole + dark ring; blocker forwards only the target tap) */
.guide-fx { position: fixed; inset: 0; z-index: 55; }
.guide-hole { position: fixed; border-radius: 12px; outline: 3px solid var(--red); pointer-events: none; animation: guideBlink 1s ease-in-out infinite; }
@keyframes guideBlink { 0%, 100% { outline-color: var(--red); box-shadow: 0 0 0 9999px #000d, 0 0 14px 2px var(--red); } 50% { outline-color: #fff; box-shadow: 0 0 0 9999px #000d, 0 0 28px 6px var(--red); } }
.guide-arrow { position: fixed; transform: translate(-50%, -100%); color: var(--red); font-size: 34px; text-shadow: 0 0 10px var(--red); pointer-events: none; animation: guideArrow .8s ease-in-out infinite; }
@keyframes guideArrow { 0%, 100% { margin-top: 0; } 50% { margin-top: -8px; } }
.guide-bubble { position: fixed; left: 50%; transform: translateX(-50%); width: min(92%, 440px); background: var(--panel2); border: 1px solid var(--red); border-radius: 14px; padding: 12px 16px; font-size: 14px; line-height: 1.4; box-shadow: 0 8px 24px #000b; pointer-events: none; }
.gb-coach { position: fixed; width: 330px; object-fit: contain; object-position: bottom center; pointer-events: none; filter: drop-shadow(0 6px 16px #000c); }
.guide-bubble .gb-txt { min-width: 0; }
.guide-bubble .gb-name { color: var(--red); display: block; font-size: 12px; font-weight: 800; margin-bottom: 3px; }
.guide-bubble b { color: #fff; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; padding: 12px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.seg button.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.seg-diff button { padding: 11px 6px; font-size: 12.5px; }
.seg-diff button.on { background: var(--gold); border-color: var(--gold); color: #2a1f00; }
.songlist { display: flex; flex-direction: column; gap: 8px; }
.songlist button { display: flex; align-items: center; gap: 9px; padding: 12px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--line); font-weight: 600; font-size: 13px; text-align: left; }
.songlist button .ic { color: var(--blue); } .songlist button.on { border-color: var(--blue); background: #5db4ff18; }
.primary { width: 100%; margin-top: 18px; padding: 16px; border-radius: 12px; background: var(--pink); color: #fff; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ghost { background: none; color: var(--dim); }

/* ---------- boot / initial loading ---------- */
.boot { position: absolute; inset: 0; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; }
.boot-title { max-width: 84%; max-height: 50vh; object-fit: contain; filter: drop-shadow(0 0 34px #ff5bd055); animation: bootpulse 2.4s ease-in-out infinite; }
@keyframes bootpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.boot-bar { width: min(360px, 80%); height: 8px; background: #15182a; border-radius: 6px; overflow: hidden; border: 1px solid #2a2f45; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--gold)); box-shadow: 0 0 14px var(--pink); transition: width 3s ease; }
.boot-tipbox { background: var(--panel2); border: 1px solid var(--red); border-radius: 14px; padding: 12px 20px; max-width: 420px; }
.boot-tip { color: #cfd6ea; font-size: 14px; line-height: 1.5; text-align: center; min-height: 42px; }
.boot-hint { color: var(--red); font-size: 15px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; text-align: center; }

/* ---------- loading ---------- */
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: #cfd6ea; background: #07080f; }
.load-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; z-index: 0; }
.loading .spinner, .loading p { position: relative; z-index: 1; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--pink); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- result ---------- */
.result { align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 24px; }
.result button { width: 100%; max-width: 360px; padding: 15px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.result .primary { background: var(--pink); border-color: var(--pink); }
.result h1 { font-size: 42px; margin: 0; letter-spacing: 2px; }
.result.win h1 { color: var(--r-legendary); text-shadow: 0 0 26px #ffcb1e99; } .result.lose h1 { color: var(--red); text-shadow: 0 0 26px #e7202b99; }
.res-defeated { display: flex; justify-content: center; margin: 14px 0 10px; }
.rd-frame { position: relative; width: 150px; height: 150px; border-radius: 12px; overflow: hidden; border: 3px solid #2a2a2e; box-shadow: 0 6px 14px #000a; background: #111; transform-origin: top left; }
.rd-frame img { width: 100%; height: 100%; object-fit: cover; transition: filter .5s ease; }
.rd-frame .rd-slash { position: absolute; inset: 0; width: 100%; height: 100%; }
.rd-frame .rd-slash line { stroke: var(--red); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 1px 2px #000); stroke-dasharray: 140; stroke-dashoffset: 140; }
.rd-frame.play img { filter: brightness(.4) saturate(.6); }
.rd-frame.play .rd-slash line { animation: rdSlash .3s ease forwards; }
.rd-frame.play { animation: rdFall 1s .3s cubic-bezier(.36,.07,.19,.97) forwards; }
@keyframes rdSlash { to { stroke-dashoffset: 0; } }

/* ---------- tappable currency icons + tooltip ---------- */
/* !important: this icon sits inside all sorts of containers (result cards, challenge
   rows, gacha banners...) that style their OWN bare "button" descendants with padding/
   backgrounds meant for a real action button — those rules out-specificity a plain
   class here, so the reset has to hold regardless of where it's nested. */
.cur-btn { all: unset; display: inline-flex !important; align-items: center; cursor: pointer; background: none !important; border: none !important; padding: 0 !important; margin: 0 !important; width: auto !important; height: auto !important; border-radius: 0 !important; }
.cur-tip { position: fixed; z-index: 200; max-width: 220px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.4; box-shadow: 0 8px 22px #000a; opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.cur-tip.show { opacity: 1; transform: translateY(0); }
.cur-tip b { display: block; font-size: 13px; margin-bottom: 3px; color: var(--txt); }
.cur-tip span { color: var(--dim); }
@keyframes rdFall { 0% { transform: rotate(0) translate(0, 0); } 100% { transform: rotate(16deg) translate(5px, 22px); } }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 360px; margin: 10px 0; }
.res-grid div { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 13px 4px; }
.res-grid b { display: block; font-size: 22px; color: var(--gold); } .res-grid span { font-size: 11px; color: var(--dim); }
.res-rewards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-weight: 700; font-size: 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; margin: 4px 0; }
.res-rewards span { display: inline-flex; align-items: center; gap: 5px; } .res-rewards .ic { color: var(--gold); }
.lvup { width: 100%; color: var(--r-uncommon); font-size: 20px; font-weight: 900; margin-top: 6px; text-shadow: 0 0 16px #27c46b99; animation: pop .3s, lvupPulse 1.2s ease-in-out infinite; }
@keyframes lvupPulse { 50% { transform: scale(1.08); } }

/* ---------- combat ---------- */
.combat { background: #000; }
.combat #cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.combat .cam-tint { position: absolute; inset: 0; background: radial-gradient(120% 100% at 50% 40%, #0a0c1880 0%, #060812d8 100%); z-index: 1; }
.combat #ring { position: absolute; inset: 0; z-index: 2; }
.hud-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; padding: calc(env(safe-area-inset-top) + 14px) 16px 12px; background: linear-gradient(#000b, transparent); }
.enemy-name { font-weight: 800; font-size: 16px; margin-bottom: 7px; display: flex; gap: 8px; align-items: baseline; }
.enemy-name span { color: var(--dim); font-weight: 500; font-size: 12px; }
.bar.enemy { height: 14px; position: relative; } .bar.enemy .fill { background: linear-gradient(90deg, var(--green), #7fffa0); }
.hud-bottom { position: absolute; bottom: 0; left: 0; right: 0; z-index: 3; padding: 12px 16px calc(env(safe-area-inset-bottom) + 16px); background: linear-gradient(transparent, #000d); }
.bar.player { height: 18px; position: relative; } .bar.player .fill { background: linear-gradient(90deg, var(--green), #7fffa0); }
.bar.player b { position: absolute; inset: 0; text-align: center; font-size: 11px; font-weight: 700; line-height: 18px; text-shadow: 0 1px 2px #000; }
/* Street-Fighter-style damage reveal: green fill snaps down instantly, a red "ghost"
   layer underneath lags behind and shrinks down to match, briefly exposing the lost
   chunk in red; a white flash punches through on the hit that caused it. */
.bar.enemy .fill, .bar.player .fill { position: absolute; inset: 0; height: auto; transition: width .18s ease; z-index: 2; }
.bar.enemy .fill-ghost, .bar.player .fill-ghost { position: absolute; inset: 0; background: linear-gradient(90deg, var(--red), var(--red-2)); transition: width .5s cubic-bezier(.3,.7,.2,1) .12s; z-index: 1; }
.hp-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 3; }
.hp-flash.on { animation: hpFlash .3s ease-out; }
@keyframes hpFlash { 0% { opacity: .85; } 100% { opacity: 0; } }
/* Flow State: player HP bar beats like a heartbeat and looks like it's on fire. */
.bar.player.flow-fire { animation: flowBeat .5s ease-in-out infinite; box-shadow: 0 0 16px #ff6a00cc; }
.bar.player.flow-fire .fill { background: linear-gradient(90deg, #ff2436, #ff8a00, #ffce54, #ff2436) !important; background-size: 300% 100%; animation: flowFireShift .8s linear infinite; box-shadow: 0 0 14px #ff6a00; }
@keyframes flowBeat { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.3); } }
@keyframes flowFireShift { from { background-position: 0% 0; } to { background-position: 300% 0; } }
.flow-row { display: flex; align-items: center; gap: 9px; margin-top: 9px; }
.bar.flow { flex: 1; height: 9px; } .bar.flow .fill { background: linear-gradient(90deg, var(--blue), var(--pink)); }
#flowlabel { font-size: 11.5px; color: var(--dim); font-weight: 700; min-width: 92px; text-align: right; }
#flowlabel.flow-on { color: var(--gold); animation: pulse .6s infinite alternate; }
@keyframes pulse { to { opacity: .45; } }
.combo { position: absolute; top: 13%; left: 0; right: 0; z-index: 3; text-align: center; pointer-events: none; }
.combo b { font-size: 46px; font-weight: 900; color: #fff; text-shadow: 0 0 16px var(--pink); line-height: 1; }
.combo small { display: block; font-size: 12px; letter-spacing: 4px; color: var(--dim); }
.combo .super { color: var(--pink); font-weight: 900; font-size: 17px; margin-top: 4px; animation: pulse .4s infinite alternate; }
.countdown { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; font-size: 96px; font-weight: 900; color: #fff; text-shadow: 0 0 34px var(--pink); pointer-events: none; }
.prep-overlay { position: absolute; inset: 0; z-index: 6; display: grid; place-items: end center; padding: 0 16px calc(env(safe-area-inset-bottom) + 22px); pointer-events: none; }
.prep-box { width: 100%; max-width: 440px; background: #0b0e1ae6; border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 20px; text-align: center; pointer-events: auto; backdrop-filter: blur(6px); }
.prep-box h3 { margin: 0 0 8px; color: var(--gold); letter-spacing: .5px; }
.prep-box p { color: var(--dim); font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
.prep-status { font-weight: 800; color: var(--green); margin-bottom: 14px; min-height: 20px; }
.prep-box .primary { margin-top: 0; }
.quit { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 14px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #000a; color: #fff; display: grid; place-items: center; }
.omit-btn { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); transform: translateX(-50%); z-index: 22; padding: 10px 18px; border-radius: 12px; border: none; background: var(--red); color: #fff; font-weight: 900; font-size: 13px; box-shadow: 0 4px 14px #000a, 0 0 16px #ff2a3688; }
.omit-btn:active { transform: translateX(-50%) scale(.95); }
.cc-bubble { position: relative; background: var(--panel2); border: 1px solid var(--red); border-radius: 16px; padding: 14px 18px; font-size: 14px; line-height: 1.45; box-shadow: 0 10px 30px #000c; }
/* same size/position as the coach everywhere else (.gb-coach): 330px, right side, rising
   up behind the box (bubble comes after in DOM so its background paints over the overlap) */
.cc-coach { position: absolute; right: -8px; bottom: 0; width: 330px; height: auto; object-fit: contain; object-position: bottom center; filter: drop-shadow(0 6px 16px #000c); pointer-events: none; }
.cc-txt { min-width: 0; }
.cc-name { color: var(--red); display: block; font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.cc-next { margin-top: 8px; font-size: 11px; color: #ffffff88; letter-spacing: .5px; }

/* combo + points OUTSIDE the triangle (top-left) */
.combat-info { position: absolute; top: calc(env(safe-area-inset-top) + 74px); left: 16px; z-index: 3; pointer-events: none; }
.ci-score { font-weight: 900; font-size: 22px; color: #fff; text-shadow: 0 2px 6px #000; }
.ci-score span { font-size: 11px; color: var(--dim); }
.ci-combo { font-weight: 900; font-size: 18px; color: var(--gold); text-shadow: 0 2px 6px #000; margin-top: 2px; }
.ci-combo.super { color: var(--pink); }
.ci-combo span { font-size: 10px; letter-spacing: 1px; color: #cfd6ea; }
/* judgement feed (PERFECT / GOOD / ...) top-right */
.judge-feed { position: absolute; top: calc(env(safe-area-inset-top) + 74px); right: 16px; z-index: 3; text-align: right; pointer-events: none; display: flex; flex-direction: column; gap: 2px; }
.judge-feed .jl { font-weight: 900; font-size: 20px; text-shadow: 0 2px 6px #000; }
/* minimal pre-start hint (no instruction box) */
.prep-hint { position: absolute; top: 15%; left: 50%; transform: translateX(-50%); z-index: 4; text-align: center; font-weight: 900; letter-spacing: 4px; font-size: 16px; color: #fff; opacity: .9; pointer-events: none; text-shadow: 0 2px 10px #000; }
.prep-hint.ok { color: var(--green); }
/* first-fight staged tutorial: HUD starts dark, each stage un-dims its own piece */
.hud-top.tut-dim, .hud-bottom.tut-dim { opacity: .12; transition: opacity .4s ease; pointer-events: none; }
.hud-top, .hud-bottom { transition: opacity .4s ease; }
.drill-count { position: absolute; top: 16%; left: 50%; transform: translateX(-50%); z-index: 21; font-weight: 900; letter-spacing: 2px; font-size: 15px; color: var(--gold); background: #000a; padding: 8px 16px; border-radius: 20px; box-shadow: 0 4px 14px #000a; pointer-events: none; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%); z-index: 99; background: #000e; color: #fff; padding: 12px 18px; border-radius: 22px; border: 1px solid var(--line); font-size: 14px; animation: pop .2s; }

/* ---------- boxing flair: ropes, glass, glow ---------- */
/* ring ropes under the top bar */
.topbar { border-bottom: 4px solid transparent; border-image: linear-gradient(90deg, var(--red), #fff, var(--blue)) 1; box-shadow: 0 6px 14px #0006; }

/* broken-glass burst behind the logo and the victory title */
.logo, .result h1 { position: relative; }
.logo::before, .result.win h1::before {
  content: ""; position: absolute; inset: -40px -30px; z-index: -1; pointer-events: none; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200'%3E%3Cg stroke='%23ffffff' stroke-opacity='0.16' fill='none' stroke-width='1.4'%3E%3Cpath d='M150 100 L40 20 M150 100 L255 18 M150 100 L10 120 M150 100 L290 130 M150 100 L80 190 M150 100 L225 188 M150 100 L150 4 M150 100 L150 196'/%3E%3Cpolygon points='150,100 40,20 10,120'/%3E%3Cpolygon points='150,100 255,18 290,130'/%3E%3Cpolygon points='150,100 80,190 150,196'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
}

/* glow on key SVG icons + music notes so they read from far away */
.menu-grid .ic, .currency .ic, .songlist .ic, .res-rewards .ic, .chal-foot .reward .ic { filter: drop-shadow(0 0 5px currentColor); }
.songlist button.on { box-shadow: 0 0 14px #5db4ff66; }
.songlist button.on .ic { filter: drop-shadow(0 0 7px var(--blue)); }

/* brighter combat HUD bars (visible at arm's length) */
.bar.enemy { height: 20px; } .bar.enemy .fill { box-shadow: 0 0 12px var(--green); }
.bar.player { height: 20px; } .bar.player .fill { box-shadow: 0 0 12px var(--green); }
.bar.flow .fill { box-shadow: 0 0 10px var(--pink); }
.enemy-name { font-size: 20px; text-shadow: 0 2px 6px #000; }
#flowlabel { font-size: 12.5px; }
.combo b { font-size: 52px; }

.enemy-bar { display: flex; align-items: center; gap: 11px; }
.enemy-info { flex: 1; min-width: 0; }

/* Native APK: the camera is drawn by a native layer BEHIND a transparent WebView, so the
   page must be see-through during combat (the .cam-tint overlay still darkens for contrast). */
html.native-cam, html.native-cam body, html.native-cam #app { background: transparent !important; }
html.native-cam .scene.combat { background: transparent !important; }
html.native-cam .scene.combat > #cam { display: none !important; }

/* practice cards */
.practice-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 18px; border-radius: 14px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--txt); }
.practice-card .pc-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--bg2); flex: none; }
.practice-card.p-punch .pc-ic { color: var(--blue); } .practice-card.p-dodge .pc-ic { color: var(--orange); }
.practice-card.p-punch { border-color: #5db4ff55; } .practice-card.p-dodge { border-color: #ff8a4d55; }
.pc-name { font-weight: 800; font-size: 17px; } .pc-sub { font-size: 12.5px; color: var(--dim); margin-top: 2px; }

/* coach / tutorial */
.tut-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; }
.coach { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 14px; }
.coach-portrait { width: 130px; height: 160px; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--line); box-shadow: 0 10px 30px #0007; }
.coach-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coach-fallback { width: 100%; height: 100%; place-items: center; color: var(--blue); filter: drop-shadow(0 0 8px var(--blue)); }
.coach-name { font-weight: 800; color: var(--gold); letter-spacing: .3px; }
.bubble { position: relative; max-width: 440px; background: var(--panel2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; font-size: 15px; line-height: 1.55; }
.bubble::before { content: ""; position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotate(45deg); width: 16px; height: 16px; background: var(--panel2); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.tut-progress { color: var(--dim); font-size: 12px; margin: 10px 0; }
.tut-nav { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 440px; }
.tut-nav button { padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; color: var(--txt); }
.tut-nav .primary { background: var(--pink); border-color: var(--pink); color: #fff; }
