html,
body {
  min-width: 320px;
  min-height: 100%;
}

body {
  background: #e9eef2;
  color: var(--map-ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

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

.screen.is-active {
  animation: screen-in 700ms var(--ease-out) both;
}

@keyframes screen-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: calc(64px + var(--safe-top));
  padding: calc(14px + var(--safe-top)) max(20px, var(--safe-right)) 10px max(20px, var(--safe-left));
  position: relative;
  z-index: 20;
}

.wordmark {
  color: inherit;
  font-size: clamp(1.04rem, 3.5vw, 1.32rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.language-switch {
  align-items: center;
  display: flex;
  font-size: 0.72rem;
  gap: 2px;
  letter-spacing: 0.08em;
  opacity: 0.82;
}

.language-button {
  background: transparent;
  border-radius: 999px;
  min-height: 36px;
  min-width: 34px;
  opacity: 0.48;
  padding: 6px;
}

.language-button.is-active {
  font-weight: 700;
  opacity: 1;
}

/* Location screen */
.map-screen {
  background:
    radial-gradient(circle at 82% 4%, rgba(181, 215, 225, 0.33), transparent 33%),
    linear-gradient(155deg, #fbfcfc 0%, #f3f7f8 56%, #e8eff1 100%);
  color: var(--map-ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar--map {
  min-height: calc(52px + var(--safe-top));
  padding-bottom: 4px;
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
  padding-top: calc(8px + var(--safe-top));
}

.map-page {
  flex: 1 0 auto;
  margin: 0 auto;
  max-width: 1180px;
  padding: 2px max(18px, var(--safe-right)) max(8px, var(--safe-bottom)) max(18px, var(--safe-left));
  width: 100%;
}

.map-intro {
  margin: 2px 4px 10px;
}

.kicker {
  color: var(--map-muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  margin-bottom: 1px;
}

.map-intro h1 {
  font-size: clamp(1.32rem, 6vw, 2.35rem);
  font-size: clamp(1.32rem, min(6vw, 3.8dvh), 2.35rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.map-shell {
  display: grid;
  gap: 8px;
}

.location-controls {
  display: grid;
  gap: 6px;
}

.search-block {
  position: relative;
  z-index: 30;
}

.search-form {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(63, 84, 106, 0.08);
  border-radius: var(--radius-small);
  box-shadow: 0 12px 32px rgba(36, 59, 76, 0.08);
  display: grid;
  grid-template-columns: 1fr 44px;
  min-height: 44px;
  overflow: hidden;
}

.search-form input {
  background: transparent;
  border: 0;
  min-width: 0;
  padding: 0 0 0 16px;
}

.search-form input::-webkit-search-cancel-button {
  opacity: 0.55;
}

.icon-button {
  align-items: center;
  background: transparent;
  display: inline-flex;
  justify-content: center;
}

.search-button span {
  border: 1.6px solid var(--map-muted);
  border-radius: 50%;
  height: 15px;
  position: relative;
  width: 15px;
}

.search-button span::after {
  background: var(--map-muted);
  content: "";
  height: 1.6px;
  position: absolute;
  right: -5px;
  top: 11px;
  transform: rotate(45deg);
  width: 7px;
}

.search-form.is-loading .search-button span {
  animation: search-spin 700ms linear infinite;
  border-bottom-color: transparent;
}

.search-form.is-loading .search-button span::after {
  opacity: 0;
}

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

.search-button:disabled,
.soft-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.search-results {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(63, 84, 106, 0.1);
  border-radius: var(--radius-small);
  box-shadow: 0 18px 42px rgba(31, 52, 70, 0.18);
  left: 0;
  max-height: min(224px, 36vh);
  max-height: min(224px, 36dvh);
  overflow-y: auto;
  padding: 7px;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
}

.search-results-label {
  color: var(--map-muted);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  padding: 3px 8px 5px;
}

.search-result-list {
  display: grid;
  gap: 2px;
}

.search-result {
  background: transparent;
  border-radius: 10px;
  color: var(--map-ink);
  display: block;
  font-size: 0.76rem;
  line-height: 1.35;
  min-height: 44px;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.search-result strong,
.search-result span {
  display: block;
  overflow-wrap: anywhere;
}

.search-result strong {
  font-weight: 600;
}

.search-result span {
  color: var(--map-muted);
  font-size: 0.66rem;
  margin-top: 1px;
}

.search-result:hover,
.search-result:focus-visible {
  background: rgba(223, 233, 237, 0.68);
}

.quick-controls {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
}

.soft-button,
.date-control {
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(56, 76, 94, 0.1);
  border-radius: 999px;
  display: flex;
  min-height: 44px;
  min-width: 0;
}

.soft-button {
  gap: 6px;
  justify-content: center;
  padding: 0 8px;
}

.soft-button > span:last-child {
  white-space: nowrap;
}

.target-icon {
  border: 1.5px solid currentColor;
  border-radius: 50%;
  height: 13px;
  position: relative;
  width: 13px;
}

.target-icon::after {
  background: currentColor;
  border-radius: 50%;
  content: "";
  inset: 3px;
  position: absolute;
}

.date-control {
  gap: 4px;
  justify-content: space-between;
  padding: 0 8px 0 10px;
}

.date-control > span {
  color: var(--map-muted);
  font-size: 0.72rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.date-control input {
  background: transparent;
  border: 0;
  flex: 1 1 auto;
  min-width: 0;
  width: 112px;
}

.inline-status {
  color: var(--map-muted);
  font-size: 0.68rem;
  line-height: 1.3;
  min-height: 2.6em;
  padding: 0 3px;
}

.map-canvas {
  background:
    radial-gradient(ellipse at 52% 48%, rgba(169, 206, 227, 0.64) 0 12%, transparent 13%),
    repeating-linear-gradient(26deg, transparent 0 46px, rgba(141, 162, 154, 0.13) 47px 48px),
    repeating-linear-gradient(111deg, transparent 0 66px, rgba(155, 169, 163, 0.12) 67px 68px),
    linear-gradient(145deg, #f8f7ed, #e7f0e8 48%, #eef4f4);
  border: 1px solid rgba(60, 83, 89, 0.1);
  border-radius: var(--radius-medium);
  box-shadow: inset 0 0 80px rgba(91, 119, 120, 0.08), 0 24px 50px rgba(38, 66, 75, 0.08);
  height: clamp(210px, 31vh, 340px);
  height: clamp(210px, 31dvh, 340px);
  min-height: 210px;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.map-fallback {
  inset: 0;
  opacity: 1;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  transition: opacity 180ms ease;
  z-index: 2;
}

.map-canvas.is-map-ready .map-fallback {
  opacity: 0;
}

.map-canvas .maplibregl-canvas-container,
.map-canvas .maplibregl-canvas {
  border-radius: inherit;
}

.map-canvas .maplibregl-ctrl-attrib {
  background: rgba(255, 255, 255, 0.76);
  font-size: 9px;
}

.map-canvas .maplibregl-ctrl-attrib a {
  color: #334d5f;
}

.map-canvas::after {
  background: linear-gradient(90deg, rgba(255,255,255,.25), transparent 30%, transparent 70%, rgba(255,255,255,.18));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.map-rings {
  border: 1px solid rgba(82, 123, 145, 0.12);
  border-radius: 50%;
  height: 260px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
}

.map-rings::before,
.map-rings::after {
  border: 1px solid rgba(82, 123, 145, 0.1);
  border-radius: inherit;
  content: "";
  inset: 32px;
  position: absolute;
}

.map-rings::after { inset: 76px; }

.lake-shape {
  background: linear-gradient(145deg, #b9d8e9, #91bed8);
  clip-path: polygon(47% 0, 57% 10%, 62% 25%, 57% 40%, 63% 55%, 56% 76%, 48% 100%, 40% 89%, 43% 67%, 36% 48%, 41% 25%);
  filter: drop-shadow(0 8px 13px rgba(66, 121, 147, 0.18));
  height: 72%;
  left: 33%;
  opacity: 0.9;
  position: absolute;
  top: 12%;
  transform: rotate(-7deg);
  width: 36%;
}

.map-road {
  border: solid rgba(202, 180, 140, 0.48);
  border-width: 2px 0 0;
  border-radius: 50%;
  height: 45%;
  position: absolute;
  width: 78%;
}

.map-road--one { left: -8%; top: 26%; transform: rotate(12deg); }
.map-road--two { right: -17%; top: 56%; transform: rotate(-17deg); }

.map-marker {
  height: 38px;
  left: var(--marker-x);
  position: absolute;
  top: var(--marker-y);
  transform: translate(-50%, -100%);
  width: 28px;
  z-index: 3;
}

.map-marker::before {
  animation: marker-ripple 1s var(--ease-out) both;
  background: rgba(236, 99, 88, 0.2);
  border-radius: 50%;
  bottom: -5px;
  content: "";
  height: 28px;
  left: 0;
  position: absolute;
  width: 28px;
}

.map-marker span {
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 8px 18px rgba(90, 49, 45, 0.26);
  height: 24px;
  left: 2px;
  position: absolute;
  top: 1px;
  transform: rotate(-45deg);
  width: 24px;
}

.interactive-map-marker {
  cursor: grab;
  height: 38px;
  position: relative;
  width: 28px;
}

.interactive-map-marker:active {
  cursor: grabbing;
}

.interactive-map-marker::before {
  background: rgba(236, 99, 88, 0.2);
  border-radius: 50%;
  bottom: -5px;
  content: "";
  height: 28px;
  left: 0;
  position: absolute;
  width: 28px;
}

.interactive-map-marker::after {
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 8px 18px rgba(90, 49, 45, 0.26);
  content: "";
  height: 24px;
  left: 2px;
  position: absolute;
  top: 1px;
  transform: rotate(-45deg);
  width: 24px;
}

@keyframes marker-ripple {
  from { opacity: 0.8; transform: scale(0.3); }
  to { opacity: 0; transform: scale(1.8); }
}

.map-place-label {
  color: rgba(33, 60, 71, 0.45);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  position: absolute;
}

.map-place-label--otsu { left: 58%; top: 66%; }
.map-place-label--biwa { left: 41%; top: 35%; transform: rotate(-70deg); }

.map-attribution {
  bottom: 9px;
  color: rgba(38, 58, 65, 0.45);
  font-size: 0.57rem;
  position: absolute;
  right: 12px;
}

.map-error {
  align-items: center;
  background: rgba(247, 249, 249, 0.94);
  border: 1px solid rgba(48, 70, 82, 0.11);
  border-radius: 12px;
  bottom: 12px;
  box-shadow: 0 10px 26px rgba(37, 57, 67, 0.15);
  color: var(--map-ink);
  display: flex;
  font-size: 0.68rem;
  gap: 9px;
  left: 12px;
  line-height: 1.35;
  padding: 8px 9px 8px 11px;
  pointer-events: auto;
  position: absolute;
  right: 12px;
  z-index: 5;
}

.map-error button {
  background: #162a40;
  border-radius: 999px;
  color: #fff;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 13px;
}

.selected-location-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(56, 76, 94, 0.08);
  border-radius: var(--radius-small);
  display: flex;
  gap: 10px;
  min-height: 58px;
  padding: 8px 12px;
}

.selected-location-card > div {
  display: grid;
  gap: 0;
  line-height: 1.3;
  min-width: 0;
}

.pin-dot {
  background: var(--accent);
  border: 4px solid rgba(239, 100, 91, 0.15);
  background-clip: padding-box;
  border-radius: 50%;
  height: 17px;
  width: 17px;
}

.card-label,
.coordinates {
  color: var(--map-muted);
  font-size: 0.68rem;
}

.selected-location-card strong {
  font-size: 0.92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.primary-button {
  align-items: center;
  background: #162a40;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(18, 36, 56, 0.17);
  color: #fff;
  display: flex;
  font-size: 0.97rem;
  font-weight: 600;
  justify-content: space-between;
  justify-self: center;
  min-height: 48px;
  padding: 0 18px 0 20px;
  width: min(260px, calc(100% - 32px));
}

.primary-button:hover { background: #203a55; }

/* Experience screen */
.scene-screen {
  background: var(--sky-top);
  color: var(--scene-text);
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  position: relative;
  transition: color 180ms linear;
}

.scene-visual {
  --scene-position-x: 50%;
  --scene-position-y: 50%;
  --scene-scale: 1;
  --scene-translate-x: 0%;
  --scene-translate-y: 0%;
  background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-middle) 48%, var(--sky-horizon) 72%, var(--surface-color) 73%, var(--surface-color) 100%);
  inset: 0;
  overflow: hidden;
  position: absolute;
  transition: background 120ms linear;
  z-index: -2;
}

.scene-images {
  inset: 0;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  transition: opacity 220ms linear;
}

.scene-image {
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: var(--scene-position-x) var(--scene-position-y);
  opacity: 0;
  position: absolute;
  transform: translate(var(--scene-translate-x), var(--scene-translate-y)) scale(var(--scene-scale));
  transform-origin: center;
  width: 100%;
  will-change: opacity, transform;
}

.scene-image--day.is-loaded { opacity: var(--day-opacity); }
.scene-image--sunset.is-loaded { opacity: var(--sunset-opacity); }
.scene-image--night.is-loaded { opacity: var(--night-opacity); }

.scene-visual.is-scene-ready .scene-images { opacity: 1; }

.sky-glow {
  background: radial-gradient(ellipse at 50% 67%, color-mix(in srgb, var(--sky-horizon) 90%, white) 0%, transparent 42%);
  inset: 0;
  opacity: var(--sky-glow-opacity);
  position: absolute;
}

.stars {
  inset: 0;
  opacity: var(--star-opacity);
  position: absolute;
  transition: opacity 180ms linear;
}

.stars::before,
.stars::after {
  animation: star-shimmer-a 8.7s ease-in-out infinite;
  background: #fff;
  border-radius: 50%;
  box-shadow: 8vw 8vh rgba(255,255,255,.8), 20vw 16vh rgba(255,255,255,.55), 34vw 7vh rgba(255,255,255,.82), 49vw 22vh rgba(255,255,255,.7), 61vw 11vh rgba(255,255,255,.58), 75vw 20vh rgba(255,255,255,.8), 88vw 9vh rgba(255,255,255,.62), 94vw 29vh rgba(255,255,255,.7), 13vw 34vh rgba(255,255,255,.52), 42vw 36vh rgba(255,255,255,.74), 72vw 39vh rgba(255,255,255,.6);
  content: "";
  height: 2px;
  left: 4vw;
  position: absolute;
  top: 5vh;
  width: 2px;
}

.stars::after {
  animation-name: star-shimmer-b;
  animation-delay: -4.3s;
  animation-duration: 13.1s;
  box-shadow: 6vw 24vh rgba(255,255,255,.5), 25vw 29vh rgba(255,255,255,.74), 38vw 18vh rgba(255,255,255,.48), 56vw 5vh rgba(255,255,255,.8), 67vw 31vh rgba(255,255,255,.68), 82vw 33vh rgba(255,255,255,.55), 91vw 17vh rgba(255,255,255,.76);
  height: 1px;
  left: 1vw;
  top: 1vh;
  width: 1px;
}

.stars--two { transform: translate(3vw, 5vh) scale(0.8); }

.scene-visual[data-phase="day"] .stars::before,
.scene-visual[data-phase="day"] .stars::after,
.scene-visual[data-phase="sunset"] .stars::before,
.scene-visual[data-phase="sunset"] .stars::after {
  animation-play-state: paused;
}

@keyframes star-shimmer-a {
  0%, 100% { filter: brightness(0.98); opacity: 0.82; }
  19% { filter: brightness(1.03); opacity: 0.90; }
  47% { filter: brightness(0.96); opacity: 0.78; }
  71% { filter: brightness(1.05); opacity: 0.92; }
}

@keyframes star-shimmer-b {
  0%, 100% { filter: brightness(0.97); opacity: 0.76; }
  31% { filter: brightness(1.04); opacity: 0.88; }
  58% { filter: brightness(0.95); opacity: 0.73; }
  83% { filter: brightness(1.02); opacity: 0.84; }
}

@media (prefers-reduced-motion: reduce) {
  .stars::before,
  .stars::after { animation: none; }
}

.celestial-orb {
  background: rgba(255, 225, 170, 0.92);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(255, 190, 120, 0.55);
  height: 28px;
  left: 50%;
  opacity: var(--orb-opacity);
  position: absolute;
  top: var(--orb-y);
  transform: translateX(-50%);
  width: 28px;
}

.haze-line {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.24), transparent);
  height: 1px;
  left: 8%;
  position: absolute;
  top: 69%;
  width: 84%;
}

.mountain {
  bottom: 26%;
  clip-path: polygon(0 100%, 0 68%, 8% 63%, 15% 48%, 23% 70%, 34% 55%, 44% 70%, 57% 36%, 66% 61%, 75% 43%, 84% 64%, 92% 50%, 100% 67%, 100% 100%);
  height: 22%;
  left: -6%;
  position: absolute;
  width: 112%;
}

.mountain--far {
  background: var(--silhouette-far);
  filter: blur(0.4px);
  opacity: 0.82;
  transform: scaleY(0.76);
  transform-origin: bottom;
}

.mountain--near {
  background: var(--silhouette-near);
  clip-path: polygon(0 100%, 0 75%, 9% 62%, 16% 74%, 26% 61%, 35% 75%, 49% 65%, 62% 77%, 74% 55%, 84% 73%, 93% 59%, 100% 70%, 100% 100%);
  opacity: 0.88;
}

.scene-surface {
  background:
    repeating-linear-gradient(174deg, transparent 0 14px, rgba(255,255,255,.05) 15px 16px),
    linear-gradient(to bottom, color-mix(in srgb, var(--surface-color) 82%, var(--sky-horizon)), var(--surface-color));
  bottom: 0;
  height: 27%;
  left: 0;
  position: absolute;
  width: 100%;
}

.reflection {
  background: linear-gradient(90deg, transparent, rgba(255, 215, 174, 0.4), transparent);
  bottom: 2%;
  clip-path: polygon(43% 0, 57% 0, 70% 100%, 28% 100%);
  height: 25%;
  left: 34%;
  opacity: var(--reflection-opacity);
  position: absolute;
  width: 32%;
}

.shore {
  background: var(--shore-color);
  bottom: -2%;
  position: absolute;
}

.shore--left {
  clip-path: polygon(0 22%, 55% 40%, 82% 62%, 100% 100%, 0 100%);
  height: 24%;
  left: 0;
  width: 38%;
}

.shore--right {
  clip-path: polygon(35% 37%, 67% 26%, 100% 12%, 100% 100%, 0 100%);
  height: 31%;
  right: 0;
  width: 45%;
}

.shore--right::before {
  background: color-mix(in srgb, var(--shore-color), white 12%);
  border-radius: 50% 0 0;
  content: "";
  height: 90%;
  position: absolute;
  right: 4%;
  top: -35%;
  transform: rotate(-12deg);
  width: 23%;
}

.field-lines,
.city-silhouette { display: none; }

.scene-visual[data-scene-type="mountain"] .mountain--far {
  clip-path: polygon(0 100%, 0 80%, 10% 56%, 18% 67%, 28% 38%, 38% 64%, 50% 12%, 62% 57%, 72% 32%, 84% 67%, 94% 44%, 100% 60%, 100% 100%);
  height: 38%;
  transform: none;
}

.scene-visual[data-scene-type="mountain"] .mountain--near { height: 27%; }
.scene-visual[data-scene-type="mountain"] .scene-surface { height: 20%; }
.scene-visual[data-scene-type="mountain"] .shore,
.scene-visual[data-scene-type="mountain"] .reflection { display: none; }

.scene-visual[data-scene-type="plain"] .mountain {
  clip-path: polygon(0 100%, 0 79%, 13% 72%, 29% 78%, 44% 70%, 61% 79%, 78% 71%, 100% 76%, 100% 100%);
  height: 17%;
}

.scene-visual[data-scene-type="plain"] .scene-surface {
  background: linear-gradient(to bottom, color-mix(in srgb, var(--surface-color), #74854a 42%), color-mix(in srgb, var(--surface-color), #263f25 46%));
  height: 32%;
}

.scene-visual[data-scene-type="plain"] .field-lines {
  background: repeating-linear-gradient(102deg, transparent 0 8%, rgba(230, 226, 160, .18) 8.4% 9%);
  bottom: 0;
  display: block;
  height: 27%;
  left: 0;
  perspective: 500px;
  position: absolute;
  width: 100%;
}

.scene-visual[data-scene-type="plain"] .shore,
.scene-visual[data-scene-type="plain"] .reflection { display: none; }

.scene-visual[data-scene-type="city"] .mountain { opacity: 0.35; }
.scene-visual[data-scene-type="city"] .scene-surface { height: 24%; }
.scene-visual[data-scene-type="city"] .shore,
.scene-visual[data-scene-type="city"] .reflection { display: none; }
.scene-visual[data-scene-type="city"] .city-silhouette {
  background:
    linear-gradient(90deg,
      transparent 0 3%, var(--shore-color) 3% 9%, transparent 9% 11%, var(--shore-color) 11% 19%, transparent 19% 21%,
      var(--shore-color) 21% 26%, transparent 26% 28%, var(--shore-color) 28% 42%, transparent 42% 45%,
      var(--shore-color) 45% 50%, transparent 50% 52%, var(--shore-color) 52% 67%, transparent 67% 70%,
      var(--shore-color) 70% 77%, transparent 77% 80%, var(--shore-color) 80% 94%, transparent 94%);
  bottom: 19%;
  display: block;
  filter: drop-shadow(0 -8px 12px rgba(255, 190, 92, var(--city-glow-alpha)));
  height: 13%;
  left: 0;
  position: absolute;
  width: 100%;
}

/* Photo mode keeps photographic layers and atmospheric effects only. */
.scene-visual[data-background-mode="photo"] > .scene-abstract-layer {
  display: none;
}

.scene-vignette {
  background:
    linear-gradient(to bottom, rgba(5, 12, 24, 0.16), transparent 25%, transparent 55%, rgba(3, 8, 17, 0.38)),
    linear-gradient(90deg, rgba(3, 8, 17, 0.14), transparent 18%, transparent 82%, rgba(3, 8, 17, 0.18));
  inset: 0;
  position: absolute;
}

.scene-visual.is-scene-ready .scene-vignette {
  background:
    linear-gradient(to bottom, rgba(3, 8, 18, 0.2), transparent 28%, transparent 52%, rgba(3, 8, 18, 0.44)),
    linear-gradient(90deg, rgba(3, 8, 18, 0.16), transparent 20%, transparent 80%, rgba(3, 8, 18, 0.2));
}

.scene-interface {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  position: relative;
  z-index: 1;
}

.topbar--scene {
  color: var(--scene-text);
  text-shadow: 0 1px 14px rgba(0,0,0,.14);
}

.scene-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  padding: clamp(28px, 7vh, 72px) max(18px, var(--safe-right)) calc(18px + var(--safe-bottom)) max(18px, var(--safe-left));
}

.scene-place {
  margin: 0 auto;
  max-width: 680px;
  text-align: center;
  text-shadow: 0 2px 18px rgba(8, 14, 24, 0.2);
}

.phase-label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  margin-bottom: 9px;
  opacity: 0.82;
}

.scene-place h1 {
  font-size: clamp(1.72rem, 7.6vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.scene-date {
  font-size: 0.76rem;
  margin-top: 8px;
  opacity: 0.72;
}

.time-focus {
  align-items: center;
  display: flex;
  flex-direction: column;
  margin: auto;
  text-shadow: 0 2px 18px rgba(5, 10, 19, .22);
}

.time-focus span {
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  opacity: 0.76;
}

.time-focus strong {
  font-size: clamp(2.35rem, 13vw, 5.6rem);
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.experience-controls {
  margin: 0 auto;
  max-width: 780px;
  width: 100%;
}

.secondary-actions {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ghost-button {
  align-items: center;
  background: color-mix(in srgb, var(--panel-bg), transparent 32%);
  border: 1px solid color-mix(in srgb, var(--panel-border), transparent 12%);
  border-radius: 999px;
  box-shadow: 0 8px 24px var(--panel-shadow);
  color: var(--scene-text);
  display: inline-flex;
  font-size: 0.7rem;
  gap: 7px;
  min-height: 42px;
  padding: 0 13px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.ghost-button strong { font-weight: 600; }

.timeline-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-medium);
  box-shadow: 0 18px 48px var(--panel-shadow);
  color: var(--scene-text);
  padding: 15px 15px 12px;
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  backdrop-filter: blur(18px) saturate(115%);
  transition: background 160ms linear, color 160ms linear;
}

.timeline-summary {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.timeline-summary > div { display: grid; gap: 1px; }

.timeline-summary span {
  font-size: 0.67rem;
  opacity: 0.72;
}

.timeline-summary strong {
  font-size: 1.18rem;
  font-weight: 500;
}

.details-button {
  align-items: center;
  background: rgba(255,255,255,.12);
  border: 1px solid color-mix(in srgb, var(--scene-text), transparent 82%);
  border-radius: 999px;
  display: flex;
  gap: 7px;
  min-height: 38px;
  padding: 0 11px;
}

.timeline-control {
  height: 61px;
  margin-top: 5px;
  position: relative;
}

#timeline-range {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 44px;
  left: 0;
  margin: 0;
  position: absolute;
  top: 0;
  touch-action: none;
  width: 100%;
  z-index: 2;
}

#timeline-range::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #ffd76c 0%, #ff8a67 18%, #cd5a97 42%, #6845ba 65%, #2352a7 82%, #0f2973 100%);
  border-radius: 999px;
  height: 14px;
}

#timeline-range::-moz-range-track {
  background: linear-gradient(90deg, #ffd76c 0%, #ff8a67 18%, #cd5a97 42%, #6845ba 65%, #2352a7 82%, #0f2973 100%);
  border: 0;
  border-radius: 999px;
  height: 14px;
}

#timeline-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: color-mix(in srgb, var(--scene-text), white 20%);
  border: 3px solid var(--panel-strong);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  height: 26px;
  margin-top: -6px;
  width: 26px;
}

#timeline-range::-moz-range-thumb {
  background: color-mix(in srgb, var(--scene-text), white 20%);
  border: 3px solid var(--panel-strong);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  height: 20px;
  width: 20px;
}

.timeline-marks {
  pointer-events: none;
}

.timeline-marks span {
  left: var(--mark-position);
  position: absolute;
  top: 16px;
  transform: translateX(-50%);
  z-index: 3;
}

.timeline-marks i {
  background: rgba(255,255,255,.9);
  border-radius: 50%;
  display: block;
  height: 4px;
  margin: 4px auto 13px;
  width: 4px;
}

.timeline-marks b {
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

.timeline-hint {
  font-size: 0.61rem;
  opacity: 0.66;
  text-align: center;
}

.overlay-backdrop {
  background: rgba(4, 9, 18, 0.32);
  inset: 0;
  position: fixed;
  z-index: 29;
}

.scene-selector,
.details-panel {
  background: color-mix(in srgb, var(--panel-strong), transparent 6%);
  border: 1px solid var(--panel-border);
  border-radius: 26px 26px 0 0;
  bottom: 0;
  box-shadow: 0 -24px 70px rgba(3, 8, 18, .28);
  color: var(--scene-text);
  left: 0;
  max-height: min(78svh, 680px);
  overflow-y: auto;
  padding: 8px 20px calc(24px + var(--safe-bottom));
  position: fixed;
  right: 0;
  z-index: 30;
  -webkit-backdrop-filter: blur(28px) saturate(130%);
  backdrop-filter: blur(28px) saturate(130%);
}

.scene-selector:not([hidden]),
.details-panel:not([hidden]) {
  animation: sheet-in 330ms var(--ease-out) both;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-handle {
  background: color-mix(in srgb, var(--scene-text), transparent 74%);
  border-radius: 999px;
  height: 4px;
  margin: 2px auto 14px;
  width: 40px;
}

.panel-heading-row {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  opacity: 0.64;
}

.panel-heading-row h2 {
  font-size: 1.28rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.details-panel > .panel-heading-row {
  background: color-mix(in srgb, var(--panel-strong), transparent 4%);
  margin-bottom: 18px;
  padding-top: 8px;
  position: sticky;
  top: -8px;
  z-index: 2;
}

.panel-close {
  background: transparent;
  border-radius: 50%;
  font-size: 1.45rem;
  font-weight: 200;
  height: 44px;
  line-height: 1;
  width: 44px;
}

.scene-options {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, 1fr);
}

.scene-option {
  align-items: center;
  background: color-mix(in srgb, var(--panel-bg), transparent 10%);
  border: 1px solid color-mix(in srgb, var(--scene-text), transparent 88%);
  border-radius: var(--radius-small);
  display: flex;
  gap: 11px;
  min-height: 58px;
  padding: 0 14px;
  text-align: left;
}

.scene-option.is-selected {
  background: color-mix(in srgb, var(--scene-text), transparent 88%);
  border-color: color-mix(in srgb, var(--scene-text), transparent 52%);
}

.scene-option span { font-size: 1.25rem; }
.scene-option b { font-weight: 500; }

.scene-note,
.prototype-note {
  font-size: 0.68rem;
  line-height: 1.6;
  margin-top: 16px;
  opacity: 0.68;
}

.current-phase-card {
  align-items: center;
  background: color-mix(in srgb, var(--scene-text), transparent 90%);
  border-radius: var(--radius-small);
  display: grid;
  gap: 1px;
  grid-template-columns: 1fr auto;
  margin-bottom: 16px;
  padding: 14px;
}

.current-phase-card span { font-size: 0.74rem; }
.current-phase-card strong {
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  grid-row: span 2;
}
.current-phase-card small { opacity: 0.7; }

.details-section h3 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}

.twilight-table {
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
  width: 100%;
}

.twilight-table .time-column { width: 58px; }
.twilight-table .elapsed-column { width: 84px; }

.twilight-table th,
.twilight-table td {
  border-bottom: 1px solid color-mix(in srgb, var(--scene-text), transparent 90%);
  min-width: 0;
  padding: 9px 5px;
  vertical-align: middle;
}

.twilight-table th:first-child { padding-left: 7px; }
.twilight-table th:last-child,
.twilight-table td:last-child { padding-right: 5px; }

.twilight-table thead th {
  font-size: 0.6rem;
  font-weight: 500;
  opacity: 0.58;
  text-align: left;
}

.twilight-table thead th:not(:first-child),
.twilight-table td {
  text-align: right;
}

.twilight-table tbody th {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-align: left;
}

.twilight-table tbody th small {
  display: block;
  font-size: 0.56rem;
  font-weight: 400;
  margin-top: 2px;
  opacity: 0.58;
}

.event-time,
.event-elapsed {
  font-size: 0.69rem;
  white-space: nowrap;
}

.event-time.is-special {
  font-size: 0.6rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.evening-table tbody tr.is-current > * {
  background: color-mix(in srgb, var(--scene-text), transparent 91%);
  color: color-mix(in srgb, var(--scene-text), white 5%);
}

.evening-table tbody tr.is-current > th {
  box-shadow: inset 2px 0 color-mix(in srgb, var(--scene-text), transparent 38%);
}

.morning-details {
  border-bottom: 1px solid color-mix(in srgb, var(--scene-text), transparent 88%);
  border-top: 1px solid color-mix(in srgb, var(--scene-text), transparent 88%);
  margin: 18px 0;
}

.morning-details summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 0.72rem;
  font-weight: 500;
  justify-content: space-between;
  list-style: none;
  min-height: 46px;
  padding: 0 7px;
}

.morning-details summary::-webkit-details-marker { display: none; }

.details-disclosure {
  border-bottom: 1px solid currentColor;
  border-right: 1px solid currentColor;
  height: 7px;
  margin-right: 4px;
  opacity: 0.58;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 180ms var(--ease-out);
  width: 7px;
}

.morning-details[open] .details-disclosure {
  transform: rotate(225deg) translate(-1px, -1px);
}

.morning-table { margin-bottom: 8px; }
.morning-table .time-column { width: 62px; }

.calculation-details {
  opacity: 0.78;
}

.calculation-details h3 {
  font-size: 0.7rem;
  opacity: 0.76;
}

.details-list {
  display: grid;
}

.details-list > div {
  align-items: baseline;
  border-bottom: 1px solid color-mix(in srgb, var(--scene-text), transparent 90%);
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr auto;
  padding: 9px 2px;
}

.details-list dt { font-size: 0.76rem; min-width: 0; opacity: 0.76; }
.details-list dd {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  max-width: min(58vw, 230px);
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.toast {
  background: rgba(17, 31, 47, .92);
  border-radius: 999px;
  bottom: calc(24px + var(--safe-bottom));
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  color: #fff;
  font-size: 0.75rem;
  left: 50%;
  max-width: calc(100vw - 36px);
  padding: 10px 16px;
  position: fixed;
  text-align: center;
  transform: translateX(-50%);
  z-index: 60;
}

noscript {
  background: #fff;
  inset: 0;
  padding: 3rem;
  position: fixed;
  z-index: 100;
}
