:root {
  --card-bg: rgba(15, 23, 42, 0.9);
  --card-border: rgba(255, 255, 255, 0.16);
  --text: #f8fafc;
  --muted: #cbd5e1;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #38bdf8;
  color: var(--text);
}

#gameContainer {
  position: fixed;
  inset: 0;
}

.split-divider {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 12px rgba(15, 23, 42, 0.6);
  z-index: 9;
  display: none;
  pointer-events: none;
}

.split-divider.visible {
  display: block;
}

.hud-top {
  position: fixed;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 10;
  pointer-events: none;
}

.brand {
  font-weight: 900;
  letter-spacing: 0.1em;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.team-bar {
  flex: 1;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.team-segment {
  height: 100%;
  transition: width 0.25s ease;
}

.icon-btn {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.78);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.hud-stats {
  position: fixed;
  top: 60px;
  left: 16px;
  display: flex;
  gap: 10px;
  z-index: 10;
  pointer-events: none;
}

.stat-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--card-border);
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
}

#minimap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 140px;
  height: 140px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 83, 45, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 10;
  pointer-events: none;
}

.banner-msg {
  position: fixed;
  top: 104px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 700;
  font-size: 0.92rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 12;
  pointer-events: none;
}

.banner-msg.visible {
  opacity: 1;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.card h1 {
  margin: 0 0 8px;
  font-size: 1.9rem;
}

.subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.mode-btn {
  flex: 1;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mode-btn.active {
  background: rgba(56, 189, 248, 0.24);
  border-color: #38bdf8;
  color: #ffffff;
}

.p2-options {
  margin-bottom: 4px;
}

.color-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.color-picker {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

.color-swatch {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.selected {
  transform: scale(1.15);
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.primary-btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  background: #facc15;
  color: #0f172a;
  font-weight: 900;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.primary-btn:hover {
  background: #fde047;
}

.primary-btn:active {
  transform: scale(0.98);
}

.controls-list {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  font-size: 0.8rem;
  color: var(--muted);
}

kbd {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
}
