:root { --c: #ff5d3d; --ink: #14203d; --mut: #5d6a8a; --sat: env(safe-area-inset-top, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f6f1e7; font-family: "Be Vietnam Pro", system-ui, sans-serif; color: var(--ink); overscroll-behavior: none; }
canvas#c { position: fixed; inset: 0; touch-action: none; display: block; }
#menu { position: fixed; inset: 0; z-index: 20; display: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#menu.on { display: block; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .5; }

.home { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; padding: calc(var(--sat) + 76px) 16px 32px; max-width: 520px; margin: 0 auto; }
.logo { text-align: center; color: #fff; text-shadow: 0 4px 18px rgba(0,40,90,.35); }
.logo .mark { width: 76px; height: 76px; margin: 0 auto 6px; border-radius: 24px; display: grid; place-items: center; font-size: 42px; background: linear-gradient(135deg, #ff9f1c, #e63946); box-shadow: 0 10px 30px rgba(255,90,80,.45); transform: rotate(-8deg); }
.logo h1 { margin: 0; font-size: clamp(40px, 11vw, 60px); font-weight: 900; letter-spacing: -1px; line-height: 1; }
.logo p { margin: 4px 0 0; font-weight: 800; font-size: 18px; opacity: .95; }
.btn { display: block; width: 100%; min-height: 52px; border: 0; border-radius: 18px; background: #fff; font-weight: 800; font-size: 17px; margin: 8px 0; box-shadow: 0 6px 18px rgba(10,40,90,.18); }
.btn.main { background: linear-gradient(180deg, #ff8a6b, var(--c)); color: #fff; box-shadow: 0 8px 22px rgba(255,93,61,.45); }
.btn.big { min-height: 72px; font-size: 24px; font-weight: 900; }
.btn.big small { display: block; font-size: 14px; font-weight: 700; opacity: .9; }
.btn.ghost { background: rgba(255,255,255,.6); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.tile { border: 0; border-radius: 20px; background: rgba(255,255,255,.93); padding: 14px 12px; text-align: left; min-height: 104px; box-shadow: 0 6px 18px rgba(10,40,90,.16); display: flex; flex-direction: column; gap: 2px; }
.tile i { font-style: normal; font-size: 28px; }
.tile b { font-size: 17px; }
.tile small { color: var(--mut); font-weight: 700; font-size: 13px; }
.link { border: 0; background: rgba(255,255,255,.85); border-radius: 14px; padding: 12px 16px; font-weight: 800; width: 100%; }
.foot { color: #fff; font-weight: 700; font-size: 13px; text-align: center; text-shadow: 0 2px 8px rgba(0,40,90,.4); }
.foot a { color: #fff; }

.page { max-width: 640px; margin: 0 auto; padding: calc(var(--sat) + 70px) 16px 40px; min-height: 100%; background: linear-gradient(180deg, rgba(240,248,255,.97), rgba(240,248,255,.97)); }
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.top h2 { margin: 0; font-size: 26px; font-weight: 900; }
.back { border: 0; background: #fff; border-radius: 14px; min-height: 44px; padding: 0 14px; font-weight: 800; box-shadow: 0 3px 10px rgba(10,40,90,.1); }
.mut { color: var(--mut); font-size: 14px; margin: 4px 0 10px; }
h3 { margin: 18px 0 8px; font-size: 18px; }
.zone { background: #fff; border-radius: 22px; padding: 14px; margin: 12px 0; border-top: 6px solid var(--z); box-shadow: 0 6px 18px rgba(10,40,90,.08); }
.zone h3 { margin: 0; color: var(--z); }
.lvls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lvl { border: 0; border-radius: 16px; background: #f1f5fd; padding: 10px 4px; min-height: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lvl b { font-size: 24px; font-weight: 900; color: var(--z); }
.lvl span { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.2; }
.lvl em { font-style: normal; color: #ffb400; letter-spacing: 1px; }
.lvl.boss { background: linear-gradient(180deg, #fff1f3, #ffe0e6); }
.lvl.lock { opacity: .5; }
.brief { background: #fff; border-radius: 22px; padding: 16px; border-left: 8px solid var(--z); box-shadow: 0 6px 18px rgba(10,40,90,.08); }
.brief small { color: var(--z); font-weight: 800; }
.brief h2 { margin: 2px 0 4px; font-size: 26px; }
.brief p { margin: 0 0 8px; font-weight: 600; }
.stars { list-style: none; padding: 0; margin: 0; }
.stars li { padding: 6px 0; font-weight: 700; color: var(--mut); }
.stars li.on { color: #d79400; }
.planes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.planes.wide { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pl { border: 3px solid transparent; background: #fff; border-radius: 20px; padding: 10px; text-align: center; display: flex; flex-direction: column; align-items: center; box-shadow: 0 4px 14px rgba(10,40,90,.08); }
.pl.sel { border-color: var(--c); }
.pl canvas { width: 120px; height: 90px; background: radial-gradient(circle, #d9f3ff, #bfe7fb); border-radius: 16px; }
.pl b { margin-top: 6px; font-size: 17px; }
.pl small { color: var(--mut); font-weight: 700; font-size: 12px; }
.pl p { font-size: 13px; margin: 6px 0; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; width: 100%; font-size: 12px; font-weight: 700; align-items: center; margin-bottom: 4px; }
.bar { display: block; height: 8px; background: #e6ecf7; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #40a4ff, #b04dff); }
.wallet { font-size: 20px; font-weight: 900; color: #b8860b; margin: 0; }
.ups { display: flex; flex-direction: column; gap: 8px; }
.up { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 18px; padding: 10px 12px; box-shadow: 0 4px 12px rgba(10,40,90,.06); }
.up > i { font-style: normal; font-size: 26px; width: 36px; text-align: center; }
.up > div { flex: 1; }
.up b em { font-style: normal; color: var(--c); letter-spacing: 2px; margin-left: 4px; }
.up small { display: block; color: var(--mut); font-weight: 600; }
.up .btn { width: auto; min-width: 96px; margin: 0; min-height: 44px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { border: 0; background: #fff; border-radius: 18px; padding: 16px; text-align: left; display: flex; flex-direction: column; box-shadow: 0 4px 12px rgba(10,40,90,.06); }
.row span { color: var(--mut); font-weight: 600; font-size: 14px; }

.ov { min-height: 100%; display: grid; place-items: center; padding: 16px; background: rgba(10,25,60,.45); backdrop-filter: blur(3px); }
.panel { width: 100%; max-width: 420px; background: #fff; border-radius: 26px; padding: 20px; text-align: center; box-shadow: 0 24px 60px rgba(10,20,60,.35); }
.panel h2 { margin: 0 0 4px; font-size: 26px; font-weight: 900; }
.panel.cards { max-width: 720px; }
.cardrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.card { border: 3px solid #e6ecf7; background: linear-gradient(180deg, #fff, #f3f7ff); border-radius: 20px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 190px; animation: cardIn .35s ease both; }
.card:nth-child(2) { animation-delay: .08s; } .card:nth-child(3) { animation-delay: .16s; }
.card:active { transform: scale(.97); border-color: var(--c); }
.card small { display: block; font-weight: 800; color: var(--c); font-size: 12px; text-transform: uppercase; }
.card div { display: flex; flex-direction: column; gap: 4px; }
.card i { font-style: normal; font-size: 40px; line-height: 1.2; }
.card b { font-size: 16px; }
.card span { font-size: 13px; color: var(--mut); font-weight: 600; }
@keyframes cardIn { from { transform: translateY(30px) scale(.9); opacity: 0; } }
@media (max-width: 480px) { .cardrow { grid-template-columns: 1fr; } .card { min-height: 0; flex-direction: row; text-align: left; gap: 14px; padding: 12px 14px; } .card i { font-size: 34px; width: 44px; text-align: center; } .card div { align-items: flex-start; gap: 1px; } .lvls { grid-template-columns: repeat(2, 1fr); } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid #dfe6f3; background: #fff; border-radius: 14px; min-height: 44px; padding: 0 14px; font-weight: 800; }
.chip.on { border-color: var(--c); background: #eafaf1; }
.opps { display: flex; flex-direction: column; gap: 8px; }
.opp { display: flex; gap: 12px; align-items: center; text-align: left; border: 0; background: #fff; border-radius: 18px; padding: 12px; box-shadow: 0 4px 12px rgba(10,40,90,.06); }
.opp.lock { opacity: .55; }
.opp div { display: flex; flex-direction: column; }
.opp small { color: var(--c); font-weight: 800; }
.opp span { color: var(--mut); font-size: 13px; font-weight: 600; }
.ava { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-style: normal; font-weight: 900; font-size: 22px; flex: none; text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.cup { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 14px; margin: 10px 0; box-shadow: 0 4px 12px rgba(10,40,90,.06); }
.cup > div { flex: 1; display: flex; flex-direction: column; } .cup small { color: var(--mut); font-weight: 700; }
.cup .btn { width: auto; min-width: 120px; margin: 0; }
.cup.lock { opacity: .7; }
.row em { font-style: normal; color: var(--c); font-weight: 800; font-size: 13px; margin-top: 2px; }
.shirts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shirt { border: 3px solid transparent; background: #fff; border-radius: 18px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 4px 12px rgba(10,40,90,.06); }
.shirt.on { border-color: var(--c); }
.shirt i { width: 54px; height: 54px; border-radius: 16px 16px 12px 12px; border: 2px solid #dfe6f3; }
.shirt small { font-weight: 700; color: var(--mut); font-size: 12px; }
.soon { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; }
.soon span { background: rgba(255,255,255,.25); border-radius: 10px; padding: 4px 10px; }
.trk { background: linear-gradient(135deg, var(--a), var(--b)); color: #14203d; }
.trk span { color: #14203d; opacity: .8; }
.trk.lock { filter: grayscale(.7); opacity: .7; }
.cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.carc { border: 3px solid transparent; background: #fff; border-radius: 20px; padding: 12px; text-align: center; box-shadow: 0 4px 14px rgba(10,40,90,.08); display: flex; flex-direction: column; align-items: center; }
.carc.sel { border-color: var(--c); }
.carc canvas { width: 180px; height: 115px; background: radial-gradient(circle at 50% 80%, #e8eefb, #fff); border-radius: 14px; }
.carc b { font-size: 17px; } .carc small { color: var(--c); font-weight: 800; } .carc p { font-size: 13px; margin: 6px 0; }
.paints { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.pt { width: 34px; height: 34px; border-radius: 10px; border: 3px solid #e3e7f5; }
.pt.on { border-color: #14203d; }
.note { color: #fff; font-size: 12px; font-weight: 700; text-align: center; opacity: .9; margin: 0; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.fighters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fc { border: 3px solid transparent; background: #fff; border-radius: 20px; padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 4px 14px rgba(10,40,90,.08); }
.fc.sel { border-color: var(--k); background: linear-gradient(180deg, #fff, #fff6f2); }
.fc canvas { width: 120px; height: 126px; background: radial-gradient(circle at 50% 90%, #f1e6d4, #fff); border-radius: 14px; }
.fc b { font-size: 18px; } .fc small { color: var(--k); font-weight: 900; } .fc span { font-size: 12px; color: var(--mut); font-weight: 600; margin: 4px 0; } .fc em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--c); }
.home .logo, .home .foot, .home .note, .home .soon { color: #3a2a1e; text-shadow: none; }
.home .foot a { color: #3a2a1e; }
.home .soon span { background: rgba(0,0,0,.08); }
