:root {
  color-scheme: dark;
  --bg: #08090b;
  --line: #22252a;
  --line-hover: #3a3f47;
  --text: #c8ccd2;
  --muted: #7a808a;
  --accent: #6fa8ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.sim {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 24px;
}

.device {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.bezel {
  padding: 18px 14px 28px;
  border-radius: 30px;
  border: 1px solid #25282e;
  background: linear-gradient(#141619, #0c0d0f);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#screen {
  display: block;
  /* the board's exact size; a narrow phone scales it down a little to fit */
  width: min(368px, calc(100vw - 48px));
  height: auto;
  aspect-ratio: 368 / 448;
  border-radius: 6px;
  background: #000;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.caption {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.panel {
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel header p {
  margin: 2px 0 0;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.motion {
  display: flex;
  gap: 18px;
  align-items: center;
}

button {
  touch-action: manipulation;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15171b;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

button:hover {
  border-color: var(--line-hover);
}

button:active {
  transform: translateY(1px);
}

.pad {
  position: relative;
  width: 124px;
  height: 124px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle, #14171b 0%, #0b0c0e 72%);
  touch-action: none;
  cursor: grab;
}

.pad::before,
.pad::after {
  content: '';
  position: absolute;
  background: var(--line);
}

.pad::before {
  left: 50%;
  top: 8%;
  bottom: 8%;
  width: 1px;
}

.pad::after {
  top: 50%;
  left: 8%;
  right: 8%;
  height: 1px;
}

.pad-dot {
  position: absolute;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(111, 168, 255, 0.55);
}

.slider {
  display: grid;
  grid-template-columns: 62px 1fr 34px;
  gap: 10px;
  align-items: center;
  margin: 2px 0;
}

.slider span,
.slider output {
  color: var(--muted);
}

.slider output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px;
}

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

.hint {
  margin: 4px 0 0;
}

#stats {
  margin: 0;
}

/* phones: the screen on top, full width, the bench below it */
@media (max-width: 560px) {
  .sim {
    gap: 24px;
    padding: 14px 12px 40px;
  }

  .bezel {
    padding: 10px 10px 16px;
    border-radius: 24px;
  }

  .panel {
    width: 100%;
    max-width: 420px;
  }

  button {
    padding: 8px 13px;
  }
}

/* ?bare: only the screen, on black */
body.bare .panel,
body.bare .caption {
  display: none;
}

body.bare .sim {
  min-height: 100vh;
  align-items: center;
  padding: 0;
}

body.bare .bezel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

body.bare #screen {
  width: min(368px, 100vw);
  border-radius: 0;
}
