:root {
  color-scheme: dark;
  --bg: #07070c;
  --ink: #e8fbff;
  --muted: #93a3ad;
  --cyan: #3df0ff;
  --magenta: #ff2bd6;
  --panel: #0c1016;
  --line: #1c3c44;
  font-family: "Segoe UI", Helvetica, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  min-height: 100%;
}

body.xr {
  display: block;
}

body.xr #shell,
body.xr #touch,
body.xr #boot {
  display: none;
}

#c {
  width: 100%;
  height: 100%;
  display: block;
  min-height: 100vh;
  background: var(--bg);
}

#shell {
  padding: 16px 16px 28px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow: auto;
  max-height: 100vh;
}

header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: 0.04em; }
h1 { font-size: 1.25rem; }
h2 { font-size: 0.78rem; text-transform: uppercase; color: var(--cyan); margin: 14px 0 8px; }
h3 { font-size: 0.85rem; color: var(--magenta); margin: 12px 0 8px; }
.credit, .fine, .guide p, #note, #owner-state { color: var(--muted); font-size: 0.86rem; line-height: 1.4; }
.credit { margin: 2px 0 0; }

button, input {
  font: inherit;
  color: var(--ink);
}

button {
  background: #10141c;
  border: 1px solid #5c2748;
  min-height: 44px;
  padding: 8px 12px;
  cursor: pointer;
}

button[aria-pressed="true"], button.on {
  border-color: var(--cyan);
  box-shadow: inset 0 0 0 1px var(--cyan);
}

button:disabled { opacity: 0.45; cursor: default; }

#enter-vr, #start, #results button {
  margin-left: auto;
  border-color: var(--cyan);
}

#start, #results button { width: 100%; margin: 12px 0; }

.cards { display: grid; gap: 8px; }
.cards button { text-align: left; }
.cards span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.row button { flex: 1; }
.wrap button { flex: 1 1 40%; }

input {
  background: #07070c;
  border: 1px solid var(--line);
  min-height: 44px;
  padding: 8px;
  width: 100%;
}

#owner-form { display: grid; gap: 8px; }
#note { min-height: 1.2em; color: var(--cyan); }

#boot, #fail {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 5;
  padding: 24px;
  text-align: center;
}

#fail { color: var(--magenta); }

#touch {
  position: fixed;
  inset: auto 0 0 0;
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-template-rows: 120px auto;
  gap: 8px;
  padding: 10px;
  pointer-events: none;
  z-index: 3;
}

#touch[hidden] { display: none; }

.stick, .look, .touch-buttons button { pointer-events: auto; }

.stick {
  width: 112px;
  height: 112px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  position: relative;
  grid-row: 1 / 3;
  align-self: end;
  background: rgba(7, 7, 12, 0.45);
}

.knob {
  width: 42px;
  height: 42px;
  margin: 35px;
  background: var(--cyan);
}

.look {
  justify-self: end;
  width: 88px;
  height: 72px;
  border: 1px dashed #5c2748;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(7, 7, 12, 0.25);
}

.touch-buttons { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 800px) {
  html, body { height: 100%; overflow: hidden; }
  body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 42vh) minmax(0, 1fr);
  }
  #shell {
    max-height: 42vh;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #playbar {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel);
    padding-bottom: 8px;
  }
  #c { min-height: 0; height: 100%; }
  header { flex-wrap: wrap; }
}

@media (pointer: coarse) {
  #touch { display: grid; }
}
