@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@500;700;800&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --bg: #03110c;
  --bg-2: #0d1f18;
  --panel: #11251d;
  --panel-soft: rgba(13, 31, 24, 0.8);
  --border: #2a4a3d;
  --primary: #1fbf78;
  --primary-hover: #18a767;
  --accent: #d6b25e;
  --text: #eff9f4;
  --muted: #9dc4b3;
  --ok: #47d28f;
  --warn: #f3be56;
  --danger: #f98787;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-md: 0 20px 45px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", Arial, sans-serif;
  background: radial-gradient(circle at 15% -15%, rgba(31, 191, 120, 0.25), transparent 35%),
    radial-gradient(circle at 85% 0%, rgba(214, 178, 94, 0.2), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 15, 11, 0.96);
  overflow: auto;
}

.login-card {
  width: min(420px, 92vw);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-md);
}

.glass {
  backdrop-filter: blur(12px);
}

body.auth-locked #appShell,
body.auth-locked #loadingOverlay {
  display: none !important;
}

body.auth-locked #loginGate {
  display: flex !important;
}

body:not(.auth-locked) #loginGate {
  display: none !important;
}

body.auth-locked {
  overflow: hidden;
}

.login-card h2 {
  margin: 0 0 0.5rem;
}

.container {
  width: min(1200px, 94vw);
  margin: 0 auto;
  padding: 1.15rem 0;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-header {
  border-bottom: 1px solid var(--border);
  background: rgba(3, 16, 12, 0.92);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-logo {
  font-size: 1.4rem;
  font-family: "Outfit", "Source Sans 3", sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
}

.hero-panel {
  background: linear-gradient(160deg, rgba(17, 37, 29, 0.95), rgba(12, 30, 24, 0.88));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
}

.hero-copy h1 {
  font-family: "Outfit", "Source Sans 3", sans-serif;
  margin: 0;
  line-height: 1.2;
  font-size: 1.6rem;
}

.hero-copy p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  max-width: 76ch;
}

.hero-tags {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.26rem 0.7rem;
  font-size: 0.8rem;
  color: var(--text);
  background: rgba(13, 31, 24, 0.7);
}

.tag-accent {
  border-color: rgba(214, 178, 94, 0.45);
  color: #ffe1a4;
}

.section-title {
  margin: 0 0 0.55rem;
  font-family: "Outfit", "Source Sans 3", sans-serif;
  font-size: 1.05rem;
}

.section-subtitle {
  margin: 0 0 0.8rem;
}

.country-team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.selector-card {
  background: rgba(7, 19, 14, 0.74);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem;
}

.selector-card h4 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

.selector-actions {
  margin-top: 1rem;
}

.select-control,
.input-control {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select-control:focus,
.input-control:focus,
.textarea-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 191, 120, 0.18);
}

.match-meta {
  background: rgba(10, 35, 27, 0.85);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.teams-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem;
}

.team-block {
  text-align: center;
}

.team-shield {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(31, 191, 120, 0.25), rgba(214, 178, 94, 0.25));
  border: 2px solid rgba(214, 178, 94, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.team-name {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.vs-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

.kpi-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.kpi-value {
  margin: 0.3rem 0 0;
  font-weight: 700;
  font-size: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
}

.select-control,
.textarea-control,
.input-control {
  width: 100%;
  background: rgba(7, 19, 14, 0.86);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.btn-primary,
.btn-secondary {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 700;
}

.btn-primary {
  width: 100%;
  margin-top: 0.8rem;
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(7, 19, 14, 0.7);
  border-color: var(--border);
  color: var(--text);
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

.analysis-box {
  margin-top: 0.8rem;
  background: rgba(6, 18, 13, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  min-height: 140px;
}

.analysis-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.5rem;
}

.confidence-pill {
  display: inline-block;
  background: linear-gradient(120deg, var(--primary), #169a5f);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.badge.ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--ok);
}

.badge.warn {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warn);
}

.squad-table {
  margin-top: 0.75rem;
  max-height: 240px;
  overflow: auto;
}

.squad-table table {
  width: 100%;
  border-collapse: collapse;
}

.squad-table th,
.squad-table td {
  border-bottom: 1px solid rgba(157, 196, 179, 0.2);
  text-align: left;
  padding: 0.38rem 0.2rem;
  font-size: 0.82rem;
}

.squad-table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.status-chip {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.08rem 0.45rem;
  font-size: 0.72rem;
}

.status-chip.aktiv {
  color: var(--ok);
}

.status-chip.verletzt,
.status-chip.gesperrt {
  color: var(--warn);
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(1, 12, 9, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.loading-card {
  width: min(92vw, 420px);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.loading-bar {
  height: 4px;
  background: rgba(20, 36, 30, 0.95);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1rem;
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--primary);
  animation: slide 1.1s ease-in-out infinite;
}

@keyframes slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.status-line {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.status-line.ok {
  color: #4ade80;
}

.status-line.err {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.heatmap-grid table {
  width: 100%;
  border-collapse: collapse;
}

.heatmap-grid td {
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.35rem;
  text-align: center;
  font-size: 0.7rem;
}

@media (max-width: 980px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .country-team-grid {
    grid-template-columns: 1fr;
  }

  .header-row,
  .user-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-grid,
  .settings-row {
    grid-template-columns: 1fr;
  }
}
