/* Guest room controls. Tokens and shared components live in /shared/tokens.css.
   Accents: pink for lights and the primary action, blue for the speaker (never more than two in one view). */

body { -webkit-tap-highlight-color: transparent; }

.loading { padding: var(--space-7) var(--space-5); text-align: center; color: var(--text-secondary); font-size: 16px; }

/* ---- Layout ---- */

.shell {
  max-width: 1120px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 48px) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
}

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
h1 { margin: var(--space-2) 0 0; font-size: clamp(2.25rem, 4vw, 3.5rem); }
.top-actions { display: flex; align-items: center; gap: var(--space-5); }
.clock { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-secondary); }

.offline {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-1);
  color: var(--warning);
  font-size: 15px;
  font-weight: 500;
}

.main { display: grid; gap: clamp(20px, 3vw, 32px); align-items: start; align-content: start; flex-grow: 1; }
@media (min-width: 900px) {
  .main.has-speaker { grid-template-columns: minmax(0, 1fr) 400px; }
}
@media (max-width: 899px) {
  .clock { display: none; }
}

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
h2 { margin: 0; font-size: 1.75rem; }
.count { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-top: var(--space-1); }
.head-actions { display: flex; gap: var(--space-2); }

/* ---- Lights ---- */

.lights { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }

.light {
  width: 100%;
  min-height: 120px;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
  transition: transform var(--dur-med) var(--ease-out), background-color var(--dur-med) var(--ease-standard), box-shadow var(--dur-med) var(--ease-standard);
}
button.light:hover:not(:disabled) { transform: translateY(-4px); background: var(--bg-2); box-shadow: var(--shadow-md); }
button.light:active:not(:disabled) { transform: scale(0.98); }
.light.on { background: var(--bg-2); }
.light.unavailable { opacity: 0.55; }

.light-row { display: flex; align-items: center; gap: var(--space-4); }
.bulb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-pill);
  background-color: var(--bg-3);
  background-image: var(--dot-texture);
  background-size: var(--dot-texture-size);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.light.on .bulb { background-color: var(--pink-500); background-image: none; color: var(--text-on-pastel); }
.light-name { font-size: 18px; font-weight: 700; line-height: 1.3; }
.light-status { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-top: 2px; }
.light.on .light-status { color: var(--pink-500); }

input[type="range"] { width: 100%; height: 32px; margin: 0; accent-color: var(--pink-500); }

/* ---- Speaker ---- */

.speaker {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.speaker-label { display: flex; align-items: center; gap: var(--space-2); }
.now { display: flex; align-items: center; gap: var(--space-4); }
.play {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--blue-500);
  color: var(--text-on-pastel);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-standard);
}
.play:hover:not(:disabled) { transform: translateY(-1px); background: var(--blue-300); }
.play:active:not(:disabled) { transform: scale(0.97); }
.play:disabled {
  background-color: var(--bg-3);
  background-image: var(--dot-texture);
  background-size: var(--dot-texture-size);
  color: var(--text-secondary);
}
.now-state { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.now-title { font-size: 22px; font-weight: 700; line-height: 1.3; margin-top: var(--space-1); overflow-wrap: anywhere; }
.now-sub { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.volume { display: flex; align-items: center; gap: var(--space-3); color: var(--text-secondary); }
.volume input[type="range"] { accent-color: var(--blue-500); }
.volume-value { width: 44px; text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.divider { height: 1px; background: var(--border-subtle); }
.presets { display: flex; flex-direction: column; gap: var(--space-2); }
.presets .eyebrow { margin-bottom: var(--space-1); }
.preset {
  min-height: 56px;
  padding: 10px var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.preset:hover { transform: translateY(-1px); background: var(--bg-2); border-color: var(--lavender-500); }
.preset:active { transform: scale(0.97); }
.preset-name { font-size: 16px; font-weight: 700; }
.preset-sub { font-size: 13px; color: var(--text-secondary); }

/* ---- Footer, ended screen ---- */

.foot { display: flex; justify-content: space-between; gap: var(--space-2) var(--space-5); flex-wrap: wrap; font-size: 14px; color: var(--text-secondary); }

.ended {
  min-height: 100dvh;
  max-width: 440px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  text-align: center;
}
.ended-icon {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-1);
  background-image: var(--dot-texture);
  background-size: var(--dot-texture-size);
  border: 1px solid var(--border-subtle);
  color: var(--lavender-500);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ended h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); margin: 0; }

.pair-form { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); margin-top: var(--space-2); }
.pair-code {
  height: 72px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  color: var(--text-primary);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.pair-code:focus { outline: none; border-color: var(--focus-ring); }
.ended .pair-error { min-height: 1.6em; font-size: 15px; color: var(--danger); }
.pass-input {
  height: 52px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  color: var(--text-primary);
  font-size: 15px;
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.pass-input:focus { outline: none; border-color: var(--focus-ring); }
.pass-input::placeholder { color: var(--text-muted); }
.ended-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.ended-actions:empty { display: none; }
.ended p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--text-secondary); }
