:root {
  --bg-0: #140904;
  --bg-1: #1f1108;
  --bg-2: #2a1810;
  --ink: #f2d9b8;
  --ink-dim: #b89778;
  --amber: #f0a350;
  --ember: #d96a3b;
  --rose: #c94a5a;
  --line: rgba(240, 200, 150, 0.12);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(120% 60% at 50% 0%, #3a1c0e 0%, transparent 60%),
    radial-gradient(120% 60% at 50% 100%, #2a1208 0%, transparent 55%),
    var(--bg-0);
}

.topbar {
  padding: max(env(safe-area-inset-top), 18px) 22px 8px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.title { font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; color: var(--ink-dim); }
.subtitle { font-weight: 700; font-size: 15px; color: var(--amber); text-transform: capitalize; }

.stage {
  position: relative;
  overflow: hidden;
}
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  font-size: 12px; color: var(--ink-dim); letter-spacing: 0.06em;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(20,10,4,0.6); backdrop-filter: blur(6px);
  transition: opacity 0.4s;
  pointer-events: none;
}
.hint.fade { opacity: 0; }

.dock {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  padding: 10px 14px max(env(safe-area-inset-bottom), 14px);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 100%);
  overflow-x: auto;
  scrollbar-width: none;
}
.dock::-webkit-scrollbar { display: none; }

.toy-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 180, 120, 0.04);
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 6px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  min-width: 68px;
}
.toy-btn .swatch {
  width: 28px; height: 28px; border-radius: 50%;
  box-shadow: inset -4px -6px 10px rgba(0,0,0,0.35), 0 4px 10px rgba(0,0,0,0.4);
}
.toy-btn[aria-pressed="true"] {
  background: rgba(240, 163, 80, 0.12);
  border-color: rgba(240, 163, 80, 0.5);
  transform: translateY(-2px);
}

#orientation-gate {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 80% at 50% 30%, #2a1208 0%, #0d0603 70%);
  padding: 24px;
}
#orientation-gate[hidden] { display: none; }
.gate-card {
  max-width: 320px; text-align: center;
  border: 1px solid var(--line);
  background: rgba(30, 15, 8, 0.7);
  border-radius: 22px;
  padding: 28px 22px;
}
.gate-emoji { font-size: 44px; margin-bottom: 10px; }
.gate-card h1 { margin: 0 0 8px; font-size: 20px; color: var(--amber); }
.gate-card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-dim); }
