:root {
  --arg-color: #75aadb;
  --esp-color: #d1495b;
  --bg: #10151a;
  --panel: #1a222b;
  --text: #e8edf2;
  --muted: #8a97a3;
  --accent: #3ddc84;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #263140;
}

header h1 {
  margin: 0;
  font-size: 1.25rem;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--panel);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  border: 1px solid #263140;
}

.team-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.team-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border: 1px solid #263140;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  font-weight: 600;
  transition: border-color 0.15s;
}
.team-link:hover { border-color: var(--accent); }
.team-link.argentina { border-top: 4px solid var(--arg-color); }
.team-link.spain { border-top: 4px solid var(--esp-color); }

form.tactics-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

select, button, input[type="text"], input[type="password"], input[type="number"] {
  font-size: 0.95rem;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #33414f;
  background: #0f151a;
  color: var(--text);
}

button {
  cursor: pointer;
  font-weight: 600;
  background: var(--accent);
  color: #06251a;
  border: none;
}
button:disabled {
  background: #33414f;
  color: var(--muted);
  cursor: not-allowed;
}
button.secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid #263140; }
th { color: var(--muted); font-weight: 500; }

.status-row { display: flex; gap: 1.5rem; margin-top: 0.75rem; }
.status-pill {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #0f151a;
  border: 1px solid #33414f;
  font-size: 0.85rem;
}
.status-pill.ready { border-color: var(--accent); color: var(--accent); }

#pitch-canvas {
  width: 100%;
  max-width: 840px;
  display: block;
  margin: 0 auto;
  background: #0b3d1f;
  border-radius: 8px;
}

.scoreboard {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.scoreboard .clock { font-size: 1rem; color: var(--muted); font-weight: 400; }
.scoreboard .argentina { color: var(--arg-color); }
.scoreboard .spain { color: var(--esp-color); }

#possession-indicator.argentina { color: var(--arg-color); }
#possession-indicator.spain { color: var(--esp-color); }
#possession-indicator.loose { color: var(--muted); }

.event-log {
  max-height: 140px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: var(--muted);
}

.stats-table td:not(:first-child) { text-align: center; }

.actions { display: flex; gap: 0.75rem; margin-top: 1rem; }

#goal-banner {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1000;
  visibility: hidden;
}
#goal-banner span {
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(61, 220, 132, 0.85), 0 0 4px #000;
  transform: scale(0.1);
  opacity: 0;
}
#goal-banner.show { visibility: visible; }
#goal-banner.show span {
  animation: goal-pop 1.8s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
@keyframes goal-pop {
  0% { transform: scale(0.1); opacity: 0; }
  35% { transform: scale(1.15); opacity: 1; }
  55% { transform: scale(1); opacity: 1; }
  85% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
