:root {
  --bg: #12100e;
  --bg-elev: #1c1915;
  --bg-press: #262119;
  --ink: #f4efe6;
  --muted: #b7aa96;
  --gold: #d4b15a;
  --gold-soft: rgba(212, 177, 90, 0.16);
  --live: #e24a3b;
  --ok: #8fbf73;
  --err: #e07a6a;
  --line: rgba(244, 239, 230, 0.1);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --safe-top: max(20px, env(safe-area-inset-top));
  --safe-bottom: max(20px, env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 50% -10%, #2a2218 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

#app {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--safe-top) 20px var(--safe-bottom);
}

.view {
  width: min(720px, 100%);
}

.brand,
.top {
  text-align: center;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
}

h1 {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: 0.01em;
}

.lede {
  margin: 10px 0 0;
  color: var(--muted);
}

.dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 36px 0 18px;
}

.dots span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: transparent;
  transition: background 0.12s ease, transform 0.12s ease;
}

.dots span.filled {
  background: var(--gold);
  transform: scale(1.05);
}

.dots.shake {
  animation: shake 0.35s ease;
}

@keyframes shake {
  25% {
    transform: translateX(-8px);
  }
  50% {
    transform: translateX(8px);
  }
  75% {
    transform: translateX(-4px);
  }
}

.error {
  min-height: 1.4em;
  margin: 0 0 16px;
  text-align: center;
  color: var(--err);
}

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}

.pad button {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-elev);
  font-size: 1.7rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.pad button:active {
  background: var(--bg-press);
  transform: translateY(1px);
}

.pad button.ghost {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  box-shadow: none;
  background: transparent;
}

.pad button:disabled {
  opacity: 0.5;
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6d6458;
}

.badge.ok::before {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

.badge.live {
  color: #ffd7d3;
  border-color: rgba(226, 74, 59, 0.45);
}

.badge.live::before {
  background: var(--live);
  box-shadow: 0 0 10px var(--live);
}

.banner {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(224, 122, 106, 0.12);
  border: 1px solid rgba(224, 122, 106, 0.3);
  color: #f3c7bf;
}

.scenes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  .scenes {
    grid-template-columns: 1fr 1fr;
  }
}

.scene-btn {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #241f19 0%, #18150f 100%);
  box-shadow: var(--shadow);
  padding: 24px;
}

.scene-btn svg {
  width: 48px;
  height: 48px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 1.7;
}

.scene-btn .name {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: clamp(2rem, 7vw, 3rem);
}

.scene-btn .hint {
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.scene-btn.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, #2c2418 0%, #1b160f 100%);
  box-shadow: var(--shadow), 0 0 0 6px var(--gold-soft);
}

.scene-btn:active {
  transform: translateY(1px);
}

.scene-btn:disabled {
  opacity: 0.65;
}

.logout {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
