/* ===== THE SPORT DUDES 3D - CSS ===== */

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

:root {
  --gold: #f5c518;
  --gold-dark: #c9a000;
  --white: #ffffff;
  --dark: #0a0a0f;
  --dark2: #111118;
  --green-light: #3a9e4a;
  --blue-team: #1a6fd4;
  --red-team: #d41a1a;
  --accent: #00e5ff;
  --hud-bg: rgba(0,0,0,0.88);
  --ctrl-size: 64px;
  --joystick-size: 130px;
  --joystick-knob: 52px;
}

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

/* ===== SCREENS ===== */
.screen { position: fixed; inset: 0; display: none; z-index: 10; }
.screen.active { display: flex; }
.hidden-screen { display: none !important; }
.hidden { display: none !important; }
.desktop-only { display: none; }
@media (hover: hover) { .desktop-only { display: block; } }

/* ===== MENU BACKGROUND ===== */
.menu-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(45,122,58,0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 100%, rgba(26,111,212,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(212,26,26,0.2) 0%, transparent 50%),
    linear-gradient(180deg, #050508 0%, #0d1117 40%, #0a1a0e 100%);
  overflow: hidden;
}

.stadium-lights {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 300px 200px at 15% 5%, rgba(255,240,180,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 300px 200px at 85% 5%, rgba(255,240,180,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 200px 150px at 50% 2%, rgba(255,255,255,0.06) 0%, transparent 70%);
  animation: lightFlicker 4s ease-in-out infinite alternate;
}

@keyframes lightFlicker { 0%{opacity:.8} 50%{opacity:1} 100%{opacity:.9} }

.grass-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; height: 35%;
  background: repeating-linear-gradient(90deg,
    rgba(45,122,58,0.08) 0px, rgba(45,122,58,0.08) 40px,
    rgba(30,92,42,0.08) 40px, rgba(30,92,42,0.08) 80px);
  mask-image: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}

/* ===== MENU CONTENT ===== */
.menu-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  gap: 1.5rem; padding: 1rem;
}

.logo-wrap { text-align: center; animation: logoEntrance 0.8s cubic-bezier(0.34,1.56,0.64,1) both; }

@keyframes logoEntrance {
  from { transform: translateY(-40px) scale(0.8); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.logo-badge {
  font-size: clamp(3rem, 10vw, 5rem);
  filter: drop-shadow(0 0 30px rgba(245,197,24,0.6));
  animation: ballSpin 3s linear infinite;
  display: inline-block;
}

@keyframes ballSpin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

.game-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem, 10vw, 7rem);
  line-height: 0.9; letter-spacing: 0.05em; color: var(--white);
  text-shadow: 0 0 40px rgba(245,197,24,0.4), 0 4px 20px rgba(0,0,0,0.8);
}

.game-title span {
  color: var(--gold);
  text-shadow: 0 0 60px rgba(245,197,24,0.8), 0 0 20px rgba(245,197,24,0.5), 0 4px 20px rgba(0,0,0,0.8);
}

.game-subtitle {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(0.7rem, 2.5vw, 1rem);
  letter-spacing: 0.4em; color: rgba(255,255,255,0.5);
  margin-top: 0.4rem; text-transform: uppercase;
}

.main-nav {
  display: flex; flex-direction: column;
  gap: 0.65rem; width: min(320px, 90vw);
  animation: navEntrance 0.8s 0.3s both;
}

@keyframes navEntrance {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.menu-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 0.6rem;
  padding: clamp(0.7rem, 2.5vw, 0.9rem) 2rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1rem, 3vw, 1.1rem);
  font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--white);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; cursor: pointer;
  transition: all 0.2s ease; position: relative; overflow: hidden;
  -webkit-tap-highlight-color: transparent; min-height: 48px;
}

.menu-btn:active { background: rgba(255,255,255,0.15); transform: scale(0.97); }

.menu-btn.primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  border-color: var(--gold); color: var(--dark); font-weight: 900;
  box-shadow: 0 4px 20px rgba(245,197,24,0.3);
}

.menu-btn.primary:active { transform: scale(0.97); }
.btn-icon { font-size: 0.9rem; }

.menu-footer {
  position: absolute; bottom: 1rem;
  font-size: 0.65rem; letter-spacing: 0.2em;
  color: rgba(255,255,255,0.2); text-transform: uppercase;
}

/* ===== OVERLAY PANELS ===== */
.overlay-panel {
  position: relative; z-index: 2;
  background: rgba(10,10,15,0.92);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: clamp(1.2rem, 4vw, 2.5rem);
  width: min(560px, 94vw); max-height: 90vh; overflow-y: auto;
  margin: auto; display: flex; flex-direction: column;
  gap: 1.2rem; align-items: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,197,24,0.1);
}

.panel-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  letter-spacing: 0.1em; color: var(--gold); text-align: center;
  text-shadow: 0 0 30px rgba(245,197,24,0.4);
}

/* ===== HOW TO PLAY ===== */
.controls-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem; width: 100%;
}

.control-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; padding: 0.6rem 0.4rem; text-align: center;
}

.control-key {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(0.7rem, 2.2vw, 1rem);
  color: var(--gold); margin-bottom: 0.25rem;
}

.control-desc {
  font-size: clamp(0.58rem, 1.6vw, 0.72rem);
  color: rgba(255,255,255,0.6); text-transform: uppercase;
}

.tips-box {
  background: rgba(45,122,58,0.15);
  border: 1px solid rgba(45,122,58,0.3);
  border-radius: 6px; padding: 0.85rem 1rem; width: 100%;
}

.tips-box h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem; letter-spacing: 0.2em;
  color: var(--green-light); margin-bottom: 0.5rem;
}

.tips-box p { font-size: 0.82rem; color: rgba(255,255,255,0.7); margin-bottom: 0.3rem; line-height: 1.5; }

/* ===== CREDITS ===== */
.credits-content { width: 100%; }
.credit-row { display: flex; justify-content: space-between; padding: 0.55rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.credit-label { font-family: 'Barlow Condensed', sans-serif; font-size: 0.8rem; letter-spacing: 0.2em; color: rgba(255,255,255,0.4); text-transform: uppercase; }
.credit-val { font-weight: 700; color: var(--white); }
.credit-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 0.5rem 0; width: 100%; }
.credits-tagline { text-align: center; font-style: italic; color: rgba(255,255,255,0.5); font-size: 0.9rem; }

/* ===== TEAM SELECT ===== */
.team-select-wrap {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem; padding: 1rem; overflow-y: auto;
}

.teams-container { display: flex; gap: 0.75rem; align-items: flex-start; width: min(900px, 100%); }

.team-side {
  flex: 1; background: rgba(10,10,15,0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 0.75rem; backdrop-filter: blur(20px);
}

.side-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem; letter-spacing: 0.25em;
  color: rgba(255,255,255,0.4); text-align: center;
  margin-bottom: 0.6rem; text-transform: uppercase;
}

.teams-list {
  display: flex; flex-direction: column; gap: 0.35rem;
  max-height: clamp(160px, 30vh, 280px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}

.teams-list::-webkit-scrollbar { width: 3px; }
.teams-list::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

.team-card {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.6rem; border-radius: 5px; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s ease;
  background: rgba(255,255,255,0.03); min-height: 44px;
}

.team-card:active { background: rgba(255,255,255,0.1); }
.team-card.selected { background: rgba(245,197,24,0.12); border-color: var(--gold); }
.team-card-badge { font-size: 1.3rem; }
.team-card-info { flex: 1; min-width: 0; }
.team-card-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(0.75rem, 2.5vw, 0.95rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-card-country { font-size: 0.65rem; color: rgba(255,255,255,0.4); text-transform: uppercase; }
.team-card-rating { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--gold); }

.vs-divider { display: flex; align-items: center; justify-content: center; width: 40px; padding-top: 2.5rem; flex-shrink: 0; }
.vs-divider span { font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; color: rgba(255,255,255,0.3); }

.match-settings {
  display: flex; gap: 1.5rem;
  background: rgba(10,10,15,0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 0.85rem 1.2rem;
  backdrop-filter: blur(20px); flex-wrap: wrap; justify-content: center;
}

.setting-group { display: flex; flex-direction: column; gap: 0.4rem; }
.setting-group label { font-family: 'Barlow Condensed', sans-serif; font-size: 0.7rem; letter-spacing: 0.25em; color: rgba(255,255,255,0.4); text-transform: uppercase; }
.setting-options { display: flex; gap: 0.35rem; }

.setting-btn {
  padding: 0.45rem 0.75rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px; cursor: pointer; min-height: 36px; min-width: 44px;
}

.setting-btn.active { background: rgba(245,197,24,0.15); border-color: var(--gold); color: var(--gold); }
.team-select-actions { display: flex; gap: 0.75rem; }

/* ===== GAME SCREEN ===== */
#game-screen {
  background: #000;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
}

/* Three.js container fills remaining space */
#three-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

#three-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ===== HUD ===== */
#hud {
  width: 100%; height: 52px;
  background: var(--hud-bg);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0.75rem; position: relative; z-index: 20; flex-shrink: 0;
}

.hud-team { display: flex; align-items: center; gap: 0.4rem; min-width: 0; flex: 1; }
.hud-team-right { flex-direction: row-reverse; }
.hud-team-badge { font-size: 1.4rem; flex-shrink: 0; }
.hud-team-name { font-family: 'Barlow Condensed', sans-serif; font-size: 0.65rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.6); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.hud-score { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; line-height: 1; color: var(--white); text-shadow: 0 0 20px rgba(255,255,255,0.3); flex-shrink: 0; }
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; flex-shrink: 0; padding: 0 0.5rem; }
.hud-timer { font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; letter-spacing: 0.08em; color: var(--white); line-height: 1; }
.hud-period { font-family: 'Barlow Condensed', sans-serif; font-size: 0.55rem; letter-spacing: 0.2em; color: rgba(255,255,255,0.4); text-transform: uppercase; }
.hud-possession { width: 90px; }
.poss-bar-wrap { height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; margin-bottom: 0.15rem; }
.poss-bar { height: 100%; width: 50%; background: linear-gradient(90deg, var(--blue-team), var(--accent)); border-radius: 2px; transition: width 0.5s ease; }
.poss-labels { display: flex; justify-content: space-between; font-size: 0.55rem; color: rgba(255,255,255,0.4); font-family: 'Barlow Condensed', sans-serif; }
.poss-mid { color: rgba(255,255,255,0.2); }

/* ===== ACTION FEEDBACK ===== */
#action-feedback {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%);
  font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; letter-spacing: 0.15em;
  color: var(--gold); text-shadow: 0 0 20px rgba(245,197,24,0.6);
  pointer-events: none; z-index: 30; opacity: 0; transition: opacity 0.3s; white-space: nowrap;
}
#action-feedback.show { opacity: 1; }

/* ===== MOBILE CONTROLS ===== */
#mobile-controls {
  position: fixed; bottom: 0; left: 0; right: 0; height: 160px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 12px; pointer-events: none; z-index: 40;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
}

#joystick-zone { width: var(--joystick-size); height: var(--joystick-size); pointer-events: all; position: relative; flex-shrink: 0; }

#joystick-base {
  width: var(--joystick-size); height: var(--joystick-size); border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.18);
  position: relative; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.4), inset 0 0 20px rgba(0,0,0,0.3);
}

#joystick-knob {
  width: var(--joystick-knob); height: var(--joystick-knob); border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.35), rgba(255,255,255,0.08));
  border: 2px solid rgba(255,255,255,0.3); position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5); pointer-events: none;
}

#action-buttons { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: all; }
.action-row { display: flex; gap: 8px; align-items: center; }

.action-btn {
  width: var(--ctrl-size); height: var(--ctrl-size); border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; cursor: pointer; pointer-events: all;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s, background 0.08s;
  backdrop-filter: blur(4px); box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.action-btn:active, .action-btn.pressed { transform: scale(0.88); background: rgba(255,255,255,0.15); }
.btn-label { font-size: 1.3rem; line-height: 1; pointer-events: none; }
.btn-name { font-family: 'Barlow Condensed', sans-serif; font-size: 0.5rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.6); text-transform: uppercase; pointer-events: none; }

.btn-shoot { border-color: rgba(245,197,24,0.5); background: rgba(245,197,24,0.12); width: 72px; height: 72px; }
.btn-shoot:active, .btn-shoot.pressed { background: rgba(245,197,24,0.3); }
.btn-sprint { border-color: rgba(0,229,255,0.4); background: rgba(0,229,255,0.08); }
.btn-sprint:active, .btn-sprint.pressed { background: rgba(0,229,255,0.2); }
.btn-pass { border-color: rgba(100,200,100,0.4); background: rgba(100,200,100,0.08); }
.btn-chip { border-color: rgba(200,150,255,0.4); background: rgba(200,150,255,0.08); }
.btn-switch { border-color: rgba(255,150,50,0.4); background: rgba(255,150,50,0.08); }

#mobile-pause-btn {
  position: fixed; top: 58px; right: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.2);
  font-size: 1rem; color: white; cursor: pointer; z-index: 41;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; pointer-events: all;
}

/* ===== PAUSE MENU ===== */
#pause-menu {
  position: absolute; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; backdrop-filter: blur(8px);
}

.pause-panel {
  background: rgba(10,10,15,0.95); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 2rem; display: flex; flex-direction: column;
  gap: 0.75rem; align-items: center; min-width: 260px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.pause-panel h2 { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; letter-spacing: 0.2em; color: var(--gold); margin-bottom: 0.4rem; }

.esc-hint { position: fixed; bottom: 1rem; right: 1rem; font-family: 'Barlow Condensed', sans-serif; font-size: 0.7rem; letter-spacing: 0.2em; color: rgba(255,255,255,0.2); text-transform: uppercase; z-index: 20; }

/* ===== GOAL OVERLAY ===== */
#goal-overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 100; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}

.goal-content { text-align: center; }

.goal-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(4rem, 18vw, 12rem); letter-spacing: 0.05em; color: var(--gold);
  text-shadow: 0 0 60px rgba(245,197,24,0.8), 0 0 120px rgba(245,197,24,0.4), 0 8px 30px rgba(0,0,0,0.8);
  animation: goalPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes goalPop { from{transform:scale(0.3) rotate(-5deg);opacity:0} to{transform:scale(1) rotate(0deg);opacity:1} }

.goal-scorer {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1rem, 4vw, 1.5rem); letter-spacing: 0.2em;
  color: rgba(255,255,255,0.8); margin-top: 0.5rem;
  animation: fadeInUp 0.4s 0.2s both;
}

@keyframes fadeInUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }

/* ===== RESULT SCREENS ===== */
.result-panel { max-width: 480px; }
.result-badge-big { font-size: 3.5rem; animation: trophyBounce 0.6s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes trophyBounce { from{transform:scale(0) rotate(-20deg);opacity:0} to{transform:scale(1) rotate(0deg);opacity:1} }
.result-score-wrap { display: flex; align-items: center; gap: 1rem; width: 100%; justify-content: center; }
.result-team { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; flex: 1; }
.result-badge { font-size: 2rem; }
.result-name { font-family: 'Barlow Condensed', sans-serif; font-size: 0.8rem; letter-spacing: 0.12em; color: rgba(255,255,255,0.6); text-transform: uppercase; text-align: center; }
.result-score { font-family: 'Bebas Neue', sans-serif; font-size: 3.5rem; color: var(--white); text-shadow: 0 0 30px rgba(255,255,255,0.3); }
.result-vs { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; color: rgba(255,255,255,0.2); }
.ft-stats { width: 100%; display: flex; flex-direction: column; gap: 0.4rem; }
.ft-stat-row { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; }
.ft-stat-label { flex: 1; text-align: center; font-family: 'Barlow Condensed', sans-serif; font-size: 0.65rem; letter-spacing: 0.12em; color: rgba(255,255,255,0.4); text-transform: uppercase; }
.ft-stat-val { font-family: 'Bebas Neue', sans-serif; font-size: 1rem; color: var(--white); min-width: 36px; text-align: center; }
.ft-stat-bar-wrap { flex: 2; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; display: flex; }
.ft-stat-bar-p { height: 100%; background: var(--blue-team); border-radius: 2px 0 0 2px; transition: width 0.8s ease; }
.ft-stat-bar-a { height: 100%; background: var(--red-team); border-radius: 0 2px 2px 0; transition: width 0.8s ease; }
.ft-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; justify-content: center; }

/* ===== RESPONSIVE ===== */
@media (max-height: 500px) and (orientation: landscape) {
  #hud { height: 44px; }
  #mobile-controls { height: 130px; }
  :root { --joystick-size: 110px; --joystick-knob: 44px; --ctrl-size: 54px; }
  .hud-score { font-size: 1.6rem; }
  .hud-timer { font-size: 1.3rem; }
  .hud-possession { display: none; }
}

@media (max-width: 380px) {
  :root { --joystick-size: 110px; --joystick-knob: 44px; --ctrl-size: 56px; }
  .hud-team-name { max-width: 50px; }
}

@media (min-width: 768px) {
  :root { --joystick-size: 150px; --joystick-knob: 60px; --ctrl-size: 72px; }
  #hud { height: 64px; padding: 0 1.5rem; }
  .hud-score { font-size: 2.6rem; }
  .hud-timer { font-size: 1.8rem; }
  .hud-team-badge { font-size: 1.8rem; }
  .hud-team-name { font-size: 0.75rem; max-width: 120px; }
  .hud-possession { width: 140px; }
  #mobile-controls { height: 180px; padding: 0 20px 16px; }
  #action-feedback { top: 76px; font-size: 1.4rem; }
  #mobile-pause-btn { top: 70px; }
}

@media (max-width: 500px) {
  .teams-container { flex-direction: column; gap: 0.5rem; }
  .vs-divider { width: 100%; padding: 0; height: 24px; }
  .match-settings { flex-direction: column; gap: 0.75rem; }
  .controls-grid { grid-template-columns: repeat(2, 1fr); }
  .team-select-wrap { justify-content: flex-start; padding-top: 1.5rem; }
}