:root {
  --bg: #0a1630;
  --glass: rgba(12, 22, 46, 0.84);
  --glass-soft: rgba(16, 28, 56, 0.66);
  --stroke: rgba(140, 175, 255, 0.18);
  --stroke-strong: rgba(150, 185, 255, 0.34);
  --txt: #eaf1ff;
  --muted: #92a5c9;
  --gold: #ffc24b;
  --gold-deep: #d98a00;
  --blue: #3d8bff;
  --blue-deep: #1f5fd6;
  --green: #43d17a;
  --red: #ff5540;
  --medal: #ffd76a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --r-pill: 999px;
  --r-card: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

body { touch-action: none; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}

.hidden { display: none !important; }

.ico { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.ico svg { width: 100%; height: 100%; display: block; }
.ico svg * { stroke-width: 2; }

.val { font-variant-numeric: tabular-nums; }

#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(10px + env(safe-area-inset-top)) 12px 0 12px;
  gap: 8px;
  pointer-events: none;
  z-index: 20;
}

.hud-col { display: flex; flex-direction: column; gap: 6px; }
.hud-col.center { align-items: center; }
.hud-col.right { align-items: flex-end; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--glass);
  border: 1.5px solid var(--stroke);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  line-height: 1;
  white-space: nowrap;
}

.pill .ico { color: var(--muted); }
.pill.gold .ico { color: var(--gold); }
.pill.medals .ico { color: var(--medal); }
.pill.squad .ico { color: var(--blue); }
.pill.weapon .ico { color: var(--green); }
.pill.gold { color: var(--gold); }
.pill.medals { color: var(--medal); }

.pill.sub { font-size: 13px; padding: 6px 12px; color: var(--muted); opacity: 0.95; }
.pill.sub .val { color: var(--txt); }

.pill.dist { font-size: 22px; padding: 8px 18px; letter-spacing: 0.02em; }
.pill.dist .unit { font-size: 13px; color: var(--muted); margin-left: 2px; }

.pill.squad.big { font-size: 24px; padding: 10px 20px; }

.pill.pop { animation: pillPop 0.28s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pillPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

#hud-bossbar {
  position: relative;
  width: 190px;
  height: 16px;
  border-radius: var(--r-pill);
  background: rgba(10, 18, 38, 0.8);
  border: 1.5px solid var(--stroke);
  overflow: hidden;
  display: none;
}
#hud-bossbar.on { display: block; animation: fadeIn 0.3s ease; }
#hud-bossbar i {
  position: absolute;
  inset: 2px;
  width: 0%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, #ff8a5c, #ff3b30);
  transition: width 0.2s linear;
}
#hud-bossbar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #ffd9d0;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

#hud-squad-wrap {
  position: fixed;
  left: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  z-index: 20;
  pointer-events: none;
}

#hint {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--muted);
  background: var(--glass-soft);
  border: 1.5px solid var(--stroke);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  z-index: 20;
  animation: hintFade 6s ease forwards;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

#hint .key {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(150, 185, 255, 0.14);
  border: 1px solid var(--stroke-strong);
  font-size: 13px;
  color: var(--txt);
}

@keyframes hintFade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

#dock {
  position: fixed;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 30;
}

.dock-btn {
  position: relative;
  width: 54px; height: 54px;
  border-radius: 16px;
  border: 1.5px solid var(--stroke);
  background: var(--glass);
  color: var(--txt);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter: blur(8px);
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.dock-btn:hover { border-color: var(--stroke-strong); background: rgba(20, 34, 66, 0.9); }
.dock-btn:active { transform: scale(0.93); }
.dock-btn .ico { width: 26px; height: 26px; }
.dock-btn .badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--green);
  border: 2.5px solid #0b1733;
  animation: badgePulse 1.6s ease infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
  background: radial-gradient(120% 90% at 50% 20%, rgba(16, 32, 70, 0.5), rgba(6, 10, 26, 0.88));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn 0.35s ease;
  padding: 16px;
}

.screen-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 420px; width: 100%; }

.logo { display: flex; flex-direction: column; line-height: 0.88; animation: logoIn 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
.logo-top {
  font-size: clamp(46px, 12vw, 78px);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  -webkit-text-stroke: 3px #060b1c;
  text-shadow: 0 6px 0 #060b1c, 0 12px 28px rgba(0,0,0,.55);
  transform: rotate(-2deg);
}
.logo-bottom {
  font-size: clamp(56px, 15vw, 96px);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #7dd0ff 0%, #3d8bff 55%, #1f5fd6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 3px #060b1c;
  filter: drop-shadow(0 6px 0 #060b1c) drop-shadow(0 12px 28px rgba(0,0,0,.55));
  transform: rotate(1.5deg);
}
@keyframes logoIn {
  0% { transform: scale(0.55) translateY(30px); opacity: 0; }
  60% { transform: scale(1.06) translateY(0); opacity: 1; }
  100% { transform: scale(1); }
}

.tagline { color: var(--muted); font-size: 15px; font-weight: 700; letter-spacing: 0.04em; }
.keys { color: #6d80a8; font-size: 12px; letter-spacing: 0.08em; }

.big-btn {
  font: inherit;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #fff;
  padding: 16px 52px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #5aa2ff 0%, var(--blue) 45%, var(--blue-deep) 100%);
  box-shadow: 0 6px 0 #143f92, 0 14px 30px rgba(31, 95, 214, 0.45), inset 0 2px 0 rgba(255,255,255,0.35);
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
  transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.1s ease;
}
.big-btn:hover { filter: brightness(1.08); }
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #143f92, 0 6px 16px rgba(31, 95, 214, 0.4), inset 0 2px 0 rgba(255,255,255,0.35); }
.big-btn:disabled { filter: grayscale(0.7) brightness(0.7); cursor: not-allowed; box-shadow: 0 4px 0 #202a44; }

.ghost-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--txt);
  padding: 12px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--stroke-strong);
  background: rgba(140, 175, 255, 0.07);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.ghost-btn:hover { background: rgba(140, 175, 255, 0.14); }
.ghost-btn:active { transform: scale(0.96); }
.ghost-btn.danger { color: #ff9d8f; border-color: rgba(255, 85, 64, 0.4); }
.ghost-btn.danger:hover { background: rgba(255, 85, 64, 0.12); }

.title-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.screen.card { background: none; backdrop-filter: none; }
.screen-inner.card {
  background: var(--glass);
  border: 1.5px solid var(--stroke);
  border-radius: 22px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: cardIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes cardIn {
  0% { transform: scale(0.85) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.screen-inner.card h2 {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.08em;
  -webkit-text-stroke: 1.5px #060b1c;
  text-shadow: 0 4px 0 rgba(6, 11, 28, 0.9);
}
.screen-inner.card h2.record { color: var(--gold); }

.rows { width: 100%; display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; }
.rows .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(10, 18, 38, 0.55);
  border: 1px solid rgba(140, 175, 255, 0.1);
  font-size: 15px;
}
.rows .row .k { color: var(--muted); font-size: 12px; letter-spacing: 0.14em; font-weight: 800; }
.rows .row .v { font-weight: 900; font-variant-numeric: tabular-nums; }
.rows .row .v.accent { color: var(--gold); }
.rows .row .v.good { color: var(--green); }

.screen-actions { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; margin-top: 4px; }
.switch input { display: none; }
.switch .track {
  width: 42px; height: 24px;
  border-radius: var(--r-pill);
  background: rgba(10, 18, 38, 0.9);
  border: 1.5px solid var(--stroke-strong);
  position: relative;
  transition: background 0.18s ease;
}
.switch .knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s cubic-bezier(0.2, 1.3, 0.4, 1), background 0.18s ease;
}
.switch input:checked + .track { background: rgba(67, 209, 122, 0.25); border-color: rgba(67, 209, 122, 0.6); }
.switch input:checked + .track .knob { transform: translateX(18px); background: var(--green); }
.switch-label { font-size: 12px; letter-spacing: 0.14em; color: var(--muted); font-weight: 800; }

.panel {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(430px, 100vw);
  background: linear-gradient(180deg, rgba(13, 24, 50, 0.97), rgba(9, 17, 37, 0.97));
  border-left: 1.5px solid var(--stroke);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(104%);
  transition: transform 0.32s cubic-bezier(0.25, 1, 0.3, 1);
  z-index: 60;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.panel.open { transform: translateX(0); }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 10px;
}
.panel-title { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 900; letter-spacing: 0.1em; }
.panel-title .ico { width: 22px; height: 22px; color: var(--gold); }
#panel-prestige .panel-title .ico { color: var(--medal); }
#panel-stats .panel-title .ico { color: var(--blue); }

.panel-close {
  width: 36px; height: 36px;
  border-radius: 12px;
  border: 1.5px solid var(--stroke);
  background: rgba(140, 175, 255, 0.06);
  color: var(--txt);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
}
.panel-close:hover { background: rgba(255, 85, 64, 0.14); }

.tabs {
  display: flex;
  gap: 6px;
  padding: 0 16px 10px;
}
.tab {
  flex: 1;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 9px 6px;
  color: var(--muted);
  background: rgba(10, 18, 38, 0.6);
  border: 1.5px solid var(--stroke);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab.active { color: #fff; background: rgba(61, 139, 255, 0.22); border-color: rgba(90, 162, 255, 0.55); }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 175, 255, 0.25) transparent;
}

.wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 18px;
  font-weight: 900;
  color: var(--gold);
  background: rgba(255, 194, 75, 0.08);
  border: 1.5px solid rgba(255, 194, 75, 0.25);
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
#panel-prestige .wallet { color: var(--medal); background: rgba(255, 215, 106, 0.08); border-color: rgba(255, 215, 106, 0.25); }

.card-grid { display: flex; flex-direction: column; gap: 9px; }

.ucard {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 11px;
  align-items: center;
  background: rgba(15, 27, 55, 0.75);
  border: 1.5px solid rgba(140, 175, 255, 0.13);
  border-radius: var(--r-card);
  padding: 10px 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ucard:hover { border-color: rgba(140, 175, 255, 0.3); }
.ucard.locked { opacity: 0.55; filter: saturate(0.4); }

.ucard .uicon {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(61, 139, 255, 0.12);
  border: 1px solid rgba(90, 162, 255, 0.22);
}
.ucard .uicon .ico { width: 25px; height: 25px; color: #7fb4ff; }
.ucard.medal .uicon { background: rgba(255, 215, 106, 0.1); border-color: rgba(255, 215, 106, 0.25); }
.ucard.medal .uicon .ico { color: var(--medal); }

.ucard .ubody { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ucard .uname { font-size: 14.5px; font-weight: 900; display: flex; align-items: center; gap: 7px; }
.ucard .ulvl {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.08em;
  background: rgba(140, 175, 255, 0.1);
  padding: 2px 7px;
  border-radius: var(--r-pill);
}
.ucard .ueff { font-size: 12px; color: var(--muted); font-weight: 700; }
.ucard .ueff b { color: var(--green); font-weight: 800; }
.ucard .ueff .lock-note { color: #ffb08a; }

.ucard .ubuy {
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 86px;
  padding: 9px 12px;
  border-radius: 13px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  color: #1c1200;
  background: linear-gradient(180deg, #ffd985 0%, var(--gold) 50%, var(--gold-deep) 100%);
  box-shadow: 0 3px 0 #8f5c00, inset 0 1.5px 0 rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.ucard .ubuy:hover { filter: brightness(1.07); }
.ucard .ubuy:active { transform: translateY(2px); box-shadow: 0 1px 0 #8f5c00; }
.ucard .ubuy .cost { display: inline-flex; align-items: center; gap: 5px; }
.ucard .ubuy .cost .ico { width: 14px; height: 14px; }
.ucard .ubuy:disabled {
  cursor: not-allowed;
  background: rgba(140, 175, 255, 0.09);
  color: var(--muted);
  box-shadow: none;
  border: 1.5px solid rgba(140, 175, 255, 0.14);
}
.ucard.medal .ubuy { background: linear-gradient(180deg, #ffe9a8 0%, var(--medal) 50%, #d9a51d 100%); box-shadow: 0 3px 0 #8a6a10, inset 0 1.5px 0 rgba(255,255,255,.5); }
.ucard .ubuy.maxed { background: rgba(67, 209, 122, 0.18); color: var(--green); border: 1.5px solid rgba(67, 209, 122, 0.4); box-shadow: none; }
.ucard .ubuy.lockedbtn { background: rgba(140, 175, 255, 0.09); color: var(--muted); box-shadow: none; }

.section-label {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--muted);
  font-weight: 800;
  margin: 8px 2px 0;
}

.prestige-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-card);
  border: 1.5px solid rgba(255, 215, 106, 0.22);
  background: linear-gradient(180deg, rgba(255, 215, 106, 0.06), rgba(255, 215, 106, 0.02));
}
.pnote { font-size: 12.5px; color: var(--muted); font-weight: 700; line-height: 1.5; }
.plock { font-size: 12px; color: #ffb08a; font-weight: 800; letter-spacing: 0.04em; }
.prestige-block .big-btn { font-size: 19px; padding: 13px 20px; width: 100%; display: flex; gap: 10px; justify-content: center; align-items: center; }
.prestige-block .big-btn #prestige-gain { color: #fff6cf; font-size: 17px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-cell {
  background: rgba(15, 27, 55, 0.75);
  border: 1.5px solid rgba(140, 175, 255, 0.13);
  border-radius: 13px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-cell .k { font-size: 10.5px; letter-spacing: 0.14em; color: var(--muted); font-weight: 800; }
.stat-cell .v { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }

.achv-grid { display: flex; flex-direction: column; gap: 7px; }
.achv {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 13px;
  background: rgba(15, 27, 55, 0.7);
  border: 1.5px solid rgba(140, 175, 255, 0.12);
}
.achv.locked { opacity: 0.45; filter: saturate(0.2); }
.achv .aicon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 215, 106, 0.1); border: 1px solid rgba(255, 215, 106, 0.22); }
.achv .aicon .ico { width: 20px; height: 20px; color: var(--medal); }
.achv .abody { display: flex; flex-direction: column; gap: 1px; }
.achv .aname { font-size: 13.5px; font-weight: 900; }
.achv .adesc { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.achv .acheck { color: var(--green); font-size: 18px; font-weight: 900; }

.danger-row { margin-top: 14px; display: flex; justify-content: center; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(5, 9, 22, 0.72);
  backdrop-filter: blur(5px);
  padding: 16px;
  animation: fadeIn 0.3s ease;
}
.modal-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  background: var(--glass);
  border: 1.5px solid var(--stroke);
  border-radius: 22px;
  padding: 26px 28px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: cardIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.modal-card h3 { font-size: 21px; letter-spacing: 0.08em; font-weight: 900; -webkit-text-stroke: 1px #060b1c; }
.pmuted { color: var(--muted); font-size: 13px; font-weight: 700; }
.offline-gold { display: flex; align-items: center; gap: 10px; font-size: 34px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.offline-gold .ico { width: 30px; height: 30px; }

.reward-grid { display: flex; flex-direction: column; gap: 9px; width: 100%; }
.reward-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 15px;
  border: 1.5px solid rgba(140, 175, 255, 0.2);
  background: rgba(15, 27, 55, 0.85);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  text-align: left;
}
.reward-card:hover { border-color: var(--stroke-strong); background: rgba(23, 39, 74, 0.95); transform: translateY(-1px); }
.reward-card:active { transform: scale(0.98); }
.reward-card .ricon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 194, 75, 0.12); border: 1px solid rgba(255, 194, 75, 0.3); }
.reward-card .ricon .ico { width: 23px; height: 23px; color: var(--gold); }
.reward-card .rbody { display: flex; flex-direction: column; gap: 1px; }
.reward-card .rname { font-size: 15.5px; font-weight: 900; }
.reward-card .rdesc { font-size: 12px; color: var(--muted); font-weight: 700; }

#toasts {
  position: fixed;
  left: 12px;
  top: calc(76px + env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 65;
  pointer-events: none;
  max-width: min(340px, 80vw);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1.5px solid rgba(255, 215, 106, 0.3);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  animation: toastIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1), toastOut 0.4s ease 3.6s forwards;
  backdrop-filter: blur(8px);
}
.toast .ico { width: 22px; height: 22px; color: var(--medal); flex: none; }
.toast .tbody { display: flex; flex-direction: column; gap: 1px; }
.toast .tname { font-size: 13px; font-weight: 900; letter-spacing: 0.06em; }
.toast .tdesc { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.toast.info { border-color: var(--stroke); }
.toast.info .ico { color: var(--blue); }
@keyframes toastIn {
  0% { transform: translateX(-30px) scale(0.9); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes toastOut { to { opacity: 0; transform: translateX(-20px); } }

#banners {
  position: fixed;
  top: 26%;
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 45;
}

.banner {
  font-size: clamp(30px, 6.4vw, 52px);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  -webkit-text-stroke: 2.5px #0a0f22;
  text-shadow: 0 5px 0 #0a0f22, 0 10px 26px rgba(0, 0, 0, 0.6);
  animation: bannerPop 1.5s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
  white-space: nowrap;
}
.banner.gold { color: var(--gold); }
.banner.red { color: #ff8d7d; }
.banner.green { color: #7bffab; }
.banner-sub {
  font-size: clamp(15px, 2.6vw, 21px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #cfe0ff;
  -webkit-text-stroke: 1.5px #0a0f22;
  text-shadow: 0 3px 0 #0a0f22;
  animation: bannerPop 1.5s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
@keyframes bannerPop {
  0% { transform: scale(0.4) rotate(-3deg); opacity: 0; }
  16% { transform: scale(1.12) rotate(1deg); opacity: 1; }
  26% { transform: scale(1) rotate(0deg); }
  78% { opacity: 1; }
  100% { transform: scale(1.05) translateY(-16px); opacity: 0; }
}

.confetti {
  position: absolute;
  top: -4vh;
  width: 10px;
  height: 15px;
  border-radius: 3px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(118vh) rotate(660deg); opacity: 0.6; }
}

.screenflash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  animation: flash 0.25s ease forwards;
}
@keyframes flash {
  0% { opacity: 0.55; }
  100% { opacity: 0; }
}

#boot-error {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 16px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 560px) {
  .pill { font-size: 14px; padding: 6px 11px; }
  .pill.dist { font-size: 18px; }
  .pill.squad.big { font-size: 19px; }
  .dock-btn { width: 48px; height: 48px; }
  .dock-btn .ico { width: 22px; height: 22px; }
  #hud-bossbar { width: 140px; }
  .big-btn { font-size: 22px; padding: 14px 38px; }
  .stats-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
