:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07111f;
  color: #e6f4ff;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 20%, #14233d, #050912 70%);
}

main {
  width: min(1120px, 96vw);
}

.panel {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(64, 169, 255, 0.18);
  border-radius: 16px;
  background: rgba(3, 12, 28, 0.62);
  backdrop-filter: blur(10px);
}

.title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}

h1, h2 {
  font-size: 22px;
  margin: 0;
}

input, button, select, .file-button {
  border: 1px solid #31506f;
  border-radius: 8px;
  background: #0b1929;
  color: #e6f4ff;
  padding: 8px 10px;
}

input[type="number"] {
  width: 76px;
}

button, .file-button {
  cursor: pointer;
}

button:hover, button.active, .file-button:hover {
  background: #164b7d;
  border-color: #40a9ff;
}

summary {
  cursor: pointer;
  color: #bfdbfe;
  margin-bottom: 8px;
}

#lobby {
  width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.controls-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
}

.controls-grid label,
.station-toggles label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c7d2fe;
}

.controls-grid label {
  min-width: 0;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.38);
}

.controls-grid label.check {
  justify-content: flex-start;
}

.controls-grid input,
.controls-grid select,
.controls-grid button,
.controls-grid .file-button {
  max-width: 100%;
  min-width: 0;
}

.controls-grid input[type="range"] {
  flex: 1 1 100%;
  width: 100%;
}

.station-toggles,
.controls,
.join-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.station-toggles {
  margin-top: 10px;
}

#status, #selectionInfo {
  margin: 0;
  color: #adc6ff;
}

.effects button {
  font-size: 12px;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  border: 1px solid #1d3b5d;
  border-radius: 16px;
  background: #020817;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}

.post-game {
  align-items: stretch;
}

.post-game h2,
.post-game h3 {
  width: 100%;
  margin: 0;
}

.stat-cards,
.plot-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.stat-card {
  min-width: 210px;
  border-left: 4px solid #40a9ff;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.78);
  border-radius: 10px;
  color: #dbeafe;
}

.plot-card {
  padding: 10px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  color: #dbeafe;
}

.plot-card svg {
  width: 100%;
  height: 150px;
  margin-top: 6px;
  background: rgba(2, 8, 23, 0.5);
  border-radius: 8px;
}

.plot-card small {
  display: block;
  color: #cbd5e1;
  line-height: 1.45;
}

[hidden] {
  display: none !important;
}
