:root {
  --ink-pink: #ff2e88;
  --ink-orange: #ff6b1a;
  --ink-yellow: #ffe119;
  --ink-green: #39e65b;
  --ink-cyan: #00e5ff;
  --surface: rgba(15, 20, 34, 0.82);
  --surface-strong: rgba(14, 19, 32, 0.94);
  --border-light: rgba(255, 255, 255, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #0d1220;
  color: #f8fafc;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

.hidden {
  display: none !important;
}

/* ==================== FULLSCREEN LIVE CANVAS ==================== */
#game-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
  touch-action: none;
}

/* ==================== HUD LAYERS ==================== */
.hud-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.hud-layer.active {
  display: block;
}
.hud-layer button,
.hud-layer .weapon-dock,
.hud-layer .mobile-controls,
.hud-layer .stick-base,
.hud-layer .move-zone {
  pointer-events: auto;
}

/* ==================== LOBBY HUD (BRAWL-STYLE GAME ENGINE UI) ==================== */
.lobby-top {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lobby-top-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, rgba(20, 28, 48, 0.92), rgba(14, 18, 32, 0.88));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s;
}
.profile-pill:active { transform: scale(0.95); }
.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ink-pink), var(--ink-orange));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid #fff;
}
.profile-info { text-align: left; }
.profile-name { font-size: 14px; font-weight: 900; line-height: 1.1; }
.profile-stats {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-yellow);
}
.profile-edit-tag {
  font-size: 12px;
  color: #94a3b8;
  margin-left: 2px;
}

.game-logo-ribbon {
  display: flex;
  flex-direction: column;
  transform: skewX(-8deg);
  pointer-events: none;
}
.logo-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 30%, #ffe119 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(255, 46, 136, 0.9)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}
.logo-sub {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 2.5px;
  color: var(--ink-cyan);
  margin-top: 3px;
}

.lobby-top-right {
  display: flex;
  gap: 8px;
}

.circle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.24);
  background: rgba(16, 22, 38, 0.88);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.circle-btn span { font-size: 19px; line-height: 1; }
.circle-btn small { font-size: 9.5px; font-weight: 800; color: #cbd5e1; margin-top: 2px; }
.circle-btn:active { transform: scale(0.92); }
.circle-btn.active {
  border-color: var(--ink-yellow);
  background: rgba(255, 225, 25, 0.2);
}
.circle-btn.active small { color: var(--ink-yellow); }
.circle-btn.shop-highlight {
  border-color: var(--ink-pink);
  background: linear-gradient(135deg, rgba(255, 46, 136, 0.35), rgba(255, 140, 0, 0.3));
  box-shadow: 0 0 18px rgba(255, 46, 136, 0.45);
}
.circle-btn.shop-highlight small { color: var(--ink-yellow); }

/* Left Weapon Dock */
.weapon-dock {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  top: 52%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dock-weapon {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 8px;
  min-width: 144px;
  border-radius: 14px;
  border: 2.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 20, 34, 0.84);
  color: #fff;
  cursor: pointer;
  transform: skewX(-6deg);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.38);
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}
.dock-weapon:hover { transform: skewX(-6deg) translateX(4px); }
.dock-weapon:active { transform: skewX(-6deg) scale(0.95); }
.dock-weapon.selected {
  border-color: var(--ink-yellow);
  background: linear-gradient(90deg, rgba(255, 46, 136, 0.42), rgba(255, 107, 26, 0.3));
  transform: skewX(-6deg) translateX(8px);
  box-shadow: 0 0 22px rgba(255, 46, 136, 0.45);
}
.dock-w-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transform: skewX(6deg);
}
.dock-w-text {
  transform: skewX(6deg);
  text-align: left;
}
.dock-w-name { font-size: 13px; font-weight: 900; line-height: 1.1; }
.dock-w-role { font-size: 10px; color: #cbd5e1; margin-top: 2px; font-weight: 700; }

/* Center-Bottom Hero Showcase Ribbon */
.hero-stage-bar {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero-weapon-banner {
  background: rgba(12, 16, 28, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 12.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.hero-weapon-banner .divider { color: #64748b; }
#hero-weapon-spec { color: var(--ink-cyan); }

.hero-pose-actions {
  display: flex;
  gap: 8px;
}
.pose-chip {
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(18, 25, 44, 0.85);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
}
.pose-chip:hover { border-color: var(--ink-cyan); }
.pose-chip:active { transform: scale(0.92); }
.pose-chip.accent {
  border-color: var(--ink-pink);
  background: linear-gradient(135deg, rgba(255, 46, 136, 0.32), rgba(255, 107, 26, 0.28));
  color: #fff;
}

/* Bottom-Right Iconic Action Cluster */
.lobby-bottom-right {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: max(16px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.mode-ticket {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 2.5px solid var(--ink-cyan);
  background: linear-gradient(135deg, rgba(16, 26, 48, 0.92), rgba(22, 34, 62, 0.9));
  color: #fff;
  cursor: pointer;
  transform: skewX(-6deg);
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.22);
  transition: transform 0.14s, box-shadow 0.14s;
}
.mode-ticket:hover {
  transform: skewX(-6deg) translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 229, 255, 0.38);
}
.mode-ticket:active { transform: skewX(-6deg) scale(0.95); }
.ticket-icon {
  font-size: 26px;
  transform: skewX(6deg);
}
.ticket-body {
  text-align: left;
  transform: skewX(6deg);
}
.ticket-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 900;
}
.ticket-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--ink-pink);
  color: #fff;
}
.ticket-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  font-weight: 700;
}
.ticket-arrow {
  transform: skewX(6deg);
  font-size: 11.5px;
  font-weight: 900;
  color: var(--ink-cyan);
  margin-left: 4px;
}

.play-cta {
  position: relative;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 18px;
  padding: 14px 44px;
  background: linear-gradient(135deg, #ffe119 0%, #ff8c00 50%, #ff2e88 100%);
  color: #111522;
  cursor: pointer;
  transform: skewX(-8deg);
  display: flex;
  align-items: baseline;
  gap: 10px;
  box-shadow: 0 8px 0 #9e154c, 0 14px 32px rgba(255, 46, 136, 0.55);
  transition: transform 0.1s, box-shadow 0.1s;
}
.play-cta:hover { transform: skewX(-8deg) translateY(-2px); }
.play-cta:active {
  transform: skewX(-8deg) translateY(5px);
  box-shadow: 0 3px 0 #9e154c, 0 6px 16px rgba(255, 46, 136, 0.45);
}
.play-cta-text {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
  transform: skewX(8deg);
}
.play-cta-sub {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #141824;
  background: #fff;
  padding: 2px 8px;
  border-radius: 8px;
  transform: skewX(8deg);
}
.play-cta-shine {
  position: absolute;
  top: 0;
  left: -80%;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  animation: ctaShine 2.6s ease-in-out infinite;
}
@keyframes ctaShine {
  0%, 60% { left: -80%; }
  100% { left: 140%; }
}

/* ==================== BATTLE HUD (LANDSCAPE MOBILE LAYOUT) ==================== */
.battle-top-left {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
}
.minimap-frame {
  background: rgba(12, 16, 28, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
#minimap-canvas {
  display: block;
  border-radius: 8px;
}

.battle-top-center {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.squad-strip {
  display: flex;
  gap: 4px;
}
.squad-dot {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s, transform 0.2s;
}
.squad-dot.dead {
  opacity: 0.28;
  filter: grayscale(1);
  transform: scale(0.84);
}

.clock-plate {
  background: rgba(12, 16, 28, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 4px 14px 6px;
  min-width: 196px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.clock-time {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}
.clock-time.fever {
  color: var(--ink-yellow);
  animation: pulseScale 0.55s ease-in-out infinite alternate;
}
.clock-time.overtime {
  color: #ff3b5c;
  font-size: 20px;
  animation: pulseScale 0.4s ease-in-out infinite alternate;
}
@keyframes pulseScale {
  from { transform: scale(1); }
  to { transform: scale(1.09); }
}

.tug-bar {
  margin-top: 4px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  display: flex;
}
.score-seg { height: 100%; transition: width 0.2s ease; }

.zones-pill-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
}
.zone-counter-pill {
  padding: 1px 9px;
  border-radius: 999px;
  color: #0b0f1a;
  font-variant-numeric: tabular-nums;
}
.zone-counter-pill.active-tick {
  box-shadow: 0 0 12px currentColor;
  transform: scale(1.08);
}

/* Top-Right Controls & Kill Feed */
.battle-top-right {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.battle-icon-row {
  display: flex;
  gap: 6px;
}
.mini-circle {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(14, 20, 34, 0.84);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, border-color 0.15s;
}
.mini-circle:active { transform: scale(0.9); }
.mini-circle.active {
  border-color: var(--ink-yellow);
  background: rgba(255, 225, 25, 0.22);
}

.kill-feed {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
}
.kf-item {
  background: rgba(12, 16, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 800;
  animation: kfIn 0.18s ease;
}
@keyframes kfIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Center Banner */
.center-banner {
  position: absolute;
  top: 21%;
  left: 50%;
  transform: translateX(-50%) skewX(-6deg);
  pointer-events: none;
  padding: 10px 28px;
  border-radius: 16px;
  background: rgba(12, 16, 28, 0.9);
  border: 3px solid var(--ink-yellow);
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
  animation: bannerPop 0.22s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes bannerPop {
  from { opacity: 0; transform: translateX(-50%) skewX(-6deg) scale(0.75); }
  to { opacity: 1; transform: translateX(-50%) skewX(-6deg) scale(1); }
}

/* Respawn Overlay */
.respawn-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 8, 20, 0.25);
}
.respawn-card {
  background: rgba(14, 18, 32, 0.92);
  border: 2.5px solid var(--ink-pink);
  border-radius: 18px;
  padding: 16px 28px;
  text-align: center;
}
.respawn-title { font-size: 18px; font-weight: 900; color: #ff85ba; }
.respawn-killer { font-size: 13px; color: #cbd5e1; margin-top: 4px; }
.respawn-countdown { font-size: 15px; font-weight: 800; margin-top: 8px; }
.respawn-countdown span { font-size: 24px; color: var(--ink-yellow); }

/* Bottom-Center Vitals Capsule */
.battle-bottom-center {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
.status-pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(12, 16, 28, 0.92);
  border: 2px solid var(--ink-yellow);
  color: var(--ink-yellow);
  white-space: nowrap;
}
.vitals-capsule {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 16px;
  background: rgba(12, 16, 28, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.18);
  pointer-events: auto;
}
.vital-track-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 168px;
}
.v-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.v-lbl { width: 20px; font-size: 11px; font-weight: 900; color: #94a3b8; }
.v-track {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.v-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  transition: width 0.08s linear;
}
.v-fill.hp { background: linear-gradient(90deg, #22c55e, #4dff88); }
.v-fill.shield { background: rgba(0, 229, 255, 0.8); height: 4px; }
.v-fill.ink { background: linear-gradient(90deg, var(--ink-pink), #ff7db8); }
.v-num { width: 24px; text-align: right; font-size: 11px; font-weight: 900; font-variant-numeric: tabular-nums; }

.desktop-special-btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ds-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.55), rgba(255, 46, 136, 0.82));
}
.ds-icon, .ds-pct { position: relative; z-index: 2; }
.ds-icon { font-size: 18px; line-height: 1; }
.ds-pct { font-size: 10px; font-weight: 900; margin-top: 2px; }
.desktop-special-btn.ready {
  border-color: var(--ink-yellow);
  box-shadow: 0 0 18px rgba(255, 225, 25, 0.7);
  animation: pulseScale 0.65s ease-in-out infinite alternate;
}

.desktop-keys-hint {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.72);
  background: rgba(10, 14, 24, 0.6);
  padding: 2px 10px;
  border-radius: 999px;
}

/* ==================== MOBILE TWIN-STICK CONTROLS ==================== */
.mobile-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}

.move-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44%;
  height: 62%;
  pointer-events: auto;
  touch-action: none;
}

.stick-base {
  position: absolute;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(14, 20, 34, 0.42));
  border: 3px solid rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  touch-action: none;
}
.move-base {
  left: 92px;
  top: calc(100% - 92px);
}
.stick-base.active {
  border-color: var(--ink-cyan);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.35);
}

.stick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #cbd5e1);
  border: 3px solid rgba(15, 20, 34, 0.4);
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.right-action-cluster {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 220px;
  height: 210px;
  pointer-events: none;
}

.aim-base {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: auto;
  top: auto;
  transform: none;
  width: 118px;
  height: 118px;
  border-color: rgba(255, 46, 136, 0.65);
  background: radial-gradient(circle, rgba(255, 46, 136, 0.22), rgba(14, 20, 34, 0.55));
  pointer-events: auto;
}
.aim-base.active {
  border-color: var(--ink-pink);
  box-shadow: 0 0 26px rgba(255, 46, 136, 0.55);
}
.aim-knob {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #ff2e88, #ff6b1a);
  border: 3px solid #fff;
}

.action-orb {
  position: absolute;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.45);
  background: rgba(14, 20, 36, 0.82);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.08s;
}
.action-orb.pressed { transform: scale(0.88); }

.stealth-orb {
  width: 74px;
  height: 74px;
  left: 6px;
  bottom: 14px;
  border-color: rgba(0, 229, 255, 0.72);
  background: radial-gradient(circle, rgba(0, 229, 255, 0.25), rgba(14, 20, 36, 0.85));
}
.stealth-orb.submerged {
  border-color: var(--ink-cyan);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.65);
}
.stealth-orb.ambush-ready {
  border-color: var(--ink-yellow);
  box-shadow: 0 0 26px rgba(255, 225, 25, 0.85);
  animation: pulseScale 0.5s ease-in-out infinite alternate;
}

.special-orb {
  width: 72px;
  height: 72px;
  right: 26px;
  top: 2px;
}
.special-orb.ready {
  border-color: var(--ink-yellow);
  box-shadow: 0 0 26px rgba(255, 225, 25, 0.85);
  animation: pulseScale 0.55s ease-in-out infinite alternate;
}
.orb-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(255, 225, 25, 0.7), rgba(255, 46, 136, 0.85));
}
.orb-icon, .orb-sub { position: relative; z-index: 2; }
.orb-icon { font-size: 24px; line-height: 1; }
.orb-sub { font-size: 11px; font-weight: 900; margin-top: 2px; }

/* ==================== GAME MODALS ==================== */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 10, 20, 0.74);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-shell {
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(160deg, #1a2238, #111726);
  border: 2.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}
.modal-shell.wide { max-width: 820px; }
.modal-shell.narrow { max-width: 370px; }
.center-text { text-align: center; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-head h2 { font-size: 20px; font-weight: 900; }
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.modal-section-label {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--ink-cyan);
  margin: 10px 0 8px;
  text-transform: uppercase;
}

.arcade-card-grid {
  display: grid;
  gap: 10px;
}
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

.arcade-card {
  background: rgba(10, 14, 24, 0.72);
  border: 2.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 12px 10px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s, border-color 0.14s, background 0.14s;
}
.arcade-card:active { transform: scale(0.96); }
.arcade-card.selected {
  border-color: var(--ink-yellow);
  background: linear-gradient(145deg, rgba(0, 229, 255, 0.22), rgba(255, 46, 136, 0.16));
  box-shadow: 0 0 18px rgba(255, 225, 25, 0.25);
}
.ac-icon { font-size: 24px; margin-bottom: 4px; }
.ac-title { font-size: 14px; font-weight: 900; }
.ac-desc { font-size: 11px; color: #94a3b8; margin-top: 4px; line-height: 1.35; }

.setting-group { margin-bottom: 12px; }
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice-pill {
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 14, 26, 0.75);
  color: #e2e8f0;
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.14s, background 0.14s;
}
.choice-pill:active { transform: scale(0.95); }
.choice-pill.selected {
  border-color: var(--ink-yellow);
  background: linear-gradient(135deg, rgba(255, 46, 136, 0.35), rgba(255, 107, 26, 0.35));
  color: #fff;
}

.arcade-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2.5px solid var(--ink-cyan);
  background: rgba(8, 12, 22, 0.9);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  outline: none;
  margin-bottom: 14px;
  user-select: text;
  -webkit-user-select: text;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Arcade Game Buttons */
.game-btn {
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s;
}
.game-btn:active { transform: scale(0.94); }
.game-btn.sm { padding: 7px 14px; font-size: 12.5px; }
.game-btn.gold {
  background: linear-gradient(135deg, #ff8c00, #ff2e88);
  border-color: #ffe119;
  box-shadow: 0 5px 18px rgba(255, 46, 136, 0.42);
}
.game-btn.cyan {
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  border-color: #7df9ff;
}
.game-btn.ghost {
  background: rgba(255, 255, 255, 0.12);
}
.game-btn.danger {
  background: rgba(255, 46, 99, 0.25);
  border-color: #ff4d79;
  color: #ff9bb3;
}
.ml-auto { margin-left: auto; }
.big-modal-title { font-size: 24px; font-weight: 900; margin-bottom: 18px; }
.stack-btns { display: flex; flex-direction: column; gap: 10px; }

/* Matchmaking */
.mm-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.mm-spin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--ink-cyan);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mm-sub { font-size: 12.5px; color: #94a3b8; margin-top: 2px; font-weight: 700; }

.mm-roster {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.mm-slot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 5px solid #475569;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.22s ease;
}
.mm-slot.joined { opacity: 1; transform: translateY(0); }
.mm-slot.is-me { background: rgba(255, 225, 25, 0.14); }
.mm-avatar { font-size: 20px; }
.mm-name { font-weight: 900; font-size: 13px; }
.mm-meta { font-size: 11px; color: #94a3b8; display: flex; gap: 6px; margin-top: 2px; }
.mm-rank { font-weight: 900; padding: 0 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); }
.mm-weapon { margin-left: auto; font-size: 12px; font-weight: 800; }

/* Result Screen */
.result-top { text-align: center; margin-bottom: 12px; }
.result-verdict { font-size: 32px; font-weight: 900; letter-spacing: 1px; }
.result-verdict.win { color: var(--ink-yellow); text-shadow: 0 0 24px rgba(255, 225, 25, 0.55); }
.result-verdict.lose { color: #94a3b8; }
.result-reason { font-size: 13.5px; color: #cbd5e1; font-weight: 700; margin-top: 2px; }

.result-tally-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(0, 0, 0, 0.28);
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 12px;
}
.tally-row { display: flex; align-items: center; gap: 10px; }
.tally-team-label { width: 82px; font-size: 12.5px; font-weight: 900; }
.tally-track { flex: 1; height: 18px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.tally-fill { height: 100%; width: 0%; border-radius: 999px; transition: width 1.05s cubic-bezier(0.22, 1, 0.36, 1); }
.tally-pct { width: 78px; text-align: right; font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }

.result-mid-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.mvp-pill {
  font-size: 12.5px;
  font-weight: 900;
  color: var(--ink-yellow);
  background: rgba(255, 225, 25, 0.14);
  border: 1.5px solid rgba(255, 225, 25, 0.4);
  padding: 5px 12px;
  border-radius: 999px;
}

.result-scoreboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.sb-team-col {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 8px;
  border-top: 4px solid #64748b;
}
.sb-team-header {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 900;
  margin-bottom: 6px;
}
.sb-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  border-radius: 9px;
  font-size: 12px;
  margin-bottom: 4px;
  background: rgba(12, 16, 28, 0.7);
}
.sb-row.is-me { outline: 2px solid var(--ink-yellow); background: rgba(255, 225, 25, 0.14); }
.sb-name { font-weight: 900; }
.sb-ai-tag { font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 5px; margin-left: 4px; }
.sb-stats { margin-left: auto; display: flex; gap: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sb-turf { color: var(--ink-cyan); }

.result-foot {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ==================== SHOP & PAINT WORKSHOP ==================== */
.shop-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.coin-pill, .coins-reward-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: #141824;
  background: linear-gradient(135deg, #ffe119, #ffaa00);
  box-shadow: 0 3px 12px rgba(255, 225, 25, 0.4);
}
.coins-reward-pill {
  margin-top: 6px;
  font-size: 14px;
}

.shop-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.shop-tab {
  flex: 1;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 14, 26, 0.72);
  color: #cbd5e1;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.14s;
}
.shop-tab.active {
  border-color: var(--ink-yellow);
  background: linear-gradient(135deg, rgba(255, 46, 136, 0.35), rgba(0, 229, 255, 0.25));
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 225, 25, 0.22);
}

.shop-pane { display: none; }
.shop-pane.active { display: block; }

.gacha-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 46, 136, 0.22), rgba(255, 225, 25, 0.16));
  border: 2px solid rgba(255, 225, 25, 0.45);
  margin-bottom: 12px;
}
.gacha-strip strong { display: block; font-size: 14px; color: var(--ink-yellow); }
.gacha-strip small { font-size: 11.5px; color: #cbd5e1; }

.shop-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.skin-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px;
  border-radius: 16px;
  background: rgba(10, 14, 24, 0.78);
  border: 2.5px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.14s;
}
.skin-card:active { transform: scale(0.96); }
.skin-card.equipped {
  border-color: var(--ink-yellow);
  background: linear-gradient(145deg, rgba(255, 225, 25, 0.16), rgba(255, 46, 136, 0.18));
  box-shadow: 0 0 18px rgba(255, 225, 25, 0.25);
}
.skin-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.skin-emoji { font-size: 28px; }
.skin-rarity {
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
}
.skin-name { font-size: 14px; font-weight: 900; }
.skin-desc { font-size: 11px; color: #94a3b8; line-height: 1.35; flex: 1; }
.skin-action-bar {
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
}
.skin-card.equipped .skin-action-bar {
  background: var(--ink-green);
  color: #0b1320;
}
.skin-card.locked .skin-action-bar {
  background: linear-gradient(135deg, #ffe119, #ff8c00);
  color: #141824;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.palette-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.palette-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(10, 14, 24, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform 0.1s, border-color 0.14s;
}
.palette-card:active { transform: scale(0.96); }
.palette-card.selected {
  border-color: var(--ink-yellow);
  background: rgba(0, 229, 255, 0.16);
}
.pal-swatches {
  display: flex;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}
.pal-swatch { flex: 1; }
.pal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
}
.pal-tag {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 900;
}
.pal-tag.fresh { background: rgba(92, 214, 154, 0.24); color: #86efac; }
.pal-tag.neon { background: rgba(255, 46, 136, 0.24); color: #ff85ba; }

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 12px;
}
.pattern-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(10, 14, 24, 0.78);
  border: 2.5px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  text-align: left;
}
.pattern-card.selected {
  border-color: var(--ink-yellow);
  box-shadow: 0 0 16px rgba(255, 225, 25, 0.28);
}
.pattern-preview {
  width: 100%;
  height: 52px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background-size: 48px 48px;
  background-repeat: repeat;
}
.pattern-name { font-size: 12.5px; font-weight: 900; }
.pattern-desc { font-size: 10.5px; color: #94a3b8; line-height: 1.25; }

.custom-upload-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(0, 229, 255, 0.1);
  border: 2px dashed rgba(0, 229, 255, 0.45);
}
.upload-left strong { display: block; font-size: 13px; color: var(--ink-cyan); }
.upload-left small { font-size: 11px; color: #cbd5e1; }
.upload-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upload-label { display: inline-flex; align-items: center; gap: 4px; }
.compact-pills .choice-pill { padding: 6px 10px; font-size: 11.5px; }

.shop-toast {
  margin-right: auto;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink-yellow);
}

/* Portrait Rotate Prompt */
.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 12, 22, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.rotate-card {
  text-align: center;
  max-width: 320px;
}
.rotate-phone-icon {
  font-size: 54px;
  margin-bottom: 12px;
  animation: tiltPhone 1.8s ease-in-out infinite;
}
@keyframes tiltPhone {
  0%, 100% { transform: rotate(0deg); }
  45%, 65% { transform: rotate(-90deg); }
}
.rotate-card h2 { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.rotate-card p { font-size: 13.5px; color: #94a3b8; margin-bottom: 18px; line-height: 1.5; }
.rotate-actions { display: flex; justify-content: center; gap: 10px; }

/* Compact Landscape Mobile Tuning (Phones like 667x375 / 844x390) */
@media (max-height: 480px) {
  .game-logo-ribbon .logo-title { font-size: 20px; }
  .circle-btn { width: 42px; height: 42px; border-radius: 12px; }
  .circle-btn span { font-size: 16px; }
  .circle-btn small { font-size: 8.5px; }
  .dock-weapon { padding: 5px 10px 5px 6px; min-width: 124px; gap: 7px; }
  .dock-w-icon { width: 28px; height: 28px; font-size: 16px; }
  .dock-w-name { font-size: 11.5px; }
  .dock-w-role { display: none; }
  .play-cta { padding: 10px 30px; }
  .play-cta-text { font-size: 20px; }
  .mode-ticket { padding: 7px 10px; }
  .ticket-icon { font-size: 22px; }
  .ticket-top { font-size: 13px; }
  .minimap-frame canvas { width: 128px; height: 80px; }
  .clock-plate { min-width: 164px; padding: 3px 10px 5px; }
  .clock-time { font-size: 19px; }
  .mini-circle { width: 30px; height: 30px; font-size: 14px; }
  .vitals-capsule { padding: 5px 10px; }
  .vital-track-group { width: 135px; }
  .right-action-cluster { width: 196px; height: 188px; }
  .stick-base, .aim-base { width: 104px; height: 104px; }
  .stealth-orb, .special-orb { width: 64px; height: 64px; }
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
}
