:root {
  color-scheme: dark;
  --ink: #fff8e9;
  --muted: #dbcdb5;
  --gold: #e9c477;
  --gold-bright: #ffe9a6;
  --green: #07150f;
  --panel: rgba(6, 13, 10, .9);
  --panel-solid: #0a1711;
  --pink: #f4b7c9;
  --stage-width: 1600px;
  --stage-height: 1000px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #030806; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow: hidden; }
button, a, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; }
.app-shell { min-height: 100dvh; isolation: isolate; background: radial-gradient(circle at 50% 0, #183b27 0, #050b08 45%, #020403 100%); }
.hud {
  position: fixed; z-index: 50; top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px;
  min-height: 58px; display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border: 1px solid rgba(233, 196, 119, .45); border-radius: 20px;
  background: rgba(4, 10, 7, .84); backdrop-filter: blur(16px); box-shadow: 0 16px 45px rgba(0,0,0,.42);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; min-width: 0; margin-right: auto; }
.brand-seal { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 50%; font-family: Georgia, serif; font-size: 23px; color: #092015; background: radial-gradient(circle at 35% 25%, #fff1bc, #c4943c 70%); box-shadow: 0 0 0 2px #263b2f, 0 0 0 3px rgba(233,196,119,.65), 0 8px 22px rgba(0,0,0,.45); }
.brand strong { display: block; font-family: Georgia, serif; color: var(--gold-bright); font-size: 17px; line-height: 1; white-space: nowrap; }
.brand small { display: block; margin-top: 3px; color: var(--pink); font-size: 9px; letter-spacing: .17em; text-transform: uppercase; white-space: nowrap; }
.hud-status { display: flex; align-items: center; gap: 8px; min-width: 0; }
#roomName { display: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.progress-pill, .icon-button { border: 1px solid rgba(233,196,119,.4); color: var(--ink); background: rgba(255,255,255,.055); cursor: pointer; }
.progress-pill { border-radius: 999px; padding: 8px 10px; font-weight: 900; font-size: 12px; white-space: nowrap; }
.icon-button { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; }
.room-viewport { position: fixed; inset: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(233,196,119,.4) #020503; padding-bottom: calc(78px + var(--safe-bottom)); }
.room-stage { position: relative; width: var(--stage-width); height: var(--stage-height); min-width: var(--stage-width); overflow: hidden; background: #06100b; }
.room-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; user-select: none; -webkit-user-drag: none; }
.room-atmosphere { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 40%, transparent 35%, rgba(2,6,4,.12) 78%, rgba(1,3,2,.46) 100%); }
.room-atmosphere::after { content: ""; position: absolute; inset: 0; opacity: .18; background-image: radial-gradient(circle, rgba(255,243,198,.85) 0 1px, transparent 1.8px); background-size: 78px 78px; animation: drift 22s linear infinite; }
@keyframes drift { to { background-position: 156px -234px; } }
.hotspot-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hotspot { cursor: pointer; pointer-events: all; }
.hotspot .hit-shape { fill: rgba(255,255,255,.001); stroke: transparent; stroke-width: 5; vector-effect: non-scaling-stroke; transition: fill .25s ease, stroke .25s ease, filter .25s ease; }
.hotspot .glow-shape { fill: transparent; stroke: rgba(255,226,150,.13); stroke-width: 9; opacity: .22; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 12px rgba(255,224,137,.58)); animation: breathe 3.6s ease-in-out infinite; pointer-events: none; }
.hotspot.pink-sparkle .glow-shape { stroke: rgba(255,174,211,.26); filter: drop-shadow(0 0 14px rgba(255,153,204,.72)); }
.hotspot.vault-pulse .glow-shape { stroke: rgba(255,214,120,.28); animation-duration: 2.8s; }
.hotspot:hover .hit-shape, .hotspot:focus .hit-shape { fill: rgba(255,238,183,.07); stroke: rgba(255,226,150,.74); filter: drop-shadow(0 0 16px rgba(255,222,136,.72)); }
.hotspot text { display: none; pointer-events: none; fill: #06100b; stroke: none; font-weight: 900; font-size: 21px; paint-order: stroke; }
@keyframes breathe { 0%,100% { opacity: .14; } 50% { opacity: .46; } }
html.qa-hotspots .hotspot .hit-shape { fill: rgba(86,231,255,.18); stroke: #77edff; stroke-width: 4; }
html.qa-hotspots .hotspot .glow-shape { opacity: .9; }
html.qa-hotspots .hotspot text { display: block; fill: #07150f; stroke: #fff; stroke-width: 5px; }
.route-intro { position: absolute; z-index: 4; left: 28px; top: 94px; max-width: 410px; padding: 17px 18px; border-radius: 20px; border: 1px solid rgba(233,196,119,.42); background: rgba(5,11,8,.78); backdrop-filter: blur(13px); box-shadow: 0 18px 46px rgba(0,0,0,.34); opacity: 0; transform: translateY(-8px); transition: opacity .35s ease, transform .35s ease; pointer-events: none; }
.route-intro.show { opacity: 1; transform: translateY(0); }
.route-intro small { display: block; color: var(--pink); letter-spacing: .15em; text-transform: uppercase; font-weight: 900; font-size: 10px; }
.route-intro strong { display: block; margin-top: 4px; font-family: Georgia, serif; color: var(--gold-bright); font-size: 29px; line-height: 1; }
.route-intro span { display: block; color: var(--muted); line-height: 1.4; margin-top: 7px; font-size: 13px; }
.bottom-nav { position: fixed; z-index: 45; left: 8px; right: 8px; bottom: max(8px, var(--safe-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px; border: 1px solid rgba(233,196,119,.38); border-radius: 21px; background: rgba(4,10,7,.89); backdrop-filter: blur(16px); box-shadow: 0 -12px 36px rgba(0,0,0,.36); }
.bottom-nav a { min-height: 49px; display: grid; place-items: center; align-content: center; gap: 1px; border-radius: 15px; color: #bdb29d; text-decoration: none; text-transform: uppercase; letter-spacing: .08em; font-size: 9px; font-weight: 900; }
.bottom-nav a span { font-size: 18px; line-height: 1; }
.bottom-nav a.active { color: #07150f; background: linear-gradient(145deg, #fff1b7, #c99b47); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), 0 8px 20px rgba(0,0,0,.24); }
.estate-drawer { position: fixed; z-index: 80; top: 0; right: 0; width: min(430px, 92vw); height: 100dvh; padding: max(22px, env(safe-area-inset-top)) 20px calc(24px + var(--safe-bottom)); overflow: auto; background: linear-gradient(160deg, #10271a, #06100b 55%, #020604); border-left: 1px solid rgba(233,196,119,.4); box-shadow: -24px 0 70px rgba(0,0,0,.6); transform: translateX(104%); transition: transform .28s ease; }
.estate-drawer.open { transform: translateX(0); }
.drawer-scrim, .action-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.62); backdrop-filter: blur(4px); }
.drawer-head { display: flex; gap: 12px; align-items: flex-start; }
.drawer-head > div { margin-right: auto; }
.drawer-head small { color: var(--pink); letter-spacing: .13em; text-transform: uppercase; font-size: 10px; font-weight: 900; }
.drawer-head h2 { margin: 4px 0 0; font-family: Georgia, serif; color: var(--gold-bright); font-size: 30px; line-height: 1; }
.close-button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(233,196,119,.42); background: rgba(255,255,255,.06); color: var(--ink); cursor: pointer; font-size: 24px; }
.drawer-lede { color: var(--muted); line-height: 1.5; }
.journey-list { display: grid; gap: 9px; padding: 0; margin: 20px 0; list-style: none; counter-reset: journey; }
.journey-list li { counter-increment: journey; display: grid; grid-template-columns: 38px 1fr; gap: 11px; align-items: center; min-height: 58px; padding: 10px 12px; border-radius: 16px; border: 1px solid rgba(233,196,119,.18); background: rgba(255,255,255,.035); color: #b7ae9d; }
.journey-list li::before { content: counter(journey); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(233,196,119,.28); font-weight: 900; }
.journey-list li.complete { color: var(--ink); border-color: rgba(233,196,119,.46); background: rgba(233,196,119,.09); }
.journey-list li.complete::before { content: "✓"; color: #06100b; background: var(--gold); }
.journey-list strong { display: block; font-size: 13px; }
.journey-list small { display: block; color: #9f9584; margin-top: 2px; line-height: 1.25; }
.inventory-card { display: flex; align-items: center; gap: 12px; padding: 14px; margin: 18px 0; border-radius: 18px; border: 1px solid rgba(233,196,119,.3); background: rgba(0,0,0,.24); }
.inventory-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.055); color: var(--gold); font-size: 23px; }
.inventory-card small { display: block; color: var(--pink); text-transform: uppercase; letter-spacing: .1em; font-size: 9px; }
.inventory-card strong { display: block; margin-top: 4px; }
.primary-button, .quiet-button { width: 100%; border-radius: 15px; padding: 14px 16px; font-weight: 900; cursor: pointer; }
.primary-button { border: 1px solid #ffe8a0; color: #06100b; background: linear-gradient(145deg, #fff2b8, #c69238); box-shadow: 0 12px 28px rgba(0,0,0,.32); }
.quiet-button { margin-top: 9px; color: var(--muted); border: 1px solid rgba(233,196,119,.22); background: transparent; }
.action-sheet { position: fixed; z-index: 100; left: 50%; bottom: calc(74px + var(--safe-bottom)); width: min(760px, calc(100vw - 22px)); max-height: min(76dvh, 720px); overflow: auto; padding: 22px; border-radius: 28px; border: 1px solid rgba(233,196,119,.5); background: linear-gradient(155deg, rgba(18,40,27,.98), rgba(5,12,8,.98) 62%, rgba(2,5,3,.99)); box-shadow: 0 25px 90px rgba(0,0,0,.68); transform: translate(-50%, calc(100% + 120px)); opacity: 0; visibility: hidden; pointer-events: none; transition: transform .28s ease, opacity .2s ease, visibility 0s linear .28s; }
.action-sheet.open { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; transition: transform .28s ease, opacity .2s ease; }
.action-scrim { z-index: 90; }
.sheet-close { position: sticky; z-index: 2; float: right; top: 0; }
.action-kicker { color: var(--pink); text-transform: uppercase; letter-spacing: .14em; font-weight: 900; font-size: 10px; }
.action-sheet h2 { margin: 5px 50px 8px 0; font-family: Georgia, serif; color: var(--gold-bright); font-size: clamp(29px, 6vw, 45px); line-height: .98; }
.action-sheet p { color: var(--muted); line-height: 1.55; }
.action-buttons { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.action-buttons button { flex: 1 1 190px; border-radius: 14px; padding: 13px 15px; cursor: pointer; font-weight: 900; }
.secondary-button { border: 1px solid rgba(233,196,119,.42); background: rgba(255,255,255,.055); color: var(--ink); }
.carousel-preview { position: relative; min-height: 280px; margin: 14px 0; border-radius: 22px; overflow: hidden; border: 1px solid rgba(255,205,225,.43); background-image: linear-gradient(rgba(9,4,7,.12), rgba(9,4,7,.58)), url("assets/rooms/candy-shop/background.webp"); background-size: cover; background-position: center; }
.carousel-preview::before, .carousel-preview::after { content: ""; position: absolute; left: 50%; top: 50%; width: 52%; aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(255,223,154,.66); transform: translate(-50%,-50%); box-shadow: 0 0 35px rgba(255,184,216,.48), inset 0 0 30px rgba(255,227,165,.2); animation: carouselPulse 3s ease-in-out infinite; }
.carousel-preview::after { width: 37%; border-style: dotted; animation: carouselTurn 8s linear infinite; }
@keyframes carouselPulse { 50% { transform: translate(-50%,-50%) scale(1.06); opacity: .65; } }
@keyframes carouselTurn { to { transform: translate(-50%,-50%) rotate(360deg); } }
.key-reveal { display: grid; place-items: center; min-height: 170px; margin: 14px 0; border-radius: 22px; background: radial-gradient(circle, rgba(255,226,144,.22), transparent 62%); }
.key-symbol { font-size: 74px; filter: drop-shadow(0 0 20px rgba(255,217,115,.72)); animation: keyFloat 2.5s ease-in-out infinite; }
@keyframes keyFloat { 50% { transform: translateY(-8px) rotate(-4deg); } }
.game-panel { display: grid; gap: 14px; }
.hole-visual { position: relative; height: 260px; overflow: hidden; border-radius: 22px; border: 1px solid rgba(233,196,119,.38); background: radial-gradient(ellipse at 75% 70%, #4f9b4e 0 10%, #2f7136 11% 28%, #1d552c 29% 56%, #0c2a19 57% 100%); }
.hole-visual::after { content: ""; position: absolute; left: 8%; right: 17%; bottom: 28%; height: 4px; transform: rotate(-4deg); transform-origin: left; background: linear-gradient(90deg, rgba(255,238,173,.9), rgba(255,238,173,.05)); }
.flag-pole { position: absolute; right: 22%; top: 22%; width: 4px; height: 122px; background: #ffeeb0; }
.flag-pole::after { content: ""; position: absolute; left: 4px; top: 0; border-left: 52px solid #f4b7c9; border-top: 18px solid transparent; border-bottom: 18px solid transparent; }
.cup { position: absolute; right: calc(22% - 17px); bottom: 24%; width: 38px; height: 15px; border-radius: 50%; background: #020403; border: 2px solid #d2aa54; }
.game-ball { position: absolute; left: 10%; bottom: 29%; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: inset -6px -7px 8px rgba(0,0,0,.2), 0 4px 10px rgba(0,0,0,.35); transition: left 1.1s cubic-bezier(.16,.72,.25,1), bottom 1.1s ease; }
.game-ball.shot { left: var(--ball-left, 68%); bottom: var(--ball-bottom, 29%); }
.game-ball.holed { left: calc(78% - 10px); bottom: 24%; transform: scale(.6); }
.game-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.game-controls input { width: 100%; accent-color: var(--gold); }
.score-line { display: flex; gap: 10px; flex-wrap: wrap; }
.score-chip { padding: 8px 10px; border-radius: 999px; background: rgba(233,196,119,.11); border: 1px solid rgba(233,196,119,.28); font-size: 12px; }
.toast { position: fixed; z-index: 120; left: 50%; top: max(82px, calc(env(safe-area-inset-top) + 76px)); max-width: min(88vw, 520px); padding: 11px 15px; border-radius: 999px; color: #07150f; background: linear-gradient(145deg, #fff0ae, #d6aa55); box-shadow: 0 13px 34px rgba(0,0,0,.42); font-weight: 900; font-size: 12px; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 760px) {
  #roomName { display: inline; }
  .hud { left: 16px; right: 16px; top: 14px; padding: 8px 10px; }
  .bottom-nav { width: 520px; left: 50%; right: auto; transform: translateX(-50%); }
  .route-intro { left: 48px; top: 104px; }
}
@media (min-width: 1200px) {
  .room-stage { margin: 0 auto; }
}
@media (max-width: 820px) {
  :root { --stage-width: 1180px; }
  .room-viewport { padding-top: 0; }
  .room-stage { margin: 0; }
  .route-intro { position: fixed; left: 10px; right: 10px; top: 78px; max-width: none; z-index: 30; }
  .route-intro strong { font-size: 24px; }
  .action-sheet { padding: 19px; bottom: calc(72px + var(--safe-bottom)); }
  .game-controls { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
