:root {
  --ink: #17171f; --navy: #050a24; --panel: rgba(9, 14, 40, .9); --line: rgba(255, 255, 255, .12);
  --yellow: #ffd21f; --red: #e8283c; --pink: #ff5c8a; --cyan: #3fd0ff; --green: #5dff9c;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --peek: 200px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--navy); color: #fff; font-family: Rubik, Arial, sans-serif; overflow: hidden; -webkit-tap-highlight-color: transparent; }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; }

/* ---------- reality-camera chrome ---------- */
.top { position: fixed; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; pointer-events: none; z-index: 5; }
.brand { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px 0 4px; border-radius: 14px; background: var(--red); border: 2px solid var(--ink); font-weight: 900; font-size: 17px; white-space: nowrap; }
.brand canvas { width: 50px; height: 33px; animation: tremble 2.4s ease-in-out infinite; }
@keyframes tremble { 0%, 100% { transform: rotate(0) } 47% { transform: rotate(0) } 50% { transform: rotate(-4deg) translateX(-1px) } 53% { transform: rotate(3deg) translateX(1px) } 56% { transform: rotate(0) } }
.brand em { font-style: normal; color: var(--yellow); }
.live { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px; background: rgba(0, 0, 0, .55); font-size: 13px; font-weight: 700; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: #ff2b3a; box-shadow: 0 0 8px #ff2b3a; animation: rec 1.2s steps(2) infinite; }
@keyframes rec { 50% { opacity: .25; } }
.count { margin-inline-start: auto; height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 12px; background: rgba(9, 14, 40, .85); font-weight: 700; font-size: 14px; white-space: nowrap; }
.count b { color: var(--yellow); direction: ltr; }
.frame { position: fixed; inset: calc(58px + var(--safe-t)) 8px calc(var(--peek) + 62px + var(--safe-b)); pointer-events: none; z-index: 2; }
.frame i { position: absolute; width: 26px; height: 26px; border: 0 solid rgba(255, 255, 255, .7); }
.frame i:nth-child(1) { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; }
.frame i:nth-child(2) { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; }
.frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; }
.frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; }
.camlabel { position: fixed; top: calc(64px + var(--safe-t)); right: 18px; z-index: 3; padding: 5px 10px; border-radius: 8px; background: rgba(0, 0, 0, .5); font-size: 12px; font-weight: 700; letter-spacing: .02em; pointer-events: none; }
.build { position: fixed; top: calc(100px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 3; padding: 8px 16px; border-radius: 12px; background: rgba(9, 14, 40, .9); border: 2px solid var(--ink); font-weight: 900; font-size: 15px; white-space: nowrap; }
.build b { color: var(--yellow); direction: ltr; display: inline-block; min-width: 3.2ch; }

/* ---------- rooms ---------- */
.rooms { position: fixed; left: 0; right: 0; bottom: calc(var(--peek) + var(--safe-b) + 8px); z-index: 4; display: flex; gap: 6px; padding: 0 10px; overflow-x: auto; scrollbar-width: none; }
.rooms::-webkit-scrollbar { display: none; }
.rooms button { flex: none; height: 40px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--ink); background: rgba(255, 255, 255, .92); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.rooms button[aria-pressed="true"] { background: var(--yellow); }
.rooms button:focus-visible, .grab:focus-visible, .cta:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- the panel: a sheet on phones, a card on desktop ---------- */
.panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; max-height: calc(100% - 120px - var(--safe-t)); overflow-y: auto; padding: 4px 16px calc(14px + var(--safe-b)); background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; }
.grab { display: block; margin: 6px auto 4px; padding: 6px 16px 8px; border: 0; border-radius: 999px; background: var(--pink); color: #fff; font-weight: 900; font-size: 14px; cursor: pointer; }
.grab::after { content: " ▴"; }
.panel.open .grab::after { content: " ▾"; }
h1 { margin: 2px 0 2px; font-size: 26px; font-weight: 900; line-height: 1.15; text-align: center; }
h1 span { color: var(--yellow); }
.lead { margin: 0 0 8px; text-align: center; font-size: 14px; color: #cfd8f3; }
.places { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.places li { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; border: 2px solid var(--cyan); background: rgba(63, 208, 255, .08); box-shadow: 0 0 10px rgba(63, 208, 255, .35) inset; overflow: hidden; }
.places .n { position: absolute; top: 1px; right: 4px; font-size: 9px; color: #8fe6ff; }
.places .q { color: var(--yellow); font-size: 20px; font-weight: 900; text-shadow: 0 0 10px var(--yellow); animation: q 1.6s ease-in-out infinite; }
.places li:nth-child(odd) .q { animation-delay: .5s; }
@keyframes q { 50% { opacity: .35; } }
.places li.in { border-color: var(--green); box-shadow: 0 0 10px rgba(93, 255, 156, .35) inset; }
.places li.in b { font-size: 9px; padding: 0 2px; word-break: break-all; text-align: center; }
.more { display: none; }
.panel.open .more { display: block; }
h2 { margin: 16px 0 8px; font-size: 19px; font-weight: 900; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.steps li { position: relative; counter-increment: s; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 50px 10px 12px; border-radius: 14px; background: #fff; color: var(--ink); font-size: 15px; line-height: 1.35; }
.steps li::before { content: counter(s); position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 900; }
.steps li:nth-child(2)::before { background: var(--pink); }
.steps li:nth-child(3)::before { background: #2f6bff; }
.stamp { padding: 1px 8px 3px; border: 3px solid var(--red); border-radius: 8px; color: var(--red); font-weight: 900; font-size: 13px; transform: rotate(-6deg); }
.cta { display: block; margin: 14px 0 6px; padding: 14px; border-radius: 14px; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); text-align: center; font-weight: 900; font-size: 17px; text-decoration: none; }
.cta[hidden] { display: none; }
.fine { margin: 10px 0 0; font-size: 12px; color: #9aa6c9; text-align: center; }

.live { white-space: nowrap; }
@media (max-width: 370px) {
  .live { font-size: 0; gap: 0; padding: 0 9px; }
  .brand { font-size: 15px; padding-inline-end: 9px; }
  .brand canvas { width: 42px; height: 28px; }
  .count { font-size: 12px; padding: 0 8px; }
}

@media (min-width: 821px) {
  :root { --peek: 0px; }
  .panel { left: auto; right: 18px; top: calc(70px + var(--safe-t)); bottom: 18px; width: 380px; max-height: none; border-radius: 22px; border: 1px solid var(--line); padding: 16px 20px; }
  .grab { display: none; }
  .more { display: block; }
  h1 { font-size: 32px; }
  .places { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .places .n { font-size: 11px; }
  .places .q { font-size: 30px; }
  .places li.in b { font-size: 12px; }
  .rooms { right: 418px; left: 18px; bottom: 18px; flex-wrap: wrap; }
  .frame { inset: 64px 416px 72px 12px; }
  .camlabel { right: 418px; }
  .build { left: calc((100% - 400px) / 2); }
}

/* ---------- the eye blink between rooms ---------- */
.blink { position: fixed; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.blink i { position: absolute; left: -10%; right: -10%; height: 52%; background: #000; transition: transform .25s ease-in; }
.blink i:first-child { top: 0; transform: translateY(-101%); border-radius: 0 0 50% 50% / 0 0 30% 30%; }
.blink i:last-child { bottom: 0; transform: translateY(101%); border-radius: 50% 50% 0 0 / 30% 30% 0 0; }
.blink.shut i { transform: none; }

/* ---------- a camera cut in the live channel: a quick flash ---------- */
.cut { position: fixed; inset: 0; z-index: 6; background: #fff; opacity: 0; pointer-events: none; }
.cut.on { animation: cutflash .3s ease-out; }
@keyframes cutflash { 0% { opacity: .28; } 100% { opacity: 0; } }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 9; display: grid; place-content: center; justify-items: center; gap: 18px; background: radial-gradient(circle, #12307a, var(--navy) 70%); transition: opacity .5s, visibility .5s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader .eye { width: 150px; height: 80px; border: 6px solid var(--ink); border-radius: 75% 15%; transform: rotate(45deg) scale(.75); background: #fff; position: relative; box-shadow: 0 0 30px var(--cyan); animation: look 1.4s ease-in-out infinite; overflow: hidden; }
.loader .eye::after { content: ""; position: absolute; width: 56px; height: 56px; border-radius: 50%; left: 18px; top: 6px; background: radial-gradient(circle at 40% 40%, #05070f 0 30%, #1677e8 32%, #57d2ff 70%); border: 3px solid var(--ink); }
@keyframes look { 50% { transform: rotate(45deg) scale(.75) translate(4px, -4px); } }
.loader p { margin: 0; font-weight: 700; color: #cfe8ff; }
.loader p::after { content: "..."; }
.nojs { position: fixed; inset: auto 0 40% 0; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .live i, .places .q, .loader .eye, .brand canvas { animation: none; }
  .blink i { transition: none; }
}
