/* ===== THE SPORT DUDES V2 — ULTRA EDITION ===== */
:root {
  --cyan:   #00f5ff;
  --pink:   #ff2d78;
  --gold:   #ffd700;
  --green:  #00ff88;
  --purple: #9b30ff;
  --orange: #ff6b00;
  --dark:   #04060f;
  --dark2:  #080c1a;
  --dark3:  #0d1428;
  --glass:  rgba(255,255,255,0.04);
  --border: rgba(0,245,255,0.18);
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--dark);
  font-family: 'Barlow Condensed', sans-serif;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ===== SCREENS ===== */
.screen {
  position: fixed; inset: 0;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 10;
}
.screen.active { display: flex; }

/* ===== MENU BACKGROUND ===== */
.menu-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 40%, #0a1a3a 0%, var(--dark) 70%);
  overflow: hidden;
}
.menu-grid {
  position: absolute; inset: -50%;
  background-image:
    linear-gradient(rgba(0,245,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,255,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridScroll 18s linear infinite;
}
@keyframes gridScroll {
  0%   { transform: translate(0,0); }
  100% { transform: translate(60px,60px); }
}
.menu-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.18;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb1 { width:500px;height:500px; background:var(--cyan);   top:-100px; left:-100px; animation-delay:0s; }
.orb2 { width:400px;height:400px; background:var(--pink);   bottom:-80px; right:-80px; animation-delay:-3s; }
.orb3 { width:300px;height:300px; background:var(--purple); top:40%; left:50%; animation-delay:-5s; }
@keyframes orbFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(30px,-30px) scale(1.08); }
}

/* ===== MENU CONTENT ===== */
.menu-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; gap: 2rem;
  padding: 2rem;
}
.logo-area { text-align: center; }
.logo-ball {
  font-size: 4rem;
  animation: ballSpin 3s linear infinite;
  display: inline-block;
  filter: drop-shadow(0 0 20px rgba(0,245,255,0.6));
}
@keyframes ballSpin { to { transform: rotate(360deg); } }

.logo-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #fff 0%, var(--cyan) 40%, var(--pink) 80%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(0,245,255,0.4));
  position: relative;
}
.logo-title span {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 60%, var(--pink) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-title::before {
  content: attr(data-text);
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  animation: glitch 5s infinite;
}
@keyframes glitch {
  0%,92%,100% { opacity:0; transform:none; }
  93% { opacity:0.7; transform:translate(-3px,0) skewX(-5deg); clip-path:polygon(0 20%,100% 20%,100% 40%,0 40%); }
  95% { opacity:0.5; transform:translate(3px,0) skewX(3deg); clip-path:polygon(0 60%,100% 60%,100% 80%,0 80%); }
  97% { opacity:0; }
}
.logo-sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255,215,0,0.5);
  margin-top: 0.3rem;
}

/* ===== MAIN NAV ===== */
.main-nav { display: flex; flex-direction: column; gap: 0.75rem; width: min(340px, 90vw); }

.mbtn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--glass);
  border: 1px solid var(--border);
  clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.mbtn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0,245,255,0.08), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}
.mbtn:hover::before, .mbtn:active::before { transform: translateX(100%); }
.mbtn:hover { border-color: var(--cyan); box-shadow: 0 0 20px rgba(0,245,255,0.25), inset 0 0 20px rgba(0,245,255,0.05); }
.mbtn:active { transform: scale(0.97); }
.mbtn-primary {
  background: linear-gradient(135deg, rgba(0,245,255,0.15), rgba(155,48,255,0.15));
  border-color: var(--cyan);
  box-shadow: 0 0 25px rgba(0,245,255,0.2);
  animation: pulseBorder 2s ease-in-out infinite;
}
@keyframes pulseBorder {
  0%,100% { box-shadow: 0 0 20px rgba(0,245,255,0.2); }
  50%      { box-shadow: 0 0 40px rgba(0,245,255,0.45), 0 0 80px rgba(0,245,255,0.1); }
}
.mbtn-icon { font-size: 1rem; }
.menu-footer { font-size: 0.7rem; color: rgba(255,255,255,0.25); letter-spacing: 0.15em; }

/* ===== OVERLAY PANEL ===== */
.overlay-panel {
  position: relative; z-index: 2;
  background: rgba(4,6,15,0.92);
  border: 1px solid var(--border);
  padding: 2rem;
  width: min(560px, 95vw);
  max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1.2rem;
  backdrop-filter: blur(20px);
  clip-path: polygon(16px 0%, 100% 0%, calc(100% - 16px) 100%, 0% 100%);
}
.panel-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem; letter-spacing: 0.15em;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

/* ===== CONTROLS GRID ===== */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}
.ctrl-card {
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  text-align: center;
}
.ctrl-key {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem; color: var(--cyan);
  letter-spacing: 0.08em;
}
.ctrl-desc { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-top: 0.2rem; }

.tips-box {
  background: rgba(0,245,255,0.04);
  border: 1px solid rgba(0,245,255,0.12);
  padding: 1rem;
}
.tips-box h3 { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--gold); margin-bottom: 0.5rem; }
.tips-box p { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 0.3rem; }

/* ===== CREDITS ===== */
.credits-list { display: flex; flex-direction: column; gap: 0.5rem; }
.credit-row { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.credit-label { font-family: 'Bebas Neue', sans-serif; font-size: 0.9rem; color: var(--cyan); letter-spacing: 0.1em; }
.credit-val { font-size: 0.85rem; color: rgba(255,255,255,0.7); }
.credit-divider { height: 1px; background: var(--border); margin: 0.5rem 0; }
.credits-tagline { text-align: center; font-style: italic; color: var(--gold); font-size: 0.9rem; }

/* ===== TEAM SELECT ===== */
.teams-wrap {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; gap: 1rem;
  padding: 1.5rem;
  width: 100%; max-height: 100vh; overflow-y: auto;
}
.teams-row {
  display: flex; align-items: flex-start; gap: 1rem;
  width: min(700px, 98vw);
}
.team-col { flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.team-col-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem; letter-spacing: 0.15em;
  color: var(--cyan); text-align: center;
  margin-bottom: 0.3rem;
}
.teams-list { display: flex; flex-direction: column; gap: 0.3rem; max-height: 40vh; overflow-y: auto; }
.team-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff; cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.05em;
  transition: all 0.15s;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
.team-btn:hover { border-color: var(--cyan); background: rgba(0,245,255,0.06); }
.team-btn.selected-p { border-color: var(--cyan); background: rgba(0,245,255,0.12); box-shadow: 0 0 12px rgba(0,245,255,0.2); }
.team-btn.selected-a { border-color: var(--pink); background: rgba(255,45,120,0.12); box-shadow: 0 0 12px rgba(255,45,120,0.2); }
.team-badge { font-size: 1.2rem; }
.team-name { flex: 1; }
.team-rating { font-size: 0.75rem; color: var(--gold); }
.vs-badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem; color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
  padding-top: 2rem; flex-shrink: 0;
}

/* ===== SETTINGS ===== */
.match-settings { display: flex; flex-direction: column; gap: 0.6rem; width: min(500px, 95vw); }
.setting-row { display: flex; align-items: center; gap: 1rem; }
.setting-label { font-family: 'Bebas Neue', sans-serif; font-size: 1rem; color: rgba(255,255,255,0.5); letter-spacing: 0.1em; width: 90px; flex-shrink: 0; }
.setting-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.sbtn {
  padding: 0.35rem 0.8rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem; letter-spacing: 0.08em;
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  cursor: pointer; transition: all 0.15s;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}
.sbtn.active { border-color: var(--cyan); color: var(--cyan); background: rgba(0,245,255,0.1); }
.sbtn:hover { border-color: rgba(0,245,255,0.4); color: #fff; }

/* ===== GAME SCREEN ===== */
#screen-game { background: #000; }
#three-container { position: absolute; inset: 0; }

/* ===== HUD ===== */
#hud {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: stretch;
  background: linear-gradient(180deg, rgba(4,6,15,0.95) 0%, rgba(4,6,15,0.0) 100%);
  padding: 0.5rem 1rem;
  z-index: 100;
  pointer-events: none;
}
#hud-left, #hud-right {
  flex: 1; display: flex; align-items: center; gap: 0.5rem;
}
#hud-right { justify-content: flex-end; }
#hud-center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 1rem;
}
.hud-team {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(0.8rem, 2.5vw, 1.1rem);
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.7);
}
.hud-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 20px rgba(0,245,255,0.5);
}
#hud-timer {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  color: var(--gold);
  text-shadow: 0 0 15px rgba(255,215,0,0.4);
  letter-spacing: 0.05em;
}
#hud-half {
  font-size: 0.65rem; letter-spacing: 0.2em;
  color: rgba(255,255,255,0.4);
}

/* ===== STAMINA ===== */
#stamina-wrap {
  position: fixed; bottom: 8px; left: 12px;
  z-index: 100; pointer-events: none;
  display: flex; flex-direction: column; gap: 3px;
}
#stamina-label { font-size: 0.6rem; letter-spacing: 0.15em; color: rgba(255,255,255,0.4); }
#stamina-track {
  width: 90px; height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px; overflow: hidden;
}
#stamina-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--green), #00cc66);
  border-radius: 3px;
  transition: width 0.1s, background 0.3s;
}

/* ===== POWER BAR ===== */
#power-wrap {
  position: fixed; bottom: 130px; left: 50%; transform: translateX(-50%);
  z-index: 100; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
#power-wrap.hidden { display: none; }
#power-label { font-family: 'Bebas Neue', sans-serif; font-size: 0.8rem; letter-spacing: 0.15em; color: var(--gold); }
#power-track {
  width: 180px; height: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 5px; overflow: hidden;
}
#power-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--pink));
  border-radius: 5px;
  transition: width 0.05s;
  box-shadow: 0 0 8px rgba(255,215,0,0.5);
}

/* ===== POSSESSION ===== */
#poss-wrap {
  position: fixed; top: 58px; left: 50%; transform: translateX(-50%);
  z-index: 100; pointer-events: none;
  display: flex; align-items: center; gap: 6px;
}
#poss-label { font-size: 0.55rem; letter-spacing: 0.15em; color: rgba(255,255,255,0.3); white-space: nowrap; }
#poss-bar-p, #poss-bar-a {
  height: 4px; border-radius: 2px;
  transition: width 0.5s ease;
}
#poss-bar-p { background: var(--cyan); width: 50px; }
#poss-bar-a { background: var(--pink); width: 50px; }

/* ===== FEEDBACK ===== */
#feedback {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 200; pointer-events: none;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.15em;
  color: #fff;
  text-shadow: 0 0 30px rgba(0,245,255,0.8), 0 2px 4px rgba(0,0,0,0.8);
  opacity: 0;
  transition: opacity 0.2s;
  text-align: center;
}
#feedback.show { opacity: 1; }

/* ===== MINIMAP ===== */
#minimap {
  position: fixed; bottom: 8px; right: 12px;
  z-index: 100;
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: 4px;
  background: rgba(4,6,15,0.8);
  opacity: 0.85;
}

/* ===== MOBILE CONTROLS ===== */
#mobile-controls {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 120px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 8px;
  background: linear-gradient(0deg, rgba(4,6,15,0.95) 0%, transparent 100%);
  z-index: 100;
}
@media (min-width: 900px) { #mobile-controls { display: none; } }
@media (max-width: 899px) {
  #xp-hud { top: auto; bottom: 128px; right: 8px; }
  .xp-hud-track { width: 70px; }
  .xp-hud-pts { display: none; }
}

#joystick-zone {
  width: 100px; height: 100px;
  position: relative; flex-shrink: 0;
}
#joystick-base {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(0,245,255,0.2);
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  display: flex; align-items: center; justify-content: center;
}
#joystick-knob {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(0,245,255,0.6), rgba(0,245,255,0.2));
  border: 2px solid var(--cyan);
  box-shadow: 0 0 12px rgba(0,245,255,0.4);
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}

#action-btns {
  display: flex; flex-direction: column; gap: 4px;
  flex-shrink: 0;
}
.abtn-row { display: flex; gap: 4px; }
.abtn {
  width: 52px; height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  background: rgba(4,6,15,0.8);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff; cursor: pointer;
  font-size: 1rem;
  transition: all 0.1s;
}
.abtn small { font-size: 0.5rem; letter-spacing: 0.08em; color: rgba(255,255,255,0.5); }
.abtn:active, .abtn.pressed { transform: scale(0.92); }
.abtn-shoot  { border-color: rgba(0,245,255,0.4); background: rgba(0,245,255,0.08); }
.abtn-pass   { border-color: rgba(0,255,136,0.4); background: rgba(0,255,136,0.06); }
.abtn-sprint { border-color: rgba(255,107,0,0.4); background: rgba(255,107,0,0.06); }
.abtn-slide  { border-color: rgba(255,215,0,0.4); background: rgba(255,215,0,0.06); }
.abtn-chip   { border-color: rgba(155,48,255,0.4); background: rgba(155,48,255,0.06); }
.abtn-switch { border-color: rgba(255,140,0,0.4); background: rgba(255,140,0,0.06); }
.abtn-skill  { border-color: rgba(255,45,120,0.4); background: rgba(255,45,120,0.06); }
.abtn-shoot:active, .abtn-shoot.pressed  { background: rgba(0,245,255,0.25); box-shadow: 0 0 16px rgba(0,245,255,0.4); }
.abtn-slide:active, .abtn-slide.pressed  { background: rgba(255,215,0,0.25); box-shadow: 0 0 16px rgba(255,215,0,0.4); }
.abtn-sprint:active, .abtn-sprint.pressed { background: rgba(255,107,0,0.25); }

#pause-btn {
  position: fixed; top: 10px; right: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(4,6,15,0.8);
  border: 1px solid rgba(0,245,255,0.3);
  color: #fff; font-size: 1rem; cursor: pointer;
  z-index: 200;
}

/* ===== PAUSE MENU ===== */
#pause-menu {
  position: fixed; inset: 0;
  background: rgba(4,6,15,0.85);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
}
#pause-menu.hidden { display: none; }

/* ===== GOAL OVERLAY ===== */
#goal-overlay {
  position: fixed; inset: 0;
  background: rgba(4,6,15,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
  animation: goalFadeIn 0.3s ease;
}
#goal-overlay.hidden { display: none; }
@keyframes goalFadeIn { from { opacity:0; transform:scale(0.8); } to { opacity:1; transform:scale(1); } }
.goal-inner { text-align: center; }
.goal-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(5rem, 18vw, 12rem);
  line-height: 0.9;
  background: linear-gradient(135deg, var(--gold), var(--cyan), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(255,215,0,0.6));
  animation: goalPulse 0.5s ease-in-out infinite alternate;
}
@keyframes goalPulse {
  from { filter: drop-shadow(0 0 30px rgba(255,215,0,0.4)); }
  to   { filter: drop-shadow(0 0 60px rgba(255,215,0,0.9)); }
}
.goal-scorer {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: #fff; letter-spacing: 0.15em;
  margin-top: 0.5rem;
}
.goal-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
}

/* ===== FULL TIME ===== */
#fulltime-overlay {
  position: fixed; inset: 0;
  background: rgba(4,6,15,0.9);
  backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
}
#fulltime-overlay.hidden { display: none; }
.ft-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 10vw, 6rem);
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255,215,0,0.5);
  text-align: center;
}
.ft-result {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  letter-spacing: 0.15em;
}
.ft-stats {
  display: flex; flex-direction: column; gap: 0.4rem;
  font-size: 0.85rem; color: rgba(255,255,255,0.6);
  text-align: center;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,245,255,0.3); border-radius: 2px; }

/* ===== XP HUD BAR ===== */
#xp-hud {
  position: fixed; top: 58px; right: 10px;
  z-index: 100; pointer-events: none;
}
.xp-hud-inner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(4,6,15,0.75);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 20px;
  padding: 4px 12px;
  backdrop-filter: blur(8px);
}
.xp-hud-lvl {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem; letter-spacing: 0.1em;
  color: var(--gold);
  white-space: nowrap;
}
.xp-hud-track {
  width: 120px; height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px; overflow: hidden;
}
.xp-hud-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  border-radius: 3px;
  transition: width 0.4s ease;
  box-shadow: 0 0 6px rgba(255,215,0,0.5);
}
.xp-hud-pts {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.7rem; color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

/* ===== FLOATING XP POPUP ===== */
.xp-popup {
  position: fixed; left: 50%; top: 42%;
  transform: translateX(-50%);
  z-index: 250; pointer-events: none;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; letter-spacing: 0.1em;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255,215,0,0.8), 0 2px 4px rgba(0,0,0,0.8);
  opacity: 0;
  transition: opacity 0.15s;
}
.xp-popup.show {
  opacity: 1;
  animation: xpFloat 1.2s ease forwards;
}
@keyframes xpFloat {
  0%   { opacity:1; transform:translateX(-50%) translateY(0); }
  70%  { opacity:1; transform:translateX(-50%) translateY(-40px); }
  100% { opacity:0; transform:translateX(-50%) translateY(-60px); }
}

/* ===== LEVEL UP OVERLAY ===== */
.levelup-overlay {
  position: fixed; inset: 0;
  background: rgba(4,6,15,0.88);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  animation: levelupFadeIn 0.4s ease;
}
@keyframes levelupFadeIn {
  from { opacity:0; } to { opacity:1; }
}
.levelup-inner {
  text-align: center;
  animation: levelupPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes levelupPop {
  from { transform: scale(0.5); opacity:0; }
  to   { transform: scale(1);   opacity:1; }
}
.levelup-badge {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold), #b8860b);
  border: 4px solid var(--gold);
  box-shadow: 0 0 60px rgba(255,215,0,0.7), 0 0 120px rgba(255,215,0,0.3);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem; color: #fff;
  margin: 0 auto 1rem;
  animation: badgeSpin 0.6s ease;
}
@keyframes badgeSpin {
  from { transform: rotateY(180deg) scale(0.5); }
  to   { transform: rotateY(0deg) scale(1); }
}
.levelup-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 10vw, 6rem);
  background: linear-gradient(135deg, var(--gold), var(--cyan), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(255,215,0,0.5));
  letter-spacing: 0.1em;
}
.levelup-rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--cyan); letter-spacing: 0.2em;
  margin: 0.3rem 0;
}
.levelup-unlock {
  font-size: 1rem; color: rgba(255,255,255,0.8);
  margin-top: 0.8rem;
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.3);
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  display: inline-block;
}

/* ===== PROFILE SCREEN ===== */
.profile-badge-row {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 1rem;
  background: rgba(255,215,0,0.05);
  border: 1px solid rgba(255,215,0,0.15);
}
.profile-badge {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold), #8b6914);
  border: 3px solid var(--gold);
  box-shadow: 0 0 24px rgba(255,215,0,0.4);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; color: #fff;
}
.profile-info { flex: 1; }
.profile-level {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem; color: var(--gold); letter-spacing: 0.1em;
}
.profile-xp-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.profile-xp-track {
  flex: 1; height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px; overflow: hidden;
}
.profile-xp-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.profile-xp-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); white-space: nowrap; }

.profile-stats {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 0.5rem;
}
.stat-card {
  background: var(--glass); border: 1px solid var(--border);
  padding: 0.6rem; text-align: center;
}
.stat-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem; color: var(--cyan);
}
.stat-lbl { font-size: 0.65rem; color: rgba(255,255,255,0.4); letter-spacing: 0.1em; }

.profile-unlocks, .profile-upcoming { display: flex; flex-direction: column; gap: 0.5rem; }
.unlocks-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem; letter-spacing: 0.12em;
  color: var(--gold);
}
.unlocks-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.unlock-chip {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 20px;
  font-size: 0.8rem; color: rgba(255,255,255,0.8);
}
.unlock-chip.locked {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35);
}
.unlock-chip .chip-lvl {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.7rem; color: var(--gold);
}

.mbtn-profile {
  border-color: rgba(255,215,0,0.4);
  background: rgba(255,215,0,0.06);
}
.mbtn-profile:hover { border-color: var(--gold); box-shadow: 0 0 20px rgba(255,215,0,0.25); }

.mbtn-market {
  border-color: rgba(167,139,250,0.4);
  background: rgba(167,139,250,0.06);
}
.mbtn-market:hover { border-color: #a78bfa; box-shadow: 0 0 20px rgba(167,139,250,0.25); }

.hidden { display: none !important; }

/* ===== CURRENCY HUD ===== */
.currency-hud-row {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 4px;
}
.currency-hud-row span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem; letter-spacing: 0.08em;
  background: rgba(4,6,15,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px; padding: 2px 10px;
}
#coins-hud { color: #ffd700; border-color: rgba(255,215,0,0.3); }
#gems-hud  { color: #a78bfa; border-color: rgba(167,139,250,0.3); }

/* ===== MARKETPLACE ===== */
.market-wrap {
  position: relative; z-index: 2;
  width: min(700px, 96vw);
  max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1.5rem 1rem;
}
.market-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
.market-currency { display: flex; gap: 12px; }
.mkt-coin, .mkt-gem {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem;
  padding: 4px 14px; border-radius: 20px;
}
.mkt-coin { background: rgba(255,215,0,0.12); border: 1px solid rgba(255,215,0,0.4); color: #ffd700; }
.mkt-gem  { background: rgba(167,139,250,0.12); border: 1px solid rgba(167,139,250,0.4); color: #a78bfa; }

.market-tabs { display: flex; gap: 6px; }
.mtab {
  flex: 1; padding: 8px 4px;
  font-family: 'Bebas Neue', sans-serif; font-size: 0.95rem; letter-spacing: 0.1em;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; color: rgba(255,255,255,0.5); cursor: pointer;
  transition: all 0.2s;
}
.mtab.active { background: rgba(0,245,255,0.12); border-color: var(--cyan); color: var(--cyan); }
.mtab:hover:not(.active) { border-color: rgba(255,255,255,0.3); color: #fff; }

.market-panel { display: flex; flex-direction: column; gap: 1rem; }
.market-panel.hidden { display: none; }

/* Player grid */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.player-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: all 0.2s; text-align: center;
}
.player-card:hover { border-color: var(--cyan); background: rgba(0,245,255,0.06); transform: translateY(-2px); }
.player-card.owned { border-color: rgba(0,255,136,0.4); background: rgba(0,255,136,0.05); }
.player-card.owned:hover { border-color: var(--green); }
.pc-badge { font-size: 2rem; }
.pc-name { font-family: 'Bebas Neue', sans-serif; font-size: 0.85rem; letter-spacing: 0.05em; color: #fff; }
.pc-rating {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.pc-rating.common   { background: rgba(150,150,150,0.3); color: #aaa; border: 1px solid #666; }
.pc-rating.rare     { background: rgba(0,100,255,0.3);   color: #60a5fa; border: 1px solid #3b82f6; }
.pc-rating.epic     { background: rgba(139,0,255,0.3);   color: #c084fc; border: 1px solid #9333ea; }
.pc-rating.legend   { background: rgba(255,165,0,0.3);   color: #fbbf24; border: 1px solid #f59e0b; }
.pc-rarity { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; }
.pc-price { font-family: 'Bebas Neue', sans-serif; font-size: 0.8rem; color: #ffd700; }
.pc-owned-tag { font-size: 0.65rem; color: var(--green); letter-spacing: 0.1em; }

/* Packs grid */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.pack-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px; padding: 16px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: all 0.25s; text-align: center;
}
.pack-card:hover { transform: translateY(-4px) scale(1.03); }
.pack-img { font-size: 2.8rem; }
.pack-bronze { filter: sepia(0.5) saturate(1.5); }
.pack-silver { filter: brightness(1.3) saturate(0.3); }
.pack-gold   { filter: sepia(1) saturate(3) brightness(1.2); }
.pack-legend { filter: hue-rotate(30deg) saturate(2) brightness(1.3); }
.pack-card:hover .pack-img { animation: packBounce 0.4s ease; }
@keyframes packBounce {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.2) rotate(-5deg); }
}
.pack-name { font-family: 'Bebas Neue', sans-serif; font-size: 1rem; letter-spacing: 0.1em; color: #fff; }
.pack-desc { font-size: 0.65rem; color: rgba(255,255,255,0.5); }
.pack-price { font-family: 'Bebas Neue', sans-serif; font-size: 0.9rem; }
.pack-bronze .pack-price, .pack-silver .pack-price { color: #ffd700; }
.pack-gold .pack-price, .pack-legend .pack-price { color: #a78bfa; }

.squad-hint { font-size: 0.75rem; color: rgba(255,255,255,0.4); text-align: center; }

/* ===== PACK OPENING OVERLAY ===== */
.pack-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(4,6,15,0.96);
  display: flex; align-items: center; justify-content: center;
}
.pack-open-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  padding: 2rem;
}
.pack-open-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 2rem;
  letter-spacing: 0.2em; color: var(--gold);
  animation: titlePulse 1s ease infinite;
}
@keyframes titlePulse {
  0%,100% { opacity: 1; text-shadow: 0 0 20px rgba(255,215,0,0.5); }
  50%      { opacity: 0.7; text-shadow: 0 0 40px rgba(255,215,0,0.9); }
}
.pack-cards-row {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.reveal-card {
  width: 100px; background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 14px; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; opacity: 0;
  animation: cardReveal 0.5s ease forwards;
}
@keyframes cardReveal {
  0%   { opacity: 0; transform: rotateY(90deg) scale(0.8); }
  60%  { transform: rotateY(-10deg) scale(1.05); }
  100% { opacity: 1; transform: rotateY(0deg) scale(1); }
}
.reveal-card.legend { border-color: #f59e0b; box-shadow: 0 0 20px rgba(245,158,11,0.4); }
.reveal-card.epic   { border-color: #9333ea; box-shadow: 0 0 16px rgba(147,51,234,0.4); }
.reveal-card.rare   { border-color: #3b82f6; box-shadow: 0 0 12px rgba(59,130,246,0.3); }
.rc-badge { font-size: 2rem; }
.rc-name  { font-family: 'Bebas Neue', sans-serif; font-size: 0.75rem; color: #fff; }
.rc-rating { font-family: 'Bebas Neue', sans-serif; font-size: 1rem; }

/* Marketplace button */
.mbtn-market {
  border-color: rgba(167,139,250,0.4);
  background: rgba(167,139,250,0.06);
  color: #a78bfa;
}
.mbtn-market:hover { border-color: #a78bfa; box-shadow: 0 0 20px rgba(167,139,250,0.25); }