:root {
  --bg: #070b18;
  --panel: rgba(16, 24, 44, 0.82);
  --panel2: rgba(28, 40, 70, 0.9);
  --line: rgba(120, 170, 255, 0.22);
  --text: #eaf2ff;
  --muted: #9fb0cf;
  --cyan: #3dfcd8;
  --gold: #ffd166;
  --red: #ff5d73;
  --green: #4dff9a;
  --head: "Russo One", "Arial Black", system-ui, sans-serif;
  --body: "Exo 2", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); overflow: hidden; user-select: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }
#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; display: none; }
.screen.on { display: block; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: linear-gradient(180deg, #2a3a63, #1a2442);
  padding: 10px 18px; border-radius: 12px; font-weight: 800; font-size: 16px; letter-spacing: .3px;
  box-shadow: 0 4px 0 #0c1226, 0 6px 16px rgba(0,0,0,.35); transition: transform .08s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #0c1226; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #4dffd9, #13b89a); color: #04221c; border-color: #8fffe9; box-shadow: 0 4px 0 #0b6e5c, 0 6px 18px rgba(61,252,216,.35); }
.btn.danger { background: linear-gradient(180deg, #ff7b8d, #d63a52); color: #fff; border-color: #ffb0bc; box-shadow: 0 4px 0 #7d1b2b; }
.btn.ghost { background: rgba(0,0,0,.35); box-shadow: none; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.big { padding: 14px 28px; font-size: 20px; border-radius: 14px; }
.btn.hint { background: linear-gradient(180deg, #ffe08a, #d9a634); color: #3a2600; box-shadow: 0 4px 0 #8a6416; }

/* ---------- loading ---------- */
#loading { display: none; place-items: center; background: radial-gradient(circle at 50% 40%, #1b2a55, #050813); }
#loading.on { display: grid; }
.logo { font-family: var(--head); font-size: 64px; text-align: center; background: linear-gradient(180deg, #fff, #3dfcd8); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 20px rgba(61,252,216,.5)); }
.logo small { display: block; font-size: 26px; letter-spacing: 12px; color: var(--gold); -webkit-text-fill-color: var(--gold); }
.spinner { width: 46px; height: 46px; border: 5px solid rgba(255,255,255,.15); border-top-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- home ---------- */
#homeBg { position: absolute; inset: 0; width: 100%; height: 100%; }
.topbar { position: absolute; top: 14px; left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.profile { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); padding: 8px 16px 8px 8px; border-radius: 40px; backdrop-filter: blur(8px); }
.lvl-badge { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--head); font-size: 20px; background: conic-gradient(from 200deg, #3dfcd8, #5ab8ff, #b65cff, #3dfcd8); color: #06101e; box-shadow: 0 0 16px rgba(61,252,216,.5); }
.pname { font-family: var(--head); font-size: 18px; }
.xpbar { width: 140px; height: 7px; background: rgba(255,255,255,.12); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #3dfcd8, #5ab8ff); }
.chips { display: flex; gap: 10px; }
.chip { background: var(--panel); border: 1px solid var(--line); padding: 9px 16px; border-radius: 30px; font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 6px; backdrop-filter: blur(8px); }
.chip.coins { color: var(--gold); }
.chip.streak { color: #ffa94d; }
.ring { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--p) * 1%), rgba(255,255,255,.15) 0); -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); }

.side-nav { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 12px; z-index: 2; }
.nav-btn { position: relative; width: 112px; padding: 12px 8px 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(8px); font-weight: 800; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .12s, border-color .2s, box-shadow .2s; }
.nav-btn span { font-size: 28px; }
.nav-btn:hover { transform: translateX(4px) scale(1.04); border-color: var(--cyan); box-shadow: 0 0 18px rgba(61,252,216,.3); }
.nav-btn em, .train-btn em { position: absolute; top: -6px; right: -6px; font-style: normal; background: var(--red); color: #fff; border-radius: 12px; padding: 2px 7px; font-size: 12px; box-shadow: 0 0 10px rgba(255,93,115,.6); }

.stage-info { position: absolute; right: 22px; top: 86px; width: 330px; z-index: 2; }
.tank-name { font-family: var(--head); font-size: 34px; text-shadow: 0 3px 14px rgba(0,0,0,.6); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rar { font-family: var(--body); font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #06101e; background: var(--rc); padding: 3px 10px; border-radius: 20px; box-shadow: 0 0 12px var(--rc); }
.stats-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; backdrop-filter: blur(10px); }
.st { display: grid; grid-template-columns: 24px 70px 1fr 48px; align-items: center; gap: 6px; margin: 6px 0; font-weight: 700; }
.st-n { color: var(--muted); font-size: 14px; }
.st b { text-align: right; }
.st-bar { height: 8px; background: rgba(255,255,255,.1); border-radius: 5px; overflow: hidden; }
.st-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3dfcd8, #5ab8ff); border-radius: 5px; }
.power { margin-top: 10px; font-family: var(--head); color: var(--gold); font-size: 18px; }
.drone-line { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.drone-line b { color: var(--text); }

.train-btn { position: absolute; left: 18px; bottom: 20px; z-index: 2; padding: 14px 20px; border-radius: 16px; border: 1px solid rgba(61,252,216,.5); background: rgba(10,40,44,.8); font-weight: 800; font-size: 17px; backdrop-filter: blur(8px); }
.train-btn:hover { box-shadow: 0 0 20px rgba(61,252,216,.4); }
.train-btn em { position: static; margin-left: 6px; }

.play-zone { position: absolute; right: 20px; bottom: 20px; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.modes { display: flex; gap: 8px; }
.mode { padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-weight: 800; font-size: 14px; display: flex; gap: 6px; align-items: center; backdrop-filter: blur(8px); }
.mode.on { border-color: var(--gold); box-shadow: 0 0 14px rgba(255,209,102,.45); color: var(--gold); }
.play-row { display: flex; gap: 12px; align-items: stretch; }
.drops { width: 200px; border-radius: 18px; border: 1px solid rgba(255,181,46,.45); background: linear-gradient(180deg, rgba(60,40,10,.85), rgba(30,20,6,.85)); padding: 10px 12px; text-align: left; backdrop-filter: blur(8px); }
.drops.ready { animation: pulse 1.4s ease-in-out infinite; border-color: #ffb52e; }
@keyframes pulse { 50% { box-shadow: 0 0 26px rgba(255,181,46,.7); } }
.drops-title { font-family: var(--head); font-size: 14px; color: #ffcf6b; letter-spacing: 1px; }
.drops-slots { display: flex; gap: 6px; margin: 6px 0; }
.slot { flex: 1; text-align: center; font-size: 22px; padding: 4px 0; border-radius: 10px; background: rgba(0,0,0,.35); filter: grayscale(1) brightness(.5); }
.slot.full { filter: none; background: rgba(255,181,46,.25); box-shadow: inset 0 0 10px rgba(255,181,46,.5); }
.slot.used { filter: grayscale(1) brightness(.3); }
.drops-bar { height: 7px; background: rgba(0,0,0,.4); border-radius: 4px; overflow: hidden; }
.drops-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb52e, #ffe08a); }
.drops-sub { font-size: 12px; color: #ffdf9e; margin-top: 4px; font-weight: 700; }
.play-btn { width: 210px; border: none; border-radius: 20px; background: linear-gradient(180deg, #ffe066, #ff9f1c); color: #3b1d00; font-family: var(--head); box-shadow: 0 6px 0 #a35a00, 0 10px 30px rgba(255,159,28,.5); display: flex; flex-direction: column; justify-content: center; align-items: center; transition: transform .1s; }
.play-btn span { font-size: 44px; line-height: 1; }
.play-btn small { font-family: var(--body); font-weight: 800; font-size: 14px; opacity: .8; }
.play-btn:hover { transform: scale(1.04); }
.play-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #a35a00; }

/* ---------- panel (hangars etc.) ---------- */
#panel { position: fixed; inset: 0; z-index: 20; display: none; flex-direction: column; background: radial-gradient(circle at 50% 0%, #1b2a55, #060914 70%); }
#panel.show { display: flex; }
.panel-head { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.25); }
.panel-head h2 { flex: 1; margin: 0; font-family: var(--head); font-size: 28px; font-weight: 400; letter-spacing: 1px; }
.back { border: 1px solid var(--line); background: var(--panel2); padding: 8px 14px; border-radius: 10px; font-weight: 800; }
.panel-body { flex: 1; overflow: auto; padding: 18px 20px; }

.hangar { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(340px, 460px); gap: 20px; height: 100%; }
.h-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; overflow: auto; padding: 4px; }
.card { position: relative; border-radius: 16px; border: 2px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.25)); padding: 8px 8px 10px; text-align: center; transition: transform .12s, border-color .2s; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 30%, var(--rc), transparent 70%); opacity: .25; }
.card:hover { transform: translateY(-3px); }
.card.sel { border-color: var(--rc); box-shadow: 0 0 18px var(--rc); }
.card.locked .thumb { filter: brightness(.55) saturate(.6); }
.thumb { position: relative; width: 100%; height: 80px; display: block; }
.c-name { position: relative; font-weight: 800; }
.c-rar { position: relative; color: var(--rc); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.c-eq, .c-price, .c-lv { position: relative; margin-top: 4px; font-size: 12px; font-weight: 800; }
.c-eq { color: var(--cyan); }
.c-price { color: var(--gold); }
.h-detail { border-radius: 20px; border: 1px solid var(--line); background: var(--panel); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 0 40px rgba(0,0,0,.4); overflow: auto; }
.h-preview { width: 100%; height: 200px; border-radius: 14px; background: rgba(0,0,0,.3); }
.h-title { font-family: var(--head); font-size: 26px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.h-desc { color: var(--muted); }
.h-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.h-stats span { background: rgba(0,0,0,.35); border-radius: 10px; padding: 6px 10px; font-weight: 800; }
.tokens { color: var(--gold); font-weight: 800; }
.parts { display: flex; flex-direction: column; gap: 8px; }
.part { display: flex; gap: 10px; align-items: center; background: rgba(0,0,0,.28); border-radius: 12px; padding: 8px 10px; }
.p-ic { font-size: 24px; }
.p-txt { flex: 1; display: flex; flex-direction: column; }
.p-txt small { color: var(--muted); }
.pips { display: flex; gap: 3px; margin-top: 4px; }
.pips i { flex: 1; max-width: 22px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); }
.pips i.on { background: linear-gradient(90deg, var(--cyan), #5ab8ff); box-shadow: 0 0 6px var(--cyan); }
.pips.big i { height: 9px; max-width: 34px; }
.maxed { color: var(--gold); font-family: var(--head); }
.h-lock { color: var(--muted); padding: 10px; background: rgba(0,0,0,.25); border-radius: 12px; }
.h-actions { display: flex; gap: 10px; margin-top: auto; }
.h-actions .btn { flex: 1; }
.perk { background: rgba(61,252,216,.08); border: 1px solid rgba(61,252,216,.3); border-radius: 12px; padding: 10px 12px; font-weight: 700; }
.perk small { display: block; color: var(--muted); font-weight: 600; margin-top: 4px; }

/* battle pass */
.pass { display: flex; flex-direction: column; gap: 18px; height: 100%; }
.pass-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; background: linear-gradient(90deg, rgba(182,92,255,.25), rgba(61,252,216,.15)); border: 1px solid var(--line); border-radius: 18px; padding: 16px 20px; }
.season { color: var(--gold); font-weight: 800; letter-spacing: 3px; }
.season-name { font-family: var(--head); font-size: 34px; }
.pass-prog { min-width: 300px; font-weight: 700; }
.pass-prog b { font-family: var(--head); font-size: 22px; color: var(--cyan); }
.pass-prog .bar { height: 12px; background: rgba(0,0,0,.4); border-radius: 6px; overflow: hidden; margin: 6px 0; }
.pass-prog .bar i { display: block; height: 100%; background: linear-gradient(90deg, #b65cff, #3dfcd8); }
.pass-prog small { color: var(--muted); }
.pass-track { display: flex; gap: 12px; overflow-x: auto; padding: 8px 4px 16px; scroll-behavior: smooth; }
.tier { flex: 0 0 138px; height: 230px; border-radius: 16px; border: 2px solid rgba(255,255,255,.08); background: rgba(0,0,0,.3); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 10px; position: relative; }
.tier.reached { border-color: var(--rc); box-shadow: 0 0 14px color-mix(in srgb, var(--rc) 50%, transparent); }
.tier.claimed { opacity: .55; }
.tier.big { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 35%, transparent), rgba(0,0,0,.35)); }
.t-num { font-family: var(--head); font-size: 20px; color: var(--muted); }
.t-ic { font-size: 46px; }
.t-cv { width: 118px; height: 80px; }
.t-txt { font-weight: 800; text-align: center; font-size: 14px; color: var(--rc); }
.t-done { color: var(--green); font-weight: 800; font-size: 13px; }
.t-lock { font-size: 20px; opacity: .6; }

/* word book */
.words { display: grid; grid-template-columns: 1fr minmax(280px, 380px); gap: 20px; }
.w-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.w-stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.w-stats b { display: block; font-family: var(--head); font-size: 28px; color: var(--cyan); }
.w-stats small { color: var(--muted); font-weight: 700; }
.w-note { color: var(--muted); line-height: 1.5; }
.lvl-list { display: flex; flex-direction: column; gap: 8px; }
.lvl-row { text-align: left; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); padding: 10px 14px; }
.lvl-row.cur { border-color: var(--cyan); box-shadow: 0 0 14px rgba(61,252,216,.3); }
.lr-name { font-weight: 800; font-size: 17px; }
.lr-name em { font-style: normal; font-size: 11px; background: var(--cyan); color: #04221c; padding: 2px 8px; border-radius: 10px; margin-left: 6px; }
.lr-bar { height: 9px; background: rgba(255,255,255,.08); border-radius: 5px; overflow: hidden; display: flex; margin: 6px 0; }
.lr-bar .m { background: var(--green); }
.lr-bar .l { background: #5ab8ff; }
.lr-num { color: var(--muted); font-size: 13px; font-weight: 600; }
.w-right h3 { font-family: var(--head); font-weight: 400; margin-top: 0; }
.tw { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; line-height: 1.4; }
.tw b { font-size: 17px; color: var(--gold); }
.tw small { color: var(--muted); }
.tw-s { display: block; margin-top: 4px; }
.spk { background: none; border: none; font-size: 18px; padding: 0 4px; }

.settings { max-width: 520px; display: flex; flex-direction: column; gap: 14px; font-weight: 700; }
.settings label { display: flex; flex-direction: column; gap: 6px; }
.settings label.tog { flex-direction: row; align-items: center; gap: 10px; }
.settings input:not([type]), .settings select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: var(--text); }
.settings input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--cyan); }
.set-stats { color: var(--muted); font-weight: 600; line-height: 1.5; }

/* ---------- quiz ---------- */
#quiz { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; background: rgba(3,6,16,.78); backdrop-filter: blur(6px); }
#quiz.show { display: grid; }
.quiz-panel { width: min(720px, 94vw); max-height: 94vh; display: flex; flex-direction: column; border-radius: 24px; background: linear-gradient(180deg, #17223f, #0d1428); border: 2px solid var(--qc); box-shadow: 0 0 40px color-mix(in srgb, var(--qc) 40%, transparent), 0 20px 60px rgba(0,0,0,.6); overflow: hidden; animation: popin .25s ease-out; }
@keyframes popin { from { transform: scale(.9); opacity: 0; } }
.quiz-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: linear-gradient(90deg, color-mix(in srgb, var(--qc) 30%, transparent), transparent); }
.qh-icon { font-size: 38px; }
.qh-txt { flex: 1; }
.qh-title { font-family: var(--head); font-size: 24px; }
.qh-sub { color: var(--muted); font-weight: 700; }
.qh-sub b { color: var(--qc); }
.qh-combo { font-weight: 800; color: #ffa94d; transition: transform .2s; }
.qh-combo.hot { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.3); } }
.qh-x { background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 50%; width: 34px; height: 34px; }
.quiz-pips { display: flex; gap: 6px; padding: 0 18px 10px; }
.pip { flex: 1; height: 10px; border-radius: 5px; background: rgba(255,255,255,.12); transition: background .3s; }
.pip.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pip.bad { background: var(--red); }
.quiz-body { padding: 8px 22px 16px; overflow: auto; }
.quiz-foot { display: flex; gap: 12px; align-items: center; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); min-height: 72px; flex-wrap: wrap; }
.quiz-foot.good { background: rgba(77,255,154,.12); border-top-color: rgba(77,255,154,.5); }
.quiz-foot.bad { background: rgba(255,93,115,.12); border-top-color: rgba(255,93,115,.5); }
.fb-info { flex: 1; min-width: 240px; line-height: 1.4; }
.fb-title { font-weight: 800; font-size: 18px; }
.quiz-foot.good .fb-title { color: var(--green); }
.quiz-foot.bad .fb-title { color: #ff8b9c; }
.fb-def, .fb-guess { color: var(--text); font-size: 15px; }
.fb-ex { color: var(--muted); font-style: italic; font-size: 14px; }
.fb-ex b { color: var(--gold); font-style: normal; }
.xp { color: var(--gold); font-size: 14px; margin-left: 6px; }
.q-card { text-align: center; }
.q-label { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 2px; font-size: 13px; margin: 8px 0; }
.q-big { font-family: var(--head); font-size: 44px; color: #fff; text-shadow: 0 0 20px color-mix(in srgb, var(--qc) 60%, transparent); margin: 6px 0; }
.q-clue { font-size: 22px; font-weight: 700; line-height: 1.35; margin: 10px 0; }
.q-sub { color: var(--qc); font-style: italic; font-weight: 700; margin-bottom: 8px; }
.q-sentence { font-size: 21px; line-height: 1.5; margin: 12px 0; }
.q-sentence .blank { color: var(--qc); font-weight: 800; }
.q-options { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.q-options.words { grid-template-columns: 1fr 1fr; }
.opt { display: flex; gap: 12px; align-items: center; text-align: left; padding: 13px 14px; border-radius: 14px; border: 2px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); font-size: 17px; font-weight: 700; box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .08s, border-color .15s, background .15s; }
.q-options.words .opt { font-size: 20px; justify-content: center; }
.opt:hover:not(:disabled) { border-color: var(--qc); background: color-mix(in srgb, var(--qc) 12%, transparent); }
.opt:active:not(:disabled) { transform: translateY(3px); }
.opt .k { flex: 0 0 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(0,0,0,.35); font-size: 13px; color: var(--muted); }
.q-options.words .opt .k { position: absolute; left: 14px; }
.q-options.words .opt { position: relative; }
.opt.right { border-color: var(--green); background: rgba(77,255,154,.18); }
.opt.wrong { border-color: var(--red); background: rgba(255,93,115,.2); animation: shakeX .35s; }
.opt.gone { opacity: .2; }
.opt:disabled { cursor: default; }
@keyframes shakeX { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.tile-slot, .tile-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0; }
.tile { min-width: 46px; height: 52px; border-radius: 12px; border: 2px solid rgba(255,255,255,.15); background: linear-gradient(180deg, #2c3d68, #1a2546); font-family: var(--head); font-size: 24px; text-transform: lowercase; box-shadow: 0 4px 0 #0c1226; }
.tile:disabled { opacity: .2; }
.tile.slot { display: inline-grid; place-items: center; background: rgba(0,0,0,.35); border-style: dashed; box-shadow: none; min-width: 40px; height: 48px; }
.tile.slot.filled { border-style: solid; border-color: var(--qc); background: color-mix(in srgb, var(--qc) 20%, #0d1428); cursor: pointer; }
.type-wrap { margin: 16px auto; max-width: 420px; }
.type-hint { font-family: var(--head); font-size: 28px; letter-spacing: 6px; margin-bottom: 10px; }
.type-hint span { color: var(--muted); }
.type-hint small { font-family: var(--body); font-size: 13px; letter-spacing: 0; color: var(--muted); }
.type-in { width: 100%; font: 700 26px var(--body); text-align: center; padding: 12px; border-radius: 14px; border: 2px solid var(--qc); background: rgba(0,0,0,.4); color: #fff; outline: none; }
.learn-card { text-align: center; padding: 10px 0; }
.lc-tag { display: inline-block; background: linear-gradient(90deg, #ffd166, #ff9f1c); color: #3b1d00; padding: 4px 14px; border-radius: 20px; font-weight: 800; letter-spacing: 2px; font-size: 13px; }
.lc-word { font-family: var(--head); font-size: 48px; margin: 12px 0 0; }
.lc-pos { color: var(--qc); font-style: italic; font-weight: 700; }
.lc-def { font-size: 22px; font-weight: 700; margin: 14px 0; line-height: 1.35; }
.lc-ex { color: var(--muted); font-style: italic; font-size: 17px; margin: 10px 0; line-height: 1.4; }
.lc-ex b { color: var(--gold); font-style: normal; }
.lc-syn { color: var(--muted); margin-bottom: 18px; }
.quiz-result { text-align: center; padding: 20px 0; }
.qr-icon { font-size: 80px; animation: popin .4s; }
.qr-title { font-family: var(--head); font-size: 32px; }
.quiz-result.win .qr-title { color: var(--green); text-shadow: 0 0 20px rgba(77,255,154,.5); }
.quiz-result.lose .qr-title { color: #ff8b9c; }
.qr-score { font-size: 22px; font-weight: 800; margin: 8px 0; }
.qr-note { color: var(--muted); }

/* ---------- battle ---------- */
#battle canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.team-bars { display: flex; flex-direction: column; gap: 6px; width: 290px; }
.team-bars.right { align-items: flex-end; }
.tb { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; backdrop-filter: blur(6px); transition: border-color .2s; }
.tb.turn { border-color: #fff; box-shadow: 0 0 14px rgba(255,255,255,.35); }
.tb.dead { opacity: .4; }
.tb-name { font-weight: 800; font-size: 14px; }
.tb-bar { position: relative; height: 10px; background: rgba(0,0,0,.45); border-radius: 5px; overflow: hidden; margin: 3px 0; }
.tb-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #3dfcd8, #4dff9a); border-radius: 5px; transition: width .4s; }
.team-bars.right .tb-bar i { background: linear-gradient(90deg, #ff5d73, #ff9f43); }
.tb-bar s { position: absolute; left: 0; top: 0; height: 4px; background: #7fd3ff; }
.tb-hp { font-size: 12px; color: var(--muted); font-weight: 700; }
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wind { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 6px 16px; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.wl { color: var(--muted); font-size: 12px; letter-spacing: 2px; }
.wa { color: #7fd3ff; letter-spacing: -3px; }
.hud-banner { position: absolute; top: 28%; left: 0; right: 0; text-align: center; font-family: var(--head); font-size: 52px; opacity: 0; pointer-events: none; text-shadow: 0 4px 24px rgba(0,0,0,.8); }
.hud-banner.show { animation: banner 1.8s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: scale(1.6); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
.hud-bottom { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 10px; align-items: flex-end; opacity: .45; transition: opacity .25s; pointer-events: none; }
.hud.active .hud-bottom { opacity: 1; pointer-events: auto; }
.hb-move { display: flex; gap: 6px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px; backdrop-filter: blur(6px); }
.mv { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, #2a3a63, #1a2442); font-size: 22px; touch-action: none; }
.mv:active { filter: brightness(1.4); }
.fuel { width: 80px; text-align: center; }
.fl { font-size: 11px; color: var(--muted); font-weight: 800; letter-spacing: 2px; }
.fb { height: 9px; background: rgba(0,0,0,.4); border-radius: 5px; overflow: hidden; margin-top: 4px; }
.fb i { display: block; height: 100%; background: linear-gradient(90deg, #ffb52e, #ffe08a); }
.hb-weapons { flex: 1; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.wcard { position: relative; width: 96px; padding: 8px 6px; border-radius: 14px; border: 2px solid color-mix(in srgb, var(--wc) 40%, transparent); background: linear-gradient(180deg, rgba(20,30,56,.92), rgba(10,15,30,.92)); text-align: center; transition: transform .1s, box-shadow .2s; }
.wcard:hover { transform: translateY(-4px); box-shadow: 0 0 18px color-mix(in srgb, var(--wc) 60%, transparent); }
.wcard.armed { border-color: var(--wc); box-shadow: 0 0 22px var(--wc); transform: translateY(-6px); }
.wcard.dim, .wcard.cd { opacity: .45; }
.wi { font-size: 28px; }
.wn { font-weight: 800; font-size: 12px; }
.wq { font-size: 11px; font-weight: 800; color: var(--wc); margin-top: 2px; }
.wcd { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.6); border-radius: 12px; font-family: var(--head); font-size: 26px; }
.hb-aim { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; gap: 4px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; backdrop-filter: blur(6px); }
.aim-read { grid-column: 1; display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-weight: 800; }
.aim-read b { color: #fff; font-size: 16px; }
.sl { grid-column: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.sl span { width: 42px; }
.sl input { width: 170px; accent-color: var(--cyan); }
.fire-btn { grid-column: 2; grid-row: 1 / 4; width: 110px; border: none; border-radius: 50%; aspect-ratio: 1; background: radial-gradient(circle at 40% 35%, #ff8a8a, #e0182d 70%); color: #fff; font-family: var(--head); font-size: 26px; box-shadow: 0 6px 0 #7a0c18, 0 0 30px rgba(255,60,80,.5); transition: transform .1s; }
.fire-btn:hover { transform: scale(1.05); }
.fire-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #7a0c18; }
.hud-tip { position: absolute; bottom: 150px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.55); font-size: 13px; font-weight: 700; pointer-events: none; opacity: 0; transition: opacity .3s; white-space: nowrap; }
.hud.active .hud-tip { opacity: 1; }
.battle-end { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(3,6,16,.7); backdrop-filter: blur(5px); z-index: 5; animation: fadein .4s; }
@keyframes fadein { from { opacity: 0; } }
.be-card { text-align: center; padding: 28px 36px; border-radius: 26px; background: linear-gradient(180deg, #1a2648, #0c1328); border: 2px solid var(--line); min-width: 420px; animation: popin .35s; }
.battle-end.win .be-card { border-color: var(--gold); box-shadow: 0 0 50px rgba(255,209,102,.35); }
.be-title { font-family: var(--head); font-size: 64px; }
.battle-end.win .be-title { background: linear-gradient(180deg, #fff3b0, #ffb52e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.battle-end.lose .be-title { color: #ff8b9c; }
.be-sub { color: var(--muted); font-weight: 700; }
.be-rewards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0; }
.be-rewards div { background: rgba(0,0,0,.3); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; }
.be-rewards span { font-size: 28px; }
.be-rewards b { font-family: var(--head); font-size: 22px; }
.be-rewards small { color: var(--muted); font-weight: 700; }
.be-btns { display: flex; gap: 12px; justify-content: center; }
.be-btns .btn { min-width: 150px; }

/* ---------- crate ---------- */
#crate { position: fixed; inset: 0; z-index: 30; display: none; background: #050812; }
#crate.show { display: block; }
#crateCv { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.crate-ui { position: absolute; left: 0; right: 0; top: 7%; text-align: center; pointer-events: none; }
.crate-rar { font-family: var(--head); font-size: 54px; letter-spacing: 4px; text-shadow: 0 0 30px currentColor; }
.crate-rar.pop { animation: rpop .5s; }
@keyframes rpop { 0% { transform: scale(2); } 100% { transform: scale(1); } }
.crate-taps { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.crate-taps i { width: 26px; height: 10px; border-radius: 5px; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.crate-taps i.used { background: rgba(255,255,255,.15); box-shadow: none; }
.crate-hint { position: fixed; bottom: 8%; left: 0; right: 0; font-family: var(--head); font-size: 22px; color: var(--muted); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.crate-reward { position: absolute; inset: 0; display: none; place-items: center; }
.crate-reward.show { display: grid; }
.rew-card { text-align: center; padding: 28px; border-radius: 24px; background: rgba(12,18,36,.92); border: 2px solid var(--rc); box-shadow: 0 0 60px var(--rc); min-width: 360px; animation: popin .4s; }
.rew-rar { font-family: var(--head); font-size: 30px; color: var(--rc); margin-bottom: 16px; }
.rew-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.rew-item { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.06); border-radius: 14px; padding: 12px 16px; font-size: 20px; }
.rew-item span { font-size: 30px; }
.rew-item b { color: var(--ic); }
.rew-item.big { border: 2px solid var(--ic); box-shadow: 0 0 20px var(--ic); }
.rew-item em { margin-left: auto; font-style: normal; background: var(--gold); color: #3b1d00; border-radius: 10px; padding: 2px 8px; font-weight: 800; font-size: 13px; }

/* ---------- toast ---------- */
#toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 60; background: rgba(10,16,32,.95); border: 2px solid var(--cyan); border-radius: 14px; padding: 12px 22px; font-weight: 800; opacity: 0; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.show { animation: toast 2.8s; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -20px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .stage-info { width: 280px; }
  .tank-name { font-size: 26px; }
  .nav-btn { width: 92px; font-size: 11px; }
  .sl input { width: 120px; }
  .wcard { width: 80px; }
  .hangar, .words { grid-template-columns: 1fr; }
}
@media (max-height: 700px) {
  .stage-info { top: 70px; }
  .st { margin: 3px 0; }
  .nav-btn { padding: 6px; }
  .nav-btn span { font-size: 22px; }
}
