:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  --bar-height: 48px;
  --bar: rgba(12, 14, 22, 0.86);
  --text: #d9dee8;
  --muted: #8b93a3;
  --line: rgba(255, 255, 255, 0.12);
  --active: rgba(255, 255, 255, 0.12);
  --page: #07090f;
}
body[data-theme="light"] {
  --bar: rgba(255, 255, 255, 0.92);
  --text: #1f2933;
  --muted: #64748b;
  --line: #d5dae1;
  --active: #e4e8ee;
  --page: #e9ecf0;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  overflow: hidden;
  background: var(--page);
  color: var(--text);
  transition: background 0.7s ease;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 2px;
}
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 3;
  height: calc(var(--bar-height) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    background 0.7s ease,
    color 0.7s ease,
    border-color 0.7s ease;
}
.rooms {
  display: flex;
  gap: 2px;
  min-width: 0;
}
.tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.activity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
}
.activity[hidden] {
  display: none;
}
.activity input {
  width: 110px;
}
.rooms button,
.quiet {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border-radius: 16px;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    background 0.3s ease,
    color 0.3s ease;
}
.rooms button[aria-pressed="true"],
.quiet[aria-pressed="true"],
.quiet[aria-expanded="true"] {
  background: var(--active);
  color: var(--text);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.dot.water {
  background: radial-gradient(circle at 40% 35%, #a9b9d8, #2a3a66 70%);
}
.dot.plate {
  background: #fff;
  border: 2px solid #475569;
}
.dot.rose {
  background: conic-gradient(#8a2a3a, #c98a2b, #2f48a0, #6a45a0, #8a2a3a);
}
.panel {
  position: fixed;
  z-index: 3;
  top: calc(var(--bar-height) + env(safe-area-inset-top, 0px) + 8px);
  right: 8px;
  width: min(340px, calc(100vw - 16px));
  padding: 14px;
  display: grid;
  gap: 12px;
  border-radius: 14px;
  background: var(--bar);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.panel[hidden] {
  display: none;
}
.field {
  display: grid;
  gap: 6px;
}
.label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.segmented {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.segmented.wrap {
  flex-wrap: wrap;
}
.segmented button {
  flex: 1 0 auto;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
}
.segmented button[aria-pressed="true"] {
  background: var(--active);
  color: var(--text);
}
input[type="range"] {
  width: 100%;
  accent-color: #64748b;
}
.stage {
  position: fixed;
  inset: calc(var(--bar-height) + env(safe-area-inset-top, 0px)) 0 0 0;
}
.stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
.stage iframe.active {
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}
#start {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  height: 44px;
  padding: 0 28px;
  border-radius: 22px;
  background: var(--bar);
  border: 1px solid var(--line);
  color: var(--text);
  letter-spacing: 0.06em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.6s ease;
}
#start.leaving {
  opacity: 0;
  pointer-events: none;
}
.label output {
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0;
}
.narrow-only {
  display: none;
}
.rooms {
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
@media (max-width: 720px) {
  .activity {
    display: none;
  }
  .narrow-only {
    display: grid;
  }
  .rooms button .dot {
    display: none;
  }
}
@media (max-width: 420px) {
  .rooms button,
  .quiet {
    padding: 0 8px;
    gap: 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01s !important;
  }
}
