:root {
  --bg-deep: #0b1528;
  --bg-card: rgba(17, 30, 56, 0.88);
  --bg-card-solid: #132342;
  --border-gold: rgba(251, 191, 36, 0.42);
  --border-soft: rgba(148, 163, 184, 0.24);
  --gold: #fbbf24;
  --gold-bright: #fef08a;
  --sky: #38bdf8;
  --emerald: #10b981;
  --purple: #a855f7;
  --coral: #fb7185;
  --text-main: #f8fafc;
  --text-dim: #cbd5e1;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-arcade: 0 10px 28px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input {
  user-select: text;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 50% 22%, #1d3b6e 0%, #0f1f3d 55%, #091224 100%);
  color: var(--text-main);
}

.hidden {
  display: none !important;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ======================== GAME CENTER TOAST ======================== */
.gc-toast {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 58, 138, 0.96));
  border: 2px solid var(--gold);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 24px rgba(251, 191, 36, 0.35);
  animation: gcSlideIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes gcSlideIn {
  from { transform: translate(-50%, -80px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.gc-toast-icon {
  font-size: 28px;
}
.gc-toast-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.gc-toast-title {
  font-size: 14px;
  font-weight: 800;
}
.gc-toast-sub {
  font-size: 12px;
  color: var(--text-dim);
}

/* ======================== TOPBAR ======================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(9, 18, 36, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  gap: 12px;
  flex-wrap: wrap;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-crest {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 4px 10px rgba(251, 191, 36, 0.4));
}

.brand-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.brand-title span {
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(251, 191, 36, 0.45);
}
.brand-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.currency-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid var(--border-soft);
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.pill-stat:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
}
.pill-laurels { border-color: rgba(251, 191, 36, 0.5); cursor: default; }
.pill-keys { border-color: rgba(168, 85, 247, 0.55); }
.pill-xp { border-color: rgba(56, 189, 248, 0.55); }
.pill-label { font-size: 12px; color: var(--text-dim); }

.mini-xp-track {
  width: 48px;
  height: 7px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  overflow: hidden;
  display: inline-block;
}
.mini-xp-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #fbbf24);
}

.icon-btn, .profile-chip {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-main);
  border: 1.5px solid var(--border-soft);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.profile-chip:hover, .icon-btn:hover {
  border-color: var(--gold);
}

/* ======================== LOBBY GRID ======================== */
.lobby-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 310px 1fr 350px;
  gap: 18px;
  padding: 16px 20px;
  overflow-y: auto;
  align-items: stretch;
}

.lobby-left, .lobby-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 2px solid var(--border-soft);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-arcade);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.vault-card { border-color: rgba(16, 185, 129, 0.48); }
.chest-card { border-color: rgba(251, 191, 36, 0.55); background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(88, 28, 135, 0.52)); }
.armory-card { border-color: rgba(56, 189, 248, 0.45); }

.fc-icon { font-size: 32px; flex-shrink: 0; }
.fc-text { padding-right: 92px; }
.fc-title { font-size: 15.5px; font-weight: 800; line-height: 1.2; }
.fc-desc { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.fc-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.5);
  white-space: nowrap;
}
.fc-badge.gold-pulse {
  background: rgba(251, 191, 36, 0.24);
  color: var(--gold-bright);
  border-color: var(--gold);
}

.quests-box {
  flex: 1;
  background: var(--bg-card);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-arcade);
}
.quests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-bright);
}
.link-pill {
  background: rgba(251, 191, 36, 0.16);
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.quest-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.quest-item {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 11px;
  padding: 8px 10px;
  font-size: 12px;
}
.quest-item.done {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(6, 78, 59, 0.35);
}
.quest-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 4px;
}
.quest-prog-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}
.quest-prog-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #fbbf24);
}

/* ======================== CENTER PEDESTAL STAGE ======================== */
.lobby-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(ellipse at 50% 62%, rgba(251, 191, 36, 0.18) 0%, rgba(56, 189, 248, 0.08) 42%, transparent 72%);
  border-radius: 26px;
  padding: 14px;
}

.pedestal-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.pedestal-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.pedestal-emote-bubble {
  position: absolute;
  top: -18px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  animation: floatBob 1.8s ease-in-out infinite;
}

.pedestal-tier-pill {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.pedestal-figurine {
  width: 220px;
  height: 220px;
  object-fit: contain;
  border-radius: 28px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(251, 191, 36, 0.55);
  animation: floatBob 3.2s ease-in-out infinite;
  background: #0f172a;
}

.pedestal-unit.partner .pedestal-figurine {
  width: 175px;
  height: 175px;
  border-color: #38bdf8;
}

@keyframes floatBob {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-7px); }
}

.pedestal-base {
  margin-top: -10px;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fbbf24 0%, #b45309 100%);
  color: #0f172a;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  text-align: center;
}
.pedestal-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  max-width: 260px;
}

.stage-emote-bar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.emote-hint { font-size: 12px; color: var(--text-dim); font-weight: 700; }
.emote-chip {
  background: rgba(30, 41, 59, 0.85);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.emote-chip:hover { border-color: var(--gold); transform: scale(1.05); }

/* ======================== RIGHT COLUMN: MODES & PARTY ======================== */
.panel-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-arcade);
}
.panel-kicker {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 9px;
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mode-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.72);
  border: 2px solid transparent;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.14s ease;
}
.mode-btn strong { display: block; font-size: 14px; }
.mode-btn small { font-size: 11.5px; color: var(--text-dim); }
.mode-icon { font-size: 24px; }
.mode-btn:hover { background: rgba(30, 41, 59, 0.92); }
.mode-btn.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(37, 99, 235, 0.25));
}

.party-help {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 10px;
  line-height: 1.4;
}
.party-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.party-join-inline {
  display: flex;
  gap: 6px;
  flex: 1;
}
.party-join-inline input {
  width: 86px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border-soft);
  background: #091224;
  color: var(--gold-bright);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.btn-secondary, .btn-primary {
  padding: 9px 13px;
  border-radius: 11px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  border: 1.5px solid var(--border-soft);
  background: #1e293b;
  color: var(--text-main);
}
.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  border-color: var(--gold-bright);
}
.btn-secondary:hover { border-color: var(--gold); }

.party-code-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px dashed var(--gold);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.code-label { display: block; font-size: 10px; color: var(--text-dim); font-weight: 800; }
.party-code-banner strong { font-size: 22px; color: var(--gold-bright); letter-spacing: 0.14em; }
.party-mini-btns { display: flex; gap: 6px; }
.btn-tiny {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: #1e293b;
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.btn-tiny.danger { color: #fda4af; border-color: rgba(251, 113, 133, 0.4); }
.party-member-pills {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
}
.party-member-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 9px;
  border-radius: 9px;
  background: rgba(30, 58, 138, 0.35);
}

.btn-play-giant {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 20px;
  border: 3px solid #fef08a;
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 55%, #d97706 100%);
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.65);
  transition: transform 0.12s ease;
}
.btn-play-giant:hover { transform: scale(1.02); }
.btn-play-giant:active { transform: scale(0.98); }
.play-spark { font-size: 30px; }
.play-main { font-size: 20px; font-weight: 900; letter-spacing: 0.03em; }
.play-sub { font-size: 11.5px; font-weight: 700; opacity: 0.85; }

/* ======================== ARENA & DROP MAP ======================== */
#arenaCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(9, 18, 36, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.drop-card {
  width: min(740px, 96vw);
  background: #10203d;
  border: 2.5px solid var(--gold);
  border-radius: 24px;
  padding: 18px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}
.drop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.drop-kicker { font-size: 11px; font-weight: 900; color: var(--gold); letter-spacing: 0.1em; }
.drop-header h2 { margin: 3px 0 0; font-size: 20px; }
.drop-timer-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.85);
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-gold);
}
.drop-timer-box strong { font-size: 22px; color: var(--gold-bright); }
.btn-launch-now {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.drop-map-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: radial-gradient(circle, #15803d 0%, #0d9488 68%, #0284c7 100%);
  padding: 14px;
  border-radius: 18px;
  border: 3px solid #eab308;
}

.zone-drop-tile {
  position: relative;
  padding: 14px 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.zone-drop-tile:hover { transform: scale(1.03); border-color: #fef08a; }
.zone-drop-tile.selected {
  border-color: #fde047;
  background: rgba(245, 158, 11, 0.34);
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.5);
}
.zone-tile-icon { font-size: 26px; }
.zone-tile-name { font-size: 13px; font-weight: 800; margin-top: 4px; }
.zone-tile-meta { font-size: 11px; color: #fde68a; margin-top: 2px; }
.zone-rival-badge {
  position: absolute;
  top: 6px;
  right: 7px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.9);
  padding: 2px 7px;
  border-radius: 99px;
  color: #93c5fd;
}

.drop-footer {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 8px;
}

/* ======================== IN-MATCH HUD ======================== */
.arena-hud-top {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  gap: 10px;
}

.hud-vitals-stack, .hud-right-stack, .hud-center-banner {
  pointer-events: auto;
}

.vital-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  border: 1.5px solid var(--border-soft);
  border-radius: 16px;
  min-width: 225px;
}
.vital-avatar { width: 42px; height: 42px; }
.vital-bars { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.vital-name-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.bush-stealth-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.bar-track {
  position: relative;
  height: 13px;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill { height: 100%; transition: width 0.12s linear; }
.shield-fill { background: linear-gradient(90deg, #06b6d4, #38bdf8); }
.hp-fill { background: linear-gradient(90deg, #22c55e, #4ade80); }
.bar-track span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  text-shadow: 0 1px 2px #000;
}

.squad-vitals-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mate-vital-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 12px;
  font-size: 12px;
}
.mate-vital-pill.downed {
  border-color: #fbbf24;
  background: rgba(180, 83, 9, 0.65);
  animation: pulseWarn 0.8s infinite alternate;
}
@keyframes pulseWarn {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.hud-center-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.score-pill, .wars-score-pill {
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  border: 1.5px solid var(--border-gold);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.team-oly { color: #38bdf8; font-weight: 800; }
.team-tit { color: #fb7185; font-weight: 800; }
.wars-vs { font-size: 10px; font-weight: 900; color: var(--gold); }
.storm-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(88, 28, 135, 0.78);
  border: 1px solid rgba(192, 132, 252, 0.5);
  font-size: 11.5px;
  font-weight: 700;
}

.hud-right-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.minimap-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  border: 2px solid var(--gold);
  border-radius: 16px;
  overflow: hidden;
  background: #072f49;
  box-shadow: var(--shadow-arcade);
}
#minimapCanvas { display: block; }
.btn-leave-arena {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.killfeed {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 270px;
}
.kf-pill {
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.82);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.partner-compass {
  position: absolute;
  z-index: 22;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.92);
  border: 2px solid #fef08a;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.arena-hud-bottom {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.weapon-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid var(--gold);
  box-shadow: var(--shadow-arcade);
}
.weapon-star-pill {
  padding: 4px 8px;
  border-radius: 9px;
  font-weight: 900;
  font-size: 13px;
  background: #22c55e;
  color: #052e16;
}
.weapon-icon-big { font-size: 26px; }
.weapon-meta { min-width: 155px; }
.weapon-title { font-size: 13px; font-weight: 800; margin-bottom: 3px; }
.nectar-bar-track {
  position: relative;
  height: 12px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  overflow: hidden;
}
.nectar-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fde047);
  transition: width 0.08s linear;
}
.nectar-bar-track span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.action-pill-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border-soft);
  background: #1e293b;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}
.action-pill-btn small { font-size: 9.5px; font-weight: 800; margin-top: 1px; }
.action-pill-btn.swap-highlight {
  border-color: #fde047;
  background: rgba(245, 158, 11, 0.35);
}

.arena-emote-strip {
  display: flex;
  gap: 5px;
  background: rgba(15, 23, 42, 0.82);
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}
.arena-emote-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  font-size: 17px;
  cursor: pointer;
}
.arena-emote-btn:hover { transform: scale(1.12); background: rgba(251, 191, 36, 0.3); }

/* ======================== TWIN-STICK TOUCH CONTROLS ======================== */
.touch-layer {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  display: none;
}
body.touch-active .touch-layer {
  display: block;
}
.touch-zone {
  position: absolute;
  bottom: 0;
  top: 90px;
  width: 48%;
  pointer-events: auto;
  touch-action: none;
}
.left-zone { left: 0; }
.right-zone { right: 0; }

.stick-base {
  position: absolute;
  bottom: 85px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2.5px solid rgba(255, 255, 255, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
}
#leftStickBase { left: 36px; }
#rightStickBase {
  right: 36px;
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(245, 158, 11, 0.16);
}
.stick-knob {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.fire-stick-knob {
  background: linear-gradient(135deg, #fde047, #f59e0b);
}

/* ======================== MODALS & 64-CHARACTER VAULT ======================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 12, 26, 0.84);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-window {
  width: min(680px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card-solid);
  border: 2px solid var(--border-gold);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}
.modal-window.modal-wide {
  width: min(1060px, 96vw);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-kicker { font-size: 10.5px; font-weight: 900; letter-spacing: 0.1em; color: var(--gold); }
.modal-header h2 { margin: 2px 0 0; font-size: 22px; }
.modal-header-right { display: flex; align-items: center; gap: 8px; }
.btn-close-modal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border-soft);
  background: #1e293b;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.tier-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tier-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border-soft);
  background: #0f172a;
  color: var(--text-dim);
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
}
.tier-tab.active {
  background: var(--gold);
  color: #0f172a;
  border-color: var(--gold-bright);
}

.vault-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 16px;
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.char-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px 7px;
  border-radius: 15px;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(148, 163, 184, 0.22);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.char-tile:hover { transform: translateY(-2px); border-color: var(--gold); }
.char-tile.selected { border-color: #fde047; box-shadow: 0 0 16px rgba(251, 191, 36, 0.45); }
.char-tile.locked img { filter: grayscale(0.55) brightness(0.68); }
.char-tile img { width: 66px; height: 66px; border-radius: 12px; object-fit: cover; }
.char-tile-name { font-size: 12px; font-weight: 800; margin-top: 5px; text-align: center; }
.char-tile-tier { font-size: 10px; font-weight: 800; margin-top: 2px; }
.char-lock-pill {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--gold-bright);
  font-weight: 800;
}

.vault-inspector {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid var(--border-soft);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.vault-inspector img {
  width: 170px;
  height: 170px;
  border-radius: 20px;
  border: 2.5px solid var(--gold);
  margin-bottom: 10px;
}
.inspector-lore {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.45;
  margin: 8px 0 12px;
}

/* Mystery Chests */
.chest-tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.chest-box-card {
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid var(--border-soft);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chest-big-emoji { font-size: 46px; }
.chest-reveal-stage {
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.25), rgba(15, 23, 42, 0.95));
  border: 2px solid var(--gold);
  text-align: center;
}
.chest-reveal-stage img {
  width: 160px;
  height: 160px;
  border-radius: 22px;
  border: 3px solid var(--gold-bright);
}

/* Armory & Trail & Results */
.cosmetic-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cosmetic-chip {
  padding: 8px 13px;
  border-radius: 12px;
  background: #0f172a;
  border: 1.5px solid var(--border-soft);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}
.cosmetic-chip.active { border-color: var(--gold); background: rgba(245, 158, 11, 0.22); }
.cosmetic-chip.locked { opacity: 0.5; cursor: not-allowed; }

.weapons-codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 10px;
}
.weapon-codex-card {
  background: rgba(15, 23, 42, 0.82);
  border: 1.5px solid var(--border-soft);
  border-radius: 14px;
  padding: 11px 13px;
}
.weapon-codex-card.mythic { border-color: #ec4899; background: rgba(131, 24, 67, 0.28); }

.season-trail-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 10px;
}
.trail-node {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.82);
  border: 1.5px solid var(--border-soft);
}
.trail-node.claimed {
  border-color: #10b981;
  background: rgba(6, 78, 59, 0.32);
}

.inline-row { display: flex; gap: 8px; margin-top: 6px; }
.inline-row input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border-soft);
  background: #091224;
  color: #fff;
}
.cloud-sync-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-soft);
  font-size: 13px;
}
.stats-mini-grid, .achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.stat-box, .ach-card {
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-soft);
  font-size: 12px;
}
.ach-card.unlocked { border-color: var(--gold); background: rgba(245, 158, 11, 0.16); }

.leaderboard-list { display: flex; flex-direction: column; gap: 7px; }
.leader-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-soft);
}

.results-window { text-align: center; }
.results-banner h2 { font-size: 28px; color: var(--gold-bright); margin: 4px 0; }
.results-podium-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.podium-hero img { width: 112px; height: 112px; border-radius: 18px; border: 2.5px solid var(--gold); }
.results-rewards-strip {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.reward-chip {
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  border: 1.5px solid var(--gold);
  font-weight: 900;
}
.results-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.btn-play-again {
  padding: 11px 22px;
  border-radius: 14px;
  border: 2px solid #fef08a;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #0f172a;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
}

/* Responsive Tablet & Mobile Layout */
@media (max-width: 980px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
  .pedestal-figurine {
    width: 165px;
    height: 165px;
  }
  .vault-layout {
    grid-template-columns: 1fr;
  }
  .chest-tiers-grid {
    grid-template-columns: 1fr;
  }
  .vital-card {
    min-width: 175px;
  }
}
