/* Root background / general look */
body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #1d283a 0, #020617 55%, #000 100%);
  color: var(--pico-color);
}

/* Container layouts */
.player-layout,
.admin-layout {
  padding-block: 2.5rem;
}

/* Headings and subtitles */
header h1 {
  margin-bottom: 0.25rem;
}

.subtitle {
  margin-top: 0;
  opacity: 0.8;
  font-size: 0.95rem;
}

/* Glass-card effect for main panels */
.card-glass,
article {
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.85)
  );
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.8);
}

/* Slightly lighter header area inside cards */
article > header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.tagline {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

/* Pills / labels */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.3;
}

.pill-muted {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: rgba(226, 232, 240, 0.8);
}

/* PLAYER PAGE --------------------------------------------------- */

.buzzer-card {
  margin-top: 1.5rem;
}

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

.buzzer-header h2 {
  margin: 0;
}

/* Big buzzer button */
.buzzer-button {
  width: 100%;
  height: min(55vh, 380px);
  margin-top: 1.25rem;
  border-radius: 1.5rem;
  font-size: clamp(2.2rem, 6vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  border: none;
  cursor: pointer;
  color: #f9fafb;
  text-shadow: 0 3px 8px rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at 30% 20%, #4ade80, #16a34a 55%, #14532d);
  box-shadow:
    0 22px 45px rgba(22, 163, 74, 0.45),
    inset 0 0 25px rgba(248, 250, 252, 0.12);
  transition:
    transform 0.07s ease,
    box-shadow 0.07s ease,
    background 0.12s ease;
}

.buzzer-button:active {
  transform: translateY(2px) scale(0.98);
  box-shadow:
    0 14px 25px rgba(22, 163, 74, 0.35),
    inset 0 0 15px rgba(248, 250, 252, 0.1);
}

/* RED when locked */
.buzzer-button.locked {
  background: radial-gradient(circle at 30% 20%, #f97373, #ef4444 55%, #7f1d1d);
  box-shadow:
    0 22px 45px rgba(239, 68, 68, 0.5),
    inset 0 0 25px rgba(254, 242, 242, 0.12);
}

/* BLUE when winner */
.buzzer-button.winner {
  background: radial-gradient(circle at 30% 20%, #60a5fa, #2563eb 55%, #1e3a8a);
  box-shadow:
    0 22px 45px rgba(37, 99, 235, 0.5),
    inset 0 0 25px rgba(239, 246, 255, 0.12);
}

/* Disabled look tweaks */
.buzzer-button:disabled {
  opacity: 0.75;
  cursor: default;
}

/* ADMIN PAGE ---------------------------------------------------- */

body.admin main.container {
  max-width: 1100px;
}

.admin-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

/* Grid: left controls / right scoreboard */
.admin-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 2fr);
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Round status layout */
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.status-grid .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.6;
}

.status-value {
  margin-top: 0.15rem;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Admin control buttons */
.admin-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.admin-buttons button {
  flex: 1 1 11rem;
}

/* Button color helpers (using Pico's color variables) */
button.primary {
  background-color: var(--pico-primary);
  color: var(--pico-primary-inverse);
}

button.secondary {
  background-color: var(--pico-secondary);
  color: #ffffff;
}

button.success {
  background-color: #16a34a;
  color: #ffffff;
}

button.warning {
  background-color: #ff4319;
  color: #ffffff;
}

button.contrast {
  background-color: var(--pico-contrast);
  color: var(--pico-contrast-inverse);
}

/* Small pill-like buttons in table */
.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  margin-right: 0.25rem;
}

.btn-xs:nth-child(1) {
  background-color: var(--pico-success);
  color: var(--pico-success-inverse);
}

.btn-xs:nth-child(2) {
  background-color: var(--pico-warning);
  color: var(--pico-warning-inverse);
}

.btn-xs:nth-child(3) {
  background-color: #ef4444;
  color: #f9fafb;
}

/* Table wrapper for horizontal scroll on small screens */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

/* SCOREBOARD VIEW ---------------------------------------------- */

.scoreboard-body {
  background: radial-gradient(circle at top, #0f172a 0, #020617 55%, #000 100%);
}

.scoreboard-layout {
  padding-block: 2.5rem;
  max-width: 900px;
}

.scoreboard-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.scoreboard-header h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
}

.scoreboard-card {
  padding-block: 1.5rem 2rem;
}

/* List styling */
.scoreboard-list {
  list-style: none;
  padding-left: 0;
  margin: 1.25rem 10 10;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scoreboard-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  background: radial-gradient(
    circle at top left,
    rgba(148, 163, 184, 0.25),
    rgba(15, 23, 42, 0.9)
  );
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.7);
}

.scoreboard-item.leader {
  background: radial-gradient(
    circle at top left,
    rgba(52, 211, 153, 0.35),
    rgba(15, 23, 42, 0.95)
  );
  border: 1px solid rgba(52, 211, 153, 0.5);
}

.scoreboard-rank {
  font-weight: 700;
  font-size: 1.1rem;
  opacity: 0.9;
}

.scoreboard-name {
  font-size: 1.3rem;
  font-weight: 600;
}

.scoreboard-score {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Empty state text */
.scoreboard-empty {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.75;
}

.team-info {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  font-size: 1.05rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.team-info div {
  margin-bottom: 0.25rem;
}

.remote-layout {
  padding-block: 2.5rem;
  max-width: 600px;
}

.remote-button-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (max-width: 500px) {
  .remote-button-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Lock status pill dynamic background is handled inline in JS;
   base pill visuals come from .pill + .pill-muted. */