:root {
  color-scheme: dark;
  --bg: #090d17;
  --ink: #f7f1df;
  --muted: #b8b3a4;
  --line: rgba(247, 241, 223, 0.16);
  --panel: rgba(18, 23, 35, 0.88);
  --cyan: #55e6ff;
  --gold: #f9c846;
  --green: #78e08f;
  --red: #ff6d6d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(9, 13, 23, 0.55), rgba(9, 13, 23, 0.9)),
    url("https://images.unsplash.com/photo-1462331940025-496dfbfc7564?auto=format&fit=crop&w=1800&q=80") center / cover fixed;
}

button,
input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

button {
  min-height: 46px;
  padding: 0.72rem 0.9rem;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    #232a37;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

button:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.65rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

input[type="range"] {
  accent-color: var(--cyan);
}

.primary {
  color: #101319;
  background: linear-gradient(135deg, var(--green), var(--gold));
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 14px;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10131b;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  cursor: none;
  touch-action: none;
}

.controls {
  display: grid;
  align-content: start;
  gap: 12px;
  height: 100%;
  overflow: auto;
  padding-right: 2px;
}

.sideHeader,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.sideHeader {
  padding: 14px;
}

.panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.panel.compact {
  gap: 8px;
}

.panel button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.panel span {
  color: var(--gold);
}

.kicker {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.05;
}

h2 {
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.42;
}

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

.scoreStrip span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.58rem 0.64rem;
  color: var(--muted);
  background: rgba(9, 13, 23, 0.72);
}

.scoreStrip strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
}

.segmented,
.joinRow {
  display: grid;
  gap: 8px;
}

.segmented {
  grid-template-columns: 1fr 1fr;
}

.joinRow {
  grid-template-columns: minmax(0, 1fr) auto;
}

.roomStatus,
.roomHelp {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.72rem;
  color: var(--muted);
  background: rgba(9, 13, 23, 0.54);
  font-weight: 850;
  line-height: 1.35;
}

.missionPanel {
  background:
    linear-gradient(145deg, rgba(85, 230, 255, 0.15), rgba(249, 200, 70, 0.07)),
    var(--panel);
}

.storePanel {
  background:
    linear-gradient(145deg, rgba(249, 200, 70, 0.12), rgba(120, 224, 143, 0.06)),
    var(--panel);
}

.hostMission {
  min-height: 52px;
  color: #081018;
  background:
    linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 0 26px rgba(120, 224, 143, 0.14);
}

.roomHelp {
  display: grid;
  gap: 8px;
}

.roomHelp strong {
  color: var(--ink);
}

.roomHelp button {
  justify-content: center;
}

.settingsGroup {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.saveStatus {
  border: 1px solid rgba(120, 224, 143, 0.22);
  border-radius: 8px;
  padding: 0.58rem 0.68rem;
  color: var(--green);
  background: rgba(120, 224, 143, 0.08);
  font-size: 0.86rem;
  font-weight: 850;
}

.skinShop {
  display: grid;
  gap: 10px;
}

.skinCard {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(9, 13, 23, 0.64);
}

.skinCard.equipped {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(249, 200, 70, 0.35), 0 0 28px rgba(249, 200, 70, 0.12);
}

.skinPreview {
  width: 86px;
  height: 54px;
  border-radius: 8px;
  background: #0b101e;
}

.skinInfo {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.skinName {
  font-weight: 1000;
}

.skinMeta {
  color: var(--muted);
  font-size: 0.82rem;
}

.skinCard button {
  min-height: 38px;
  padding: 0.5rem 0.65rem;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

[hidden] {
  display: none !important;
}

@media (max-width: 880px) {
  body {
    overflow: auto;
  }

  .app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
  }

  canvas {
    height: min(62vh, 620px);
  }

  .scoreStrip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
