/* client/src/theme.css */
:root {
  --bg: #0b0e14;
  --surface: #141a26;
  --surface-2: #1c2434;
  --line: #2a3448;
  --text: #e8ecf3;
  --muted: #9fb0c9;
  --accent: #ffc93c;
  --accent-ink: #1a1405;
  --go: #4ade80;
  --danger: #f87171;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html, body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
}

body {
  -webkit-tap-highlight-color: transparent;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

button {
  font: inherit;
  color: inherit;
}

input, select, textarea {
  font: inherit;
}

.app {
  max-width: 860px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 0 6rem;
}

.topbar {
  position: sticky;
  z-index: 40;
  display: flex;
  border-bottom: 1px solid var(--line);
  background: #0b0e14f5;
  align-items:  center;
  gap: .5rem;
  padding: .55rem .75rem;
  top: 0;
}

.topbar .brand {
  letter-spacing: .01em;
  display: flex;
  align-items:  center;
  gap: .45rem;
  margin-right: auto;
  font-weight: 800;
}

.topbar .brand small {
  color: var(--muted);
  font-weight: 600;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  border-radius: 999px;
  padding: .5rem .95rem;
  font-weight: 650;
  line-height: 1.15;
}

.btn:active {
  transform: scale(.98);
}

.btn:disabled {
  opacity: .45;
  cursor: default;
  transform: none;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.go {
  background: var(--go);
  border-color: var(--go);
  color: #06230f;
}

.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
  background: none;
}

.btn.ghost {
  background: none;
}

.btn.small {
  padding: .32rem .7rem;
  font-size: .88rem;
}

.btn.big {
  border-radius: 16px;
  width: 100%;
  padding: .85rem 1.4rem;
  font-size: 1.08rem;
}

.btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.banner {
  border-radius: var(--radius);
  color: #ffe9a8;
  display: flex;
  background: #3a2c07;
  border: 1px solid #8a6d1f;
  justify-content: space-between;
  align-items:  center;
  gap: .6rem;
  margin: .6rem .75rem 0;
  padding: .6rem .8rem;
  font-size: .95rem;
}

.errorbar {
  border-radius: var(--radius);
  color: #fecaca;
  background: #3d1214;
  border: 1px solid #7c2328;
  margin: .6rem .75rem 0;
  padding: .6rem .8rem;
  font-size: .95rem;
}

.toast {
  position: fixed;
  z-index: 90;
  border: 1px solid var(--line);
  color: var(--text);
  text-align: center;
  background: #22304a;
  border-radius: 999px;
  max-width: 92vw;
  padding: .65rem 1rem;
  font-weight: 650;
  bottom: 5.2rem;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 10px 30px #00000080;
}

.stage-wrap {
  position: relative;
  margin: .6rem .75rem 0;
}

.stage-box {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: #000;
  border-radius: 18px;
  width: 100%;
}

.stage-box canvas {
  display: block;
  width: 100%;
  height: auto;
}

.stage-empty {
  aspect-ratio: 16 / 9;
  display: flex;
  text-align: center;
  color: var(--muted);
  background: radial-gradient(120% 120% at 50% 0%, #182236 0%, #0b0e14 70%);
  flex-direction: column;
  justify-content: center;
  align-items:  center;
  gap: .8rem;
  padding: 1.2rem;
}

.callout {
  text-align: center;
  color: var(--text);
  padding: .55rem .75rem 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.callout .sub {
  display: block;
  color: var(--muted);
  margin-top: .15rem;
  font-size: .9rem;
  font-weight: 550;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .6rem .75rem 0;
}

.action-row .btn {
  flex: auto;
}

.statusline {
  color: var(--muted);
  min-height: 1.2em;
  padding: .45rem .9rem 0;
  font-size: .92rem;
}

.statusline b {
  color: var(--text);
}

.lights-pill {
  position: fixed;
  z-index: 60;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: grab;
  touch-action: none;
  border: none;
  border-radius: 999px;
  padding: .7rem 1.05rem;
  font-weight: 800;
  right: .65rem;
  box-shadow: 0 8px 24px #0000008c;
}

.lights-pill:active {
  cursor: grabbing;
}

.hint-bubble {
  position: fixed;
  z-index: 61;
  border: 1px solid var(--line);
  color: var(--text);
  background: #22304a;
  border-radius: 12px;
  max-width: 240px;
  padding: .6rem .75rem;
  font-size: .9rem;
  font-weight: 600;
  right: .65rem;
  box-shadow: 0 10px 30px #00000080;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: .7rem .75rem 0;
  padding: .9rem;
}

.panel h2 {
  margin: 0 0 .6rem;
  font-size: 1.05rem;
}

.panel h3 {
  margin: .9rem 0 .4rem;
  font-size: .98rem;
}

.panel p {
  color: var(--muted);
  line-height: 1.45;
}

.segments {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .8rem;
}

.segments .btn {
  flex: auto;
}

.field {
  margin: .55rem 0;
}

.field label {
  display: block;
  margin-bottom: .3rem;
  font-size: .95rem;
  font-weight: 650;
}

.field .hint {
  color: var(--muted);
  margin-top: .25rem;
  font-size: .85rem;
}

.input, select.input, textarea.input {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  width: 100%;
  padding: .6rem .7rem;
}

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

input[type="color"] {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 10px;
  width: 56px;
  height: 40px;
  padding: 2px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.swatch {
  cursor: pointer;
  border: 3px solid #0000;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
}

.swatch.on {
  border-color: #fff;
}

.chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.slider-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr 3.2rem;
  align-items:  center;
  gap: .6rem;
  margin: .45rem 0;
}

.slider-row .val {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.popout {
  position: fixed;
  z-index: 80;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  width: min(430px, 94vw);
  padding: .9rem;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 18px 50px #0009;
}

.popout h3 {
  margin: 0 0 .6rem;
}

.popout .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}

.popout .grid .btn {
  border-radius: 14px;
  padding: .85rem .5rem;
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: .5rem 0;
  padding: .7rem .8rem;
}

.card .row {
  display: flex;
  align-items:  center;
  gap: .55rem;
}

.card .row .grow {
  flex: 1;
  min-width: 0;
}

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

.small {
  font-size: .88rem;
}

.mono {
  font-variant-numeric: tabular-nums;
}

.signin {
  text-align: center;
  max-width: 430px;
  margin: 9vh auto 0;
  padding: 0 1.2rem;
}

.signin h1 {
  margin-bottom: .3rem;
  font-size: 1.7rem;
}

.signin p {
  color: var(--muted);
  line-height: 1.5;
}

.google-btn {
  display: inline-flex;
  color: #1f2430;
  cursor: pointer;
  background: #fff;
  border: none;
  border-radius: 999px;
  align-items:  center;
  gap: .6rem;
  margin-top: 1rem;
  padding: .8rem 1.5rem;
  font-size: 1.02rem;
  font-weight: 750;
}

.more-tag {
  border-top: 1px solid var(--line);
  margin-top: .8rem;
  padding-top: .55rem;
}

.more-tag > button {
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: .2rem 0;
  font-weight: 700;
}

.more-tag .body {
  color: var(--muted);
  padding-top: .4rem;
  font-size: .92rem;
  line-height: 1.5;
}

.hidden-controls-note {
  text-align: center;
  color: var(--muted);
  padding: .4rem;
  font-size: .88rem;
}

kbd.code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  letter-spacing: .3em;
  border-radius: 8px;
  padding: .1rem .5rem;
  font-size: 1.25rem;
  font-weight: 800;
}
