:root {
  color-scheme: dark;
  --bg: #050912;
  --bg-soft: #0b1522;
  --panel: rgba(10, 20, 33, 0.76);
  --panel-strong: rgba(12, 23, 38, 0.94);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f7fbff;
  --muted: #9fb0c1;
  --soft: #d9e6ef;
  --cyan: #35e0d8;
  --cyan-deep: #0a8f9a;
  --gold: #ffc75f;
  --rose: #f3917f;
  --violet: #7f8cff;
  --danger: #ffb29f;
  --sky-top: #102947;
  --sky-mid: #2d7586;
  --sky-bottom: #78c2bd;
  --sun-x: 48%;
  --sun-y: 34%;
  --scene-glow: rgba(255, 205, 105, 0.42);
  --scene-mist: rgba(221, 245, 249, 0.2);
  --hill-front: #2f704f;
  --hill-back: #214d45;
  --ground-a: #8fd66a;
  --ground-b: #458359;
  --ground-c: #23634e;
  --edge-a: #1a3146;
  --edge-b: #091420;
  --shadow: rgba(0, 0, 0, 0.48);
  --card-radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -8%, rgba(53, 224, 216, 0.2), transparent 18rem),
    radial-gradient(circle at 100% 8%, rgba(255, 199, 95, 0.12), transparent 18rem),
    linear-gradient(160deg, #02050a 0%, var(--bg) 48%, #0a1722 100%);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 30px;
  isolation: isolate;
}

.info-panel {
  display: contents;
}

.scene-panel {
  min-width: 0;
}

.topbar {
  order: 1;
}

.status-panel {
  order: 4;
}

.current-weather {
  order: 3;
}

.scene-panel {
  order: 2;
}

.more-sheet {
  order: 5;
}

.more-sheet-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  padding: 0 15px;
  color: var(--text);
  cursor: pointer;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(12, 23, 38, 0.88);
  border: 1px solid rgba(173, 203, 230, 0.2);
  border-radius: var(--card-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 44px rgba(0, 0, 0, 0.22);
  font-weight: 850;
  letter-spacing: 0.01em;
}

.more-sheet-toggle span:last-child {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(53, 224, 216, 0.34);
  border-radius: 999px;
  transition: transform 180ms ease;
}

.more-sheet[data-open="true"] .more-sheet-toggle span:last-child {
  transform: rotate(45deg);
}

.more-sheet-content {
  display: none;
  gap: 14px;
  padding-top: 14px;
}

.more-sheet[data-open="true"] .more-sheet-content {
  display: grid;
}

.app-ambient {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(28px);
}

.ambient-one {
  top: 90px;
  left: calc(50% - 260px);
  width: 180px;
  height: 180px;
  background: rgba(53, 224, 216, 0.12);
}

.ambient-two {
  right: calc(50% - 250px);
  bottom: 110px;
  width: 200px;
  height: 200px;
  background: rgba(127, 140, 255, 0.1);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 66px;
  margin-bottom: 10px;
}

.brand-copy,
.condition-copy {
  min-width: 0;
}

.eyebrow,
.condition,
.time-label,
.detail-card p,
.search-card label,
.status-panel p {
  margin: 0;
}

.eyebrow {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1 {
  max-width: 100%;
  margin: 5px 0 0;
  overflow: visible;
  font-size: clamp(1.48rem, 7vw, 1.9rem);
  font-weight: 820;
  line-height: 1.03;
  letter-spacing: 0;
  text-overflow: clip;
  white-space: normal;
}

@media (max-width: 719px) {
  .app-shell {
    max-width: none;
    min-height: 100svh;
    padding: 0 10px 14px;
  }

  .brand-copy h1 {
    display: none;
  }

  .topbar {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: 14px;
    left: 14px;
    z-index: 8;
    min-height: 46px;
    margin-bottom: 0;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.58);
  }

  .topbar .icon-button {
    background: rgba(5, 14, 25, 0.42);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 12px 30px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
  }

  .location-name {
    margin-top: 5px;
    color: rgba(241, 247, 255, 0.92);
  }

  .scene-panel {
    order: 1;
    margin: 0 -10px;
  }

  .diorama-card {
    height: calc(100svh - 92px);
    min-height: 640px;
    max-height: 940px;
    border-radius: 0 0 32px 32px;
    border-top: 0;
  }

  .app-shell[data-scene-mode="image"] .scene-art {
    background-position: center top;
    background-size: cover;
    transform: none;
  }

  .app-shell[data-scene-mode="image"] .scene {
    background:
      radial-gradient(ellipse at 50% 16%, rgba(55, 134, 210, 0.18), transparent 42%),
      linear-gradient(180deg, #07111d 0%, #030812 100%);
  }

  .current-weather {
    position: relative;
    z-index: 7;
    order: 2;
    margin: -172px 4px 0;
    padding: 76px 12px 22px;
    color: #fff;
    background: linear-gradient(180deg, transparent 0%, rgba(2, 7, 15, 0.44) 42%, rgba(2, 7, 15, 0.68) 100%);
    border: 0;
    border-radius: 0 0 28px 28px;
    box-shadow: none;
    backdrop-filter: none;
  }

  .temperature-row {
    gap: 8px;
  }

  .condition {
    max-width: 10rem;
    color: #fff;
    text-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  }

  .time-label {
    color: rgba(224, 236, 248, 0.78);
  }

  .temperature {
    color: #fff;
    text-shadow: 0 16px 36px rgba(0, 0, 0, 0.36);
  }

  .status-panel {
    position: relative;
    z-index: 7;
    order: 3;
    min-height: 22px;
    margin: -2px 12px 0;
    font-size: 0.78rem;
  }

  .more-sheet {
    order: 4;
    margin: 6px 8px 0;
  }

  .more-sheet-toggle {
    min-height: 50px;
    margin-top: 0;
  }
}

.location-name {
  max-width: 18rem;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--soft);
  font-size: 0.98rem;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  color: var(--text);
  cursor: pointer;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(8, 18, 31, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 16px 42px rgba(0, 0, 0, 0.26);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

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

.icon-button:hover {
  border-color: rgba(53, 224, 216, 0.52);
  transform: translateY(-1px);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.app-shell[data-loading="true"] .icon-button svg {
  animation: spin 1s linear infinite;
}

.status-panel {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.25;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: var(--cyan);
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(53, 224, 216, 0.72);
}

.status-panel[data-tone="error"] {
  color: var(--danger);
}

.status-panel[data-tone="error"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 14px rgba(255, 178, 159, 0.66);
}

.current-weather {
  display: grid;
  gap: 16px;
}

.temperature-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  min-width: 0;
}

.condition {
  max-width: 11rem;
  overflow-wrap: anywhere;
  font-size: clamp(1.62rem, 8vw, 2.25rem);
  font-weight: 850;
  line-height: 0.98;
  letter-spacing: 0;
}

.time-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.temperature {
  max-width: 9.6rem;
  margin: 0;
  overflow: hidden;
  font-size: clamp(4.4rem, 23vw, 6.35rem);
  font-weight: 235;
  line-height: 0.78;
  letter-spacing: 0;
  text-align: right;
  white-space: nowrap;
  text-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.degree-symbol {
  display: inline;
}

.app-shell[data-loading="true"] .degree-symbol {
  display: none;
}

.diorama-card {
  position: relative;
  overflow: hidden;
  min-height: clamp(350px, 56svh, 560px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 28%),
    var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -18px 48px rgba(0, 0, 0, 0.18),
    0 30px 70px rgba(0, 0, 0, 0.42);
}

/* Diorama scene system:
   Back to front: sky gradient, celestial light, clouds/skyline, hills,
   foreground weather, physical platform, and final lighting/vignette. New
   scene variants should add layers here and switch them through data attrs. */
.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at var(--sun-x) var(--sun-y), var(--scene-glow), transparent 9.5rem),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 52%, var(--sky-bottom) 100%);
}

.scene::after {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 50% 34%, transparent 0 42%, rgba(2, 6, 14, 0.16) 78%),
    linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.22));
}

.scene-art,
.scene-video,
.ambient-layer,
.scene-accent,
.scene-vignette,
.atmosphere,
.sky-glow,
.stars,
.sun-moon,
.light-beam,
.cloud,
.skyline,
.distant-hills,
.fog-layer,
.weather-layer,
.lightning,
.platform {
  position: absolute;
}

.ambient-layer {
  inset: 0;
  z-index: 28;
  pointer-events: none;
  opacity: 0;
}

.scene-accent {
  z-index: 30;
  pointer-events: none;
  opacity: 0;
}

.scene-art {
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background-image: var(--scene-art);
  background-position: center;
  background-size: cover;
  transform: scale(1.01);
  transition: opacity 420ms ease, filter 420ms ease;
}

.scene-video {
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.018);
  transition: opacity 260ms ease;
}

.scene-art::before,
.scene-art::after {
  position: absolute;
  pointer-events: none;
  content: "";
  opacity: 0;
  transition: opacity 420ms ease;
}

.scene-art::before {
  inset: 0;
  z-index: 1;
}

.scene-art::after {
  left: 52.5%;
  top: 23%;
  z-index: 2;
  width: clamp(70px, 9vw, 112px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 68% 34%, rgba(147, 177, 203, 0.46) 0 12%, transparent 13%),
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.98), rgba(213, 237, 255, 0.96) 48%, rgba(142, 190, 229, 0.92) 100%);
  box-shadow:
    0 0 30px rgba(172, 218, 255, 0.62),
    0 0 94px rgba(77, 139, 210, 0.34);
}

.scene-vignette {
  inset: 0;
  z-index: 39;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 19%, transparent 78%, rgba(255, 255, 255, 0.05)),
    radial-gradient(circle at 50% 95%, rgba(255, 255, 255, 0.07), transparent 34%);
  mix-blend-mode: screen;
}

.atmosphere {
  right: -20%;
  left: -20%;
  pointer-events: none;
}

.atmosphere-back {
  top: 12%;
  z-index: 2;
  height: 42%;
  opacity: 0.42;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(255, 255, 255, 0.28), transparent 36%),
    radial-gradient(ellipse at 70% 55%, var(--scene-mist), transparent 44%);
  filter: blur(20px);
}

.atmosphere-front {
  bottom: 19%;
  z-index: 16;
  height: 22%;
  opacity: 0.36;
  background: rgba(234, 248, 248, 0.22);
  filter: blur(22px);
}

.sky-glow {
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(circle at var(--sun-x) var(--sun-y), rgba(255, 255, 255, 0.42), transparent 20%),
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.1), transparent 44%);
  mix-blend-mode: screen;
}

.stars {
  inset: 0;
  z-index: 4;
  opacity: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.88) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(207, 234, 255, 0.75) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.62) 0 1px, transparent 1.3px);
  background-position:
    24px 42px,
    88px 102px,
    146px 64px;
  background-size:
    118px 142px,
    170px 132px,
    210px 174px;
}

.sun-moon {
  top: var(--sun-y);
  left: var(--sun-x);
  z-index: 6;
  width: 86px;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 35% 31%, #fff2b8, transparent 28%),
    #ffd462;
  border-radius: 999px;
  box-shadow:
    0 0 30px rgba(255, 226, 138, 0.95),
    0 0 90px rgba(255, 185, 72, 0.48);
  transform: translate(-50%, -50%);
}

.light-beam {
  top: 26%;
  z-index: 5;
  width: 45%;
  height: 42%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 232, 155, 0.24), rgba(255, 232, 155, 0));
  filter: blur(10px);
  opacity: 0.34;
  transform-origin: top;
}

.beam-one {
  left: 26%;
  transform: rotate(17deg);
}

.beam-two {
  right: 18%;
  transform: rotate(-24deg);
}

.cloud {
  z-index: 8;
  width: 128px;
  height: 43px;
  opacity: 0.9;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(230, 242, 244, 0.86));
  border-radius: 999px;
  filter: drop-shadow(0 18px 18px rgba(12, 35, 49, 0.2));
  animation: drift 28s ease-in-out infinite;
}

.cloud::before,
.cloud::after {
  position: absolute;
  content: "";
  background: inherit;
  border-radius: inherit;
}

.cloud::before {
  width: 61px;
  height: 61px;
  left: 18px;
  bottom: 12px;
}

.cloud::after {
  width: 76px;
  height: 76px;
  right: 13px;
  bottom: 6px;
}

.cloud-one {
  top: 33%;
  left: 5%;
}

.cloud-two {
  top: 24%;
  right: -14%;
  width: 168px;
  animation-duration: 34s;
}

.cloud-three {
  top: 43%;
  left: 58%;
  width: 112px;
  opacity: 0.78;
  animation-duration: 31s;
}

.cloud-four {
  top: 16%;
  left: -22%;
  width: 160px;
  opacity: 0.26;
  transform: scale(0.82);
  animation-duration: 45s;
}

.skyline {
  right: -8%;
  bottom: 31%;
  left: -8%;
  z-index: 10;
  height: 74px;
  opacity: 0.22;
  background:
    linear-gradient(to top, rgba(10, 31, 42, 0.74), rgba(10, 31, 42, 0.74)) 7% 100% / 8% 48% no-repeat,
    linear-gradient(to top, rgba(10, 31, 42, 0.74), rgba(10, 31, 42, 0.74)) 18% 100% / 10% 72% no-repeat,
    linear-gradient(to top, rgba(10, 31, 42, 0.74), rgba(10, 31, 42, 0.74)) 32% 100% / 7% 58% no-repeat,
    linear-gradient(to top, rgba(10, 31, 42, 0.74), rgba(10, 31, 42, 0.74)) 64% 100% / 9% 66% no-repeat,
    linear-gradient(to top, rgba(10, 31, 42, 0.74), rgba(10, 31, 42, 0.74)) 82% 100% / 12% 54% no-repeat;
}

.distant-hills {
  right: -22%;
  bottom: 27%;
  left: -22%;
  z-index: 12;
  height: 36%;
  background:
    radial-gradient(ellipse at 30% 86%, var(--hill-front) 0 34%, transparent 35%),
    radial-gradient(ellipse at 76% 88%, var(--hill-back) 0 39%, transparent 40%),
    linear-gradient(180deg, transparent 26%, rgba(7, 30, 34, 0.28));
  opacity: 0.95;
}

.platform {
  right: 7%;
  bottom: 23px;
  left: 7%;
  z-index: 25;
  height: 214px;
  transform: perspective(850px) rotateX(59deg) rotateZ(-45deg);
  transform-origin: center;
}

.platform-shadow {
  position: absolute;
  right: 4%;
  bottom: -23px;
  left: 8%;
  height: 54px;
  background: rgba(0, 0, 0, 0.44);
  border-radius: 999px;
  filter: blur(14px);
  transform: rotateZ(2deg);
}

.ground {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 23% 28%, rgba(190, 255, 129, 0.36) 0 8%, transparent 9%),
    radial-gradient(circle at 76% 62%, rgba(55, 151, 99, 0.42) 0 11%, transparent 12%),
    linear-gradient(135deg, var(--ground-a), var(--ground-b) 56%, var(--ground-c));
  border: 9px solid var(--edge-a);
  border-radius: 30px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.16),
    inset -22px -24px 36px rgba(7, 21, 29, 0.22),
    18px 24px 0 var(--edge-b),
    26px 42px 42px var(--shadow);
}

.base-lip {
  position: absolute;
  inset: auto -8px -8px -8px;
  height: 42px;
  background: linear-gradient(90deg, rgba(3, 9, 16, 0.82), rgba(15, 32, 49, 0.88));
  border-radius: 0 0 34px 34px;
  opacity: 0.88;
}

.wet-sheen,
.frosting {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.wet-sheen {
  background:
    linear-gradient(112deg, transparent 18%, rgba(188, 241, 255, 0.24) 30%, transparent 43%),
    radial-gradient(ellipse at 68% 72%, rgba(192, 244, 255, 0.22), transparent 26%);
  mix-blend-mode: screen;
}

.frosting {
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.7) 0 7%, transparent 8%),
    linear-gradient(135deg, rgba(249, 253, 255, 0.62), rgba(202, 232, 237, 0.3));
}

.path {
  position: absolute;
  right: 40%;
  bottom: -14px;
  width: 34px;
  height: 176px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 45%),
    linear-gradient(#d7c99b, #907b60);
  border-radius: 999px;
  transform: rotate(6deg);
}

.pond {
  position: absolute;
  right: 10%;
  bottom: 9%;
  width: 35%;
  height: 30%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.7), transparent 18%),
    radial-gradient(circle at 35% 35%, #8df1f2, #1e768e 72%);
  border: 4px solid rgba(255, 255, 255, 0.24);
  border-radius: 48% 52% 42% 58%;
  box-shadow:
    inset -12px -10px 18px rgba(10, 44, 66, 0.24),
    0 8px 14px rgba(5, 24, 38, 0.24);
}

.stone {
  position: absolute;
  width: 14px;
  height: 8px;
  background: rgba(32, 53, 55, 0.42);
  border-radius: 999px;
}

.stone-one {
  left: 24%;
  bottom: 25%;
}

.stone-two {
  right: 31%;
  top: 31%;
}

.house {
  position: absolute;
  top: 35%;
  left: 39%;
  width: 98px;
  height: 86px;
  transform: rotate(45deg) translate(-50%, -50%);
  transform-origin: center;
}

.house-shadow {
  position: absolute;
  right: 4px;
  bottom: -7px;
  left: 4px;
  height: 25px;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  filter: blur(6px);
}

.roof {
  position: absolute;
  top: 0;
  left: 4px;
  z-index: 2;
  width: 90px;
  height: 47px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.15), transparent 42%),
    linear-gradient(135deg, #223a55, #0e1a2b);
  clip-path: polygon(50% 0, 100% 65%, 86% 100%, 14% 100%, 0 65%);
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.22));
}

.wall {
  position: absolute;
  right: 13px;
  bottom: 0;
  left: 13px;
  z-index: 1;
  height: 54px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 40%),
    linear-gradient(135deg, #b9c3c9, #6f7d8b);
  border-radius: 6px;
}

.chimney {
  position: absolute;
  top: 7px;
  right: 22px;
  z-index: 1;
  width: 12px;
  height: 28px;
  background: #6a473b;
}

.smoke {
  position: absolute;
  top: -12px;
  right: 10px;
  z-index: 4;
  width: 43px;
  height: 18px;
  background: rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  filter: blur(4px);
  animation: smoke 4.8s ease-in-out infinite;
}

.window,
.door {
  position: absolute;
  bottom: 15px;
  background: #ffd879;
  box-shadow: 0 0 14px rgba(255, 216, 121, 0.82);
}

.window {
  width: 15px;
  height: 15px;
  border-radius: 3px;
}

.window-left {
  left: 12px;
}

.window-right {
  right: 12px;
}

.door {
  bottom: 0;
  left: calc(50% - 7px);
  width: 14px;
  height: 25px;
  border-radius: 4px 4px 0 0;
}

.tree {
  position: absolute;
  width: 0;
  height: 0;
  border-right: 25px solid transparent;
  border-bottom: 76px solid #145d43;
  border-left: 25px solid transparent;
  filter: drop-shadow(0 10px 7px rgba(0, 0, 0, 0.24));
}

.tree::before {
  position: absolute;
  top: 20px;
  left: -18px;
  content: "";
  border-right: 18px solid transparent;
  border-bottom: 52px solid rgba(33, 126, 77, 0.78);
  border-left: 18px solid transparent;
}

.tree::after {
  position: absolute;
  top: 62px;
  left: -5px;
  width: 10px;
  height: 24px;
  content: "";
  background: #704632;
}

.tree-left {
  top: 25%;
  left: 15%;
}

.tree-right {
  right: 15%;
  bottom: 22%;
}

.tree-back {
  top: 17%;
  right: 31%;
  transform: scale(0.82);
}

.weather-layer {
  inset: -20%;
  z-index: 32;
  pointer-events: none;
}

.rain-layer,
.snow-layer,
.fog-layer,
.lightning {
  opacity: 0;
}

.rain-layer {
  background-image: repeating-linear-gradient(
    105deg,
    rgba(203, 238, 255, 0) 0 10px,
    rgba(203, 238, 255, 0.76) 11px 12px,
    rgba(203, 238, 255, 0) 13px 27px
  );
  background-size: 34px 58px;
  animation: rain 0.62s linear infinite;
}

.snow-layer {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.94) 0 2px, transparent 2.7px),
    radial-gradient(circle, rgba(255, 255, 255, 0.72) 0 1.5px, transparent 2.2px);
  background-position:
    0 0,
    28px 34px;
  background-size:
    74px 92px,
    96px 118px;
  animation: snow 7s linear infinite;
}

.fog-layer {
  right: -28%;
  left: -28%;
  z-index: 34;
  height: 132px;
  background: rgba(232, 243, 245, 0.38);
  border-radius: 999px;
  filter: blur(23px);
  animation: fog 14s ease-in-out infinite;
}

.fog-a {
  top: 36%;
}

.fog-b {
  top: 54%;
  animation-delay: -6s;
}

.lightning {
  inset: 0;
  z-index: 33;
  pointer-events: none;
  background: rgba(209, 231, 255, 0.86);
  mix-blend-mode: screen;
}

.search-card,
.scene-picker,
.detail-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 44px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.search-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--card-radius);
}

.search-card label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 10px;
}

.search-row input,
.search-row button {
  min-width: 0;
  min-height: 48px;
  border-radius: var(--card-radius);
}

.search-row input {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.13);
  outline: none;
  padding: 0 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.search-row input::placeholder {
  color: rgba(217, 230, 239, 0.52);
}

.search-row input:focus {
  border-color: rgba(53, 224, 216, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(53, 224, 216, 0.12);
}

.search-row button {
  color: #021014;
  font-weight: 850;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent),
    var(--cyan);
  border: 0;
  padding: 0 12px;
  box-shadow: 0 12px 28px rgba(53, 224, 216, 0.2);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.hourly-panel {
  margin-top: 14px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 44px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.scene-picker {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--card-radius);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2,
.section-heading p,
.hour-card p {
  margin: 0;
}

.scene-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(118px, 1fr));
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.scene-options::-webkit-scrollbar {
  display: none;
}

.scene-option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  min-width: 148px;
  min-height: 68px;
  gap: 10px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--card-radius);
  padding: 9px;
}

.scene-option[aria-pressed="true"] {
  border-color: rgba(53, 224, 216, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(53, 224, 216, 0.12),
    0 12px 28px rgba(53, 224, 216, 0.08);
}

.scene-option[data-locked="true"] {
  cursor: not-allowed;
  opacity: 0.62;
}

.scene-option[data-selectable="true"] {
  cursor: pointer;
  opacity: 1;
}

.scene-preview {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  overflow: hidden;
  background: linear-gradient(180deg, #327d86, #72ba73);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.scene-preview::before,
.scene-preview::after {
  position: absolute;
  content: "";
}

.scene-preview::before {
  right: 3px;
  bottom: 8px;
  left: 3px;
  height: 16px;
  background: rgba(17, 72, 52, 0.82);
  border-radius: 50% 50% 0 0;
}

.scene-preview::after {
  top: 9px;
  right: 10px;
  width: 12px;
  height: 12px;
  background: #ffd462;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(255, 212, 98, 0.65);
}

.scene-option-copy {
  min-width: 0;
}

.scene-option-copy strong,
.scene-option-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-option-copy strong {
  font-size: 0.82rem;
  line-height: 1.08;
}

.scene-option-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.scene-preview.scene-default-diorama {
  background:
    linear-gradient(180deg, rgba(8, 15, 25, 0.02), rgba(8, 15, 25, 0.12)),
    url("./assets/scenes/default-diorama/meadow-clear.png") center / cover;
}

.scene-preview.scene-cozy-countryside {
  background: linear-gradient(180deg, #6d4753, #d4935f 52%, #7aa35c);
}

.scene-preview.scene-city-starter {
  background:
    linear-gradient(to top, rgba(12, 28, 44, 0.95) 0 34%, transparent 35%) 4px 28px / 8px 18px no-repeat,
    linear-gradient(to top, rgba(12, 28, 44, 0.95) 0 54%, transparent 55%) 16px 22px / 9px 24px no-repeat,
    linear-gradient(to top, rgba(12, 28, 44, 0.95) 0 44%, transparent 45%) 29px 26px / 10px 20px no-repeat,
    linear-gradient(180deg, #14294a, #418295);
}

.scene-option[data-locked="true"] .scene-preview:not([style]) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(127, 140, 255, 0.24), rgba(53, 224, 216, 0.12));
}

.scene-option[data-locked="true"] .scene-preview::after {
  top: 13px;
  left: 15px;
  width: 12px;
  height: 9px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-top: 0;
  border-radius: 2px;
  box-shadow: none;
}

.scene-option[data-locked="true"] .scene-preview::before {
  top: 8px;
  left: 15px;
  width: 12px;
  height: 12px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.section-heading h2 {
  font-size: 0.78rem;
  font-weight: 860;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.section-heading p {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.hourly-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(78px, 1fr));
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.hourly-strip::-webkit-scrollbar {
  display: none;
}

.hour-card {
  min-width: 78px;
  padding: 11px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--card-radius);
}

.hour-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
}

.hour-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.32rem;
  font-weight: 760;
  line-height: 1;
}

.hour-card p {
  margin-top: 7px;
  overflow: hidden;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 720;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-card {
  display: flex;
  align-items: center;
  min-height: 92px;
  gap: 11px;
  padding: 13px;
  border-radius: var(--card-radius);
}

.detail-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: var(--cyan);
  font-size: 0.64rem;
  font-weight: 900;
  border: 1px solid rgba(53, 224, 216, 0.34);
  border-radius: 50%;
  background: rgba(53, 224, 216, 0.06);
  box-shadow: inset 0 0 18px rgba(53, 224, 216, 0.04);
}

.detail-card p {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-card strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.02rem, 4vw, 1.24rem);
  line-height: 1.08;
}

/* Weather condition switches keep the data contract simple:
   app.js sets data-condition, CSS changes the atmosphere and overlays. */
.app-shell[data-condition="clear"] .cloud-two,
.app-shell[data-condition="clear"] .cloud-three,
.app-shell[data-condition="clear"] .cloud-four {
  opacity: 0.16;
}

.app-shell[data-condition="clear"] .sun-moon {
  width: 92px;
}

/* Scene-pack switches are intentionally separate from weather and location.
   Weather data sets data-condition/data-time; scene choice sets data-scene.
   Image-backed scenes use .scene-art as the base, then reuse the shared
   weather overlays above it so future packs can mix static art and CSS motion. */
.app-shell[data-scene="diorama-meadow"] .scene-art {
  --scene-art: url("./assets/scenes/default-diorama/meadow-clear.png");
}

.app-shell[data-scene="diorama-meadow"][data-condition="rain"] .scene-art {
  --scene-art: url("./assets/scenes/default-diorama/meadow-rain.png");
}

.app-shell[data-scene="diorama-meadow"][data-condition="storm"] .scene-art {
  --scene-art: url("./assets/scenes/default-diorama/meadow-storm.png");
}

.app-shell[data-scene="diorama-meadow"][data-condition="snow"] .scene-art {
  --scene-art: url("./assets/scenes/default-diorama/meadow-snow.png");
}

.app-shell[data-scene="diorama-meadow"] .scene-art {
  opacity: 1;
}

.app-shell[data-scene="diorama-meadow"] .sun-moon,
.app-shell[data-scene="diorama-meadow"] .light-beam,
.app-shell[data-scene="diorama-meadow"] .cloud,
.app-shell[data-scene="diorama-meadow"] .skyline,
.app-shell[data-scene="diorama-meadow"] .distant-hills,
.app-shell[data-scene="diorama-meadow"] .platform {
  opacity: 0;
}

.app-shell[data-scene="diorama-meadow"][data-condition="rain"] .rain-layer,
.app-shell[data-scene="diorama-meadow"][data-condition="storm"] .rain-layer {
  opacity: 0.34;
}

.app-shell[data-scene="diorama-meadow"][data-condition="snow"] .snow-layer {
  opacity: 0.48;
}

.app-shell[data-scene="diorama-meadow"][data-time="evening"] .scene-art {
  filter: saturate(1.04) hue-rotate(-4deg) brightness(0.94);
}

.app-shell[data-scene="diorama-meadow"][data-time="night"] .scene-art {
  filter: saturate(0.72) hue-rotate(12deg) brightness(0.56);
}

.app-shell[data-scene="diorama-meadow"][data-time="night"] .scene-art::before {
  opacity: 1;
  background:
    radial-gradient(circle at 52.5% 23%, rgba(5, 8, 18, 0.72) 0 11%, rgba(7, 12, 27, 0.5) 18%, transparent 33%),
    radial-gradient(circle at 52.5% 23%, rgba(105, 166, 235, 0.25), transparent 34%),
    linear-gradient(180deg, rgba(4, 10, 24, 0.44), rgba(5, 13, 29, 0.12) 42%, rgba(2, 5, 13, 0.54));
}

.app-shell[data-scene="diorama-meadow"][data-time="night"]:not([data-condition="rain"]):not([data-condition="storm"]):not([data-condition="snow"]) .scene-art::after {
  opacity: 1;
}

.app-shell[data-scene="diorama-meadow"][data-condition="fog"] .scene-art,
.app-shell[data-scene="diorama-meadow"][data-condition="cloudy"] .scene-art {
  filter: saturate(0.86) brightness(0.78);
}

.app-shell[data-scene="diorama-meadow"][data-time="night"][data-condition="fog"] .scene-art,
.app-shell[data-scene="diorama-meadow"][data-time="night"][data-condition="cloudy"] .scene-art {
  filter: saturate(0.68) hue-rotate(12deg) brightness(0.5);
}

.app-shell[data-scene="diorama-meadow"][data-time="night"][data-condition="rain"] .scene-art,
.app-shell[data-scene="diorama-meadow"][data-time="night"][data-condition="storm"] .scene-art {
  filter: saturate(0.92) brightness(0.72);
}

.app-shell[data-scene="cozy-countryside"] {
  --ground-a: #b9b35f;
  --ground-b: #7d8449;
  --ground-c: #4a6a42;
  --hill-front: #6d7650;
  --hill-back: #694d4e;
  --edge-a: #34263b;
  --edge-b: #140d1c;
  --scene-glow: rgba(255, 169, 92, 0.45);
}

.app-shell[data-scene="cozy-countryside"] .wall {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 40%),
    linear-gradient(135deg, #c79565, #7e5a4a);
}

.app-shell[data-scene="cozy-countryside"] .roof {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(135deg, #56304a, #21172b);
}

.app-shell[data-scene="cozy-countryside"] .pond {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.58), transparent 18%),
    radial-gradient(circle at 35% 35%, #a5d7c5, #477b71 72%);
}

.app-shell[data-scene="city-starter"] {
  --ground-a: #6f8791;
  --ground-b: #465f67;
  --ground-c: #2c4651;
  --hill-front: #273e55;
  --hill-back: #1c2b45;
  --edge-a: #18283e;
  --edge-b: #07101d;
  --scene-glow: rgba(101, 180, 215, 0.28);
}

.app-shell[data-scene="city-starter"] .skyline {
  opacity: 0.56;
}

.app-shell[data-scene="city-starter"] .tree {
  opacity: 0.38;
}

.app-shell[data-scene="city-starter"] .path {
  width: 54px;
  background:
    repeating-linear-gradient(0deg, transparent 0 20px, rgba(255, 255, 255, 0.42) 21px 25px, transparent 26px 46px),
    linear-gradient(#495b67, #2a3945);
}

.app-shell[data-scene="city-starter"] .house {
  width: 104px;
  height: 96px;
}

.app-shell[data-scene="city-starter"] .roof {
  height: 28px;
  background: linear-gradient(135deg, #26384d, #121d2d);
  clip-path: polygon(0 22%, 100% 22%, 100% 100%, 0 100%);
}

.app-shell[data-scene="city-starter"] .wall {
  height: 68px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 217, 121, 0.8) 11px 16px, transparent 17px 28px),
    linear-gradient(135deg, #556574, #2e3f50);
}

.app-shell[data-condition="partly-cloudy"] .cloud {
  opacity: 0.92;
}

.app-shell[data-condition="cloudy"] .scene,
.app-shell[data-condition="fog"] .scene {
  --sky-top: #263443;
  --sky-mid: #607782;
  --sky-bottom: #a3b1ab;
  --scene-glow: rgba(237, 244, 239, 0.2);
  --hill-front: #3f6658;
  --hill-back: #354d4d;
}

.app-shell[data-condition="cloudy"] .cloud {
  opacity: 0.98;
  filter: drop-shadow(0 16px 20px rgba(17, 31, 43, 0.3)) saturate(0.82);
}

.app-shell[data-condition="cloudy"] .sun-moon {
  opacity: 0.44;
}

.app-shell[data-condition="rain"] .scene,
.app-shell[data-condition="storm"] .scene {
  --sky-top: #0d1828;
  --sky-mid: #2c455d;
  --sky-bottom: #445e6d;
  --scene-glow: rgba(111, 169, 202, 0.18);
  --scene-mist: rgba(166, 209, 224, 0.25);
  --ground-a: #5f9965;
  --ground-b: #356e58;
  --ground-c: #1d4d46;
}

.app-shell[data-condition="rain"] .rain-layer,
.app-shell[data-condition="storm"] .rain-layer {
  opacity: 0.64;
}

.app-shell[data-condition="rain"] .wet-sheen,
.app-shell[data-condition="storm"] .wet-sheen {
  opacity: 0.86;
}

.app-shell[data-condition="storm"] .lightning {
  opacity: 1;
  animation: lightning 7s steps(1, end) infinite;
}

.app-shell[data-condition="storm"] .cloud {
  background: linear-gradient(180deg, rgba(196, 210, 217, 0.96), rgba(125, 145, 158, 0.88));
}

.app-shell[data-condition="fog"] .fog-layer {
  opacity: 1;
}

.app-shell[data-condition="fog"] .scene::after {
  background:
    linear-gradient(180deg, rgba(222, 235, 235, 0.08), rgba(222, 235, 235, 0.18)),
    radial-gradient(circle at 50% 60%, rgba(240, 247, 246, 0.16), transparent 62%);
}

.app-shell[data-condition="snow"] .scene {
  --sky-top: #1b2b46;
  --sky-mid: #6b91a8;
  --sky-bottom: #bdd4d9;
  --scene-glow: rgba(225, 246, 255, 0.26);
  --ground-a: #eef7fb;
  --ground-b: #b7d5d4;
  --ground-c: #8db8bb;
}

.app-shell[data-condition="snow"] .snow-layer {
  opacity: 0.88;
}

.app-shell[data-condition="snow"] .frosting {
  opacity: 0.82;
}

.app-shell[data-condition="snow"] .tree {
  border-bottom-color: #22644e;
}

/* Time of day is layered on top of weather. Keep these broad enough that
   stormy evenings, foggy mornings, and clear nights still compose gracefully. */
.app-shell[data-time="morning"] .scene {
  --sky-top: #283c5c;
  --sky-mid: #d48275;
  --sky-bottom: #ffd19b;
  --sun-x: 35%;
  --sun-y: 38%;
  --scene-glow: rgba(255, 194, 124, 0.44);
}

.app-shell[data-time="day"] .scene {
  --sky-top: #102947;
  --sky-mid: #2d7586;
  --sky-bottom: #78c2bd;
}

.app-shell[data-time="evening"] .scene {
  --sky-top: #202449;
  --sky-mid: #854f72;
  --sky-bottom: #e08a70;
  --sun-x: 70%;
  --sun-y: 39%;
  --scene-glow: rgba(255, 146, 100, 0.4);
}

.app-shell[data-time="night"] .scene {
  --sky-top: #050914;
  --sky-mid: #111f3c;
  --sky-bottom: #223958;
  --sun-x: 67%;
  --sun-y: 29%;
  --scene-glow: rgba(144, 187, 255, 0.22);
  --hill-front: #17364a;
  --hill-back: #112942;
  --ground-a: #426f67;
  --ground-b: #254f55;
  --ground-c: #173c48;
}

.app-shell[data-time="night"] .stars {
  opacity: 0.95;
}

.app-shell[data-time="night"] .sun-moon {
  width: 78px;
  background:
    radial-gradient(circle at 72% 34%, #9bb6c9 0 20%, transparent 21%),
    radial-gradient(circle at 35% 31%, #ffffff, transparent 32%),
    #dff4ff;
  box-shadow:
    0 0 34px rgba(164, 213, 255, 0.72),
    0 0 86px rgba(91, 143, 205, 0.28);
}

.app-shell[data-time="night"] .light-beam {
  opacity: 0.12;
  background: linear-gradient(180deg, rgba(160, 204, 255, 0.2), transparent);
}

.app-shell[data-time="night"] .window {
  background: #ffe18b;
  box-shadow: 0 0 24px rgba(255, 225, 139, 0.92);
}

.app-shell[data-time="night"] .skyline {
  opacity: 0.36;
  filter: drop-shadow(0 0 8px rgba(255, 213, 126, 0.14));
}

@keyframes drift {
  0% {
    translate: -18px 0;
  }
  50% {
    translate: 20px 4px;
  }
  100% {
    translate: -18px 0;
  }
}

@keyframes smoke {
  0%,
  100% {
    opacity: 0.28;
    transform: translate(0, 0) scale(0.82);
  }
  50% {
    opacity: 0.66;
    transform: translate(-14px, -13px) scale(1.16);
  }
}

@keyframes rain {
  to {
    background-position: -32px 64px;
  }
}

@keyframes snow {
  to {
    background-position:
      38px 120px,
      -18px 142px;
  }
}

@keyframes fog {
  0%,
  100% {
    transform: translateX(-7%);
  }
  50% {
    transform: translateX(8%);
  }
}

@keyframes lightning {
  0%,
  90%,
  100% {
    opacity: 0;
  }
  91%,
  92% {
    opacity: 0.58;
  }
  93% {
    opacity: 0;
  }
  94% {
    opacity: 0.26;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 720px) {
  body {
    background:
      radial-gradient(circle at 32% 2%, rgba(53, 224, 216, 0.14), transparent 26rem),
      radial-gradient(circle at 68% 5%, rgba(255, 199, 95, 0.1), transparent 22rem),
      linear-gradient(160deg, #02050a 0%, var(--bg) 52%, #0a1722 100%);
  }

  .app-shell {
    display: grid;
    grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
    align-items: start;
    width: min(100% - 48px, 1180px);
    max-width: none;
    gap: clamp(24px, 4vw, 52px);
    padding: 34px 0;
  }

  .info-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 68px);
    padding: clamp(18px, 2.2vw, 30px);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
      rgba(5, 13, 24, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--card-radius);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 30px 80px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(14px);
  }

  .scene-panel {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 68px);
  }

  .more-sheet {
    display: block;
    margin-top: 14px;
  }

  .more-sheet-content {
    display: grid;
    gap: 14px;
    padding-top: 0;
  }

  .more-sheet-toggle {
    display: none;
  }

  .topbar {
    margin-bottom: 12px;
  }

  h1 {
    font-size: clamp(2rem, 3.2vw, 3.35rem);
    line-height: 0.98;
    white-space: normal;
  }

  .location-name {
    max-width: none;
    font-size: 1.08rem;
  }

  .condition {
    max-width: 18rem;
    font-size: clamp(2rem, 3.7vw, 3.7rem);
  }

  .temperature {
    max-width: 12.5rem;
    font-size: clamp(5.2rem, 8vw, 8.5rem);
  }

  .diorama-card {
    width: 100%;
    min-height: clamp(560px, 76vh, 820px);
  }

  .platform {
    right: 8%;
    bottom: 42px;
    left: 8%;
    height: clamp(270px, 31vw, 390px);
  }

  .sun-moon {
    width: clamp(92px, 9vw, 132px);
  }

  .cloud {
    transform: scale(1.12);
  }

  .cloud-two {
    width: clamp(180px, 18vw, 260px);
  }

  .search-card {
    margin-top: 0;
  }
}

@media (min-width: 960px) {
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hourly-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
  }

  .scene-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }
}

@media (min-width: 720px) and (max-width: 959px) {
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-card {
    min-height: 68px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .hour-card {
    min-width: 72px;
  }
}

@media (min-width: 1260px) {
  .app-shell {
    grid-template-columns: minmax(380px, 0.7fr) minmax(620px, 1.3fr);
  }

  .condition {
    font-size: clamp(2.7rem, 3.5vw, 4.15rem);
  }

  .temperature {
    max-width: 14rem;
    font-size: clamp(7rem, 7.6vw, 9.6rem);
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding-right: 8px;
    padding-left: 8px;
  }

  .temperature {
    font-size: clamp(3.8rem, 21vw, 5.4rem);
  }

  .diorama-card {
    height: calc(100svh - 86px);
    min-height: 590px;
  }

  .platform {
    right: 2%;
    left: 2%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding-top: 0;
    padding-bottom: 18px;
  }

  .topbar {
    min-height: 46px;
  }

  .status-panel {
    min-height: 28px;
    font-size: 0.78rem;
  }

  .current-weather {
    gap: 8px;
    margin-top: -166px;
    padding: 72px 12px 18px;
  }

  .condition {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
  }

  .temperature {
    font-size: clamp(3.7rem, 19vw, 5.35rem);
  }

  .search-row {
    grid-template-columns: 1fr;
  }
}

/* Scene rendering modes:
   image = generated scene art as the base, with only live weather overlays.
   css = full CSS diorama fallback with built sun/clouds/hills/platform. */
.app-shell[data-scene-mode="image"] .scene-art {
  opacity: 1;
  background-size: contain;
  background-repeat: no-repeat;
}

.app-shell[data-scene-mode="image"]:not([data-scene="diorama-meadow"]) .scene-art {
  --scene-art: var(--selected-scene-hero);
}

.app-shell[data-scene-mode="image"] .sun-moon,
.app-shell[data-scene-mode="image"] .light-beam,
.app-shell[data-scene-mode="image"] .cloud,
.app-shell[data-scene-mode="image"] .skyline,
.app-shell[data-scene-mode="image"] .distant-hills,
.app-shell[data-scene-mode="image"] .platform,
.app-shell[data-scene-mode="image"] .sky-glow,
.app-shell[data-scene-mode="image"] .atmosphere-back {
  opacity: 0 !important;
}

.app-shell[data-scene-mode="image"] .scene::after {
  background:
    radial-gradient(circle at 50% 44%, transparent 0 54%, rgba(2, 6, 14, 0.1) 86%),
    linear-gradient(180deg, transparent 65%, rgba(0, 0, 0, 0.16));
}

.app-shell[data-scene-mode="image"] .scene-art::after {
  opacity: 0 !important;
}

.app-shell[data-scene-mode="image"] .scene-art::before {
  opacity: 0;
}

.app-shell[data-scene-mode="image"][data-time="morning"] .scene-art {
  filter: saturate(1.02) brightness(0.98);
}

.app-shell[data-scene-mode="image"][data-time="day"] .scene-art {
  filter: saturate(1.02) brightness(1);
}

.app-shell[data-scene-mode="image"][data-time="evening"] .scene-art {
  filter: saturate(1.04) brightness(0.94);
}

.app-shell[data-scene-mode="image"][data-time="night"] .scene-art {
  filter: saturate(0.82) hue-rotate(8deg) brightness(0.68);
}

.app-shell[data-scene-mode="image"][data-time="night"] .scene-art::before {
  opacity: 1;
  background: linear-gradient(180deg, rgba(2, 8, 22, 0.2), rgba(2, 6, 17, 0.34));
}

.app-shell[data-scene-mode="image"][data-condition="cloudy"] .scene-art {
  filter: saturate(0.9) brightness(0.92);
}

.app-shell[data-scene-mode="image"][data-condition="fog"] .scene-art {
  filter: saturate(0.84) brightness(0.9);
}

.app-shell[data-scene-mode="image"][data-time="night"][data-condition="cloudy"] .scene-art,
.app-shell[data-scene-mode="image"][data-time="night"][data-condition="fog"] .scene-art {
  filter: saturate(0.72) hue-rotate(8deg) brightness(0.62);
}

.app-shell[data-scene-mode="image"][data-time="night"][data-condition="rain"] .scene-art,
.app-shell[data-scene-mode="image"][data-time="night"][data-condition="storm"] .scene-art,
.app-shell[data-scene-mode="image"][data-time="night"][data-condition="snow"] .scene-art {
  filter: saturate(0.78) hue-rotate(8deg) brightness(0.66);
}

.app-shell[data-scene-mode="image"][data-condition="rain"] .rain-layer {
  opacity: 0.26;
}

.app-shell[data-scene-mode="image"][data-condition="storm"] .rain-layer {
  opacity: 0.32;
}

.app-shell[data-scene-mode="image"][data-condition="snow"] .snow-layer {
  opacity: 0.38;
}

.app-shell[data-scene-mode="image"][data-condition="fog"] .fog-layer {
  opacity: 0.42;
}

.app-shell[data-scene-mode="image"][data-condition="storm"] .lightning {
  opacity: 0.82;
}

.scene-library-button {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 76px;
  gap: 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(53, 224, 216, 0.12), transparent 38%),
    rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--card-radius);
  padding: 10px;
}

.scene-library-button:hover,
.scene-library-button:focus-visible {
  border-color: rgba(53, 224, 216, 0.55);
  outline: none;
  box-shadow: 0 0 0 3px rgba(53, 224, 216, 0.11);
}

.scene-library-thumb {
  display: block;
  width: 56px;
  aspect-ratio: 1;
  overflow: hidden;
  background:
    var(--scene-thumb),
    linear-gradient(180deg, #327d86, #72ba73);
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
}

.scene-library-copy {
  min-width: 0;
}

.scene-library-copy strong,
.scene-library-copy span,
.scene-library-action {
  display: block;
}

.scene-library-copy strong {
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-library-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 780;
}

.scene-library-action {
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 850;
}

.scene-library[hidden] {
  display: none;
}

.scene-library {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: stretch;
  padding: 14px;
}

.scene-library-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 12%, rgba(53, 224, 216, 0.16), transparent 28rem),
    rgba(2, 6, 13, 0.78);
  backdrop-filter: blur(18px);
}

.scene-library-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 1180px);
  max-height: min(920px, calc(100vh - 28px));
  margin: auto;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    #07111d;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 34px 110px rgba(0, 0, 0, 0.58);
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  transition: opacity 180ms ease, transform 180ms ease;
}

.scene-library[data-open="true"] .scene-library-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.scene-library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scene-library-header h2 {
  max-width: 38rem;
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 3vw, 2.8rem);
  line-height: 1;
}

.scene-library-message {
  max-width: 34rem;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.close-library-button {
  flex: 0 0 auto;
}

.scene-library-body {
  display: grid;
  gap: 18px;
  overflow: auto;
  padding: clamp(16px, 2.5vw, 26px);
}

.scene-library-catalog {
  display: grid;
  gap: 18px;
}

.scene-library-group-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.scene-library-group-heading h3,
.scene-library-group-heading p {
  margin: 0;
}

.scene-library-group-heading h3 {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.scene-library-group-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.scene-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
}

.scene-library .scene-option {
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
  min-height: 0;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
}

.scene-library .scene-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background:
    var(--scene-thumb),
    linear-gradient(180deg, #14294a, #418295);
  background-position: center;
  background-size: cover;
  border-radius: 12px;
}

.scene-library .scene-preview[style]::before,
.scene-library .scene-preview[style]::after {
  display: none;
}

.scene-library .scene-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  color: #ecfbff;
  background: rgba(5, 13, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.64rem;
  font-weight: 880;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.scene-library .scene-option[data-locked="true"] {
  opacity: 1;
}

.scene-library .scene-option[data-selectable="true"] {
  cursor: pointer;
}

.scene-library .scene-option[data-locked="true"] .scene-preview {
  filter: saturate(0.85) brightness(0.76);
}

.scene-library .scene-option[data-locked="true"] .scene-badge {
  color: #f0d9ff;
  background: rgba(91, 48, 150, 0.72);
}

.scene-library .scene-option-copy strong {
  font-size: 0.94rem;
}

.scene-library .scene-option-copy span {
  color: var(--cyan);
}

.scene-library .scene-option-copy small {
  display: -webkit-box;
  min-height: 2.35em;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.scene-library-explainer {
  display: grid;
  gap: 10px;
}

.scene-library-explainer article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}

.scene-library-explainer span {
  display: grid;
  place-items: center;
  width: 44px;
  aspect-ratio: 1;
  color: var(--cyan);
  background: rgba(53, 224, 216, 0.1);
  border: 1px solid rgba(53, 224, 216, 0.18);
  border-radius: 14px;
  font-weight: 900;
}

.scene-library-explainer h3,
.scene-library-explainer p {
  margin: 0;
}

.scene-library-explainer h3 {
  font-size: 0.92rem;
}

.scene-library-explainer p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.hourly-strip {
  gap: 10px;
}

.hour-card {
  min-width: 78px;
  padding: 10px;
}

.diorama-card {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    inset 0 -20px 54px rgba(0, 0, 0, 0.22),
    0 34px 92px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(53, 224, 216, 0.04);
}

@media (min-width: 720px) {
  .info-panel {
    justify-content: flex-start;
    min-height: auto;
  }

  .scene-panel {
    min-height: auto;
  }

  .scene-library {
    padding: 28px;
  }

  .scene-library-body {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }

  .scene-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  }
}

@media (min-width: 1180px) {
  .scene-card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .scene-library .scene-option:first-child {
    grid-column: span 1;
  }
}

/* Hourly forecast layout:
   This row must never compress cards into overlap. It intentionally scrolls
   horizontally whenever the left panel cannot fit all five cards cleanly. */
.hourly-panel {
  min-width: 0;
  overflow: hidden;
}

.hourly-strip {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(68px, 76px);
  grid-template-columns: none !important;
  gap: 10px;
  width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden;
  padding: 1px 2px 6px;
  scrollbar-color: rgba(53, 224, 216, 0.34) transparent;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.hourly-strip::-webkit-scrollbar {
  height: 6px;
  display: block;
}

.hourly-strip::-webkit-scrollbar-track {
  background: transparent;
}

.hourly-strip::-webkit-scrollbar-thumb {
  background: rgba(53, 224, 216, 0.28);
  border-radius: 999px;
}

.hour-card {
  width: auto;
  min-width: 0 !important;
  scroll-snap-align: start;
}

.hour-card span,
.hour-card strong,
.hour-card p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .hourly-strip {
    grid-auto-columns: minmax(64px, 70px);
  }

  .hour-card {
    padding: 9px 8px;
  }
}

/* Image-scene ambient motion:
   Generated art is the base. These overlays add life without drawing duplicate
   suns, moons, big clouds, houses, hills, platforms, or water objects. */
.app-shell[data-scene-mode="image"] .diorama-card {
  background: #07111d;
}

.app-shell[data-scene-mode="image"] .scene {
  background:
    radial-gradient(circle at 50% 35%, rgba(53, 224, 216, 0.06), transparent 40%),
    #07111d;
}

.app-shell[data-scene-mode="image"] .scene-art {
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.012);
}

.app-shell[data-scene-mode="image"] .ambient-haze {
  opacity: 0.28;
  background:
    radial-gradient(ellipse at 34% 30%, rgba(255, 255, 255, 0.16), transparent 32%),
    radial-gradient(ellipse at 72% 58%, rgba(53, 224, 216, 0.09), transparent 36%);
  filter: blur(18px);
  animation: ambientDrift 18s ease-in-out infinite;
}

.app-shell[data-scene-mode="image"] .ambient-shimmer {
  opacity: 0.22;
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(255, 255, 255, 0.13) 46%, transparent 58%),
    radial-gradient(circle at 74% 78%, rgba(255, 218, 137, 0.16), transparent 18%);
  mix-blend-mode: screen;
  transform: translateX(-18%);
  animation: shimmerDrift 13s ease-in-out infinite;
}

.app-shell[data-scene-mode="image"] .ambient-particles {
  opacity: 0.3;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.52) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(150, 225, 255, 0.36) 0 1px, transparent 1.5px);
  background-position:
    24px 38px,
    86px 122px;
  background-size:
    132px 148px,
    176px 196px;
  mix-blend-mode: screen;
  animation: particleFloat 22s linear infinite;
}

.app-shell[data-scene-mode="image"][data-condition="cloudy"] .ambient-haze {
  opacity: 0.36;
}

.app-shell[data-scene-mode="image"][data-time="night"] .ambient-shimmer {
  opacity: 0.14;
}

.app-shell[data-scene-mode="image"][data-time="night"] .ambient-particles {
  opacity: 0.48;
}

.app-shell[data-scene-mode="image"][data-condition="rain"] .ambient-particles,
.app-shell[data-scene-mode="image"][data-condition="storm"] .ambient-particles {
  opacity: 0.12;
}

.app-shell[data-scene-mode="image"] .scene-smoke {
  width: 84px;
  height: 92px;
  transform: translate(-50%, -50%);
  filter: blur(0.2px);
}

.app-shell[data-scene="diorama-meadow"] .scene-smoke,
.app-shell[data-scene="mountain-cabin"] .scene-smoke {
  opacity: 0.72;
}

.app-shell[data-scene="diorama-meadow"] .scene-smoke {
  left: 31.5%;
  top: 46.5%;
}

.app-shell[data-scene="mountain-cabin"] .scene-smoke {
  left: 48%;
  top: 42%;
}

.scene-smoke::before,
.scene-smoke::after {
  position: absolute;
  content: "";
  width: 28px;
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(248, 252, 255, 0.68), rgba(198, 214, 218, 0.22) 62%, transparent 72%);
  animation: chimneySmoke 5.8s ease-in-out infinite;
}

.scene-smoke::before {
  left: 24px;
  bottom: 12px;
}

.scene-smoke::after {
  left: 36px;
  bottom: 28px;
  width: 36px;
  animation-delay: -2.6s;
}

.app-shell[data-condition="rain"] .scene-smoke,
.app-shell[data-condition="storm"] .scene-smoke {
  opacity: 0.44;
}

@keyframes ambientDrift {
  0%,
  100% {
    transform: translate3d(-1.5%, -1%, 0) scale(1.02);
  }
  50% {
    transform: translate3d(1.5%, 1%, 0) scale(1.05);
  }
}

@keyframes shimmerDrift {
  0%,
  100% {
    transform: translateX(-28%);
  }
  50% {
    transform: translateX(18%);
  }
}

@keyframes particleFloat {
  to {
    background-position:
      42px 164px,
      62px 268px;
  }
}

@keyframes chimneySmoke {
  0% {
    opacity: 0;
    transform: translate3d(0, 16px, 0) scale(0.6);
  }
  28% {
    opacity: 0.62;
  }
  100% {
    opacity: 0;
    transform: translate3d(-18px, -42px, 0) scale(1.35);
  }
}

/* Current weather spacing:
   Keep the large temperature optically high enough that its descender area
   never clips into the detail cards below. */
.temperature-row {
  align-items: center;
  margin-bottom: 4px;
}

.temperature {
  overflow: visible;
  line-height: 0.86;
  transform: translateY(-0.04em);
}

.detail-grid {
  margin-top: 18px;
}

/* Optional video-loop scene mode:
   Video is progressive enhancement only. The scene image remains underneath as
   a poster/fallback, and CSS-only diorama objects stay hidden for media modes. */
.app-shell[data-scene-mode="video"] .scene-video {
  opacity: 1;
}

.app-shell[data-scene-mode="video"] .scene-art {
  opacity: 1;
}

.app-shell[data-scene-mode="video"] .sun-moon,
.app-shell[data-scene-mode="video"] .light-beam,
.app-shell[data-scene-mode="video"] .cloud,
.app-shell[data-scene-mode="video"] .skyline,
.app-shell[data-scene-mode="video"] .distant-hills,
.app-shell[data-scene-mode="video"] .platform,
.app-shell[data-scene-mode="video"] .sky-glow,
.app-shell[data-scene-mode="video"] .atmosphere-back {
  opacity: 0 !important;
}

.app-shell[data-scene-mode="video"] .ambient-haze {
  opacity: 0.2;
}

.app-shell[data-scene-mode="video"] .ambient-shimmer {
  opacity: 0.16;
}

.app-shell[data-scene-mode="video"] .ambient-particles {
  opacity: 0.18;
}

.app-shell[data-scene-mode="video"][data-condition="rain"] .rain-layer {
  opacity: 0.16;
}

.app-shell[data-scene-mode="video"][data-condition="storm"] .rain-layer {
  opacity: 0.18;
}

.app-shell[data-scene-mode="video"][data-condition="storm"] .lightning {
  opacity: 0.28;
}

.app-shell[data-scene-mode="video"][data-condition="snow"] .snow-layer {
  opacity: 0.22;
}

.app-shell[data-scene-mode="video"][data-condition="fog"] .fog-layer {
  opacity: 0.24;
}

/* Final hourly layout guard:
   The forecast strip is a true horizontal scroller. Cards keep a stable width
   and never overlap, even inside the narrow desktop info panel. */
.hourly-strip {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  grid-auto-flow: initial !important;
  grid-auto-columns: initial !important;
  grid-template-columns: none !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  padding: 2px 4px 8px;
  scroll-padding-inline: 4px;
  -webkit-overflow-scrolling: touch;
}

.hour-card {
  flex: 0 0 72px;
  width: 72px;
  min-width: 72px !important;
  box-sizing: border-box;
}

@media (max-width: 380px) {
  .hour-card {
    flex-basis: 68px;
    width: 68px;
    min-width: 68px !important;
  }
}

/* Premium placeholder thumbnails for future packs. These give locked scenes
   a visual identity before generated thumbnail/hero art is dropped in. */
.scene-preview.scene-magical-village {
  background:
    radial-gradient(circle at 70% 18%, rgba(255, 226, 126, 0.9) 0 5px, transparent 6px),
    radial-gradient(circle at 28% 70%, rgba(78, 255, 210, 0.24), transparent 38%),
    linear-gradient(145deg, #10243f, #3d2871 54%, #132b32);
}

.scene-preview.scene-enchanted-castle {
  background:
    linear-gradient(to top, rgba(238, 205, 121, 0.9) 0 8%, transparent 9%) 51% 58% / 32px 36px no-repeat,
    linear-gradient(to top, rgba(145, 161, 190, 0.95) 0 54%, transparent 55%) 50% 48% / 46px 52px no-repeat,
    radial-gradient(circle at 64% 20%, rgba(120, 177, 255, 0.35), transparent 28%),
    linear-gradient(150deg, #081c34, #273b69 58%, #161d37);
}

.scene-preview.scene-floating-islands {
  background:
    radial-gradient(ellipse at 48% 72%, rgba(42, 235, 255, 0.62), transparent 30%),
    radial-gradient(ellipse at 64% 48%, rgba(75, 130, 255, 0.62), transparent 24%),
    radial-gradient(ellipse at 34% 42%, rgba(68, 212, 136, 0.56), transparent 22%),
    linear-gradient(160deg, #06172d, #153b72 48%, #2d2660);
}

.scene-preview.scene-castle-kingdom {
  background:
    radial-gradient(circle at 72% 24%, rgba(207, 232, 255, 0.85) 0 6px, transparent 7px),
    linear-gradient(to top, rgba(175, 179, 199, 0.98) 0 50%, transparent 51%) 50% 50% / 52px 54px no-repeat,
    radial-gradient(circle at 50% 72%, rgba(45, 190, 156, 0.28), transparent 30%),
    linear-gradient(145deg, #061326, #203760 54%, #0d1e35);
}

.scene-preview.scene-futuristic-city {
  background:
    linear-gradient(to top, rgba(98, 221, 255, 0.9) 0 62%, transparent 63%) 53% 42% / 10px 58px no-repeat,
    linear-gradient(to top, rgba(178, 225, 255, 0.82) 0 46%, transparent 47%) 34% 54% / 12px 44px no-repeat,
    linear-gradient(to top, rgba(178, 225, 255, 0.75) 0 40%, transparent 41%) 70% 58% / 14px 38px no-repeat,
    radial-gradient(circle at 52% 70%, rgba(70, 195, 255, 0.32), transparent 32%),
    linear-gradient(145deg, #051322, #0d2b54 58%, #081827);
}

.scene-preview.scene-cyberpunk-city {
  background:
    linear-gradient(to top, rgba(255, 56, 214, 0.86) 0 56%, transparent 57%) 36% 52% / 12px 48px no-repeat,
    linear-gradient(to top, rgba(36, 218, 255, 0.86) 0 68%, transparent 69%) 58% 44% / 14px 60px no-repeat,
    linear-gradient(to top, rgba(255, 155, 69, 0.72) 0 44%, transparent 45%) 74% 58% / 10px 38px no-repeat,
    radial-gradient(circle at 50% 78%, rgba(255, 45, 226, 0.32), transparent 34%),
    linear-gradient(145deg, #080918, #1d1644 55%, #07172e);
}

/* Real Scene Library thumbnails must win over pack placeholder art. The
   fantasy/future placeholder classes above stay useful only when no image
   asset is available. */
.scene-library .scene-option[data-has-asset="true"] .scene-preview {
  background:
    var(--scene-thumb),
    linear-gradient(180deg, #14294a, #418295) !important;
  background-position: center !important;
  background-size: cover !important;
}

.scene-library .scene-option[data-has-asset="true"] .scene-preview::before,
.scene-library .scene-option[data-has-asset="true"] .scene-preview::after {
  display: none !important;
}

/* Stronger image-scene polish. The scene remains a static image plus live
   ambient/weather overlays; no duplicate CSS suns, moons, clouds, or props. */
.app-shell[data-scene-mode="image"] .diorama-card {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(53, 224, 216, 0.06), transparent 42%),
    linear-gradient(180deg, #0b1726, #040a12);
}

.app-shell[data-scene-mode="image"] .scene {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.025), transparent 46%),
    #06101c;
}

.app-shell[data-scene-mode="image"] .scene-art {
  inset: 0;
  opacity: 1;
  background-position: center;
  background-size: cover;
  transform: scale(1.018);
}

.app-shell[data-scene-mode="image"] .scene::after {
  background:
    radial-gradient(circle at 50% 45%, transparent 0 57%, rgba(3, 8, 17, 0.18) 92%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%, rgba(0, 0, 0, 0.08) 100%);
}

.app-shell[data-scene-mode="image"] .ambient-haze {
  opacity: 0.34;
  background:
    radial-gradient(ellipse at 28% 24%, rgba(255, 255, 255, 0.18), transparent 30%),
    radial-gradient(ellipse at 74% 54%, rgba(53, 224, 216, 0.12), transparent 34%),
    linear-gradient(120deg, transparent 8%, rgba(255, 255, 255, 0.055) 46%, transparent 78%);
  mix-blend-mode: screen;
  animation: ambientDrift 16s ease-in-out infinite;
}

.app-shell[data-scene-mode="image"] .ambient-shimmer {
  opacity: 0.34;
  background:
    linear-gradient(112deg, transparent 0 28%, rgba(255, 255, 255, 0.2) 42%, transparent 55%),
    linear-gradient(18deg, transparent 0 58%, rgba(73, 232, 255, 0.12) 67%, transparent 77%),
    radial-gradient(circle at 78% 78%, rgba(255, 215, 143, 0.18), transparent 16%);
  animation: shimmerDrift 12s ease-in-out infinite;
}

.app-shell[data-scene-mode="image"] .ambient-particles {
  opacity: 0.42;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.68) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(136, 232, 255, 0.44) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255, 220, 140, 0.4) 0 0.8px, transparent 1.4px);
  background-position:
    18px 42px,
    78px 126px,
    144px 88px;
  background-size:
    124px 142px,
    178px 202px,
    218px 176px;
  animation: particleFloat 18s linear infinite;
}

.app-shell[data-scene-mode="image"][data-time="night"] .ambient-haze {
  opacity: 0.3;
}

.app-shell[data-scene-mode="image"][data-time="night"] .ambient-shimmer {
  opacity: 0.2;
}

.app-shell[data-scene-mode="image"][data-time="night"] .ambient-particles {
  opacity: 0.58;
  animation-duration: 14s;
}

.app-shell[data-scene-mode="image"][data-condition="cloudy"] .ambient-haze {
  opacity: 0.42;
  filter: blur(20px);
}

.app-shell[data-scene-mode="image"][data-condition="fog"] .ambient-haze {
  opacity: 0.5;
}

.app-shell[data-scene-mode="image"][data-condition="clear"] .ambient-shimmer,
.app-shell[data-scene-mode="image"][data-condition="partly-cloudy"] .ambient-shimmer {
  opacity: 0.38;
}

.app-shell[data-scene-mode="image"][data-condition="rain"] .ambient-shimmer,
.app-shell[data-scene-mode="image"][data-condition="storm"] .ambient-shimmer {
  opacity: 0.18;
}

.app-shell[data-scene-mode="image"] .scene-vignette {
  opacity: 0.58;
  background:
    radial-gradient(circle at 50% 46%, transparent 0 58%, rgba(1, 6, 14, 0.34) 94%),
    linear-gradient(180deg, rgba(3, 8, 16, 0.1), transparent 45%, rgba(0, 0, 0, 0.18));
  animation: vignetteBreathe 20s ease-in-out infinite;
}

/* Final scene-asset guardrails:
   Cards with real art use that art. Cards without art get an intentional
   pack-themed placeholder. Image scenes keep only ambient, time, and weather
   overlays above the artwork; CSS scene objects stay reserved for css mode. */
.scene-library .scene-option[data-has-asset="false"] .scene-preview {
  display: grid;
  place-items: end start;
  padding: 10px;
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 230, 142, 0.82) 0 6px, transparent 7px),
    radial-gradient(circle at 18% 78%, rgba(53, 224, 216, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(49, 69, 105, 0.92), rgba(18, 30, 47, 0.98));
}

.scene-library .scene-option[data-has-asset="false"] .scene-preview::before,
.scene-library .scene-option[data-has-asset="false"] .scene-preview::after {
  display: block;
  inset: auto;
}

.scene-library .scene-option[data-has-asset="false"] .scene-preview::before {
  content: attr(data-placeholder);
  display: none;
}

.scene-library .scene-option[data-has-asset="false"] .scene-preview::after {
  position: static;
  content: attr(data-pack-label);
}

.scene-library .scene-option[data-has-asset="false"] .scene-preview {
  --placeholder-label: "Scene art coming soon";
}

.scene-library .scene-option[data-has-asset="false"] .scene-preview .scene-badge {
  right: 8px;
  bottom: 8px;
}

.scene-library .scene-option[data-has-asset="false"] .scene-preview::after {
  max-width: calc(100% - 10px);
  color: rgba(236, 251, 255, 0.8);
  font-size: 0.68rem;
  font-weight: 860;
  line-height: 1.12;
  text-transform: uppercase;
}

.scene-library .scene-option[data-scene-pack="city-pack"][data-has-asset="false"] .scene-preview {
  background:
    linear-gradient(to top, rgba(56, 228, 255, 0.54) 0 42%, transparent 43%) 26% 64% / 18px 62px no-repeat,
    linear-gradient(to top, rgba(157, 181, 255, 0.46) 0 58%, transparent 59%) 54% 58% / 20px 78px no-repeat,
    linear-gradient(145deg, #0b1424, #162d56 55%, #08111f);
}

.scene-library .scene-option[data-scene-pack="lifestyle-pack"][data-has-asset="false"] .scene-preview {
  background:
    radial-gradient(ellipse at 46% 74%, rgba(92, 205, 126, 0.42), transparent 34%),
    radial-gradient(circle at 75% 22%, rgba(255, 213, 128, 0.72) 0 8px, transparent 9px),
    linear-gradient(145deg, #162239, #274d47 58%, #122036);
}

.scene-library .scene-option[data-scene-pack="fantasy-pack"][data-has-asset="false"] .scene-preview {
  background:
    radial-gradient(circle at 66% 22%, rgba(213, 170, 255, 0.46), transparent 23%),
    radial-gradient(circle at 28% 74%, rgba(79, 239, 202, 0.2), transparent 34%),
    linear-gradient(145deg, #0c1730, #33205d 58%, #111d34);
}

.scene-library .scene-option[data-scene-pack="future-pack"][data-has-asset="false"] .scene-preview {
  background:
    linear-gradient(to top, rgba(75, 228, 255, 0.8) 0 64%, transparent 65%) 46% 58% / 14px 70px no-repeat,
    radial-gradient(circle at 54% 78%, rgba(101, 228, 255, 0.32), transparent 36%),
    linear-gradient(145deg, #04121e, #0d2d56 58%, #071522);
}

.app-shell[data-scene-mode="image"] .sun-moon,
.app-shell[data-scene-mode="image"] .light-beam,
.app-shell[data-scene-mode="image"] .cloud,
.app-shell[data-scene-mode="image"] .skyline,
.app-shell[data-scene-mode="image"] .distant-hills,
.app-shell[data-scene-mode="image"] .platform,
.app-shell[data-scene-mode="image"] .sky-glow,
.app-shell[data-scene-mode="image"] .atmosphere-back,
.app-shell[data-scene-mode="video"] .sun-moon,
.app-shell[data-scene-mode="video"] .light-beam,
.app-shell[data-scene-mode="video"] .cloud,
.app-shell[data-scene-mode="video"] .skyline,
.app-shell[data-scene-mode="video"] .distant-hills,
.app-shell[data-scene-mode="video"] .platform,
.app-shell[data-scene-mode="video"] .sky-glow,
.app-shell[data-scene-mode="video"] .atmosphere-back {
  opacity: 0 !important;
  pointer-events: none;
}

.app-shell[data-scene-mode="image"] .scene-art {
  background-color: #07111d;
}

.app-shell[data-scene-mode="image"] .ambient-haze {
  opacity: 0.32;
}

.app-shell[data-scene-mode="image"] .ambient-shimmer {
  opacity: 0.3;
}

.app-shell[data-scene-mode="image"] .ambient-particles {
  opacity: 0.36;
}

.app-shell[data-scene-mode="image"][data-time="night"] .ambient-particles {
  opacity: 0.52;
}

.app-shell[data-scene-mode="image"][data-condition="cloudy"] .scene-art {
  filter: saturate(0.94) brightness(0.94);
}

.app-shell[data-scene-mode="image"][data-condition="rain"] .scene-art {
  filter: saturate(0.9) brightness(0.9) contrast(1.02);
}

.app-shell[data-scene-mode="image"][data-condition="storm"] .scene-art {
  filter: saturate(0.88) brightness(0.84) contrast(1.05);
}

.app-shell[data-scene-mode="image"][data-condition="fog"] .scene-art {
  filter: saturate(0.86) brightness(0.93);
}

.app-shell[data-scene-mode="image"][data-condition="snow"] .scene-art {
  filter: saturate(0.88) brightness(0.96) hue-rotate(5deg);
}

.app-shell[data-scene-mode="image"][data-condition="rain"] .rain-layer {
  opacity: 0.24;
}

.app-shell[data-scene-mode="image"][data-condition="storm"] .rain-layer {
  opacity: 0.3;
}

.app-shell[data-scene-mode="image"][data-condition="storm"] .lightning {
  opacity: 0.54;
  animation: lightning 9s steps(1, end) infinite;
}

.app-shell:not([data-condition="storm"]) .lightning {
  opacity: 0 !important;
  animation: none !important;
}

.app-shell[data-scene-mode="image"][data-condition="fog"] .fog-layer {
  opacity: 0.34;
}

.app-shell[data-scene-mode="image"][data-condition="snow"] .snow-layer {
  opacity: 0.34;
}

/* Overlay authority layer
   Base visual: .scene-art/.scene-video or the CSS fallback scene.
   Ambient layer: .ambient-haze, .ambient-shimmer, .ambient-dust, .night-stars.
   Weather layer: .rain-layer, .snow-layer, .fog-layer.
   Time layer: .scene::after and .scene-vignette.
   Storm layer: .lightning.
   Frame layer: .diorama-card and its frame polish.

   These rules intentionally sit late in the file so image scenes are driven by
   data-weather/data-time/data-scene-mode and do not inherit old CSS scene props. */
.app-shell[data-scene-mode="image"] .sun-moon,
.app-shell[data-scene-mode="image"] .light-beam,
.app-shell[data-scene-mode="image"] .cloud,
.app-shell[data-scene-mode="image"] .skyline,
.app-shell[data-scene-mode="image"] .distant-hills,
.app-shell[data-scene-mode="image"] .platform,
.app-shell[data-scene-mode="image"] .sky-glow,
.app-shell[data-scene-mode="image"] .atmosphere-back,
.app-shell[data-scene-mode="image"] .atmosphere-front,
.app-shell[data-scene-mode="image"] .scene-accent,
.app-shell[data-scene-mode="image"] .stars {
  opacity: 0 !important;
  animation: none !important;
  pointer-events: none;
}

.app-shell[data-scene-mode="image"] .scene-art {
  filter: saturate(1.02) brightness(0.99) contrast(1.02);
}

.app-shell[data-scene-mode="image"] .ambient-haze,
.app-shell[data-scene-mode="image"] .ambient-shimmer,
.app-shell[data-scene-mode="image"] .ambient-particles,
.app-shell[data-scene-mode="image"] .ambient-dust,
.app-shell[data-scene-mode="image"] .night-stars,
.app-shell[data-scene-mode="image"] .rain-layer,
.app-shell[data-scene-mode="image"] .snow-layer,
.app-shell[data-scene-mode="image"] .fog-layer,
.app-shell[data-scene-mode="image"] .lightning {
  opacity: 0 !important;
  pointer-events: none;
}

.app-shell[data-scene-mode="image"] .scene::after {
  opacity: 0.1 !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(3, 8, 16, 0.08));
}

.app-shell[data-scene-mode="image"][data-time="morning"] .scene::after {
  opacity: 0.12 !important;
  background: linear-gradient(160deg, rgba(255, 194, 132, 0.1), transparent 46%, rgba(61, 227, 216, 0.035));
}

.app-shell[data-scene-mode="image"][data-time="evening"] .scene::after {
  opacity: 0.15 !important;
  background: linear-gradient(145deg, rgba(255, 143, 96, 0.13), transparent 48%, rgba(56, 73, 145, 0.08));
}

.app-shell[data-scene-mode="image"][data-time="night"] .scene::after {
  opacity: 0.18 !important;
  background: linear-gradient(180deg, rgba(7, 20, 48, 0.2), rgba(1, 5, 14, 0.14));
}

.ambient-dust,
.night-stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.app-shell[data-scene-mode="image"] .ambient-haze {
  background:
    radial-gradient(ellipse at 48% 18%, rgba(209, 232, 255, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(207, 230, 255, 0.06), transparent 56%);
  mix-blend-mode: screen;
  transform: scale(1.05);
  animation: overlayHazeDrift 22s ease-in-out infinite;
}

.app-shell[data-scene-mode="image"] .ambient-shimmer {
  background:
    radial-gradient(ellipse at 32% 30%, rgba(255, 226, 164, 0.15), transparent 38%),
    radial-gradient(ellipse at 74% 68%, rgba(82, 224, 255, 0.08), transparent 34%);
  filter: blur(14px);
  mix-blend-mode: screen;
  transform: translate3d(-1%, 0, 0) scale(1.04);
  animation: overlaySoftDrift 19s ease-in-out infinite;
}

.app-shell[data-scene-mode="image"] .ambient-dust {
  background-image:
    radial-gradient(circle, rgba(255, 239, 192, 0.62) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(101, 239, 225, 0.36) 0 1px, transparent 1.8px);
  background-position: 12% 34%, 72% 18%;
  background-size: 210px 180px, 260px 220px;
  mask-image: radial-gradient(ellipse at 52% 42%, #000 0 34%, transparent 74%);
  mix-blend-mode: screen;
  animation: overlayDustFloat 26s linear infinite;
}

.app-shell[data-scene-mode="image"] .night-stars {
  background-image:
    radial-gradient(circle, rgba(245, 252, 255, 0.95) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(185, 224, 255, 0.72) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 255, 255, 0.62) 0 0.8px, transparent 1.5px);
  background-position: 12% 10%, 52% 18%, 82% 8%;
  background-size: 190px 130px, 230px 150px, 290px 180px;
  mask-image: linear-gradient(180deg, #000 0 42%, rgba(0, 0, 0, 0.38) 58%, transparent 75%);
  mix-blend-mode: screen;
  animation: overlayStarTwinkle 8s ease-in-out infinite;
}

.app-shell[data-scene-mode="image"][data-weather="clear"] .ambient-shimmer,
.app-shell[data-scene-mode="image"][data-weather="partly-cloudy"] .ambient-shimmer {
  opacity: 0.24 !important;
}

.app-shell[data-scene-mode="image"][data-weather="clear"][data-time="morning"] .ambient-dust,
.app-shell[data-scene-mode="image"][data-weather="clear"][data-time="day"] .ambient-dust,
.app-shell[data-scene-mode="image"][data-weather="clear"][data-time="evening"] .ambient-dust,
.app-shell[data-scene-mode="image"][data-weather="partly-cloudy"][data-time="morning"] .ambient-dust,
.app-shell[data-scene-mode="image"][data-weather="partly-cloudy"][data-time="day"] .ambient-dust,
.app-shell[data-scene-mode="image"][data-weather="partly-cloudy"][data-time="evening"] .ambient-dust {
  opacity: 0.13 !important;
}

.app-shell[data-scene-mode="image"][data-weather="clear"][data-time="night"] .night-stars {
  opacity: 0.2 !important;
}

.app-shell[data-scene-mode="image"][data-weather="cloudy"] .scene-art,
.app-shell[data-scene-mode="image"][data-weather="partly-cloudy"] .scene-art {
  filter: saturate(0.95) brightness(0.96) contrast(1.01);
}

.app-shell[data-scene-mode="image"][data-weather="cloudy"] .ambient-haze,
.app-shell[data-scene-mode="image"][data-weather="partly-cloudy"] .ambient-haze {
  opacity: 0.18 !important;
}

.app-shell[data-scene-mode="image"][data-weather="cloudy"][data-time="night"] .night-stars,
.app-shell[data-scene-mode="image"][data-weather="partly-cloudy"][data-time="night"] .night-stars {
  opacity: 0.06 !important;
}

.app-shell[data-scene-mode="image"][data-weather="rain"] .scene-art {
  filter: saturate(0.9) brightness(0.9) contrast(1.03);
}

.app-shell[data-scene-mode="image"][data-weather="rain"] .rain-layer {
  opacity: 0.24 !important;
}

.app-shell[data-scene-mode="image"][data-weather="rain"] .ambient-haze {
  opacity: 0.13 !important;
}

.app-shell[data-scene-mode="image"][data-weather="storm"] .scene-art {
  filter: saturate(0.86) brightness(0.82) contrast(1.06);
}

.app-shell[data-scene-mode="image"][data-weather="storm"] .rain-layer {
  opacity: 0.34 !important;
}

.app-shell[data-scene-mode="image"][data-weather="storm"] .lightning {
  opacity: 0.44 !important;
  animation: lightning 9s steps(1, end) infinite;
}

.app-shell:not([data-weather="storm"]) .lightning {
  opacity: 0 !important;
  animation: none !important;
}

.app-shell[data-scene-mode="image"][data-weather="fog"] .scene-art {
  filter: saturate(0.86) brightness(0.93) contrast(0.98);
}

.app-shell[data-scene-mode="image"][data-weather="fog"] .ambient-haze {
  opacity: 0.2 !important;
}

.app-shell[data-scene-mode="image"][data-weather="fog"] .fog-layer {
  opacity: 0.24 !important;
}

.app-shell[data-scene-mode="image"][data-weather="snow"] .scene-art {
  filter: saturate(0.88) brightness(0.96) hue-rotate(5deg);
}

.app-shell[data-scene-mode="image"][data-weather="snow"] .snow-layer {
  opacity: 0.32 !important;
}

.app-shell[data-scene-mode="image"][data-weather="rain"] .ambient-dust,
.app-shell[data-scene-mode="image"][data-weather="rain"] .night-stars,
.app-shell[data-scene-mode="image"][data-weather="storm"] .ambient-dust,
.app-shell[data-scene-mode="image"][data-weather="storm"] .night-stars,
.app-shell[data-scene-mode="image"][data-weather="fog"] .ambient-dust,
.app-shell[data-scene-mode="image"][data-weather="fog"] .night-stars,
.app-shell[data-scene-mode="image"][data-weather="snow"] .ambient-dust,
.app-shell[data-scene-mode="image"][data-weather="snow"] .night-stars {
  opacity: 0 !important;
}

.qa-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  width: min(310px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid rgba(173, 203, 230, 0.26);
  border-radius: 14px;
  background: rgba(11, 19, 31, 0.92);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  color: var(--text);
}

.qa-panel[hidden] {
  display: none;
}

.qa-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.qa-panel-header div {
  min-width: 0;
}

.qa-panel-header strong,
.qa-panel-header span {
  display: block;
}

.qa-panel-header span {
  max-width: 178px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.qa-toggle,
.qa-cycle-button {
  min-height: 34px;
  color: var(--text);
  cursor: pointer;
  border: 1px solid rgba(53, 224, 216, 0.28);
  border-radius: 10px;
  background: rgba(53, 224, 216, 0.1);
  font: inherit;
  font-weight: 850;
}

.qa-toggle {
  flex: 0 0 auto;
  padding: 0 10px;
  color: var(--cyan);
  font-size: 0.68rem;
}

.qa-cycle-button {
  width: 100%;
  margin-top: 10px;
  color: #031416;
  background: linear-gradient(135deg, var(--cyan), #72f2df);
  box-shadow: 0 10px 26px rgba(53, 224, 216, 0.18);
}

.qa-panel-body {
  display: none;
  margin-top: 10px;
}

.qa-panel[data-open="true"] .qa-panel-body {
  display: block;
}

.qa-panel label {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.qa-panel select {
  min-height: 38px;
  border: 1px solid rgba(173, 203, 230, 0.24);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  text-transform: none;
}

.qa-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 520px) {
  .qa-panel {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }

  .qa-panel-header span {
    max-width: 50vw;
  }
}

@keyframes overlaySoftDrift {
  0%,
  100% {
    transform: translate3d(-1%, 0, 0) scale(1.04);
  }
  50% {
    transform: translate3d(1.4%, -1%, 0) scale(1.06);
  }
}

@keyframes overlayHazeDrift {
  0%,
  100% {
    transform: translate3d(-1%, 0, 0) scale(1.05);
  }
  50% {
    transform: translate3d(1.5%, 0.8%, 0) scale(1.07);
  }
}

@keyframes overlayDustFloat {
  from {
    background-position: 12% 34%, 72% 18%;
  }
  to {
    background-position: 18% 26%, 66% 28%;
  }
}

@keyframes overlayStarTwinkle {
  0%,
  100% {
    filter: brightness(0.9);
  }
  50% {
    filter: brightness(1.28);
  }
}

@keyframes vignetteBreathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.52;
  }
  50% {
    transform: scale(1.025);
    opacity: 0.64;
  }
}

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

/* Real generated night images already include moonlight, contrast, glow, and
   darkness. When the selected asset is a real night variant, keep the art vivid
   instead of stacking the CSS night tint and condition darkening over it. */
.app-shell[data-scene-mode="image"][data-scene-variant="night"] .scene-art {
  filter: saturate(1.08) brightness(1.02) contrast(1.06) !important;
}

.app-shell[data-scene-mode="image"][data-scene-variant="night"] .scene::after {
  opacity: 0 !important;
}

.app-shell[data-scene-mode="image"][data-scene-variant="night"] .scene-vignette {
  opacity: 0.28;
}

.app-shell[data-scene-mode="image"][data-scene-variant="night"] .ambient-haze {
  opacity: 0.08 !important;
}

.app-shell[data-scene-mode="image"][data-scene-variant="night"] .ambient-shimmer {
  opacity: 0.16 !important;
}

.app-shell[data-scene-mode="image"][data-scene-variant="night"][data-weather="clear"] .night-stars,
.app-shell[data-scene-mode="image"][data-scene-variant="night"][data-weather="partly-cloudy"] .night-stars {
  opacity: 0.1 !important;
}

.app-shell[data-scene-mode="image"][data-scene-variant="night"][data-weather="cloudy"] .night-stars,
.app-shell[data-scene-mode="image"][data-scene-variant="night"][data-weather="rain"] .night-stars,
.app-shell[data-scene-mode="image"][data-scene-variant="night"][data-weather="fog"] .night-stars {
  opacity: 0 !important;
}

/* Real storm images already contain the dramatic sky and lighting. Keep them
   clear and punchy, then add only lightweight rain motion above the artwork. */
.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .scene-art {
  filter: saturate(1.06) brightness(1.02) contrast(1.07) !important;
}

.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .scene::after {
  opacity: 0 !important;
}

.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .scene-vignette {
  opacity: 0;
}

.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .ambient-haze,
.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .ambient-dust,
.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .night-stars,
.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .fog-layer,
.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .snow-layer,
.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .lightning {
  opacity: 0 !important;
}

.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .ambient-shimmer {
  opacity: 0 !important;
}

.app-shell[data-scene-mode="image"][data-scene-variant="storm"] .rain-layer {
  opacity: 0.18 !important;
}

/* Image-scene cloud and fog tuning:
   Fog should feel like a weather event moving through the diorama, while
   cloudy should feel like soft sky atmosphere rather than duplicate clouds. */
.app-shell[data-scene-mode="image"][data-weather="cloudy"] .ambient-haze {
  opacity: 0.34 !important;
  background:
    radial-gradient(ellipse at 24% 18%, rgba(234, 242, 246, 0.34), transparent 30%),
    radial-gradient(ellipse at 72% 20%, rgba(211, 226, 237, 0.3), transparent 34%),
    linear-gradient(180deg, rgba(218, 232, 240, 0.2), rgba(218, 232, 240, 0.08) 48%, transparent 72%);
  mask-image: linear-gradient(180deg, #000 0 48%, rgba(0, 0, 0, 0.48) 64%, transparent 82%);
  mix-blend-mode: screen;
}

.app-shell[data-scene-mode="image"][data-weather="partly-cloudy"] .ambient-haze {
  opacity: 0.18 !important;
  background:
    radial-gradient(ellipse at 28% 18%, rgba(245, 250, 255, 0.22), transparent 28%),
    radial-gradient(ellipse at 74% 24%, rgba(230, 239, 248, 0.18), transparent 32%);
  mask-image: linear-gradient(180deg, #000 0 44%, transparent 76%);
}

.app-shell[data-scene-mode="image"][data-weather="cloudy"] .scene::after,
.app-shell[data-scene-mode="image"][data-weather="partly-cloudy"] .scene::after {
  opacity: 0.08 !important;
  background: linear-gradient(180deg, rgba(215, 228, 238, 0.1), rgba(13, 24, 37, 0.06));
}

.app-shell[data-scene-mode="image"][data-weather="fog"] .scene-art {
  filter: saturate(0.9) brightness(0.98) contrast(0.96) !important;
}

.app-shell[data-scene-mode="image"][data-weather="fog"] .ambient-haze {
  opacity: 0.42 !important;
  background:
    radial-gradient(ellipse at 48% 24%, rgba(236, 246, 248, 0.34), transparent 36%),
    linear-gradient(180deg, rgba(229, 242, 245, 0.22), rgba(229, 242, 245, 0.08) 52%, transparent 78%);
  mask-image: linear-gradient(180deg, #000 0 38%, rgba(0, 0, 0, 0.76) 58%, transparent 86%);
}

.app-shell[data-scene-mode="image"][data-weather="fog"] .fog-layer {
  right: -38%;
  left: -38%;
  height: 24%;
  opacity: 0.58 !important;
  background:
    radial-gradient(ellipse at 22% 48%, rgba(245, 252, 252, 0.7), transparent 42%),
    radial-gradient(ellipse at 62% 54%, rgba(226, 240, 242, 0.58), transparent 46%),
    linear-gradient(90deg, transparent, rgba(239, 248, 248, 0.5) 24%, rgba(222, 237, 240, 0.56) 58%, transparent);
  border-radius: 999px;
  filter: blur(26px);
  mix-blend-mode: screen;
}

.app-shell[data-scene-mode="image"][data-weather="fog"] .fog-a {
  top: 34%;
  animation-duration: 18s;
}

.app-shell[data-scene-mode="image"][data-weather="fog"] .fog-b {
  top: 57%;
  opacity: 0.48 !important;
  animation-duration: 23s;
}

@media (max-width: 719px) {
  .app-shell[data-scene-mode="image"][data-weather="fog"] .fog-layer {
    height: 22%;
    filter: blur(24px);
  }

  .app-shell[data-scene-mode="image"][data-weather="fog"] .fog-a {
    top: 37%;
  }

  .app-shell[data-scene-mode="image"][data-weather="fog"] .fog-b {
    top: 62%;
  }

  .app-shell[data-scene-mode="image"][data-weather="cloudy"] .ambient-haze {
    opacity: 0.3 !important;
    mask-image: linear-gradient(180deg, #000 0 42%, rgba(0, 0, 0, 0.44) 58%, transparent 76%);
  }
}

/* Mobile portrait scene test overrides:
   These intentionally set background-image directly so they beat any older
   inline scene variable or browser cache oddity during phone QA. Once every
   scene has portrait assets, this can become the standard mobile path. */
@media (max-width: 1024px), (pointer: coarse) {
  .app-shell[data-scene-mode="image"][data-scene="castle-kingdom"] .scene-art,
  .app-shell[data-scene-mode="image"][data-scene="enchanted-castle"] .scene-art {
    background-position: center 58% !important;
    background-size: cover !important;
    transform: none !important;
  }

  .app-shell[data-scene-mode="image"][data-scene="castle-kingdom"][data-scene-variant="day"] .scene-art {
    background-image: url("./assets/scenes/castle-kingdom/mobile-day.png") !important;
  }

  .app-shell[data-scene-mode="image"][data-scene="castle-kingdom"][data-scene-variant="night"] .scene-art {
    background-image: url("./assets/scenes/castle-kingdom/mobile-night.png") !important;
  }

  .app-shell[data-scene-mode="image"][data-scene="castle-kingdom"][data-scene-variant="storm"] .scene-art {
    background-image: url("./assets/scenes/castle-kingdom/mobile-storm.png") !important;
  }

  .app-shell[data-scene-mode="image"][data-scene="castle-kingdom"][data-scene-variant="snow"] .scene-art {
    background-image: url("./assets/scenes/castle-kingdom/mobile-snow.png") !important;
  }

  .app-shell[data-scene-mode="image"][data-scene="enchanted-castle"][data-scene-variant="day"] .scene-art {
    background-image: url("./assets/scenes/enchanted-castle/mobile-day.png") !important;
  }

  .app-shell[data-scene-mode="image"][data-scene="enchanted-castle"][data-scene-variant="night"] .scene-art {
    background-image: url("./assets/scenes/enchanted-castle/mobile-night.png") !important;
  }

  .app-shell[data-scene-mode="image"][data-scene="enchanted-castle"][data-scene-variant="storm"] .scene-art {
    background-image: url("./assets/scenes/enchanted-castle/mobile-storm.png") !important;
  }

  .app-shell[data-scene-mode="image"][data-scene="enchanted-castle"][data-scene-variant="snow"] .scene-art {
    background-image: url("./assets/scenes/enchanted-castle/mobile-snow.png") !important;
  }
}

/* Phone beta shell:
   The mobile experience is scene-first. Weather summary floats over the art,
   while details, forecast, search, and scene controls live in a bottom sheet. */
@media (max-width: 719px) {
  body {
    min-height: 100svh;
    overflow-x: hidden;
  }

  .app-shell {
    min-height: 100svh;
    padding: 0;
  }

  .scene-panel {
    width: 100%;
    margin: 0;
  }

  .diorama-card {
    height: 100svh;
    min-height: 0;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .scene {
    border-radius: 0;
  }

  .app-shell[data-scene-mode="image"] .scene-art {
    background-position: center center;
    background-size: cover;
  }

  .topbar {
    top: max(12px, env(safe-area-inset-top));
    right: 14px;
    left: 14px;
  }

  .brand-copy {
    max-width: calc(100vw - 108px);
  }

  .eyebrow {
    font-size: 0.8rem;
  }

  .location-name {
    max-width: 100%;
    font-size: clamp(1rem, 4.7vw, 1.28rem);
  }

  .topbar .icon-button {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    border-radius: 14px;
  }

  .current-weather {
    position: fixed;
    right: 0;
    bottom: calc(74px + env(safe-area-inset-bottom));
    left: 0;
    z-index: 9;
    margin: 0;
    padding: 96px 22px 18px;
    pointer-events: none;
    background:
      linear-gradient(180deg, transparent 0%, rgba(2, 7, 15, 0.2) 32%, rgba(2, 7, 15, 0.72) 100%);
    border-radius: 0;
  }

  .temperature-row {
    align-items: flex-end;
  }

  .condition {
    max-width: 52vw;
    font-size: clamp(2.15rem, 11vw, 3.9rem);
    line-height: 0.98;
  }

  .time-label {
    margin-top: 8px;
    font-size: clamp(0.98rem, 4.2vw, 1.22rem);
  }

  .temperature {
    max-width: 46vw;
    font-size: clamp(5rem, 22vw, 8.25rem);
    line-height: 0.78;
  }

  .degree-symbol {
    font-size: 0.62em;
  }

  .status-panel {
    display: none;
  }

  .more-sheet {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    z-index: 20;
    margin: 0;
  }

  .more-sheet-toggle {
    min-height: 58px;
    padding: 0 18px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
      rgba(10, 20, 33, 0.76);
    border-color: rgba(184, 214, 240, 0.28);
    border-radius: 16px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 20px 58px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(18px);
  }

  .more-sheet-content {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    left: 0;
    max-height: min(70svh, 620px);
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
      rgba(7, 17, 29, 0.92);
    border: 1px solid rgba(184, 214, 240, 0.18);
    border-radius: 18px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.09),
      0 30px 90px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(22px);
  }

  .more-sheet[data-open="true"] .more-sheet-content {
    display: grid;
  }

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

  .detail-card {
    min-height: 72px;
  }

  .hourly-panel,
  .search-card,
  .scene-picker {
    margin-top: 0;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .scene-library {
    z-index: 40;
  }

  .qa-panel {
    right: 10px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 24;
  }

  .qa-panel:not([data-open="true"]) {
    max-width: 300px;
    left: auto;
  }
}

@media (max-width: 380px) {
  .current-weather {
    bottom: calc(70px + env(safe-area-inset-bottom));
    padding-right: 16px;
    padding-left: 16px;
  }

  .condition {
    max-width: 50vw;
    font-size: clamp(1.9rem, 10.2vw, 3.2rem);
  }

  .temperature {
    font-size: clamp(4.45rem, 21vw, 7.3rem);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}
