:root {
  --sky-top: #17152c;
  --sky-mid: #10162a;
  --sky-low: #070a14;
  --facade: #3a2737;
  --facade-warm: #4a2e3e;
  --facade-cool: #252333;
  --facade-shadow: #171421;
  --trim: #11101a;
  --trim-light: #4a3342;
  --mortar: rgba(246, 206, 164, 0.08);
  --text: #f9ecd7;
  --muted: #b9c0cf;
  --dim: #697184;
  --line: rgba(255, 226, 190, 0.17);
  --panel: rgba(9, 11, 19, 0.74);
  --warm: #ffd07c;
  --gold: #ffe49c;
  --peach: #f58c65;
  --amber: #d98742;
  --rose: #a94e62;
  --plum: #6b3158;
  --teal: #6f9f8c;
  --ink: #1d1c2a;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background: #070a14;
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app,
.screen {
  min-height: 100vh;
}

.screen {
  position: relative;
  width: 100%;
}

.is-hidden,
.screen.is-hidden {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.menu-screen {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 38px;
  background:
    linear-gradient(90deg, rgba(3, 8, 18, 0.88) 0%, rgba(7, 12, 25, 0.72) 42%, rgba(8, 10, 18, 0.58) 100%),
    linear-gradient(180deg, rgba(7, 9, 17, 0.18), rgba(7, 9, 17, 0.96)),
    url("assets/windowlight-menu-hero.png") center / cover no-repeat,
    #070a14;
}

.menu-shell {
  width: min(1120px, 100%);
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid rgba(255, 228, 195, 0.13);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(8, 13, 27, 0.68), rgba(6, 9, 17, 0.46));
  box-shadow:
    0 36px 110px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 240, 218, 0.06);
  backdrop-filter: blur(8px);
}

.brand-block {
  max-width: 780px;
  margin-bottom: 34px;
}

.brand-logo {
  display: block;
  width: min(760px, 100%);
  height: auto;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.38));
}

.brand-block p {
  max-width: 520px;
  margin: 16px 0 0;
  color: #e2a47d;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.scene-card {
  position: relative;
  min-height: 250px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 218, 171, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(35, 31, 44, 0.84), rgba(12, 16, 29, 0.9));
  color: var(--text);
  text-align: left;
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 238, 213, 0.05);
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.scene-card.is-active {
  cursor: pointer;
}

.scene-card.is-active:hover,
.scene-card.is-active:focus-visible {
  border-color: rgba(255, 190, 118, 0.6);
  background:
    linear-gradient(180deg, rgba(68, 45, 58, 0.96), rgba(16, 20, 34, 0.98));
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 184, 107, 0.08);
  outline: none;
  transform: translateY(-2px);
}

.scene-card.is-disabled {
  color: var(--dim);
  cursor: not-allowed;
  opacity: 0.7;
}

.scene-card-preview {
  position: relative;
  height: 126px;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(255, 226, 188, 0.12);
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 204, 128, 0.12), transparent 28%),
    linear-gradient(180deg, #172035, #0a0e19);
}

.scene-preview-night-apartment {
  background:
    linear-gradient(180deg, rgba(7, 10, 18, 0.05), rgba(7, 10, 18, 0.18)),
    url("assets/night-apartment-preview.png") center 38% / cover no-repeat;
}

.scene-preview-night-apartment::before {
  content: "";
  position: absolute;
  inset: 14px 16px 16px;
  border: 4px solid #100d16;
  background:
    linear-gradient(90deg, transparent 0 12%, #ffd082 12% 22%, transparent 22% 34%, #ff8d62 34% 46%, transparent 46% 58%, #ffd082 58% 70%, transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(255, 218, 171, 0.04) 18px 20px, transparent 20px 39px),
    linear-gradient(180deg, #513448, #251f32);
  box-shadow:
    0 10px 0 #1b1421,
    0 15px 0 rgba(255, 189, 108, 0.08),
    0 0 28px rgba(255, 153, 82, 0.12);
}

.scene-preview-night-apartment::after {
  content: "";
  position: absolute;
  inset: 26px 30px 28px;
  background:
    linear-gradient(90deg, transparent 0 20%, #14101b 20% 23%, transparent 23% 47%, #14101b 47% 50%, transparent 50% 73%, #14101b 73% 76%, transparent 76%),
    linear-gradient(180deg, transparent 0 47%, #14101b 47% 52%, transparent 52%),
    radial-gradient(circle at 18% 64%, #11101a 0 7px, transparent 8px),
    radial-gradient(circle at 63% 58%, #11101a 0 8px, transparent 9px),
    radial-gradient(circle at 66% 72%, #11101a 0 11px, transparent 12px);
  opacity: 0.92;
}

.scene-preview-night-apartment::before,
.scene-preview-night-apartment::after {
  display: none;
}

.scene-preview-rainy-cafe::before {
  content: "";
  position: absolute;
  inset: 32px 18px 0;
  border-width: 4px;
  background:
    linear-gradient(90deg, #ff8d62 0 43%, transparent 43% 49%, #ffd082 49% 100%),
    #242133;
}

.scene-preview-forest-cabin::before {
  content: "";
  position: absolute;
  inset: auto 42px 0;
  height: 72px;
  border: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #263143;
}

.scene-preview-train-window::before {
  content: "";
  position: absolute;
  inset: 35% 0 auto;
  height: 30px;
  border: 0;
  background: linear-gradient(90deg, #101524, rgba(255, 196, 112, 0.35), #101524);
}

.scene-card-status {
  display: inline-flex;
  margin-bottom: 10px;
  color: #e4a77f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scene-card h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 720;
  letter-spacing: 0;
}

.scene-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.scene-card.is-disabled p {
  color: var(--dim);
}

.scene-screen {
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 15%, rgba(83, 63, 111, 0.34), transparent 34%),
    radial-gradient(circle at 75% 24%, rgba(121, 72, 106, 0.16), transparent 33%),
    linear-gradient(180deg, var(--sky-top), var(--sky-mid) 46%, var(--sky-low));
}

.scene-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.5px),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1.5px),
    radial-gradient(circle at 80% 40%, rgba(255, 255, 255, 0.36) 0 1px, transparent 1.5px);
  background-size: 31px 37px, 43px 47px, 53px 59px;
  mix-blend-mode: screen;
}

.night-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.star,
.moon {
  position: absolute;
  display: block;
  border-radius: 999px;
}

.star {
  width: 2px;
  height: 2px;
  background: rgba(245, 238, 216, 0.56);
  animation: slowPulse 10s ease-in-out infinite;
}

.star-one {
  top: 13%;
  left: 18%;
}

.star-two {
  top: 22%;
  right: 22%;
  animation-delay: -3s;
}

.star-three {
  top: 10%;
  right: 39%;
  animation-delay: -6s;
}

.moon {
  top: 7%;
  right: 12%;
  width: 50px;
  height: 50px;
  background: rgba(235, 210, 151, 0.84);
  box-shadow: 0 0 16px rgba(235, 210, 151, 0.1);
}

.moon::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -13px;
  width: 50px;
  height: 58px;
  border-radius: inherit;
  background: #1a1a2d;
}

.city-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.22;
}

.city-layer-back {
  height: 36vh;
  background:
    linear-gradient(90deg, transparent 0 6%, #111426 6% 12%, transparent 12% 18%, #15182b 18% 25%, transparent 25% 34%, #101426 34% 42%, transparent 42% 55%, #13172a 55% 64%, transparent 64% 74%, #101425 74% 84%, transparent 84%),
    linear-gradient(180deg, transparent, #080b15);
}

.city-layer-front {
  height: 28vh;
  opacity: 0.18;
  background:
    linear-gradient(90deg, #090d17 0 9%, transparent 9% 16%, #0b101d 16% 31%, transparent 31% 39%, #090e18 39% 50%, transparent 50% 60%, #0b0f1b 60% 73%, transparent 73% 80%, #090e19 80% 100%);
}

.rain-layer {
  position: absolute;
  inset: -20vh 0;
  opacity: 0.11;
  background-image:
    linear-gradient(115deg, transparent 0 48%, rgba(225, 221, 215, 0.58) 49% 50%, transparent 51% 100%),
    linear-gradient(115deg, transparent 0 53%, rgba(225, 221, 215, 0.28) 54% 55%, transparent 56% 100%);
  background-size: 92px 146px, 132px 188px;
  animation: rainDrift 30s linear infinite;
}

.rare-event {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.rare-plane {
  top: 17%;
  left: -90px;
  width: 74px;
  height: 16px;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(203, 197, 183, 0.5) 12% 86%, transparent 86%),
    linear-gradient(90deg, transparent 0 42%, rgba(203, 197, 183, 0.45) 42% 58%, transparent 58%);
  clip-path: polygon(0 45%, 62% 45%, 82% 0, 89% 45%, 100% 50%, 88% 57%, 80% 100%, 62% 57%, 0 57%);
  animation: rarePlane 36s linear forwards;
}

.rare-shooting-star {
  top: 13%;
  right: 8%;
  width: 112px;
  height: 2px;
  opacity: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 236, 196, 0), rgba(255, 236, 196, 0.8));
  transform: rotate(-24deg);
  animation: rareShootingStar 5.8s ease-out forwards;
}

.rare-balloon {
  left: 12%;
  bottom: 18%;
  width: 22px;
  height: 30px;
  opacity: 0;
  border-radius: 48% 48% 45% 45%;
  background: rgba(199, 94, 106, 0.58);
  box-shadow: inset -5px -7px 0 rgba(76, 34, 54, 0.18);
  animation: rareBalloon 42s ease-in-out forwards;
}

.rare-balloon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 28px;
  width: 1px;
  height: 42px;
  background: rgba(244, 218, 185, 0.28);
}

.rare-rooftop-cat {
  left: 63%;
  top: calc(50% - min(42vh, 395px) - 60px);
  width: 54px;
  height: 26px;
  opacity: 0;
  animation: rareRooftopCat 24s ease-in-out forwards;
}

.rare-rooftop-cat::before,
.rare-rooftop-cat::after {
  content: "";
  position: absolute;
  background: rgba(12, 12, 18, 0.82);
}

.rare-rooftop-cat::before {
  left: 7px;
  bottom: 0;
  width: 36px;
  height: 17px;
  border-radius: 50% 48% 42% 42%;
}

.rare-rooftop-cat::after {
  right: 2px;
  bottom: 9px;
  width: 20px;
  height: 5px;
  border-radius: 999px;
  transform: rotate(-28deg);
}

.rare-lightning {
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 70% 18%, rgba(207, 213, 255, 0.22), transparent 42%);
  animation: rareLightning 8s ease-in-out forwards;
}

.rare-train-light {
  left: -18%;
  bottom: 8%;
  width: 14%;
  height: 3px;
  opacity: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 213, 130, 0.76), rgba(255, 163, 105, 0.56), transparent);
  animation: rareTrainLight 30s linear forwards;
}

.rare-rooftop-light {
  left: 24%;
  top: calc(50% - min(42vh, 395px) - 24px);
  width: 18px;
  height: 18px;
  opacity: 0;
  border-radius: 999px;
  background: rgba(255, 190, 98, 0.72);
  box-shadow: 0 0 24px rgba(255, 175, 89, 0.28);
  animation: rareRooftopLight 32s ease-in-out forwards;
}

.scene-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: end center;
  padding: max(84px, 8vh) 28px calc(106px + env(safe-area-inset-bottom, 0px));
}

.building {
  position: relative;
  width: min(86vw, 1080px);
  height: min(78vh, 760px);
  min-height: 560px;
  padding: 92px 86px 112px;
  border: 1px solid rgba(255, 225, 185, 0.1);
  border-bottom: 0;
  background:
    linear-gradient(90deg, rgba(255, 227, 183, 0.04) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255, 227, 183, 0.035) 0 1px, transparent 1px 100%),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(255, 218, 171, 0.045) 30px 33px, transparent 33px 67px),
    linear-gradient(90deg, #262334 0%, var(--facade) 18%, var(--facade-warm) 48%, #35283d 72%, #211f30 100%);
  background-size: 82px 100%, 100% 72px, auto, auto;
  box-shadow:
    -32px 0 0 rgba(0, 0, 0, 0.08),
    32px 0 0 rgba(0, 0, 0, 0.13),
    0 38px 82px rgba(0, 0, 0, 0.48);
}

.building::before {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  top: 20px;
  height: 30px;
  background:
    linear-gradient(90deg, transparent 0 5%, #17101c 5% 13%, transparent 13% 17%, #17101c 17% 25%, transparent 25% 29%, #17101c 29% 37%, transparent 37% 41%, #17101c 41% 49%, transparent 49% 53%, #17101c 53% 61%, transparent 61% 65%, #17101c 65% 73%, transparent 73% 77%, #17101c 77% 85%, transparent 85% 100%),
    #231927;
  box-shadow:
    0 -17px 0 #090a10,
    0 19px 0 #312235,
    0 25px 0 rgba(255, 218, 171, 0.07);
}

.roofline {
  position: absolute;
  left: 9%;
  right: 9%;
  top: -58px;
  height: 58px;
  opacity: 0.9;
  overflow: visible;
}

.roofline::before,
.roofline::after,
.roofline span {
  content: "";
  position: absolute;
  bottom: 0;
  background: #0d0e16;
}

.roofline::before {
  left: 8%;
  width: 68px;
  height: 28px;
  border-radius: 5px 5px 0 0;
}

.roofline::after {
  right: 15%;
  width: 44px;
  height: 38px;
  border-radius: 22px 22px 0 0;
}

.roofline span:nth-child(1) {
  left: 3%;
  bottom: 10px;
  width: 2px;
  height: 38px;
  box-shadow: 10px -9px 0 -1px #0d0e16, -10px -4px 0 -1px #0d0e16;
}

.roofline span:nth-child(2) {
  left: 34%;
  width: 52px;
  height: 18px;
  border-radius: 4px 4px 0 0;
}

.roofline span:nth-child(3) {
  right: 3%;
  bottom: 8px;
  width: 2px;
  height: 42px;
  box-shadow: 9px -8px 0 -1px #0d0e16, -9px -4px 0 -1px #0d0e16;
}

.roofline span:nth-child(4) {
  left: 54%;
  width: 70px;
  height: 13px;
  border-radius: 3px 3px 0 0;
}

.roofline span:nth-child(4)::after {
  content: "";
  position: absolute;
  left: -260px;
  bottom: 18px;
  width: 360px;
  height: 30px;
  border-top: 2px solid rgba(20, 16, 24, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 10% 8%, #ffd47d 0 4px, transparent 5px),
    radial-gradient(circle at 24% 24%, #ffab68 0 4px, transparent 5px),
    radial-gradient(circle at 39% 31%, #ffd47d 0 4px, transparent 5px),
    radial-gradient(circle at 55% 27%, #ffab68 0 4px, transparent 5px),
    radial-gradient(circle at 72% 14%, #ffd47d 0 4px, transparent 5px),
    radial-gradient(circle at 89% 4%, #ffab68 0 4px, transparent 5px);
  filter: drop-shadow(0 0 5px rgba(255, 185, 94, 0.35));
}

.cornice {
  position: absolute;
  left: 8%;
  right: 8%;
  top: -14px;
  height: 18px;
  border-radius: 4px 4px 0 0;
  background: #111019;
  box-shadow:
    0 7px 0 #211724,
    0 15px 0 rgba(255, 218, 171, 0.07);
}

.facade-texture {
  position: absolute;
  inset: 84px 34px 96px;
  opacity: 0.46;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(255, 199, 148, 0.15) 7% 12%, transparent 12% 23%, rgba(255, 199, 148, 0.13) 23% 27%, transparent 27% 43%, rgba(255, 199, 148, 0.12) 43% 49%, transparent 49% 64%, rgba(255, 199, 148, 0.14) 64% 69%, transparent 69% 100%),
    repeating-linear-gradient(180deg, transparent 0 45px, rgba(15, 12, 21, 0.28) 45px 48px, transparent 48px 92px);
  background-size: 100% 82px, auto;
}

.drainpipe {
  position: absolute;
  top: 60px;
  bottom: 0;
  left: 38px;
  width: 5px;
  border-radius: 5px;
  background: rgba(15, 11, 19, 0.66);
}

.fire-escape {
  display: none;
}

.fire-escape::before,
.fire-escape::after,
.fire-escape span {
  content: "";
  position: absolute;
  background: #090a10;
}

.fire-escape::before {
  top: 0;
  bottom: 0;
  left: 26px;
  width: 3px;
}

.fire-escape::after {
  inset: 0 0 auto;
  height: 100%;
  background:
    repeating-linear-gradient(180deg, #090a10 0 3px, transparent 3px 58px),
    repeating-linear-gradient(130deg, transparent 0 18px, #090a10 18px 21px, transparent 21px 40px);
}

.fire-escape span {
  left: 0;
  right: 0;
  height: 4px;
}

.fire-escape span:nth-child(1) {
  top: 16%;
}

.fire-escape span:nth-child(2) {
  top: 48%;
}

.fire-escape span:nth-child(3) {
  top: 80%;
}

.entry-glow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 92px;
  height: 66px;
  background: linear-gradient(180deg, rgba(255, 203, 123, 0.2), rgba(255, 203, 123, 0.035));
  transform: translateX(-50%);
}

.window-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  grid-template-rows: repeat(4, minmax(92px, 1fr));
  gap: clamp(18px, 2.6vh, 26px) clamp(24px, 3.2vw, 38px);
  height: 100%;
}

.window {
  position: relative;
  isolation: isolate;
  transform-origin: center;
}

.lintel,
.sill {
  position: absolute;
  left: -12%;
  right: -12%;
  z-index: 0;
  display: block;
  background: var(--trim-light);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

.lintel {
  top: -12px;
  height: 12px;
  clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
}

.frame-curtain .lintel::after,
.frame-split .lintel::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -9px;
  height: 10px;
  background:
    repeating-linear-gradient(90deg, #7e3b55 0 12px, #e07a58 12px 22px, #44263f 22px 34px);
  clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%);
  opacity: 0.72;
}

.sill {
  bottom: -11px;
  height: 12px;
  clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%);
}

.room {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  overflow: hidden;
  border: 5px solid var(--trim);
  border-radius: 3px;
  background: #0d1322;
  box-shadow:
    inset 0 0 0 1px rgba(255, 243, 214, 0.08),
    0 14px 22px rgba(0, 0, 0, 0.3);
  transition:
    box-shadow 1000ms ease,
    filter 900ms ease,
    opacity 900ms ease;
}

.window.is-lit .room {
  box-shadow:
    0 0 18px rgba(255, 171, 85, 0.26),
    0 0 44px rgba(255, 129, 83, 0.08),
    inset 0 0 0 1px rgba(255, 244, 211, 0.14);
}

.window.is-changing .room {
  filter: saturate(1.06);
}

.frame-tall {
  padding-inline: 8%;
}

.frame-wide {
  padding-block: 4%;
}

.frame-balcony .sill {
  bottom: -17px;
  height: 18px;
}

.frame-balcony .sill::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -9px;
  height: 9px;
  background:
    repeating-linear-gradient(90deg, #14101b 0 4px, transparent 4px 14px),
    rgba(18, 14, 25, 0.8);
}

.frame-split .room {
  border-color: #0f0c15;
  box-shadow:
    0 0 0 4px rgba(91, 58, 66, 0.42),
    0 14px 22px rgba(0, 0, 0, 0.28);
}

.flower-box,
.mini-ac {
  position: absolute;
  z-index: 3;
  display: block;
}

.flower-box {
  left: 18%;
  right: 18%;
  bottom: -21px;
  height: 16px;
  border-radius: 2px 2px 7px 7px;
  background:
    radial-gradient(circle at 18% 10%, #8fb977 0 7px, transparent 8px),
    radial-gradient(circle at 38% 0%, #749d67 0 8px, transparent 9px),
    radial-gradient(circle at 62% 4%, #91b978 0 7px, transparent 8px),
    radial-gradient(circle at 82% 8%, #668e61 0 6px, transparent 7px),
    linear-gradient(180deg, #7b4636, #4d2e2c);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
}

.mini-ac {
  right: -8px;
  bottom: 18%;
  width: 36px;
  height: 25px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(180deg, rgba(22, 26, 37, 0.35) 0 2px, transparent 2px 5px),
    #5d6270;
  box-shadow:
    0 7px 0 rgba(0, 0, 0, 0.18),
    inset 0 0 0 2px rgba(18, 18, 26, 0.18);
}

.mini-scene {
  display: block;
  width: 100%;
  height: 100%;
  shape-rendering: geometricPrecision;
}

.svg-room-bg {
  fill: #111726;
}

.mini-scene-gold .svg-room-bg {
  fill: #f6b55e;
}

.mini-scene-amber .svg-room-bg {
  fill: #e58a52;
}

.mini-scene-peach .svg-room-bg {
  fill: #f39a67;
}

.mini-scene-rose .svg-room-bg {
  fill: #c66a68;
}

.mini-scene-dark .svg-room-bg {
  fill: #111727;
}

.svg-wall-texture {
  fill: none;
  stroke: rgba(92, 46, 43, 0.22);
  stroke-width: 3;
  stroke-linecap: round;
}

.mini-scene-dark .svg-wall-texture {
  stroke: rgba(130, 155, 189, 0.08);
}

.svg-floor {
  fill: rgba(93, 43, 42, 0.22);
}

.svg-dim {
  fill: rgba(4, 7, 14, 0.62);
}

.svg-pane {
  fill: none;
  stroke: rgba(25, 19, 27, 0.55);
  stroke-width: 3;
}

.svg-shelf path,
.svg-laptop path,
.svg-chair path,
.svg-frame-art,
.svg-table,
.svg-desk,
.svg-radio,
.svg-plant-box,
.svg-sill-inner {
  fill: rgba(70, 38, 39, 0.52);
  stroke: none;
}

.svg-shelf path {
  fill: none;
  stroke: rgba(70, 38, 39, 0.46);
  stroke-width: 4;
  stroke-linecap: round;
}

.svg-shelf rect:nth-of-type(1) {
  fill: #693a47;
}

.svg-shelf rect:nth-of-type(2) {
  fill: #c86d52;
}

.svg-shelf rect:nth-of-type(3) {
  fill: #29334a;
}

.svg-frame-art {
  fill: rgba(255, 228, 156, 0.12);
  stroke: rgba(83, 42, 42, 0.42);
  stroke-width: 3;
}

.svg-curtains path:first-child,
.svg-curtains path:nth-child(2) {
  fill: #793357;
}

.svg-curtains.is-closed path:first-child,
.svg-curtains.is-closed path:nth-child(2) {
  fill: #4b2847;
}

.svg-curtain-fold {
  fill: none;
  stroke: rgba(40, 21, 42, 0.28);
  stroke-width: 3;
}

.svg-blinds rect {
  fill: rgba(18, 24, 36, 0.48);
}

.svg-blinds path {
  fill: none;
  stroke: rgba(235, 219, 161, 0.68);
  stroke-width: 3;
}

.mini-scene-dark .svg-blinds path {
  stroke: rgba(117, 151, 192, 0.7);
}

.svg-lamp path,
.svg-pendant path {
  fill: rgba(255, 232, 160, 0.9);
  stroke: rgba(69, 38, 39, 0.55);
  stroke-width: 3;
  stroke-linejoin: round;
}

.svg-pendant path:first-child {
  fill: none;
  stroke-width: 2;
}

.svg-plant path:first-child {
  fill: #744332;
}

.svg-plant path:not(:first-child) {
  fill: var(--teal);
}

.svg-mug path {
  fill: rgba(255, 237, 189, 0.76);
  stroke: rgba(62, 37, 37, 0.42);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-steam {
  fill: none !important;
  stroke: rgba(255, 237, 189, 0.48) !important;
  stroke-width: 3 !important;
}

.svg-person .svg-hair,
.svg-person .svg-body,
.svg-person .svg-arm,
.svg-person .svg-leg,
.svg-cat path,
.svg-embrace,
.svg-headphones,
.svg-note {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-person .svg-arm,
.svg-person .svg-leg,
.svg-embrace,
.svg-headphones,
.svg-note {
  fill: none;
  stroke-width: 7;
}

.svg-person .svg-leg {
  stroke-width: 8;
}

.svg-skin-shadow,
.svg-neck {
  fill: #2a2333;
}

.svg-book path {
  fill: rgba(255, 237, 190, 0.82);
  stroke: rgba(67, 39, 41, 0.42);
  stroke-width: 2;
}

.svg-watering-can path {
  fill: #5d6670;
  stroke: #2b2e3c;
  stroke-width: 3;
  stroke-linejoin: round;
}

.svg-string-lights path {
  fill: none;
  stroke: rgba(62, 35, 38, 0.45);
  stroke-width: 2;
}

.svg-string-lights circle {
  fill: #ffe49c;
}

.svg-radio {
  fill: #6b3158;
  stroke: #2a2333;
  stroke-width: 3;
}

.svg-headphones {
  stroke-width: 5;
}

.svg-note {
  stroke-width: 4;
}

.control-panel {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100vw - 28px);
  padding: 8px;
  border: 1px solid rgba(255, 223, 178, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(20, 19, 31, 0.82), rgba(7, 10, 18, 0.72));
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 237, 201, 0.06);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.control-button,
.intensity-control label,
.sound-control select {
  min-height: 34px;
  border: 1px solid rgba(255, 225, 188, 0.14);
  border-radius: 8px;
  background: rgba(255, 225, 188, 0.05);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

.control-button {
  flex: 0 0 auto;
  padding: 0 11px;
  cursor: pointer;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.play-icon,
.sound-on-icon,
.control-button[aria-pressed="true"] .pause-icon,
.control-button[aria-pressed="true"] .sound-off-icon {
  display: none;
}

.control-button[aria-pressed="true"] .play-icon,
.control-button[aria-pressed="true"] .sound-on-icon {
  display: block;
}

.play-icon path {
  fill: currentColor;
  stroke: none;
}

.control-button:hover,
.control-button:focus-visible,
.sound-control select:hover,
.sound-control select:focus-visible,
.intensity-control label:has(input:focus-visible) {
  border-color: rgba(255, 190, 108, 0.58);
  background: rgba(255, 205, 139, 0.1);
  outline: none;
}

.control-button[aria-pressed="true"],
.intensity-control label:has(input:checked) {
  background: rgba(255, 179, 95, 0.18);
  border-color: rgba(255, 198, 126, 0.46);
  color: #ffe0a2;
}

.intensity-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.control-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.intensity-control label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  padding: 0;
  cursor: pointer;
}

.intensity-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.intensity-dots i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.8;
}

.intensity-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.sound-control,
.volume-control {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.sound-control select {
  max-width: 162px;
  padding: 0 28px 0 10px;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, rgba(255, 224, 178, 0.78) 50%) right 13px center / 6px 6px no-repeat,
    linear-gradient(135deg, rgba(255, 224, 178, 0.78) 50%, transparent 50%) right 8px center / 6px 6px no-repeat,
    rgba(255, 225, 188, 0.05);
}

.sound-control option {
  background: #151421;
  color: var(--text);
}

.volume-control input {
  width: 90px;
  accent-color: #e4a157;
}

.tv-indicator {
  flex: 0 0 auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(173, 207, 207, 0.18);
  border-radius: 999px;
  color: rgba(210, 232, 226, 0.78);
  background: rgba(102, 142, 145, 0.12);
  font-size: 0.72rem;
  font-weight: 800;
}

.tv-indicator.is-hidden {
  display: none;
}

body.tv-mode .control-panel {
  transition: opacity 0.8s ease, transform 0.8s ease;
}

body.tv-mode.controls-idle .control-panel {
  opacity: 0.08;
  pointer-events: none;
  transform: translateX(-50%) translateY(68%);
}

body.tv-mode .scene-stage {
  padding-bottom: 44px;
}

body.tv-mode .building {
  width: min(82vw, 1180px);
  height: min(88vh, 820px);
}

@keyframes rainDrift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-80px, 146px, 0);
  }
}

@keyframes slowPulse {
  0%,
  100% {
    opacity: 0.34;
  }

  50% {
    opacity: 0.78;
  }
}

@keyframes rarePlane {
  0% {
    opacity: 0;
    transform: translateX(0);
  }

  14%,
  78% {
    opacity: 0.42;
  }

  100% {
    opacity: 0;
    transform: translateX(calc(100vw + 180px));
  }
}

@keyframes rareShootingStar {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(-24deg);
  }

  18% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
    transform: translate3d(-34vw, 20vh, 0) rotate(-24deg);
  }
}

@keyframes rareBalloon {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }

  12%,
  76% {
    opacity: 0.54;
  }

  100% {
    opacity: 0;
    transform: translate3d(18vw, -64vh, 0);
  }
}

@keyframes rareRooftopCat {
  0%,
  100% {
    opacity: 0;
    transform: translateY(5px);
  }

  18%,
  78% {
    opacity: 0.72;
    transform: translateY(0);
  }
}

@keyframes rareLightning {
  0%,
  100% {
    opacity: 0;
  }

  42%,
  56% {
    opacity: 0.38;
  }
}

@keyframes rareTrainLight {
  0% {
    opacity: 0;
    transform: translateX(0);
  }

  18%,
  72% {
    opacity: 0.48;
  }

  100% {
    opacity: 0;
    transform: translateX(132vw);
  }
}

@keyframes rareRooftopLight {
  0%,
  100% {
    opacity: 0;
  }

  18%,
  74% {
    opacity: 0.72;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .menu-screen {
    min-height: 100dvh;
    padding: 24px 16px;
    place-items: start center;
  }

  .menu-shell {
    padding: 22px;
  }

  .scene-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scene-card {
    min-height: 190px;
  }

  .scene-stage {
    padding: max(72px, 6vh) 12px calc(172px + env(safe-area-inset-bottom, 0px));
  }

  .building {
    width: min(96vw, 720px);
    height: min(72vh, 670px);
    min-height: 520px;
    padding: 68px 38px 92px;
  }

  .window-grid {
    grid-template-columns: repeat(4, minmax(48px, 1fr));
    gap: 15px 18px;
  }

  .fire-escape {
    display: none;
  }

  .drainpipe {
    left: 20px;
  }

  .control-panel {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px;
    background:
      linear-gradient(180deg, rgba(18, 17, 27, 0.72), rgba(7, 10, 18, 0.66));
    transform: none;
  }

  body.tv-mode.controls-idle .control-panel {
    transform: translateY(calc(68% + env(safe-area-inset-bottom, 0px)));
  }
}

@media (max-width: 520px) {
  .scene-grid {
    grid-template-columns: 1fr;
  }

  .menu-screen {
    padding: 12px;
  }

  .menu-shell {
    padding: 18px;
    border-radius: 10px;
  }

  .brand-block {
    margin-bottom: 22px;
  }

  .brand-logo {
    width: 100%;
    max-width: 380px;
  }

  .brand-block p {
    margin-top: 8px;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
  }

  .scene-stage {
    padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px));
  }

  .building {
    width: 96vw;
    height: min(64vh, 590px);
    min-height: 500px;
    padding: 54px 20px 78px;
  }

  .window-grid {
    gap: 12px 10px;
  }

  .room {
    border-width: 4px;
  }

  .lintel,
  .sill {
    left: -8%;
    right: -8%;
  }

  .flower-box {
    left: 14%;
    right: 14%;
  }

  .mini-ac {
    right: -4px;
    width: 30px;
    height: 22px;
  }

  .control-button,
  .intensity-control label,
  .sound-control select {
    min-height: 34px;
    font-size: 0.78rem;
  }

  .icon-button {
    width: 36px;
    min-width: 36px;
  }

  .intensity-control {
    order: 5;
    width: auto;
    justify-content: center;
  }

  .sound-control,
  .volume-control {
    font-size: 0.74rem;
  }

  .sound-control select {
    max-width: min(54vw, 180px);
  }

  .volume-control input {
    width: 96px;
  }

  body.tv-mode.controls-idle .control-panel {
    transform: translateY(calc(68% + env(safe-area-inset-bottom, 0px)));
  }
}
