[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, .rail:focus-visible { outline: 2px solid #edd7a9; outline-offset: -3px; }
#camera, #avatar-video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
#room-list .rail { justify-content: flex-start; scroll-snap-type: both mandatory; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
#room-list .card { display:block; text-decoration:none; color:inherit; scroll-snap-align:start; }
#room-list .room-photo, .sample-photo { background-image:url(/assets/rooms.png); background-size:300% auto; background-repeat:no-repeat; }
#room-list .tile-1, .sample-photo[data-art="1"], .room-hero[data-art="1"] { background-position:left 60%; }
#room-list .tile-2, .sample-photo[data-art="2"], .room-hero[data-art="2"] { background-position:center 60%; }
#room-list .tile-3, .sample-photo[data-art="3"], .room-hero[data-art="3"] { background-position:right 60%; }
.desktop #room-list .rail { overflow-y:auto; padding-right:3px; }
.mobile #room-list .rail { overflow-x:auto; overscroll-behavior-x:none; padding-inline:42px; scroll-padding-inline:42px; }
.mobile #room-list .card { flex-basis:min(306px, 76vw); }
.mobile #ask-home { position:absolute; left:27px; right:27px; bottom:34px; width:auto; z-index:1; }
.mobile #room-list { padding-bottom:66px; }
.desktop .rooms { width:min(416px,36vw); }
.desktop .room-panel { padding:clamp(15px,1.55vw,25px); }
.room-footer { margin-top:auto; }
.room-meta { color:#f0d5a9; margin:0 0 8px; font-size:13px; }
.feature { white-space:nowrap; }
.mobile .features { flex-wrap:wrap; }
#notice { position:absolute; z-index:5; top:70px; right:12px; max-width:min(92vw,360px); padding:10px; border-radius:8px; background:var(--ink); }
dialog { color:var(--cream); background:var(--ink); border:1px solid var(--glass-line); border-radius:15px; padding:20px; width:min(92vw,615px); max-height:85dvh; }
dialog::backdrop { background:rgb(7 23 34 / 65%); }
.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.dialog-head h2 { margin:0; font:400 28px Georgia,serif; }
.dialog-head .icon { width:36px; height:36px; }
dialog input, dialog textarea { width:100%; padding:9px; color:var(--ink); background:var(--cream); border:0; border-radius:5px; font:inherit; }
dialog label { display:grid; gap:5px; }
dialog form, .dialog-flow { display:grid; gap:12px; }
dialog .form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
dialog .room-action { min-height:40px; padding:7px 12px; }
dialog .sample-photo { width:100%; height:clamp(145px,40vh,290px); border-radius:9px; }
#room-list .room-photo.has-room-photo, .room-hero.has-room-photo {
  background-size: cover;
  background-position: center;
}
.photo-gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.photo-gallery > .gallery-frame, .photo-gallery > .sample-photo { touch-action: pan-y pinch-zoom; }
.gallery-frame {
  height: min(56dvh, 410px);
  background: #0a202b;
  border-radius: 9px;
  overflow: hidden;
}
.gallery-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.gallery-controls p { margin: 0; text-align: center; font-size: 13px; line-height: 1.2; }

.dialog-group { display:flex; flex-wrap:wrap; gap:8px; }
.dialog-flow article { padding:12px; margin:0; border:1px solid var(--glass-line); border-radius:8px; }
#chat-log { max-height:38dvh; overflow:auto; }
#chat-log p { margin:6px 0; padding:8px; background:rgb(255 255 255 / 8%); border-radius:6px; }
@media (max-height:620px) and (orientation:landscape) {
  .desktop .rooms, .desktop .room-panel { top:67px; bottom:12px; }
  .desktop .card { flex-basis:155px; }
  .desktop h1 { font-size:25px; }
}
dialog.virtual-tour {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #101c24;
  isolation: isolate;
}
.virtual-tour canvas, .virtual-tour .tour-fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.virtual-tour canvas { cursor: grab; touch-action: none; }
.virtual-tour canvas:active { cursor: grabbing; }
.virtual-tour .tour-fallback { background-repeat: repeat-x; }
.virtual-tour .tour-input-layer { opacity: 0; }
.virtual-tour .dialog-head {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  margin: 0;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 14px max(12px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgb(10 25 34 / 88%), transparent);
  pointer-events: none;
}
.virtual-tour .dialog-head h2 { grid-column: 2; grid-row: 1; font-size: clamp(19px, 4vw, 28px); }
.virtual-tour .dialog-head .dialog-close {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  width: 40px;
  height: 40px;
  pointer-events: auto;
}
.virtual-tour .tour-back { grid-column: 1; grid-row: 1; justify-self: start; pointer-events: auto; }
.virtual-tour .tour-hotspots { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.virtual-tour .tour-hotspot, .virtual-tour .tour-feature {
  position: absolute;
  transform: translate(-50%, -100%);
}
.virtual-tour .tour-hotspot, .virtual-tour .tour-motion, .virtual-tour .tour-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid rgb(243 220 174 / 66%);
  border-radius: 22px;
  background: #183c4b;
  color: #fff3d9;
  font-size: 13px;
  font-weight: 600;
}
.virtual-tour .tour-hotspot { max-width: min(210px, 62vw); pointer-events: auto; }
.virtual-tour .tour-hotspot svg, .virtual-tour .tour-motion svg { width: 21px; flex: none; }
.virtual-tour .tour-feature {
  max-width: min(200px, 55vw);
  padding: 5px 9px;
  border: 1px solid rgb(255 235 201 / 50%);
  border-radius: 5px;
  background: rgb(14 32 42 / 90%);
  color: #fff3d9;
  font-size: 12px;
  text-align: center;
}
.virtual-tour .tour-feature::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 8px;
  background: #fff3d9;
  content: '';
}
.virtual-tour .tour-controls {
  position: absolute;
  z-index: 2;
  inset: auto max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}
.virtual-tour .tour-motion { pointer-events: auto; }
.virtual-tour .tour-guidance, .virtual-tour .tour-status {
  margin: 0;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgb(10 25 34 / 88%);
  color: #fff3d9;
  font-size: 13px;
  text-align: center;
}
.virtual-tour .tour-guidance { display: flex; align-items: center; gap: 9px; transition: opacity .28s ease; }
.virtual-tour .tour-guidance p { margin: 0; }
.virtual-tour .tour-guidance svg { width: 28px; flex: none; }
.virtual-tour .tour-guidance-demo svg { animation: tour-swipe .8s ease-in-out 3 alternate; }
.virtual-tour .tour-guidance-dismissed { opacity: 0; }
@keyframes tour-swipe {
  from { transform: translateX(-4px); }
  to { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .virtual-tour .tour-guidance { transition: none; }
  .virtual-tour .tour-guidance svg { animation: none; }
}

.desktop #room-list .cue { display:none; }
.desktop #room-list .arrows { display:flex; gap:6px; }
/* Keep icon weight and contrast consistent over glass and photography. */
#room-list .arrows .icon, .card-arrow, .room-top .close, .dialog-head .dialog-close {
  width: 36px;
  height: 36px;
  color: #fff8eb;
  background: #132c3a;
  border: 1px solid #c6a36b;
}
#room-list .arrows .icon svg, .card-arrow svg, .room-top .close svg, .dialog-head .dialog-close svg {
  width: 22px;
  height: 22px;
  display: block;
}
#room-list .arrows .icon:hover, .card:hover .card-arrow, .room-top .close:hover, .dialog-head .dialog-close:hover {
  background: #275754;
}
.mobile #room-list .arrows .previous svg { transform: rotate(180deg); }
.desktop #room-list .arrows .previous svg { transform: rotate(-90deg); }
.desktop #room-list .arrows .next svg { transform: rotate(90deg); }
.card-title { gap: 8px; }
.card-title > span:first-child { min-width: 0; overflow-wrap: break-word; }
.desktop main { background-position: center top; }
@media (max-width:380px) {
  .mobile #room-list .rail { padding-inline:32px; scroll-padding-inline:32px; }
}
.avatar-stage {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  left: 35%;
  bottom: 7.5dvh;
  height: min(77dvh, calc(100dvh - 104px));
  aspect-ratio: 9 / 16;
  transform: translateX(-50%);
  visibility: hidden;
}
.avatar-ready .avatar-stage { visibility: visible; }
.desktop main:is(.avatar-ready, .entrance-pending) { background-image: url(/assets/welcome/entrance-landscape.webp); background-position: center center; }
.mobile main:is(.avatar-ready, .entrance-pending) { background-image: url(/assets/welcome/entrance-portrait.webp); background-position: center center; }
.mobile .avatar-stage { left: 50%; bottom: 13dvh; height: min(73dvh, calc(100dvh - 88px)); }
.avatar-stage video { position: absolute; width: 1px; height: 1px; opacity: 0; visibility: visible; }
.avatar-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar-shadow {
  position: absolute;
  top: var(--shadow-y, 98.8%);
  left: var(--shadow-x, 50%);
  width: var(--shadow-width, 29%);
  height: 3.5%;
  transform: translate(-44%, -49%) rotate(-5deg);
  background: radial-gradient(ellipse, rgba(45, 32, 20, .48) 3%, rgba(44, 30, 19, .21) 39%, rgba(42, 31, 22, 0) 73%);
  opacity: var(--shadow-opacity, .75);
}
#room-list, #room-panel { z-index: 2; }
#ask-home, .mobile #ask-home { z-index: 3; }
#welcome-sound {
  position: absolute;
  z-index: 4;
  top: clamp(72px, 16dvh, 132px);
  left: 35%;
  transform: translateX(-50%);
  padding: 10px 15px;
  min-height: 43px;
  white-space: nowrap;
}
.mobile #welcome-sound { left: 50%; top: 76px; width: max-content; }
@media (max-height: 620px) and (orientation: landscape) {
  .desktop .avatar-stage { bottom: 6dvh; height: calc(89dvh - 25px); }
}
#language-select {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 68px 20px 20px;
  background: rgb(19 44 58 / 32%);
}
.language-card {
  width: min(100%, 360px);
  max-height: 100%;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: rgb(19 44 58 / 92%);
  backdrop-filter: blur(8px);
}
.language-card h1 { font-size: clamp(24px, 4vw, 29px); margin-bottom: 8px; }
.language-card .room-action { min-height: 44px; font-size: 15px; }
.language-card .room-action:disabled { color: #a4afb0; opacity: .58; cursor: default; }
.language-card .primary { justify-content: space-between; padding-inline: 16px; }

.welcome-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
}
.welcome-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: welcome-loading .8s linear infinite;
}
@keyframes welcome-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .welcome-loading::before { animation: none; }
}

#mobile-handoff-toggle[aria-expanded="true"], #mobile-handoff-toggle:hover {
  border-color: var(--gold);
  background: var(--tide);
}
.mobile-handoff {
  position: absolute;
  top: calc(100% + 8px);
  right: clamp(12px, 3.5vw, 48px);
  width: min(260px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid var(--glass-line);
  border-radius: 13px;
  background: var(--ink);
  box-shadow: 0 12px 36px rgb(5 17 24 / 52%);
  text-align: center;
  animation: reveal-mobile-handoff .2s ease-out both;
}
.mobile-handoff img {
  display: block;
  width: min(100%, 180px);
  height: auto;
  margin: 0 auto;
  border-radius: 5px;
}
.mobile-handoff p { margin: 12px 0 0; line-height: 1.4; }
@keyframes reveal-mobile-handoff {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-handoff { animation: none; }
}

.mobile #room-list .arrows button:disabled { opacity: .45; cursor: default; }
