:root {
  --bg: #0e1114;
  --panel: #171b20;
  --ink: #e8e4dc;
  --muted: #8a8780;
  --line: #2a3038;
  --accent: #c4f542;
  --danger: #ff5c5c;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
}

body {
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a2420 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #1c1820 0%, transparent 50%),
    var(--bg);
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 16px;
  gap: 12px;
}

.top {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.06em;
  line-height: 1;
}

.brand-sub {
  margin-left: 8px;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hint {
  margin: 0;
  flex: 1;
  min-width: 200px;
  color: var(--muted);
  font-size: 0.92rem;
}

.desk-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  font-size: 0.9rem;
}

.desk-link:hover {
  color: var(--accent);
}

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr minmax(160px, 200px);
  gap: 12px;
  min-height: 0;
}

@media (max-width: 820px) {
  .stage {
    grid-template-columns: 1fr;
  }
}

.viewport {
  position: relative;
  background: #050607;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: calc(100vh - 120px);
}

video,
#draw,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

video {
  transform: scaleX(-1);
  opacity: 0.88;
}

#draw,
#overlay {
  transform: scaleX(-1);
  pointer-events: none;
}

.gate {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  background: rgba(8, 10, 12, 0.72);
  backdrop-filter: blur(6px);
  z-index: 5;
  text-align: center;
  padding: 24px;
}

.gate.hidden {
  display: none;
}

.start-btn {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  padding: 14px 28px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  color: #111;
  cursor: pointer;
}

.start-btn:hover {
  filter: brightness(1.05);
}

.gate-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 28ch;
  justify-self: center;
}

.dock {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.swatch {
  aspect-ratio: 1;
  border-radius: 3px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 1px #000;
}

.size {
  display: grid;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.size input {
  width: 100%;
  accent-color: var(--accent);
}

.actions {
  display: grid;
  gap: 6px;
}

.actions button {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 8px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: #101418;
  color: var(--ink);
  cursor: pointer;
}

.actions button:hover {
  border-color: var(--accent);
}

.status {
  margin: 0;
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 2.4em;
}
