:root {
  color-scheme: dark;
  --bg: #101319;
  --panel: #181d26;
  --panel-strong: #202735;
  --line: #323b4d;
  --text: #eef4ff;
  --muted: #9eabc0;
  --blue: #2d7df0;
  --green: #2cc86f;
  --red: #f05050;
  --yellow: #ffd15c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 0 16px;
}

button.secondary {
  background: var(--panel-strong);
  border-color: var(--line);
}

button.danger {
  background: var(--red);
}

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

button[aria-pressed="true"] {
  background: var(--green);
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1016;
  color: var(--text);
  padding: 0 12px;
}

.app {
  display: grid;
  gap: 16px;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 100vh;
  padding: 16px;
}

.sidebar,
.stage,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.stage {
  display: grid;
  min-height: calc(100vh - 32px);
  overflow: hidden;
  place-items: center;
  position: relative;
}

.stage video {
  background: #05070a;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

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

.row {
  display: flex;
  gap: 8px;
}

.row > * {
  flex: 1;
}

.status-list {
  display: grid;
  gap: 8px;
}

.status {
  align-items: center;
  display: flex;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  flex: 0 0 auto;
}

.dot.on {
  background: var(--green);
}

.dot.wait {
  background: var(--yellow);
}

.room-code {
  background: #0d1016;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 10px 12px;
  text-align: center;
}

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

.player {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
}

.log {
  background: #0d1016;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  height: 150px;
  overflow: auto;
  padding: 10px;
}

.join {
  display: grid;
  gap: 12px;
  max-width: 420px;
  padding: 18px;
}

.controller {
  bottom: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  left: 16px;
  pointer-events: none;
  position: absolute;
  right: 16px;
}

.pad,
.actions {
  align-items: center;
  display: grid;
  gap: 8px;
  pointer-events: auto;
}

.pad {
  grid-template-columns: repeat(3, 58px);
  grid-template-rows: repeat(3, 58px);
  justify-content: start;
}

.pad button,
.actions button {
  border-radius: 999px;
  min-height: 58px;
  padding: 0;
}

.pad [data-control="up"] {
  grid-column: 2;
}

.pad [data-control="left"] {
  grid-column: 1;
  grid-row: 2;
}

.pad [data-control="right"] {
  grid-column: 3;
  grid-row: 2;
}

.pad [data-control="down"] {
  grid-column: 2;
  grid-row: 3;
}

.actions {
  grid-template-columns: repeat(2, 72px);
  justify-content: end;
}

.actions button {
  min-height: 72px;
}

.video-empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 58vh;
  }
}
