:root {
  color-scheme: dark;
  --bg: #090510;
  --panel: #130d20;
  --text: #f8f4ff;
  --muted: #a49bb4;
  --violet: #a13eff;
  --violet-bright: #d65aff;
  --orange: #ff6b12;
  --line: rgba(184, 110, 255, .32);
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(ellipse at 50% -20%, #351052 0, #120a1c 38%, var(--bg) 78%); }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { width: min(100%, 620px); min-height: 100dvh; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 14px calc(84px + env(safe-area-inset-bottom)); overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 46px; margin-bottom: 10px; }
.brand-mark { display: flex; gap: 7px; align-items: center; font-size: 12px; letter-spacing: .12em; font-weight: 800; }
.brand-mark b { color: #d4a0ff; }
.brand-spark { color: var(--violet-bright); font-size: 20px; text-shadow: 0 0 14px var(--violet-bright); }
.wallets { display: flex; gap: 7px; }
.wallet { min-width: 74px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(26,17,39,.78); display: flex; align-items: center; gap: 5px; font-size: 11px; }
.wallet span { font-size: 13px; }
.wallet strong { font-size: 12px; }
.wallet small { color: var(--muted); font-size: 9px; }
.wallet-bk span, .bk-icon { color: #ffbd32; }
.wallet-xp span, .xp-icon { color: #c77aff; }
.view { display: none; animation: fade-in .22s ease; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mode-switch { display: flex; padding: 4px; margin: 3px auto 13px; width: fit-content; gap: 3px; border: 1px solid rgba(204, 141, 255, .17); border-radius: 14px; background: rgba(20, 12, 30, .8); }
.mode-tab { border: 0; border-radius: 10px; background: transparent; padding: 8px 18px; color: #9e91ad; font-weight: 800; font-size: 12px; }
.mode-tab.selected { color: #fff; background: linear-gradient(110deg, #7424ce, #a43cf0); box-shadow: 0 0 17px rgba(165, 61, 255, .35); }
.soon-dot { display: inline-block; width: 5px; height: 5px; vertical-align: 2px; border-radius: 50%; background: #ffb94a; box-shadow: 0 0 8px #ffb94a; }
.battle-heading { display: flex; justify-content: space-between; align-items: end; margin: 0 3px 10px; }
.eyebrow { margin: 0; color: #b8a3d3; font-size: 9px; line-height: 1.3; font-weight: 800; letter-spacing: .17em; }
h1 { margin: 2px 0 0; font-size: 21px; line-height: 1.2; letter-spacing: -.04em; }
.live-pill { display: flex; align-items: center; gap: 5px; border: 1px solid rgba(255, 94, 168, .22); border-radius: 20px; padding: 5px 8px; color: #ffa0cb; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.live-pill span { width: 5px; height: 5px; border-radius: 50%; background: #ff4c9b; box-shadow: 0 0 8px #ff4c9b; animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.battle-area { position: relative; }
.vs-rail { height: 20px; display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 6px; color: #d9a9ff; text-shadow: 0 0 12px var(--violet-bright); font-size: 17px; font-style: italic; font-weight: 900; }
.vs-rail i { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, #9e53ff); box-shadow: 0 0 9px #9e53ff; }
.vs-rail i:last-child { transform: scaleX(-1); }
.cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.fighter-card { position: relative; min-width: 0; padding: 6px; border: 1px solid rgba(200, 117, 255, .57); border-radius: 19px; background: linear-gradient(155deg, rgba(63,31,83,.74), rgba(17,11,27,.95) 52%, rgba(35,16,48,.9)); box-shadow: 0 0 18px rgba(155,58,255,.17), inset 0 0 17px rgba(197,112,255,.05); }
.fighter-card.right { border-color: rgba(255, 126, 50, .49); box-shadow: 0 0 18px rgba(255,102,21,.12), inset 0 0 16px rgba(255,154,73,.04); }
.portrait { position: relative; display: block; width: 100%; height: clamp(220px, 40vh, 390px); min-height: 205px; overflow: hidden; border: 0; border-radius: 14px; background: linear-gradient(135deg, #9b6cae, #433658 58%, #221632); }
.portrait-orange { background: radial-gradient(ellipse at 51% 40%, #ffe0c4 0 9%, #b9705a 10% 15%, transparent 16%), radial-gradient(ellipse at 48% 60%, #c78a61 0 23%, transparent 24%), linear-gradient(145deg, #471e51, #c0779b 48%, #f2a36f); }
.portrait-violet { background: radial-gradient(ellipse at 50% 37%, #ffe0ca 0 9%, #31202c 10% 16%, transparent 17%), radial-gradient(ellipse at 48% 61%, #c28c78 0 24%, transparent 25%), linear-gradient(145deg, #31254a, #95668d 52%, #f3b69c); }
.portrait-blue { background: radial-gradient(ellipse at 51% 38%, #f5d4be 0 9%, #34272c 10% 16%, transparent 17%), radial-gradient(ellipse at 48% 61%, #8a5e54 0 24%, transparent 25%), linear-gradient(145deg, #162d4d, #46729a 54%, #e3a886); }
.portrait-pink { background: radial-gradient(ellipse at 51% 38%, #ffe1cd 0 9%, #442735 10% 16%, transparent 17%), radial-gradient(ellipse at 48% 61%, #d29c8d 0 24%, transparent 25%), linear-gradient(145deg, #61345d, #cf78aa 56%, #ffc0bb); }
.portrait::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,4,17,.05), transparent 45%, rgba(8,3,14,.43)); }
.profile-photo { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait.has-real-photo .portrait-halo, .portrait.has-real-photo .portrait-figure { display: none; }
.portrait-halo { position: absolute; width: 68%; height: 70%; border-radius: 50%; top: 7%; left: 16%; background: rgba(255,230,221,.19); filter: blur(28px); }
.portrait-figure { position: absolute; width: 68%; height: 61%; bottom: 0; left: 16%; }
.portrait-figure i { position: absolute; width: 31%; height: 29%; left: 35%; top: 2%; border-radius: 48% 48% 43% 43%; background: linear-gradient(140deg, #f7d6c2, #9c655d); box-shadow: -8px -5px 0 2px rgba(37,22,36,.73); }
.portrait-figure b { position: absolute; width: 95%; height: 78%; left: 2%; bottom: -24%; border-radius: 45% 45% 4% 4%; background: linear-gradient(120deg, rgba(255,238,220,.9), rgba(61,37,59,.9) 55%, rgba(18,13,28,.98)); clip-path: polygon(35% 0,65% 0,78% 12%,100% 30%,93% 100%,7% 100%,0 31%,22% 12%); }
.portrait-glint { position: absolute; inset: 0; background: linear-gradient(118deg, transparent 10%, rgba(255,255,255,.2) 45%, transparent 52%); opacity: .22; }
.photo-counter { position: absolute; z-index: 2; top: 8px; right: 8px; padding: 5px 8px; border-radius: 10px; background: rgba(20,13,32,.78); color: #fff; font-size: 11px; font-weight: 800; backdrop-filter: blur(5px); }
.reaction-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 7px 0 7px; }
.reaction { display: grid; place-items: center; height: 43px; border: 1px solid rgba(205,149,255,.54); border-radius: 13px; background: linear-gradient(140deg, #7a22d2, #38126f); box-shadow: 0 0 13px rgba(160,57,255,.25); font-size: 20px; cursor: pointer; transition: transform .12s, filter .12s; }
.reaction-fire { border-color: rgba(255,172,57,.76); background: linear-gradient(140deg, #ff7a12, #b52b03); box-shadow: 0 0 13px rgba(255,111,19,.23); }
.reaction:active { transform: scale(.93); filter: brightness(1.22); }
.reaction:disabled { opacity: .45; cursor: wait; }
.fighter-meta { min-height: 24px; display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.user-dot { color: #ded3ea; font-size: 13px; }
.fighter-name { max-width: 70%; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 800; }
.crown-badge { display: inline-grid; place-items: center; width: 21px; height: 21px; border: 1px solid rgba(207,150,255,.4); border-radius: 7px; background: linear-gradient(145deg, #7f31d3, #3d176b); color: #ffd56a; font-size: 12px; }
.fighter-details { padding: 2px 0 3px; overflow: hidden; color: #b9aebf; font-size: 9px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.reward-caption { margin: 13px 0 7px; color: #857895; font-size: 8px; font-weight: 800; letter-spacing: .15em; text-align: center; }
.daily-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.progress-item { display: grid; grid-template-columns: 23px 1fr; gap: 1px 6px; align-items: center; padding: 8px 9px; border: 1px solid rgba(196,130,255,.18); border-radius: 12px; background: linear-gradient(120deg, rgba(48,22,71,.66), rgba(18,12,28,.83)); }
.progress-icon { grid-row: span 2; font-size: 18px; text-align: center; }
.progress-item strong { font-size: 12px; }
.progress-item small { color: #9d91a8; font-size: 8px; }
.progress-track { grid-column: 2; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.09); }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #993dff, #e091ff); transition: width .25s; }
.progress-item:nth-child(2) .progress-track i { background: linear-gradient(90deg, #ff922f, #ffdc68); }
.tournament-strip { display: flex; align-items: center; gap: 10px; margin-top: 11px; padding: 10px 11px; border: 1px solid rgba(237,173,74,.24); border-radius: 14px; background: linear-gradient(100deg, rgba(60,35,22,.57), rgba(28,16,31,.72)); }
.tournament-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,181,55,.13); font-size: 19px; }
.tournament-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.tournament-copy strong { font-size: 11px; }
.tournament-copy span { color: #aa9aa8; font-size: 9px; }
.arrow-button { width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.04); color: #ffca78; font-size: 22px; }
.battle-message { margin: 28px 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; color: #d2c7dc; background: rgba(34,18,47,.7); font-size: 13px; line-height: 1.55; text-align: center; }
.retry-pair { display: block; margin: 13px auto 0; padding: 8px 16px; border: 1px solid rgba(202,126,255,.45); border-radius: 10px; background: rgba(115,46,166,.45); color: #fff; font-size: 11px; font-weight: 800; }
.hidden { display: none !important; }
.bottom-nav { position: fixed; z-index: 5; bottom: 0; left: 50%; display: grid; grid-template-columns: repeat(5, 1fr); width: min(100%, 620px); padding: 7px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(188,117,255,.19); background: rgba(12,8,18,.94); backdrop-filter: blur(18px); transform: translateX(-50%); }
.bottom-nav button { display: flex; align-items: center; flex-direction: column; gap: 3px; border: 0; background: transparent; color: #867b92; }
.bottom-nav button span { font-size: 18px; line-height: 20px; }
.bottom-nav button small { font-size: 8px; font-weight: 700; }
.bottom-nav button.active { color: #d78cff; text-shadow: 0 0 12px rgba(198,103,255,.45); }
.page-heading { margin: 14px 4px 18px; }
.page-heading h1 { font-size: 26px; }
.hero-panel { position: relative; overflow: hidden; padding: 24px 20px; border: 1px solid rgba(197,122,255,.39); border-radius: 21px; background: radial-gradient(circle at 85% 25%, rgba(178,58,255,.36), transparent 33%), linear-gradient(135deg, #29143f, #130c20 80%); }
.hero-panel h2 { margin: 8px 0 19px; font-size: 27px; line-height: 1.14; letter-spacing: -.04em; }
.hero-glow { position: absolute; right: 17px; top: 7px; color: rgba(222,142,255,.3); font-size: 80px; text-shadow: 0 0 28px #a83cff; }
.primary-button { width: 100%; min-height: 46px; border: 1px solid rgba(228,190,255,.35); border-radius: 13px; background: linear-gradient(105deg, #7829c7, #a347ec); box-shadow: 0 0 18px rgba(157,63,235,.22); color: white; font-size: 13px; font-weight: 800; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat-card { display: grid; grid-template-columns: 30px 1fr; gap: 2px 6px; padding: 14px; border: 1px solid rgba(190,135,235,.17); border-radius: 15px; background: rgba(26,16,38,.75); }
.stat-card span { grid-row: span 2; font-size: 20px; }
.stat-card strong { font-size: 18px; }
.stat-card small { color: var(--muted); font-size: 9px; }
.leaderboard-tabs { display: flex; gap: 7px; margin-bottom: 11px; }
.leaderboard-tabs button { flex: 1; padding: 9px; border: 1px solid rgba(200,140,255,.21); border-radius: 11px; background: rgba(28,18,39,.8); color: #aa9bb7; font-size: 11px; font-weight: 700; }
.leaderboard-tabs button.selected { color: #fff; border-color: rgba(202,126,255,.58); background: rgba(115,46,166,.45); }
.leaderboard { display: grid; gap: 7px; }
.leader-row { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1px solid rgba(190,135,235,.17); border-radius: 13px; background: rgba(25,16,35,.76); }
.leader-place { width: 21px; color: #b5a4c5; font-weight: 800; text-align: center; }
.leader-crown { color: #ffc94c; }
.leader-name { flex: 1; font-size: 12px; font-weight: 700; }
.leader-name small, .leader-row strong small { display: block; color: #93889d; font-size: 8px; font-weight: 500; }
.leader-row strong { color: #dfb4ff; text-align: right; font-size: 12px; }
.empty-state { padding: 20px 14px; border: 1px dashed rgba(190,135,235,.25); border-radius: 14px; color: #a99db3; font-size: 12px; line-height: 1.5; text-align: center; }
.placeholder-panel { display: grid; justify-items: center; gap: 8px; padding: 34px 20px; border: 1px solid rgba(190,135,235,.18); border-radius: 20px; background: rgba(25,16,35,.75); text-align: center; }
.placeholder-panel > span { color: #f3c24b; font-size: 39px; }
.placeholder-panel h2 { margin: 5px 0 0; font-size: 18px; }
.placeholder-panel p { max-width: 280px; margin: 0; color: #a79bae; font-size: 12px; line-height: 1.5; }
.profile-form { display: grid; gap: 12px; padding: 16px; border: 1px solid rgba(190,135,235,.18); border-radius: 18px; background: rgba(25,16,35,.75); }
.profile-form label { display: grid; gap: 6px; color: #c1b4cd; font-size: 10px; font-weight: 700; }
.profile-form input:not([type=checkbox]), .profile-form select { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid rgba(198,149,232,.19); border-radius: 10px; outline: none; background: #140e1c; color: #f8f4ff; font-size: 12px; }
.profile-form input:focus, .profile-form select:focus { border-color: rgba(191,105,255,.7); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.profile-form .check-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.check-row input { accent-color: #a13eff; }
.form-note { min-height: 15px; margin: 0; color: #c7a4e2; font-size: 10px; text-align: center; }
.battle-profile-form { margin-top: 11px; }
.form-section-title h2 { margin: 4px 0 0; font-size: 16px; }
.form-help { margin: 0; color: #a99caf; font-size: 10px; line-height: 1.5; }
.profile-form input[type=file] { padding: 9px; }
.profile-form label small { color: #8d8198; font-size: 9px; font-weight: 500; }
.profile-stats { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; color: #a89caf; font-size: 9px; }
.profile-stats b { display: block; margin-top: 3px; color: white; font-size: 14px; }
.reward-overlay { position: fixed; z-index: 10; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 22px; background: rgba(8,4,14,.92); backdrop-filter: blur(14px); text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.reward-overlay.show { opacity: 1; pointer-events: all; }
.reward-burst { position: relative; display: flex; align-items: center; justify-content: center; width: 110px; height: 110px; margin-bottom: 9px; border-radius: 50%; background: radial-gradient(circle, rgba(220,158,255,.34), rgba(107,44,174,.03) 68%); box-shadow: 0 0 48px rgba(185,89,255,.3); }
.burst-star { color: #e0a0ff; font-size: 61px; text-shadow: 0 0 22px #d67cff; animation: reward-pop .65s ease-out; }
.burst-coins { position: absolute; right: -3px; bottom: 0; color: #ffd264; font-size: 32px; text-shadow: 0 0 18px #ffac28; animation: reward-pop .8s .08s ease-out; }
@keyframes reward-pop { from { transform: scale(.25) rotate(-24deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.reward-overlay h2 { margin: 6px 0 17px; font-size: 22px; }
.reward-values { display: flex; gap: 10px; }
.reward-values span { padding: 12px 15px; border: 1px solid rgba(200,130,255,.4); border-radius: 13px; background: rgba(44,23,63,.8); font-size: 19px; }
.reward-rating { display: flex; gap: 8px; margin-top: 13px; }
.reward-rating span { min-width: 110px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.04); font-size: 10px; }
.reward-rating b { margin-left: 4px; color: #e0b2ff; }
.reward-rating small { display: block; margin-top: 3px; color: #9c91a4; font-size: 8px; }
.reward-xp { color: #d999ff; }
.reward-bk { color: #ffca59; border-color: rgba(255,191,75,.4) !important; }
.reward-hint { color: #a79bae; font-size: 11px; }
.media-modal { position: fixed; z-index: 12; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 22px; background: rgba(7,4,12,.92); backdrop-filter: blur(16px); }
.modal-close { position: absolute; top: max(18px, env(safe-area-inset-top)); right: 17px; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(21,13,30,.8); font-size: 27px; }
.modal-photo { position: relative; width: min(90vw, 480px); height: min(72vh, 700px); border: 1px solid rgba(215,153,255,.5); border-radius: 23px; box-shadow: 0 0 35px rgba(151,73,227,.27); cursor: pointer; }
.modal-photo.has-real-photo { background-size: contain; background-position: center; background-repeat: no-repeat; background-color: #090510; }
.modal-counter { position: absolute; top: 16%; right: max(calc((100vw - 480px) / 2), 9vw); padding: 6px 10px; border-radius: 10px; background: rgba(20,13,32,.78); font-size: 12px; }
.modal-dots { display: flex; gap: 6px; margin-top: 13px; }
.modal-dots i { width: 6px; height: 6px; border-radius: 50%; background: #786b82; }
.modal-dots i.active { width: 17px; border-radius: 7px; background: #d69aff; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100vw - 34px); padding: 10px 15px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: #271735; color: #fff; font-size: 11px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 370px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .cards { gap: 7px; }
  .fighter-card { padding: 5px; border-radius: 16px; }
  .portrait { height: 36vh; min-height: 190px; }
  .reaction { height: 39px; }
  .fighter-name { font-size: 10px; }
  .daily-progress { gap: 6px; }
  .progress-item { padding: 7px 6px; grid-template-columns: 19px 1fr; }
}
