:root {
  color-scheme: dark;
  --bg: #08111d;
  --panel: rgba(11, 20, 35, 0.72);
  --panel-strong: rgba(8, 15, 27, 0.88);
  --line: rgba(175, 216, 255, 0.18);
  --text: #eef5ff;
  --muted: rgba(215, 227, 244, 0.72);
  --accent: #85e7ba;
  --accent-2: #ffcb6b;
  --home: #89dcff;
  --away: #ff8a8a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 10%, rgba(59, 117, 160, 0.35), transparent 38%),
    radial-gradient(circle at 10% 20%, rgba(20, 92, 60, 0.24), transparent 24%),
    linear-gradient(180deg, #060c16 0%, #08111d 55%, #050a12 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#pitch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.chrome {
  position: absolute;
  inset: 16px 16px auto 16px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  pointer-events: none;
}

.brand {
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2.2rem);
  line-height: 1;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.45);
}

.scoreboard {
  min-width: 132px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14, 25, 40, 0.92), rgba(10, 18, 30, 0.82));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
  text-align: right;
  backdrop-filter: blur(14px);
}

.scoreboard-room {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scoreboard strong {
  display: block;
  font-size: clamp(1.5rem, 2.8vw, 2.6rem);
  line-height: 1;
}

.glass {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.join-panel {
  position: absolute;
  left: 16px;
  top: 104px;
  z-index: 4;
  width: min(340px, calc(100vw - 32px));
  padding: 16px;
  border-radius: 18px;
  display: grid;
  gap: 12px;
}

.join-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.join-panel input,
.join-panel select,
.join-panel button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 11px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
}

.join-panel button {
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, rgba(133, 231, 186, 0.26), rgba(133, 231, 186, 0.12));
}

.join-panel button:hover {
  border-color: rgba(133, 231, 186, 0.45);
}

.join-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.35;
}

.status-strip {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  min-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.phase-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(133, 231, 186, 0.3);
  background: rgba(133, 231, 186, 0.08);
  color: #d5ffe9;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.goal-banner {
  position: absolute;
  inset: 0;
  z-index: 5;
  margin: auto;
  width: min(560px, calc(100vw - 32px));
  height: fit-content;
  padding: 24px 26px;
  border-radius: 24px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  transform: translateY(-10px) scale(0.98);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.goal-banner strong {
  display: block;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  color: var(--accent-2);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.goal-banner.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.footer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.84rem;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .chrome {
    inset: 12px 12px auto 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .scoreboard {
    align-self: flex-end;
  }

  .join-panel {
    top: auto;
    bottom: 76px;
    width: min(360px, calc(100vw - 24px));
  }

  .status-strip {
    left: 12px;
    right: 12px;
    bottom: 12px;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .footer {
    display: none;
  }
}
