:root {
  color-scheme: dark;
  --bg: #09111f;
  --card: rgba(12, 24, 45, 0.88);
  --card-2: rgba(30, 58, 138, 0.38);
  --accent: #4ade80;
  --accent-2: #38bdf8;
  --danger: #fb7185;
  --text: #eff6ff;
  --muted: #bfd7ff;
  --amber: #fbbf24;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(74,222,128,0.18), transparent 24%),
    linear-gradient(180deg, #07101d, #0f172a 38%, #08111f);
  color: var(--text);
  min-height: 100vh;
}
button, input, select { font: inherit; }

.app-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-size: 0.8rem;
  margin-bottom: 8px;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(1.9rem, 4vw, 3rem); }
.hero-copy { margin: 0; color: var(--muted); max-width: 700px; }
.hero-pills { display: grid; gap: 8px; }

.pill {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  padding: 10px 14px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.pill.subtle { color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid rgba(191, 215, 255, 0.12);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.25);
  backdrop-filter: blur(14px);
}

.landing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-card h2, .status-card h2, .card h2 { margin: 0 0 12px; }

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

input, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(191, 215, 255, 0.16);
  background: rgba(6, 15, 28, 0.84);
  color: var(--text);
}

button {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #22c55e);
  color: #062414;
  font-weight: 800;
  padding: 12px 14px;
  cursor: pointer;
}
button.secondary {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.powerup-icon {
  background: transparent;
  border: 0;
}

.seeker-sprite-wrap,
.hider-sprite-wrap {
  background: transparent;
  border: 0;
}

.seeker-sprite,
.hider-sprite {
  width: 44px;
  height: 44px;
  position: relative;
}

.seeker-sprite img,
.hider-sprite img {
  width: 44px;
  height: 44px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.seeker-sprite-fallback {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  font-size: 1.5rem;
}

.seeker-sprite img[alt="Seeker"]:invalid + .seeker-sprite-fallback {
  display: grid;
}

.powerup-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  background: rgba(8, 17, 31, 0.88);
  border: 1px solid rgba(191, 215, 255, 0.2);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.3);
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.compact-row {
  align-items: center;
}
.block-gap { margin-top: 12px; }
.hidden { display: none !important; }
.hint { color: var(--muted); margin: 4px 0 0; }

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
  gap: 16px;
}

.sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

.map-card { padding: 14px; }
.room-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.room-badge, .facts div, .player-row {
  background: var(--card-2);
  border: 1px solid rgba(191, 215, 255, 0.08);
  border-radius: 16px;
  padding: 12px;
}
.room-badge span, .facts span { color: var(--muted); display: block; }
.room-badge strong, .facts strong { display: block; margin-top: 6px; }

#map {
  width: 100%;
  min-height: 72vh;
  border-radius: 18px;
  overflow: hidden;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.admin-dot {
  color: #062414;
  background: var(--accent);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.players-list, .events-list {
  display: grid;
  gap: 10px;
}
.player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.player-role[data-role="seeker"] { color: #fecdd3; }
.player-role[data-role="hider"] { color: #bbf7d0; }
.player-mode { color: var(--amber); font-size: 0.84rem; margin-top: 4px; }

.event-item {
  border-left: 4px solid var(--accent-2);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--muted);
}

.share-box {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}
#qrImage {
  width: 180px;
  height: 180px;
  background: white;
  padding: 10px;
  border-radius: 16px;
  object-fit: contain;
}

@media (max-width: 980px) {
  .landing, .game-layout, .room-strip, .admin-grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column; }
  .hero-pills { width: 100%; }
  #map { min-height: 52vh; }
}
