/* ============================================================
   CARLEAGUE.IO — v3 art direction
   The menu floats over a LIVE stadium (attract-mode canvas).
   Discipline rules: one warm accent (amber) for actions, team
   cyan/magenta reserved for teams, everything else stays quiet.
   ============================================================ */

:root {
  --ink: #060a12;
  --panel: rgba(8, 12, 20, 0.74);
  --panel-solid: #0b1018;
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-strong: rgba(255, 255, 255, 0.16);

  --accent: #ffc94d;
  --accent-deep: #f0a32e;
  --cyan: #19e3ff;
  --magenta: #ff2d88;
  --green: #5ee8a4;
  --red: #ff5252;

  --text: #eef2f7;
  --text-dim: #97a4b8;
  --text-faint: #5d6b80;

  --font-body: 'Outfit', sans-serif;
  --font-display: 'Space Grotesk', 'Outfit', sans-serif;
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
}

input, select { user-select: text; }

/* ---------- LIVE STADIUM BACKDROP ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

#menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(4, 7, 12, 0.78) 0%, rgba(4, 7, 12, 0.18) 26%, rgba(4, 7, 12, 0) 50%, rgba(4, 7, 12, 0.18) 74%, rgba(4, 7, 12, 0.78) 100%),
    linear-gradient(to bottom, rgba(4, 7, 12, 0.66) 0%, rgba(4, 7, 12, 0) 18%, rgba(4, 7, 12, 0) 82%, rgba(4, 7, 12, 0.5) 100%);
}

/* ---------- APP / HEADER ---------- */
#app-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 30px;
  z-index: 100;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--text);
}

.io-text { color: var(--accent); }

.hdr-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hdr-level-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 5px 14px 5px 6px;
}

.hdr-level-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(160deg, #1a2538, #0b1220);
  border: 1px solid var(--hairline-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}

.hdr-xp-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 116px;
}

.hdr-title-label {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
}

.hdr-xp-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 2px;
  overflow: hidden;
}

.hdr-xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.hdr-xp-text { font-size: 9px; color: var(--text-dim); }

.streak-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--panel);
  border: 1px solid rgba(255, 159, 67, 0.4);
  padding: 7px 12px;
  border-radius: 12px;
  font-size: 12px;
}

/* live player count chip */
.online-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid rgba(46, 213, 115, 0.4);
  padding: 7px 12px;
  border-radius: 12px;
  font: 700 12px "Space Grotesk", "Outfit", sans-serif;
  color: #b6f5c8;
  white-space: nowrap;
}
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ed573;
  box-shadow: 0 0 8px #2ed573;
  animation: onlinePulse 2s ease-in-out infinite;
}
@keyframes onlinePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
#online-count::after { content: " online"; font-weight: 500; opacity: 0.7; }

.coin-container {
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: 8px 15px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-display);
}

.coin-icon { color: var(--accent); margin-right: 7px; font-size: 13px; }
.currency-label { font-size: 10px; color: var(--text-dim); margin-left: 5px; letter-spacing: 1px; }

.hdr-gear {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  color: var(--text-dim);
  transition: 0.2s;
  cursor: pointer;
}

.hdr-gear:hover { color: var(--text); transform: rotate(30deg); }

/* ---------- SCREENS ---------- */
.screen {
  flex: 1;
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  padding-top: 62px;
  z-index: 10;
}

.screen.active { opacity: 1; pointer-events: auto; z-index: 20; }

/* screens that should fully hide the attract backdrop */
.solid-screen { background: var(--ink); }
#garage-screen { background: radial-gradient(120% 100% at 50% 0%, #121a2a 0%, #080c14 58%, #05080d 100%); }
#results-screen { background: rgba(4, 7, 12, 0.82); backdrop-filter: blur(3px); }

.neon-text-green { color: var(--green); }
.neon-text-pink  { color: var(--magenta); }
.neon-text-blue  { color: var(--cyan); }
.neon-text-yellow{ color: var(--accent); }

/* ---------- BUTTONS ---------- */
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  border: none;
  color: #160e02;
  padding: 14px 26px;
  font-weight: 900;
  letter-spacing: 1.5px;
  border-radius: 11px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.2s, filter 0.2s;
  outline: none;
  text-align: center;
  box-shadow: 0 4px 18px rgba(240, 163, 46, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 7px 24px rgba(240, 163, 46, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-primary:active { transform: translateY(0) scale(0.985); }
.btn-primary.slim { padding: 9px 18px; font-size: 12px; }
.btn-primary.disabled, .btn-primary:disabled { filter: saturate(0.2) brightness(0.6); cursor: not-allowed; }

.cyber-btn, .btn-ghost {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--hairline-strong);
  color: var(--text);
  padding: 13px 24px;
  font-weight: 700;
  letter-spacing: 1.2px;
  border-radius: 11px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  transition: transform 0.15s ease, background 0.2s, border-color 0.2s;
  outline: none;
  text-align: center;
}

.cyber-btn:hover, .btn-ghost:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.cyber-btn:active, .btn-ghost:active { transform: translateY(0) scale(0.985); }

.cyber-btn.disabled { opacity: 0.4; cursor: not-allowed; }

.danger-glow { border-color: rgba(255, 82, 82, 0.5); color: #ffb3b3; }
.danger-glow:hover { background: rgba(255, 82, 82, 0.14); border-color: var(--red); }

.mini-btn { padding: 8px 13px; font-size: 11px; border-radius: 8px; }

.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  outline: none;
}

/* ---------- MENU LAYOUT ---------- */
.menu-layout {
  display: grid;
  grid-template-columns: 312px 1fr 318px;
  gap: 20px;
  padding: 6px 26px 22px;
  width: 100%;
  height: 100%;
}

.menu-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-height: 0;
  animation: panel-in 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) backwards;
}

.matchmaking-card { animation-delay: 0.05s; }
.right-card { animation-delay: 0.12s; }

@keyframes panel-in {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.card-heading {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px 12px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.mode-option:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.mode-option.active {
  background: rgba(255, 201, 77, 0.08);
  border-color: rgba(255, 201, 77, 0.22);
  border-left-color: var(--accent);
}

.mode-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.16s;
}

.mode-option.active .mode-icon { color: var(--accent); background: rgba(255, 201, 77, 0.12); }

.mode-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
  letter-spacing: 1px;
}

.mode-sub { color: var(--text-dim); font-size: 11px; letter-spacing: 1px; }
.mode-desc { font-size: 11px; color: var(--text-dim); line-height: 1.35; }

.new-tag {
  background: var(--magenta);
  color: #fff;
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  vertical-align: 2px;
  letter-spacing: 1.5px;
  font-family: var(--font-body);
}

#find-match-btn { margin-bottom: 9px; width: 100%; }
#play-offline-btn { width: 100%; }

/* queue spinner */
.queue-status-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 201, 77, 0.06);
  border: 1px solid rgba(255, 201, 77, 0.4);
  padding: 12px 14px;
  border-radius: 11px;
  margin-bottom: 10px;
  font-size: 12px;
}

.pulse-loader {
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  border-radius: 50%;
  animation: pulse-loader 1s infinite alternate;
  flex-shrink: 0;
}

@keyframes pulse-loader {
  0%   { transform: scale(0.6); opacity: 0.4; }
  100% { transform: scale(1.3); opacity: 1; }
}

#cancel-queue-btn { margin-left: auto; padding: 6px 11px; }

/* ---------- CENTER: live view + driver dock ---------- */
.center-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 14px;
}

.attract-spacer {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  pointer-events: none;
}

.attract-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(5, 8, 14, 0.55);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2.5px;
  color: var(--text-dim);
  animation: panel-in 0.6s 0.25s cubic-bezier(0.2, 0.9, 0.25, 1) backwards;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: live-blink 1.6s infinite;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(255, 82, 82, 0.9); }
  50%      { opacity: 0.4; box-shadow: none; }
}

.driver-dock {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: panel-in 0.5s 0.08s cubic-bezier(0.2, 0.9, 0.25, 1) backwards;
}

.name-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 13px;
  padding: 9px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.name-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--text-faint);
  font-family: var(--font-display);
}

#player-name-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  padding: 8px 13px;
  outline: none;
  transition: border-color 0.2s;
}

#player-name-input:focus { border-color: var(--accent); }

.party-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.party-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.party-card h3 {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-dim);
}

.party-code-box {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 11px;
  border-radius: 9px;
  font-size: 12px;
}

.party-code-label { font-size: 9px; letter-spacing: 2px; color: var(--text-faint); font-weight: 900; }

#party-code-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 4px;
  color: var(--accent);
}

#copy-code-btn { opacity: 0.55; transition: opacity 0.2s; color: var(--text); display: flex; }
#copy-code-btn:hover { opacity: 1; }

.party-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 96px;
  overflow-y: auto;
}

.party-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--hairline);
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 13px;
}

.party-member.self { border-color: rgba(255, 201, 77, 0.3); }
.member-name { font-weight: 700; }
.member-status { font-size: 11px; color: var(--green); }

.party-actions { display: flex; gap: 9px; align-items: stretch; }

.join-party-input-group {
  display: flex;
  border: 1px solid var(--hairline-strong);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  flex: 1;
}

.join-party-input-group input {
  background: none;
  border: none;
  color: var(--text);
  padding: 6px;
  font-size: 13px;
  text-align: center;
  width: 100%;
  outline: none;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 4px;
}

.join-party-input-group .mini-btn { border: none; border-left: 1px solid var(--hairline-strong); border-radius: 0; }

/* ---------- RIGHT: QUESTS ---------- */
.quests-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 13px;
}

.quest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--hairline);
  border-radius: 11px;
  padding: 9px 12px;
}

.quest-row.quest-ready { border-color: rgba(94, 232, 164, 0.55); }

.quest-info { flex: 1; min-width: 0; }
.quest-desc { font-size: 12px; font-weight: 700; margin-bottom: 5px; }

.quest-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 3px;
}

.quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.quest-progress { font-size: 10px; color: var(--text-faint); }
.quest-reward { font-size: 11px; color: var(--accent); font-weight: 900; white-space: nowrap; font-family: var(--font-display); }
.quest-claimed { font-size: 10px; color: var(--green); font-weight: 900; white-space: nowrap; }

.quest-claim-btn {
  border-color: rgba(94, 232, 164, 0.6);
  color: var(--green);
  animation: claim-pulse 1.6s infinite;
}

@keyframes claim-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(94, 232, 164, 0); }
  50%      { box-shadow: 0 0 13px rgba(94, 232, 164, 0.35); }
}

.right-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 13px;
}

.controls-guide {
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  padding-top: 13px;
}

.controls-guide h3 {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-faint);
  margin-bottom: 9px;
}

.controls-guide ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.controls-guide li { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); }
.controls-guide li span:first-child {
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 11px;
}

/* ---------- GARAGE ---------- */
.garage-layout {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 6px 28px 22px;
}

.garage-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.garage-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 5px;
}

.garage-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 500px;
  gap: 20px;
  min-height: 0;
}

.garage-preview-box {
  background:
    radial-gradient(80% 60% at 50% 76%, rgba(80, 110, 170, 0.14) 0%, transparent 60%),
    linear-gradient(180deg, #0d1422 0%, #070b12 100%);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

#garage-preview-canvas { width: 100%; height: 100%; }

.preview-controls-hint {
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 15px;
  border-radius: 999px;
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--hairline);
  white-space: nowrap;
}

.customizer-panel {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.customizer-tabs {
  display: flex;
  border-bottom: 1px solid var(--hairline);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-faint);
  padding: 13px 2px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content {
  display: none;
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  min-height: 0;
}

.tab-content.active { display: flex; flex-direction: column; gap: 12px; }

.garage-subheader {
  margin: 10px 0 2px;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 2px;
  text-align: center;
  font-family: var(--font-display);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.item-card {
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 11px;
  padding: 9px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  text-align: center;
  transition: all 0.16s;
  overflow: hidden;
}

.item-card:hover {
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-2px);
  border-color: var(--hairline-strong);
}

.item-card.equipped { border-color: rgba(94, 232, 164, 0.55); }
.item-card.locked .item-thumb, .item-card.locked .title-thumb { opacity: 0.45; filter: grayscale(0.4); }
.item-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.item-card.rarity-rare { background: linear-gradient(165deg, rgba(30, 144, 255, 0.07), rgba(255, 255, 255, 0.015)); }
.item-card.rarity-epic { background: linear-gradient(165deg, rgba(165, 94, 234, 0.09), rgba(255, 255, 255, 0.015)); }
.item-card.rarity-legendary {
  background: linear-gradient(165deg, rgba(255, 177, 66, 0.12), rgba(255, 255, 255, 0.015));
  border-color: rgba(255, 177, 66, 0.3);
}

.item-rarity {
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 4px;
  opacity: 0.85;
  font-family: var(--font-display);
}

.item-thumb {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.title-thumb {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.item-title { font-size: 10.5px; font-weight: 700; color: var(--text-dim); }

.item-lock-icon {
  position: absolute;
  top: 6px;
  right: 7px;
  font-size: 9px;
  font-weight: 900;
  font-family: var(--font-display);
  color: var(--accent);
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 6px;
  border-radius: 6px;
}

.color-pickers-container { display: flex; flex-direction: column; gap: 9px; }

.color-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--hairline);
}

.color-picker-row span {
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-faint);
  font-family: var(--font-display);
}

.color-presets { display: flex; gap: 7px; flex-wrap: wrap; }

.color-swatch {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.1s;
}

.color-swatch:hover { transform: scale(1.18); }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }

.purchase-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 17px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid var(--hairline);
  border-radius: 0 0 16px 16px;
}

#selected-item-name { font-weight: 700; font-size: 15px; font-family: var(--font-display); }
#selected-item-status { font-size: 11px; font-weight: 700; letter-spacing: 1px; }

/* ---------- GAME SCREEN ---------- */
#game-screen {
  padding-top: 0;
  flex-direction: column;
  align-items: stretch;
  background: #000;
}

#game-canvas { width: 100%; height: 100%; display: block; }

/* cinematic letterbox bars */
.letterbox {
  position: absolute;
  left: 0;
  width: 100%;
  height: 8vh;
  background: #000;
  z-index: 60;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.7, 0, 0.3, 1);
}

.letterbox-top { top: 0; transform: translateY(-100%); }
.letterbox-bottom { bottom: 0; transform: translateY(100%); }

#game-screen.letterboxed .letterbox-top { transform: translateY(0); }
#game-screen.letterboxed .letterbox-bottom { transform: translateY(0); }

.game-hud {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

/* broadcast "score bug" */
.hud-scoreboard {
  display: flex;
  align-items: center;
  background: rgba(6, 9, 15, 0.86);
  border: 1px solid var(--hairline);
  border-top: none;
  padding: 9px 26px 11px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 16px 100%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.hud-scoreboard::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent 35%, transparent 65%, var(--magenta));
}

.team-score { display: flex; align-items: center; gap: 12px; }

.team-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 3px;
}

.team-cyan .team-name { color: var(--cyan); }
.team-magenta .team-name { color: var(--magenta); }

.score-num {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  color: #fff;
  min-width: 30px;
  text-align: center;
}

.match-timer {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin: 0 22px;
  letter-spacing: 1px;
  padding: 0 14px;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}

.match-timer.overtime { color: var(--accent); }
.match-timer.pulse { animation: timer-pulse 0.9s ease; }

@keyframes timer-pulse {
  0%   { transform: scale(1); color: var(--text); }
  25%  { transform: scale(1.22); color: var(--red); }
  100% { transform: scale(1); color: var(--text); }
}

.ffa-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 86px;
}

.hud-label {
  color: var(--text-faint);
  font-size: 8px;
  letter-spacing: 2px;
  font-weight: 900;
  font-family: var(--font-display);
}

.ffa-cell span:last-child { font-weight: 700; font-size: 13px; font-family: var(--font-display); }

/* event feed */
#event-feed {
  position: absolute;
  top: 14px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 300px;
}

.feed-item {
  background: rgba(6, 9, 15, 0.78);
  border-left: 2px solid var(--accent);
  border-radius: 0 7px 7px 0;
  padding: 6px 11px;
  font-size: 12px;
  animation: feed-in 0.25s ease;
  transition: opacity 0.6s;
  color: var(--text-dim);
}

.feed-item b { color: var(--text); }
.feed-item.fading { opacity: 0; }

@keyframes feed-in {
  from { transform: translateX(-14px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* stat popups */
#stat-popups {
  position: absolute;
  top: 21%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.stat-popup {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 3px;
  font-style: italic;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7), 0 0 22px currentColor;
  animation: popup-rise 1.5s ease forwards;
  white-space: nowrap;
}

.popup-xp { font-size: 15px; color: var(--text); vertical-align: 7px; font-style: normal; }

@keyframes popup-rise {
  0%   { transform: translateY(14px) scale(0.6); opacity: 0; }
  12%  { transform: translateY(0) scale(1.12); opacity: 1; }
  22%  { transform: scale(1); }
  78%  { opacity: 1; }
  100% { transform: translateY(-26px); opacity: 0; }
}

/* boost meter */
.boost-meter-container {
  display: flex;
  align-items: center;
  gap: 11px;
  pointer-events: auto;
  background: rgba(6, 9, 15, 0.72);
  border: 1px solid var(--hairline);
  padding: 8px 17px 8px 9px;
  border-radius: 999px;
  position: absolute;
  bottom: 24px;
  right: 30px;
}

.boost-ring { position: relative; width: 48px; height: 48px; }
.boost-ring svg { width: 48px; height: 48px; transform: rotate(-90deg) scale(0.96); }
.boost-ring circle { fill: none; stroke-width: 5px; }
.boost-ring circle:first-child { stroke: rgba(255, 255, 255, 0.07); }

.boost-ring circle:last-child {
  stroke: var(--accent);
  stroke-dasharray: 251.2;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear, stroke 0.2s;
  stroke-linecap: round;
}

.boost-val {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.boost-label {
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-faint);
  font-family: var(--font-display);
}

#emoji-wheel-btn {
  pointer-events: auto;
  position: absolute;
  bottom: 24px;
  left: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--hairline);
  background: rgba(6, 9, 15, 0.72);
  cursor: pointer;
  color: var(--text-dim);
}

#emoji-wheel-btn:hover { color: var(--text); }
.font-size-emoji { font-size: 21px; }

/* emoji wheel */
.emoji-wheel-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
}

.emoji-wheel {
  position: relative;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: rgba(6, 9, 15, 0.9);
}

.emoji-option {
  position: absolute;
  width: 92px;
  height: 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  transform: translate(-50%, -50%);
}

.emoji-option:hover {
  background: var(--accent);
  color: #160e02;
  border-color: var(--accent);
  transform: translate(-50%, -50%) scale(1.12);
}

.emoji-option:nth-child(1) { top: 13%; left: 50%; }
.emoji-option:nth-child(2) { top: 26%; left: 81%; }
.emoji-option:nth-child(3) { top: 50%; left: 91%; }
.emoji-option:nth-child(4) { top: 74%; left: 81%; }
.emoji-option:nth-child(5) { top: 87%; left: 50%; }
.emoji-option:nth-child(6) { top: 74%; left: 19%; }
.emoji-option:nth-child(7) { top: 50%; left: 9%; }
.emoji-option:nth-child(8) { top: 26%; left: 19%; }

.emoji-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text-faint);
  font-family: var(--font-display);
}

/* GOAL: broadcast ribbon sweeping across the screen */
.goal-splash {
  position: absolute;
  top: 38%;
  left: 0;
  width: 100%;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.goal-splash.active { opacity: 1; visibility: visible; }

.goal-ribbon {
  background: linear-gradient(90deg, transparent 0%, rgba(6, 9, 15, 0.92) 12%, rgba(6, 9, 15, 0.92) 88%, transparent 100%);
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
  text-align: center;
  padding: 18px 0 20px;
  transform: translateX(-100%);
}

.goal-splash.active .goal-ribbon {
  animation: ribbon-sweep 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ribbon-sweep {
  0%   { transform: translateX(-60%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.goal-splash-title {
  font-family: var(--font-display);
  font-size: 74px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 8px;
  color: #fff;
  line-height: 1;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.6), 0 0 44px var(--magenta);
}

.goal-splash.cyan-scored .goal-splash-title { text-shadow: 0 4px 0 rgba(0, 0, 0, 0.6), 0 0 44px var(--cyan); }

.goal-splash-subtitle {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 9px;
  letter-spacing: 1.5px;
  font-family: var(--font-display);
}

/* overtime banner */
.ot-banner {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 6px;
  color: var(--accent);
  text-shadow: 0 0 28px rgba(255, 201, 77, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 85;
  white-space: nowrap;
}

.ot-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* spectate banner */
.spectate-banner {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 9, 15, 0.82);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  display: flex;
  gap: 8px;
  z-index: 60;
  font-family: var(--font-display);
  color: var(--text-dim);
}

#spectate-name { color: var(--accent); }

/* hint */
.hint-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 90;
  background: rgba(0, 0, 0, 0.5);
}

.hint-box {
  background: var(--panel-solid);
  border: 1px solid var(--hairline-strong);
  border-radius: 16px;
  padding: 26px 34px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
}

.hint-box h3 {
  font-family: var(--font-display);
  letter-spacing: 5px;
  font-size: 14px;
  margin-bottom: 18px;
  color: var(--accent);
}

.hint-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px 16px;
  text-align: left;
  font-size: 14px;
  margin-bottom: 18px;
  color: var(--text-dim);
}

.hint-key {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 1px;
}

.hint-dismiss {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 2px;
  animation: pulse-loader 1.2s infinite alternate;
}

/* ---------- RESULTS ---------- */
.results-box {
  background: var(--panel-solid);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 28px 36px;
  max-width: 540px;
  width: 92%;
  margin: auto;
  text-align: center;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: pop-up 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-height: calc(100vh - 86px);
  overflow-y: auto;
}

@keyframes pop-up {
  0%   { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.results-box h1 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  font-style: italic;
  margin-bottom: 4px;
  letter-spacing: 5px;
}

.results-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
  letter-spacing: 2px;
  font-family: var(--font-display);
}

.results-mvp {
  background: rgba(255, 201, 77, 0.07);
  border: 1px solid rgba(255, 201, 77, 0.45);
  border-radius: 11px;
  padding: 10px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 13px;
  font-family: var(--font-display);
}

.mvp-bonus { font-size: 10px; color: var(--text-dim); }

.results-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
}

.rewards-card {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 15px 17px;
  margin-bottom: 12px;
  text-align: left;
}

.rewards-card h3 {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 2.5px;
  margin-bottom: 10px;
  text-align: center;
  font-family: var(--font-display);
}

.rewards-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 7px;
  color: var(--text-dim);
}

.reward-val { font-weight: 700; color: var(--text); font-family: var(--font-display); }
.cyber-divider { border: none; border-top: 1px solid var(--hairline); margin: 10px 0; }
.total-row { font-size: 14px; font-weight: 900; color: var(--text); }

.xp-card {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 13px 17px;
  margin-bottom: 16px;
}

.xp-row { display: flex; align-items: center; gap: 14px; }

.xp-level-badge {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(160deg, #1a2538, #0b1220);
  border: 1px solid var(--hairline-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.xp-bar-col { flex: 1; }

.xp-bar {
  height: 9px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 5px;
}

.xp-bar-text {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: var(--font-display);
}

.results-buttons { display: flex; gap: 10px; }
.results-buttons > * { flex: 1; }

/* ---------- LEVEL UP ---------- */
.levelup-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.levelup-box {
  text-align: center;
  background: var(--panel-solid);
  border: 1px solid rgba(255, 201, 77, 0.65);
  border-radius: 20px;
  padding: 34px 58px;
  box-shadow: 0 0 70px rgba(255, 201, 77, 0.3);
}

.levelup-overlay.pop .levelup-box { animation: levelup-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.4); }

@keyframes levelup-pop {
  0%   { transform: scale(0.4) rotate(-3deg); opacity: 0; }
  60%  { transform: scale(1.07) rotate(1deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.levelup-burst {
  font-size: 36px;
  color: var(--accent);
  animation: pulse-loader 0.7s infinite alternate;
}

.levelup-box h1 {
  font-family: var(--font-display);
  font-size: 38px;
  font-style: italic;
  letter-spacing: 5px;
  margin: 8px 0;
  color: #fff;
  text-shadow: 0 0 26px rgba(255, 201, 77, 0.8);
}

.levelup-title { margin-top: 10px; font-weight: 700; letter-spacing: 1.5px; font-size: 14px; font-family: var(--font-display); }

/* ---------- MODALS ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
}

.modal-box {
  background: var(--panel-solid);
  border: 1px solid var(--hairline-strong);
  border-radius: 18px;
  padding: 26px 32px;
  min-width: 340px;
  max-width: 480px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: pop-up 0.3s ease;
}

.modal-box h2 {
  font-family: var(--font-display);
  letter-spacing: 5px;
  font-size: 16px;
  margin-bottom: 18px;
  text-align: center;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 700;
  gap: 24px;
  color: var(--text-dim);
}

.setting-row input[type="range"] { width: 150px; accent-color: var(--accent); }
.setting-row input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--accent); cursor: pointer; }

.setting-row select {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 7px;
  padding: 6px 10px;
  font-family: var(--font-body);
  outline: none;
}

#settings-close-btn, #stats-close-btn { width: 100%; margin-top: 8px; }

.pause-box { display: flex; flex-direction: column; gap: 9px; min-width: 300px; }
.pause-note { text-align: center; font-size: 10.5px; color: var(--text-faint); margin: -10px 0 8px; letter-spacing: 1px; }

.stats-player-line { text-align: center; margin-bottom: 15px; font-size: 13px; color: var(--text-dim); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat-cell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}

.stat-val { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--accent); }
.stat-key { font-size: 8.5px; color: var(--text-faint); letter-spacing: 1px; margin-top: 3px; font-weight: 700; }

/* ---------- TOASTS ---------- */
#toast-container {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 400;
  pointer-events: none;
}

.toast {
  background: var(--panel-solid);
  border: 1px solid var(--hairline-strong);
  border-radius: 11px;
  padding: 11px 22px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.3s ease;
  transition: opacity 0.5s;
  max-width: 90vw;
}

.toast.fading { opacity: 0; }
.toast-success { border-color: rgba(94, 232, 164, 0.6); }
.toast-error   { border-color: rgba(255, 82, 82, 0.6); }
.toast-info    { border-color: var(--hairline-strong); }

@keyframes toast-in {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ---------- SCROLLBARS ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------- SMALL SCREENS (1366×768 Chromebooks) ---------- */
@media (max-width: 1440px) {
  .menu-layout { grid-template-columns: 286px 1fr 296px; gap: 14px; padding: 4px 20px 18px; }
  .menu-card { padding: 15px; }
  .garage-body { grid-template-columns: 1fr 440px; }
  .goal-splash-title { font-size: 56px; }
}

@media (max-height: 800px) {
  #top-bar { padding: 7px 22px; }
  .screen { padding-top: 54px; }
  .mode-desc { display: none; }
  .mode-option { padding: 8px 11px; }
  .mode-icon { width: 34px; height: 34px; }
  .controls-guide { display: none; }
  .results-box { padding: 18px 26px; }
  .results-box h1 { font-size: 32px; }
}
