/* MEDC Invitational theme - matches https://medcesport.org */
:root {
  --bg: #070A12;
  --panel: #0D1223;
  --panel2: #0A0F1F;
  --text: #EAF0FF;
  --muted: #B7C3E6;
  --line: rgba(255, 255, 255, 0.10);
  --accent: #5EEAD4;
  --accent2: #60A5FA;
  --accent3: #F43F5E;
  --good: #22C55E;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  --radius: 18px;
  --radius2: 26px;
  --target: #5EEAD4;
  --target-glow: rgba(94, 234, 212, 0.35);
}

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

body {
  font-family: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(900px 420px at 18% 12%, rgba(96, 165, 250, 0.12), transparent 60%),
    radial-gradient(850px 420px at 82% 14%, rgba(244, 63, 94, 0.10), transparent 60%),
    radial-gradient(700px 380px at 55% 60%, rgba(94, 234, 212, 0.08), transparent 65%),
    linear-gradient(180deg, #050713, #070A12 35%, #060915 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header - MEDC brand */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.2s;
}

.brand:hover {
  opacity: 0.95;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.95), rgba(244, 63, 94, 0.95));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 18px 50px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(234, 240, 255, 0.95);
  line-height: 1.2;
}

.logo span {
  color: var(--accent);
  letter-spacing: 0.06em;
}

.brand small {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: none;
}

.stats-bar {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.stats-bar strong {
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

/* Kicker (MEDC style) */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.05)),
              linear-gradient(135deg, var(--accent2), var(--accent3));
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.35);
}

/* Card (MEDC panel style) */
.card {
  background: linear-gradient(180deg, rgba(13, 18, 35, 0.9), rgba(10, 15, 31, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    radial-gradient(600px 240px at 20% 0%, rgba(96, 165, 250, 0.15), transparent 62%),
    radial-gradient(620px 260px at 90% 0%, rgba(244, 63, 94, 0.12), transparent 62%),
    radial-gradient(520px 220px at 55% 60%, rgba(94, 234, 212, 0.08), transparent 70%);
  pointer-events: none;
  opacity: 0.85;
}

/* Screens */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.screen.active {
  display: flex;
}

/* Menu */
.menu-content {
  text-align: center;
  max-width: 720px;
  padding: 28px;
  position: relative;
}

.menu-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mode-card {
  background: rgba(7, 10, 18, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  position: relative;
}

.mode-card:hover {
  border-color: rgba(94, 234, 212, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(94, 234, 212, 0.12);
}

.mode-icon {
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
}

.mode-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.mode-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

.menu-footer {
  margin-top: 1rem;
  position: relative;
}

.sensitivity-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.sensitivity-label input[type="range"] {
  width: 120px;
  accent-color: var(--accent);
}

.tracking-diff-card .tracking-diff-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .difficulty-grid {
    grid-template-columns: 1fr;
  }
}

.back-pill,
.results-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1rem;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(13, 18, 35, 0.65);
  color: var(--muted);
  font-size: 13px;
  transition: all 0.2s;
}

.back-pill:hover,
.results-pill:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(13, 18, 35, 0.85);
}

/* Arena */
#arena {
  position: relative;
  padding: 0;
}

#gameArea {
  width: 100vw;
  height: calc(100vh - 60px);
  position: relative;
  cursor: crosshair;
}

.back-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  background: rgba(13, 18, 35, 0.9);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(13, 18, 35, 0.95);
}

.countdown {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 40px rgba(94, 234, 212, 0.5));
  z-index: 30;
  font-family: 'JetBrains Mono', monospace;
}

.countdown.hidden {
  display: none;
}

/* Targets - MEDC teal */
.target {
  position: absolute;
  border-radius: 50%;
  background: var(--target);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.3), 0 4px 20px var(--target-glow);
  cursor: pointer;
  transition: transform 0.05s, box-shadow 0.1s;
}

.target:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.5), 0 6px 28px var(--target-glow);
}

.target.hit {
  background: rgba(94, 234, 212, 0.7);
  transform: scale(0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.15s ease-out;
}

.target.tracking-target {
  background: linear-gradient(135deg, var(--accent) 0%, rgba(94, 234, 212, 0.8) 100%);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.35), 0 4px 24px var(--target-glow);
}

/* Results */
.results-content {
  padding: 28px;
  min-width: 320px;
  text-align: center;
  position: relative;
}

.results-content h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.results-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.results-pill {
  margin-top: 1rem;
  display: inline-flex;
}

.btn {
  padding: 10px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.btn.primary {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.95), rgba(244, 63, 94, 0.95));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.5);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.btn.secondary {
  background: rgba(13, 18, 35, 0.65);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn.secondary:hover {
  background: rgba(13, 18, 35, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Footer */
.footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: rgba(7, 10, 18, 0.5);
  backdrop-filter: blur(8px);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer-brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}

.footer-muted {
  color: var(--muted);
}

.footer-link {
  color: var(--accent);
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent2);
}
