@font-face { font-family: "Jersey 15"; src: url("/fonts/Jersey15.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Nunito"; src: url("/fonts/Nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --bg: #070814;
  --panel: rgba(13, 15, 34, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f3ff;
  --muted: #a9a8c9;
  --gold: #ffd400;
  --gold2: #ff9d00;
  --red: #ff4a5e;
  --green: #57e389;
  --woofy: #ffd400;
  --zyro: #38bdf8;
  --zex: #ef4444;
  --pixel: "Jersey 15", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--body); }
body { user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

#view { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }

/* ---------- logo ---------- */
.logo { text-align: center; line-height: 0.82; font-family: var(--pixel); pointer-events: none; }
.logo-top { font-size: clamp(26px, 4.4vw, 44px); letter-spacing: 6px; color: #fff; text-shadow: 0 3px 0 #2a1b5e, 0 0 18px rgba(176, 72, 255, 0.6); }
.logo-main {
  font-size: clamp(76px, 12vw, 136px); letter-spacing: 4px;
  background: linear-gradient(#fff27f 0%, #ffc531 55%, #f0941b 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 5px 0 #6b3500) drop-shadow(0 10px 0 rgba(0, 0, 0, 0.45)) drop-shadow(0 0 26px rgba(255, 196, 0, 0.35));
}
.logo-sub { margin-top: 10px; font-size: clamp(18px, 2.6vw, 26px); letter-spacing: 5px; color: #c7b8ff; text-shadow: 0 2px 0 #1a1240; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); }
.screen-title { font-family: var(--pixel); font-weight: 400; font-size: clamp(34px, 5vw, 52px); letter-spacing: 2px; margin: 0 0 6px; text-align: center; color: #fff; text-shadow: 0 3px 0 #1d1d44, 0 0 16px rgba(255, 255, 255, 0.15); }
.screen-title.red { color: #ff6b7a; }
.screen-title.gold { color: var(--gold); }
.sub { margin: 0 0 14px; color: var(--muted); font-weight: 700; }
.panel { width: min(560px, 100%); max-height: 100%; overflow: auto; touch-action: pan-y; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); }
.panel.wide { width: min(760px, 100%); }

#loading { background: radial-gradient(ellipse at 50% 40%, #2a2160 0%, #0d1024 60%, #070814 100%); gap: 18px; }
.loadbar { width: min(320px, 70vw); height: 14px; border-radius: 8px; background: #1b1d3d; border: 2px solid #33367a; overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold2), var(--gold)); transition: width 0.25s; }
.load-text { color: var(--muted); margin: 0; font-weight: 700; }

#title { justify-content: space-between; background: linear-gradient(rgba(7, 8, 20, 0.55), transparent 30%, transparent 55%, rgba(7, 8, 20, 0.8)); }
#title .logo { margin-top: 2vh; }
.title-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.tagline { margin: 0; text-align: center; font-weight: 800; font-size: clamp(14px, 1.8vw, 18px); text-shadow: 0 2px 6px #000; max-width: 560px; }
.c-woofy { color: var(--woofy); } .c-zyro { color: var(--zyro); } .c-zex { color: var(--zex); }
.menu { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.menu-row { display: flex; gap: 10px; justify-content: center; }
.menu-row.wrap { flex-wrap: wrap; margin-top: 14px; }

.btn {
  font-family: var(--pixel); font-size: 24px; letter-spacing: 1px; line-height: 1; padding: 11px 20px 9px; border: 0; border-radius: 10px; cursor: pointer;
  background: #2b2e58; color: #fff; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.35), 0 4px 0 #11132b, 0 6px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s, filter 0.12s;
}
.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 1px 0 #11132b; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; filter: none; }
.btn.gold { background: linear-gradient(#ffe45c, #ffb800); color: #3a2200; box-shadow: inset 0 -4px 0 rgba(120, 60, 0, 0.35), 0 4px 0 #8a5200, 0 6px 18px rgba(255, 190, 0, 0.3); }
.btn.big { font-size: 32px; padding: 13px 34px 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { font-family: var(--body); font-weight: 800; font-size: 13px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(20, 22, 48, 0.8); color: var(--text); cursor: pointer; text-decoration: none; }
.chip:hover { background: rgba(40, 44, 90, 0.9); }
.chip.off { opacity: 0.6; }
.best { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: 14px; min-height: 4px; }
.best-label { font-family: var(--pixel); font-size: 18px; color: var(--muted); letter-spacing: 1px; }
.best-item { display: inline-flex; align-items: center; gap: 5px; background: rgba(0, 0, 0, 0.45); padding: 4px 10px 4px 5px; border-radius: 999px; }
.best-item small { color: var(--muted); }
img.head, img.mini { image-rendering: pixelated; border-radius: 4px; }
img.mini { width: 22px; height: 22px; }

/* ---------- select ---------- */
#select { justify-content: space-between; background: linear-gradient(rgba(7, 8, 20, 0.5), transparent 22%, transparent 62%, rgba(7, 8, 20, 0.85)); }
.char-info {
  position: absolute; left: calc(20px + var(--safe-l)); top: calc(86px + var(--safe-t)); width: min(390px, 34vw); max-height: calc(100% - 120px); overflow: auto; touch-action: pan-y;
  background: var(--panel); border: 2px solid var(--line); border-left: 5px solid var(--acc, var(--gold)); border-radius: 14px; padding: 14px 16px;
}
.ci-head { display: flex; gap: 12px; align-items: center; }
.ci-head img { width: 52px; height: 52px; box-shadow: 0 0 0 3px var(--acc); }
.ci-head h3 { margin: 0; font-family: var(--pixel); font-weight: 400; font-size: 38px; line-height: 0.9; color: var(--acc); letter-spacing: 1px; }
.ci-head small { color: var(--muted); font-weight: 700; }
.ci-bars { margin: 12px 0 8px; display: grid; gap: 4px; }
.ci-bar { display: flex; justify-content: space-between; align-items: center; font-family: var(--pixel); font-size: 18px; letter-spacing: 1px; color: #d6d4f3; }
.pips { display: flex; gap: 4px; }
.pips i { width: 22px; height: 10px; border-radius: 3px; background: #2a2c50; }
.pips i.on { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.ci-moves { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.ci-moves li { display: flex; gap: 10px; align-items: flex-start; }
.mv-icon { font-size: 22px; width: 30px; text-align: center; line-height: 1.2; }
.ci-moves b { font-size: 15px; }
.mv-key { margin-left: 6px; font-size: 11px; font-weight: 800; color: #0d1024; background: #cfd0ef; padding: 1px 6px; border-radius: 5px; vertical-align: 2px; }
.ci-moves p { margin: 1px 0 0; font-size: 13px; color: #c9c8e6; line-height: 1.3; }
.ci-best { margin-top: 10px; font-weight: 800; font-size: 13px; color: var(--gold); }
.select-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
@media (orientation: landscape) and (min-width: 600px) {
  .select-bottom { padding-left: calc(min(390px, 34vw) + 24px); }
}
.cards { display: flex; gap: 12px; justify-content: center; }
.card {
  width: 132px; padding: 10px 8px 9px; border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: rgba(18, 20, 44, 0.88); border: 3px solid rgba(255, 255, 255, 0.08); transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.card img { width: 52px; height: 52px; }
.card b { font-family: var(--pixel); font-weight: 400; font-size: 28px; line-height: 1; letter-spacing: 1px; color: var(--acc); }
.card small { color: var(--muted); font-weight: 700; font-size: 12px; }
.card:hover { transform: translateY(-3px); }
.card.on { border-color: var(--acc); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4), 0 0 26px color-mix(in srgb, var(--acc) 55%, transparent); transform: translateY(-7px); }
.select-actions { display: flex; gap: 12px; }
#btnStart { --acc: var(--gold); }

/* ---------- perks ---------- */
#perk { background: rgba(5, 6, 16, 0.72); }
.perk-cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.perk-card {
  position: relative; width: 210px; padding: 18px 14px 16px; border-radius: 16px; cursor: pointer; text-align: center;
  background: linear-gradient(#22264f, #15173a); border: 3px solid #3b3f86; box-shadow: 0 8px 0 #0b0c22; transition: transform 0.1s, border-color 0.1s;
  animation: perkIn 0.35s backwards;
}
.perk-card:nth-child(2) { animation-delay: 0.07s; } .perk-card:nth-child(3) { animation-delay: 0.14s; }
.perk-card:hover, .perk-card:focus-visible { transform: translateY(-5px); border-color: var(--gold); }
.pk-icon { display: block; font-size: 44px; line-height: 1.2; }
.perk-card b { display: block; font-family: var(--pixel); font-weight: 400; font-size: 28px; letter-spacing: 1px; color: var(--gold); margin: 4px 0; }
.perk-card p { margin: 0; color: #d6d4f3; font-weight: 700; font-size: 14px; }
.pk-key { position: absolute; top: 8px; left: 10px; font-family: var(--pixel); font-size: 18px; color: #8a8cc0; }
.pk-have { display: block; margin-top: 8px; color: var(--muted); font-weight: 800; font-size: 12px; }
@keyframes perkIn { from { opacity: 0; transform: translateY(24px) scale(0.92); } }

/* ---------- pause / over ---------- */
#pause, #over, #board, #how { background: rgba(5, 6, 16, 0.6); }
#pause .panel { text-align: center; }
#pause .chips { margin-top: 16px; }
.pause-perks { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pp-title { width: 100%; font-family: var(--pixel); font-size: 20px; color: var(--muted); }
.pp { font-size: 13px; font-weight: 800; background: rgba(255, 255, 255, 0.07); padding: 4px 9px; border-radius: 999px; }
#over .panel { text-align: center; }
.os-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 12px; }
.os-head img { width: 40px; height: 40px; }
.os-head b { font-family: var(--pixel); font-weight: 400; font-size: 30px; }
.os-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.os-item { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; }
.os-item small { display: block; color: var(--muted); font-weight: 800; font-size: 11px; letter-spacing: 1px; }
.os-item b { font-family: var(--pixel); font-weight: 400; font-size: 30px; line-height: 1.05; }
.os-grid .os-item:first-child b { color: var(--gold); }
.submit { margin-top: 16px; text-align: left; }
.submit label { font-weight: 800; font-size: 13px; color: var(--muted); }
.submit-row { display: flex; gap: 8px; margin-top: 6px; }
.submit-row input { flex: 1; min-width: 0; font: 700 18px var(--body); padding: 10px 12px; border-radius: 10px; border: 2px solid #3b3f86; background: #0d0f26; color: #fff; user-select: text; -webkit-user-select: text; touch-action: manipulation; }
.submit-row input:focus { border-color: var(--gold); outline: none; }
.msg { min-height: 20px; margin-top: 8px; font-weight: 800; font-size: 14px; color: var(--muted); text-align: center; }
.msg.good { color: var(--green); } .msg.bad { color: var(--red); }

/* ---------- leaderboard ---------- */
#board .panel { display: flex; flex-direction: column; gap: 10px; }
#btnBoardClose, #btnHowClose { align-self: center; margin-top: 6px; }
.war-title { font-weight: 800; font-size: 13px; color: var(--muted); margin-bottom: 6px; text-align: center; }
.war-bar { display: flex; gap: 3px; border-radius: 12px; overflow: hidden; }
.war-seg { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 7px 8px; background: color-mix(in srgb, var(--acc) 30%, #141633); border-bottom: 4px solid var(--acc); white-space: nowrap; overflow: hidden; }
.war-seg b { font-family: var(--pixel); font-weight: 400; font-size: 22px; }
.war-seg small { color: #d6d4f3; font-weight: 700; font-size: 11px; }
.tabs { display: flex; gap: 6px; justify-content: center; }
.tab { font-family: var(--pixel); font-size: 20px; letter-spacing: 1px; padding: 6px 14px 4px; border-radius: 8px; border: 1px solid var(--line); background: #191b3c; cursor: pointer; color: var(--muted); }
.tab.on { background: var(--gold); color: #3a2200; border-color: var(--gold); }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 46vh; overflow: auto; touch-action: pan-y; }
.board-list li { display: grid; grid-template-columns: 44px 26px 1fr auto 90px; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); font-weight: 800; }
.board-list li.empty { display: block; text-align: center; color: var(--muted); padding: 18px; }
.board-list .rk { font-family: var(--pixel); font-size: 22px; color: var(--muted); }
.board-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: text; }
.board-list .wv { color: var(--muted); font-size: 12px; }
.board-list .sc { font-family: var(--pixel); font-size: 22px; text-align: right; color: #fff; }
.board-list li.top1 { background: linear-gradient(90deg, rgba(255, 212, 0, 0.25), rgba(255, 212, 0, 0.05)); }
.board-list li.top1 .rk { color: var(--gold); }
.board-list li.top2 { background: linear-gradient(90deg, rgba(200, 210, 230, 0.2), rgba(200, 210, 230, 0.04)); }
.board-list li.top3 { background: linear-gradient(90deg, rgba(205, 127, 50, 0.25), rgba(205, 127, 50, 0.04)); }

/* ---------- how ---------- */
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.how-card { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.how-card h3 { margin: 2px 0 6px; font-family: var(--pixel); font-weight: 400; font-size: 24px; letter-spacing: 1px; color: var(--gold); }
.how-card p, .how-card li { font-size: 14px; color: #d6d4f3; line-height: 1.4; }
.how-card ul { margin: 0; padding-left: 18px; }
.how-card p { margin: 0; }
#how .panel { display: flex; flex-direction: column; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; --acc: var(--gold); }
.hud-player { position: absolute; left: calc(14px + var(--safe-l)); top: calc(12px + var(--safe-t)); display: flex; gap: 10px; align-items: center; background: rgba(8, 9, 24, 0.55); padding: 8px 10px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.08); }
.hud-player .head { width: 46px; height: 46px; box-shadow: 0 0 0 3px var(--acc); }
.hud-bars { width: 210px; display: grid; gap: 4px; }
.hud-name { display: flex; justify-content: space-between; font-family: var(--pixel); font-size: 20px; line-height: 1; letter-spacing: 1px; }
.hud-name #hudName { color: var(--acc); }
.bar { position: relative; height: 14px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); border: 2px solid rgba(0, 0, 0, 0.6); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; transition: width 0.15s; }
.bar.hp i { background: linear-gradient(#7dff8a, #2fbf4b); }
.bar.hp i.low { background: linear-gradient(#ff8a8a, #e0243a); animation: lowhp 0.6s infinite alternate; }
.bar.ult { height: 12px; }
.bar.ult i { background: linear-gradient(90deg, #6a4cff, #b380ff); }
.bar.ult.ready i { background: linear-gradient(90deg, #ffd400, #fff27f, #ffd400); background-size: 200% 100%; animation: shimmer 1s linear infinite; }
.bar.ult span { position: absolute; inset: 0; font-family: var(--pixel); font-size: 13px; line-height: 9px; text-align: center; color: #fff; text-shadow: 0 1px 0 #000; letter-spacing: 1px; }
.bar.ult.ready span { color: #3a2200; text-shadow: none; }
.skill { position: relative; width: 46px; height: 46px; border-radius: 12px; background: rgba(0, 0, 0, 0.55); border: 2px solid rgba(255, 255, 255, 0.25); display: grid; place-items: center; font-size: 24px; overflow: hidden; }
.skill.ready { border-color: var(--acc); box-shadow: 0 0 12px color-mix(in srgb, var(--acc) 60%, transparent); }
.skill i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0, 0, 0, 0.65); }
.hud-wave { position: absolute; left: 50%; top: calc(10px + var(--safe-t)); transform: translateX(-50%); text-align: center; }
#waveText { font-family: var(--pixel); font-size: 34px; line-height: 1; letter-spacing: 2px; text-shadow: 0 3px 0 #000, 0 0 12px rgba(0, 0, 0, 0.6); }
#enemyText { font-weight: 800; font-size: 13px; color: #d6d4f3; text-shadow: 0 1px 3px #000; }
#bossBar { margin-top: 6px; width: min(460px, 70vw); }
#bossName { font-family: var(--pixel); font-size: 22px; line-height: 1; margin-bottom: 4px; letter-spacing: 2px; color: #ff6b7a; text-shadow: 0 2px 0 #000; }
.bar.boss { height: 16px; }
.bar.boss i { background: linear-gradient(#ff6b7a, #c0142e); }
.hud-score { position: absolute; right: calc(70px + var(--safe-r)); top: calc(12px + var(--safe-t)); text-align: right; }
#scoreText { font-family: var(--pixel); font-size: 40px; line-height: 1; color: var(--gold); text-shadow: 0 3px 0 #5a3500, 0 0 12px rgba(0, 0, 0, 0.6); }
#comboText { font-family: var(--pixel); font-size: 22px; color: #ffb3f0; text-shadow: 0 2px 0 #000; min-height: 22px; }
#comboText.bump { animation: bump 0.2s; }
.pause-btn { position: absolute; right: calc(14px + var(--safe-r)); top: calc(14px + var(--safe-t)); width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(8, 9, 24, 0.6); font-size: 16px; cursor: pointer; pointer-events: auto; letter-spacing: -2px; }
#chat { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(14px + var(--safe-b)); width: min(440px, 46vw); display: flex; flex-direction: column; gap: 2px; }
#chat .line { background: rgba(0, 0, 0, 0.5); padding: 3px 8px; border-radius: 4px; font-weight: 800; font-size: 14px; text-shadow: 0 1px 0 #000; animation: chatIn 0.25s; transition: opacity 1s; }
#chat .line.fade { opacity: 0; }
#chat .line.sys { color: #ffe27a; }
#chat .line.cmd { color: #c6ffd1; font-family: ui-monospace, Consolas, monospace; }
#chat .line.evil { color: #ff9aa8; }
#banner { position: absolute; left: 0; right: 0; top: 24%; text-align: center; opacity: 0; transform: scale(0.8); transition: opacity 0.25s, transform 0.25s; }
#banner.show { opacity: 1; transform: scale(1); }
#bannerBig { font-family: var(--pixel); font-size: clamp(48px, 8vw, 84px); line-height: 1; letter-spacing: 3px; color: #fff; text-shadow: 0 4px 0 #1d1d44, 0 0 24px rgba(0, 0, 0, 0.8); }
#bannerSmall { font-weight: 900; font-size: clamp(15px, 2vw, 20px); color: #e5e3ff; text-shadow: 0 2px 4px #000; margin-top: 4px; }
#banner.boss #bannerBig { color: #ff5a6e; text-shadow: 0 4px 0 #3a0010, 0 0 30px rgba(255, 40, 70, 0.6); }
#banner.clear #bannerBig { color: var(--gold); text-shadow: 0 4px 0 #5a3500, 0 0 24px rgba(255, 200, 0, 0.5); }
#banner.dead #bannerBig { color: #ff6b7a; }
#ultBanner { position: absolute; left: 50%; top: 40%; font-family: var(--pixel); font-size: clamp(40px, 7vw, 72px); color: var(--acc); white-space: nowrap; text-shadow: 0 4px 0 #000, 0 0 30px var(--acc); opacity: 0; transform: translate(-50%, -50%); }
#ultBanner.show { animation: ultIn 1.2s ease-out forwards; }
#toast { position: absolute; left: 50%; top: calc(132px + var(--safe-t)); transform: translate(-50%, -10px); background: rgba(10, 11, 28, 0.88); border: 2px solid var(--gold); color: #fff; font-weight: 900; padding: 7px 16px; border-radius: 999px; opacity: 0; transition: opacity 0.2s, transform 0.2s; white-space: nowrap; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#fx { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.ftxt { position: absolute; left: 0; top: 0; font-family: var(--pixel); font-size: 26px; line-height: 1; white-space: nowrap; color: #fff; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; will-change: transform, opacity; }
.ftxt.dmg { font-size: 24px; }
.ftxt.crit { font-size: 34px; color: var(--gold); }
.ftxt.hurt { font-size: 28px; color: #ff5a6e; }
.ftxt.fire { font-size: 19px; color: #ff9a3a; }
.ftxt.pts { font-size: 22px; color: #ffe27a; }
.ftxt.heal { font-size: 26px; color: var(--green); }
.ftxt.ult { font-size: 24px; color: #c9a8ff; }
.ftxt.bonk { font-size: 50px; color: var(--gold); text-shadow: 3px 3px 0 #b0122c, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 0 20px rgba(255, 60, 60, 0.6); }
#flash { position: fixed; inset: 0; z-index: 16; pointer-events: none; opacity: 0; }
#vignette { position: fixed; inset: 0; z-index: 16; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(255, 0, 40, 0.55) 100%); }
#vignette.hit { animation: hurt 0.45s ease-out; }

/* ---------- touch controls ---------- */
#touch { position: fixed; inset: 0; z-index: 19; pointer-events: none; }
#joyZone { position: absolute; left: 0; bottom: 0; width: 50%; height: 62%; pointer-events: auto; touch-action: none; }
.joy-hint { position: absolute; left: calc(26px + var(--safe-l)); bottom: calc(110px + var(--safe-b)); font-weight: 800; font-size: 12px; color: rgba(255, 255, 255, 0.35); }
#joyBase { position: absolute; width: 116px; height: 116px; margin: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); border: 2px solid rgba(255, 255, 255, 0.25); transform: translate(-50%, -50%); opacity: 0; left: 90px; top: 70%; }
#joyBase.on { opacity: 1; }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); border: 2px solid rgba(255, 255, 255, 0.6); transform: translate(-50%, -50%); }
.tbtn {
  position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.35); background: rgba(14, 16, 40, 0.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 24px; line-height: 1; color: #fff; padding: 0; overflow: hidden;
}
.tbtn small { font-family: var(--pixel); font-size: 15px; letter-spacing: 1px; margin-top: 2px; }
.tbtn.down { background: rgba(255, 255, 255, 0.28); transform: scale(0.94); }
.tbtn.attack { width: 92px; height: 92px; right: calc(22px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); font-size: 32px; border-color: rgba(255, 212, 0, 0.7); }
.tbtn.skill { width: 66px; height: 66px; right: calc(128px + var(--safe-r)); bottom: calc(22px + var(--safe-b)); }
.tbtn.skill::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--cd, 0%); background: rgba(0, 0, 0, 0.6); }
.tbtn.jump { width: 66px; height: 66px; right: calc(34px + var(--safe-r)); bottom: calc(132px + var(--safe-b)); }
.tbtn.ult { width: 60px; height: 60px; right: calc(118px + var(--safe-r)); bottom: calc(108px + var(--safe-b)); opacity: 0.55; }
.tbtn.ult.ready { opacity: 1; border-color: var(--gold); box-shadow: 0 0 18px var(--gold); animation: pulse 0.8s infinite alternate; }

body.touchmode #chat { bottom: auto; top: calc(78px + var(--safe-t)); width: min(320px, 60vw); }
body.touchmode #chat .line { font-size: 12px; }

/* ---------- animations ---------- */
@keyframes lowhp { to { filter: brightness(1.5); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes bump { 50% { transform: scale(1.2); } }
@keyframes chatIn { from { opacity: 0; transform: translateX(-10px); } }
@keyframes hurt { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pulse { to { transform: scale(1.06); } }
@keyframes ultIn {
  0% { opacity: 0; transform: translate(-30%, -50%) skewX(-12deg); }
  15% { opacity: 1; transform: translate(-50%, -50%) skewX(-12deg); }
  75% { opacity: 1; transform: translate(-52%, -50%) skewX(-12deg); }
  100% { opacity: 0; transform: translate(-80%, -50%) skewX(-12deg); }
}

/* ---------- small screens ---------- */
@media (max-width: 760px), (max-height: 520px) {
  .btn { font-size: 21px; padding: 9px 14px 7px; }
  .btn.big { font-size: 27px; padding: 11px 26px 9px; }
  .hud-bars { width: 150px; }
  .hud-player { padding: 6px 8px; gap: 7px; }
  .hud-player .head { width: 36px; height: 36px; }
  .skill { width: 38px; height: 38px; font-size: 20px; }
  .hud-name { font-size: 17px; }
  #waveText { font-size: 26px; }
  #scoreText { font-size: 30px; }
  #comboText { font-size: 18px; }
  .hud-score { right: calc(64px + var(--safe-r)); }
  .perk-card { width: 100%; max-width: 340px; padding: 12px; display: grid; grid-template-columns: 54px 1fr; text-align: left; column-gap: 10px; }
  .pk-icon { grid-row: span 2; font-size: 38px; align-self: center; }
  .perk-card b { font-size: 24px; margin: 0; }
  .pk-key { display: none; }
  .os-item b { font-size: 24px; }
  .card { width: 104px; padding: 8px 6px; }
  .card img { width: 40px; height: 40px; }
  .card b { font-size: 24px; }
  .card small { font-size: 11px; }
}
@media (max-width: 760px) and (orientation: portrait) {
  .hud-wave { top: calc(66px + var(--safe-t)); }
  .hud-score { top: calc(12px + var(--safe-t)); }
  body.touchmode #chat { top: calc(122px + var(--safe-t)); }
  .char-info { left: 12px; right: 12px; width: auto; top: calc(62px + var(--safe-t)); max-height: 34vh; padding: 10px 12px; }
  .ci-head img { width: 40px; height: 40px; }
  .ci-head h3 { font-size: 30px; }
  .ci-bars { grid-template-columns: 1fr 1fr; column-gap: 14px; margin: 8px 0 4px; }
  .ci-bar { font-size: 15px; }
  .pips i { width: 12px; height: 8px; }
  .ci-moves p { font-size: 12px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .char-info { top: 58px; max-height: calc(100% - 200px); width: min(360px, 44vw); padding: 10px 12px; }
  .screen-title { font-size: 32px; }
  .ci-moves p { display: none; }
  #title .logo-main { font-size: 70px; }
  .tagline { display: none; }
  .tbtn.attack { width: 82px; height: 82px; }
  .board-list { max-height: 38vh; }
}
@media (prefers-reduced-motion: reduce) {
  .perk-card { animation: none; }
  #ultBanner.show { animation-duration: 2s; }
}
