:root {
  --amber: #f2d024;
  --ink: #0a0f1c;
  --panel: #0e1322;
  --text: #e8ecf5;
  --line: #5a6788;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

/* Header, 3D stage, controls: the stage takes whatever height is left. */
body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.bar {
  margin: 10px 12px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  padding: 8px 18px;
  background: var(--panel);
  border: 2px solid var(--amber);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  font-size: 13px;
}

.brand { color: var(--amber); font-weight: 700; letter-spacing: 0.14em; }
.credits { color: var(--amber); }
.credits:focus-visible { outline: 2px solid #5fd4f4; outline-offset: 2px; }
.status { margin-left: auto; color: #c9d2e3; }

.stage { position: relative; min-height: 0; }

#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px 10px;
}

.run { flex: 0 1 auto; }
.blend { flex: 1 1 260px; max-width: 420px; }

.run,
.blend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border: 2px solid var(--amber);
}

.dock button {
  min-width: 72px;
  min-height: 44px;
  padding: 0 14px;
  background: #1b2338;
  color: var(--text);
  border: 1px solid var(--line);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.dock button.primary,
.dock button[aria-pressed="true"] {
  background: var(--amber);
  border-color: var(--amber);
  color: #141413;
  font-weight: 700;
}

.output-wrap {
  flex: 1 1 140px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.output-wrap .label { color: #c9d2e3; }

.output {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 16px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.dot.blue { background: #2f6bff; }
.dot.red { background: #f0323c; }
.lost { color: #ffb86b; margin-left: 6px; }

.rules { flex-basis: 100%; font-size: 13px; color: #c9d2e3; }
.rules.match { color: #7cf29a; }
.rules.differ { color: #ffb86b; }

.slider { flex: 1 1 160px; display: flex; align-items: center; min-height: 44px; }
.slider input { width: 100%; accent-color: var(--amber); }

button:focus-visible, input:focus-visible {
  outline: 2px solid #5fd4f4;
  outline-offset: 2px;
}

.hint {
  flex-basis: 100%;
  margin: 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  color: #c9d2e3;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Short windows: give the height to the board. */
@media (max-height: 640px) {
  .hint { display: none; }
  .bar { margin-bottom: 6px; padding-block: 5px; }
  .dock { padding-block: 6px; }
  .run, .blend { padding-block: 5px; }
}
