:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --bg2: #11151c;
  --panel: rgba(12, 15, 20, 0.75);
  --line: rgba(255, 255, 255, 0.15);
  --text: #eef2f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(157, 36, 48, 0.2), transparent 35%),
    radial-gradient(circle at 80% 60%, rgba(143, 37, 21, 0.15), transparent 40%),
    linear-gradient(150deg, var(--bg), var(--bg2));
}

#game {
  width: 100vw;
  height: 100vh;
  display: block;
}

#hud {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  z-index: 10;
}

.panel {
  min-width: 260px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
}

.panel h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.5px;
}

.panel p {
  margin: 6px 0 0;
  opacity: 0.9;
}

#scoreboard {
  max-width: 360px;
  text-align: left;
}

#scoreboard .score-title {
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.4px;
}

#scoreboard .score-row {
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#scoreboard .score-row.me {
  font-weight: 700;
  color: #f8fafc;
}
#join-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 20;
}

#join-form {
  background: #10151d;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 8px;
  min-width: 300px;
}

#join-form input,
#join-form button {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

#join-form input {
  background: #0b0f15;
  color: var(--text);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#join-form button {
  cursor: pointer;
  background: linear-gradient(135deg, #dc2626, #be123c);
  color: #fff;
  border: none;
}

#join-form button.secondary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

@media (max-width: 720px) {
  #hud {
    flex-direction: column;
    right: auto;
  }

  .panel {
    min-width: 0;
    width: calc(100vw - 24px);
  }
}

#quality-select {
  pointer-events: auto;
  background: #0b0f15;
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  padding: 2px 6px;
}


.rooms-browser {
  margin-top: 6px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 8px;
  background: rgba(8, 12, 18, 0.55);
}

.rooms-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  color: #dbeafe;
}

#join-form button.mini {
  padding: 4px 8px;
  font-size: 12px;
  background: #334155;
}

.rooms-list {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
  font-size: 13px;
}

.room-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255,255,255,0.08);
}

.room-code {
  font-weight: 600;
  letter-spacing: 0.4px;
}

.room-meta {
  color: #cbd5e1;
}

.room-join {
  padding: 5px 8px;
  border-radius: 6px;
  border: none;
  background: #0ea5e9;
  color: white;
  cursor: pointer;
}

.room-join:disabled {
  background: #475569;
  cursor: not-allowed;
}

#info-panel.is-hidden {
  display: none;
}

#toggle-info {
  pointer-events: auto;
  align-self: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(9, 14, 22, 0.8);
  color: #e5e7eb;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

#toggle-info:hover {
  background: rgba(20, 29, 43, 0.9);
}
.shadow-option {
  pointer-events: auto;
}

.shadow-option label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#shadow-toggle {
  pointer-events: auto;
}