/*
 * assets/ui/village-room.css - THE VILLAGE'S PAINTED ROOMS' look (js/village-room.js): the Hospital, Real Estate, the
 * Armory, the Roost, the Stables and the Nursery, each with its Horde twin. Goliath 2026-11-09 (10:55Z, plan approved
 * 11:56Z, https://claude.ai/artifact/3TBcNnBU1X8Y4Zn9FUVg61). It follows the Candy Store's stage (assets/ui/candy-room.css,
 * lesson UI-166) so every rebuilt room feels like one Village.
 *
 * LAYOUT. [data-stage="side"] (a PC, js/village-room.js STAGE_MIN wide or more): the room's body is two columns, the
 * painted stage and its picture bar on the left, kept in view, and the one counter picked on the right (the kit hides
 * the others; Go next stays). [data-stage="air"] (a phone, a narrow window): the room is as the kit draws it, and the
 * room's air (its lamps glowing and its motes drifting) lies over the painted backdrop, under the page.
 * Words never under 16 px (UI-5), every target --rui-tap (44 px, 48 on touch), nothing moves under
 * prefers-reduced-motion. Colours are the room kit's (js/room-ui.css); the Horde's under [data-side="horde"].
 */

/* ---- the two columns on a PC -------------------------------------------------------------------------------------- */
.rui.vr-room[data-stage="side"] .rui-body { gap: 20px; }
.vr-left { flex: 0 0 min(52%, 780px); min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 0 12px; overflow-y: auto; } /* 780: the page at 1920 stays a ~1400 px read (check:room-ui, a big PC screen) */
.vr-left[hidden] { display: none; }
/* the counter stands alone beside the painting: the room's own wide grid (the Hospital's ward-and-desk, the Roost's
   four corners) gives way to one column, since only the station picked is on the page */
.rui.vr-room[data-stage="side"] .rui-main.rsh-board,
.rui.vr-room[data-stage="side"] .rui-main { display: block; }

/* ---- the stage: the painting, its layers and its stations --------------------------------------------------------- */
.vr-stage { container: vr-stage / inline-size; position: relative; aspect-ratio: 16 / 9; width: 100%; flex: none; border-radius: 16px; overflow: hidden;
  border: 2px solid var(--rui-gold); box-shadow: 0 0 0 5px rgba(245, 194, 66, 0.08), 0 16px 40px rgba(0, 0, 0, 0.55); background: #0b0814; isolation: isolate; }
.vr-stage[data-side="horde"] { border-color: #7FE0D6; }
.vr-stage__paint { position: absolute; inset: 0; transform-origin: 50% 55%; }
/* the painting is drawn by a ::before (the element paints nothing), so the overlap scan reads it as backdrop (UI-166) */
.vr-stage__paint::before { content: ""; position: absolute; inset: 0; background: var(--vr-paint, none) center / cover no-repeat; }
.vr-stage__layers, .vr-stage__spots { position: absolute; inset: 0; }
.vr-stage__layers, .vr-air { pointer-events: none; }
.vr-stage__layers > *, .vr-air > * { position: absolute; }
.vr-lamp::before, .vr-mote::before, .vr-sway::before, .vr-cloud::before, .vr-comet::before, .vr-mist::before, .vr-vignette::before, .vr-moment::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--vr-glow); box-shadow: var(--vr-halo, none); }

/* the lamps: a warm glow on each painted light (green on the Horde), breathing; an unearned one (the look by Village
   level) is shaded still and dark over the painted one, so the room warms as the Village grows */
.vr-lamp { width: 11%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); mix-blend-mode: screen;
  --vr-glow: radial-gradient(circle, rgba(255, 214, 140, 0.55), transparent 65%); animation: vr-flicker 4s ease-in-out var(--f, 0s) infinite; }
[data-side="horde"] .vr-lamp, .vr-air[data-side="horde"] .vr-lamp { --vr-glow: radial-gradient(circle, rgba(140, 255, 170, 0.5), transparent 65%); }
.vr-lamp.is-out { mix-blend-mode: multiply; --vr-glow: radial-gradient(circle, rgba(14, 6, 22, 0.85) 18%, transparent 60%); animation: none; }
@keyframes vr-flicker { 0%, 100% { opacity: 1; } 46% { opacity: 0.78; } 50% { opacity: 0.95; } 54% { opacity: 0.74; } }

/* dust (or embers, or spores) in the light */
.vr-mote { width: 4px; height: 4px; border-radius: 50%; --vr-glow: var(--c); --vr-halo: 0 0 6px var(--c); opacity: 0; animation: vr-mote linear infinite; }
@keyframes vr-mote { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 0.85; } 100% { opacity: 0; transform: translate(16px, -110px); } }

/* a painted thing that sways (a curtain, a lantern, a wreath): a soft shimmer of light over it, rocking */
.vr-sway { transform-origin: 50% 0; mix-blend-mode: screen; --vr-glow: radial-gradient(ellipse at 50% 60%, rgba(255, 240, 210, 0.16), transparent 70%); animation: vr-sway 5s ease-in-out infinite; }
@keyframes vr-sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
/* Real Estate's window: clouds and islands drift past at sunset */
.vr-cloud { left: -20%; width: 16%; height: 6%; border-radius: 50%; mix-blend-mode: screen; --vr-glow: radial-gradient(ellipse, rgba(255, 196, 150, 0.45), transparent 70%); animation: vr-cloud 21s linear infinite; }
@keyframes vr-cloud { to { left: 104%; } }
/* the Roost's sky: a comet crosses now and then */
.vr-comet { left: 60%; top: 8%; width: 12%; height: 2px; transform: rotate(-18deg); opacity: 0; --vr-glow: linear-gradient(90deg, transparent, rgba(150, 255, 190, 0.9)); animation: vr-comet 9s ease-in 2s infinite; }
@keyframes vr-comet { 0%, 70% { opacity: 0; transform: translate(0, 0) rotate(-18deg); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-260%, 90%) rotate(-18deg); } }
/* the market square's sky: the aurora ripples */
.vr-aurora { left: 15%; top: 0; width: 70%; height: 30%; mix-blend-mode: screen; --vr-glow: radial-gradient(ellipse at 50% 30%, rgba(110, 255, 180, 0.22), transparent 70%); animation: vr-aurora 9s ease-in-out infinite; }
@keyframes vr-aurora { 0%, 100% { transform: skewX(-8deg) scaleY(1); opacity: 0.7; } 50% { transform: skewX(8deg) scaleY(1.15); opacity: 1; } }
/* the Barracks' floor: green mist rolls */
.vr-mist { left: -10%; right: -10%; bottom: 0; height: 26%; --vr-glow: radial-gradient(ellipse at 50% 100%, rgba(120, 255, 140, 0.28), transparent 70%); animation: vr-mist 8s ease-in-out infinite; }
@keyframes vr-mist { 50% { transform: translateX(6%); opacity: 0.7; } }
/* the room breathes: the dark at its edges deepens and eases */
.vr-vignette { inset: 0; --vr-glow: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(11, 8, 20, 0.5)); animation: vr-breathe 7s ease-in-out infinite; }
@keyframes vr-breathe { 50% { opacity: 0.6; } }

/* THE ARRIVAL: everything keyed off .is-arriving, so the room at rest is the whole, lit room (a thumbnail, a check) */
.vr-stage.is-arriving .vr-stage__paint { animation: vr-dolly 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes vr-dolly { 0% { transform: scale(1.18); filter: brightness(0.22) saturate(0.6); } 45% { filter: brightness(0.55); } 100% { transform: scale(1); filter: none; } }
.is-arriving .vr-lamp:not(.is-out) { animation: vr-lamp-on 0.5s ease var(--d, 0s) both, vr-flicker 4s ease-in-out var(--f, 0s) infinite; }
@keyframes vr-lamp-on { 0% { opacity: 0; } 60% { opacity: 1; } 75% { opacity: 0.35; } 100% { opacity: 1; } }
.vr-stage.is-arriving .vr-spot { animation: vr-spot-in 0.6s ease 1.6s both, vr-glow 3.2s ease-in-out 2.2s infinite; }
@keyframes vr-spot-in { from { opacity: 0; } to { opacity: 1; } }

/* the stations in the painting: a soft glow that breathes; its name on hover, on focus and while open */
.vr-spot { position: absolute; transform: translate(-50%, -50%); min-width: var(--rui-tap); min-height: var(--rui-tap); margin: 0; padding: 0; cursor: pointer; z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.28); border-radius: 16px; background: rgba(20, 13, 30, 0.14); color: var(--rui-ink);
  display: grid; place-items: end center; animation: vr-glow 3.2s ease-in-out infinite; }
.vr-spot__word { transform: translateY(calc(100% + 6px)); background: rgba(20, 13, 30, 0.9); border: 1px solid var(--rui-line); border-radius: 999px; padding: 2px 12px;
  font-family: inherit; font-weight: bold; font-size: var(--rui-min); line-height: 1.3; white-space: nowrap; visibility: hidden; }
.vr-spot:hover, .vr-spot:focus-visible, .vr-spot.is-on { border-color: var(--rui-gold); background: rgba(245, 194, 66, 0.1); box-shadow: 0 0 22px 3px rgba(245, 194, 66, 0.42); animation: none; outline: none; }
[data-side="horde"] .vr-spot:hover, [data-side="horde"] .vr-spot:focus-visible, [data-side="horde"] .vr-spot.is-on { border-color: #8DFF6B; background: rgba(127, 224, 214, 0.1); box-shadow: 0 0 22px 3px rgba(127, 255, 140, 0.42); }
.vr-spot.is-low { place-items: start center; }
.vr-spot.is-low .vr-spot__word { transform: translateY(calc(-100% - 6px)); }
.vr-spot:hover .vr-spot__word, .vr-spot:focus-visible .vr-spot__word, .vr-spot.is-on .vr-spot__word { visibility: visible; }
.vr-spot:focus-visible { outline: 3px solid var(--rui-gold); outline-offset: 2px; }
@keyframes vr-glow { 50% { border-color: rgba(245, 194, 66, 0.7); } }
/* a painting too small for its stations side by side: the picture bar under it is the menu there */
@container vr-stage (max-width: 459px) { .vr-spot { display: none; } }

/* the room's line on the painting (the arrival, a moment) and Walk in again */
.vr-toast { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 5; max-width: calc(100% - 24px); padding: 6px 14px; border-radius: 999px;
  background: var(--rui-gold); color: #1a1226; font-family: inherit; font-weight: bold; font-size: var(--rui-min); line-height: 1.3; text-align: center; }
.vr-toast.is-on { animation: vr-toast 2.8s ease both; }
@keyframes vr-toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 12%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.vr-replay { position: absolute; right: 10px; bottom: 10px; z-index: 5; min-height: var(--rui-tap); padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--rui-line); background: rgba(20, 13, 30, 0.82); color: var(--rui-ink); font-family: inherit; font-weight: bold; font-size: var(--rui-min); line-height: 1.2; }
.vr-replay:focus-visible { outline: 3px solid var(--rui-gold); outline-offset: 2px; }

/* ---- the picture bar under the painting: the stations by name, with what is in each --------------------------------- */
.vr-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.vr-bar__btn { flex: 1 1 140px; min-height: var(--rui-tap); padding: 6px 12px; border-radius: 14px; cursor: pointer; display: grid; gap: 0; justify-items: center; text-align: center;
  border: 1.5px solid var(--rui-line); background: rgba(27, 20, 40, 0.88); color: var(--rui-ink); font-family: inherit; font-weight: bold; font-size: var(--rui-min); line-height: 1.25; }
.vr-bar__btn.is-on { border-color: var(--rui-gold); box-shadow: 0 0 14px rgba(245, 194, 66, 0.35); }
[data-side="horde"] .vr-bar__btn.is-on { border-color: #8DFF6B; box-shadow: 0 0 14px rgba(127, 255, 140, 0.3); }
.vr-bar__btn:focus-visible { outline: 3px solid var(--rui-gold); outline-offset: 2px; }
.vr-bar__count { font-size: var(--rui-min); font-weight: normal; color: var(--rui-soft); }

/* ---- the air on a phone: the lamps and motes over the kit's painted backdrop, under the page ------------------------ */
.vr-air { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.rui.vr-room > :not(.vr-air) { position: relative; z-index: 1; }
.rui.vr-room[data-stage="side"] > .vr-air { display: none; }
.vr-air .vr-lamp { width: 16vmin; opacity: 0.7; }

/* ---- the moments (js/village-room.js MOMENTS), each a short flight of light over the painting ------------------------ */
.vr-moment { z-index: 3; animation: vr-moment 2.4s ease-out both; }
@keyframes vr-moment { 0% { opacity: 0; transform: scale(0.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4) translateY(-20%); } }
/* the Hospital: a healed unicorn walks out of the ward, a glow leaving the beds for the door */
.vr-moment--walk-out { left: 10%; top: 55%; width: 14%; aspect-ratio: 1; border-radius: 50%; --vr-glow: radial-gradient(circle, rgba(191, 247, 240, 0.85), transparent 65%); animation: vr-walk 2.4s ease-in-out both; }
@keyframes vr-walk { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(260%, -30%); } }
/* Real Estate: the deed rolls up and flies off */
.vr-moment--deed { left: 76%; top: 60%; width: 8%; aspect-ratio: 1; border-radius: 30%; --vr-glow: radial-gradient(circle, rgba(255, 220, 150, 0.9), transparent 70%); animation: vr-fly 2.2s ease-in both; }
@keyframes vr-fly { 0% { opacity: 0; transform: scale(0.6); } 25% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: translate(-500%, -300%) scale(0.4); } }
/* the Armory: a trophy hall's banners unfurl (the light runs down from the window) */
.vr-moment--banners { left: 30%; top: 0; width: 40%; height: 60%; --vr-glow: linear-gradient(180deg, rgba(245, 194, 66, 0.45), transparent); }
/* the Roost: the griffin lands on the perch, a rush of light from the sky to the nest */
.vr-moment--land { left: 14%; top: 10%; width: 18%; aspect-ratio: 1; border-radius: 50%; --vr-glow: radial-gradient(circle, rgba(255, 255, 255, 0.75), transparent 65%); animation: vr-land 2.2s ease-in both; }
@keyframes vr-land { 0% { opacity: 0; transform: translate(180%, -60%) scale(0.5); } 60% { opacity: 1; } 100% { opacity: 0; transform: translate(0, 120%) scale(1.2); } }
/* the Stables: the new egg glows in the basket and is carried out toward the Nursery */
.vr-moment--egg-out { left: 46%; top: 80%; width: 8%; aspect-ratio: 1; border-radius: 50%; --vr-glow: radial-gradient(circle, rgba(255, 240, 200, 0.95), transparent 70%); animation: vr-carry 2.4s ease-in-out both; }
@keyframes vr-carry { 0% { opacity: 0; transform: scale(0.5); } 30% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: translate(500%, -40%) scale(0.6); } }
/* the Nursery: an egg ready to hatch shakes and cracks with light */
.vr-moment--crack { left: 16%; top: 62%; width: 16%; aspect-ratio: 1; border-radius: 50%; --vr-glow: radial-gradient(circle, rgba(255, 255, 220, 0.9), transparent 60%); animation: vr-crack 2s ease-out both; }
@keyframes vr-crack { 0%, 40% { opacity: 0.3; transform: rotate(0); } 10%, 30% { transform: rotate(-6deg); } 20% { transform: rotate(6deg); } 55% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(1.8); } }

/* the Fountain: a Charter signed carves its stone with a flash of light */
.vr-moment--carve { left: 3%; top: 8%; width: 12%; height: 48%; border-radius: 40% 40% 8% 8%; --vr-glow: linear-gradient(180deg, rgba(255, 245, 210, 0.85), rgba(245, 194, 66, 0.2)); animation: vr-carve 2.2s ease-out both; }
[data-side="horde"] .vr-moment--carve { --vr-glow: linear-gradient(180deg, rgba(160, 255, 150, 0.8), rgba(60, 200, 90, 0.15)); }
@keyframes vr-carve { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

/* the Marketplace's counters (js/market-room.js): a sales mouse beside her words and the way in; the SOTC stall shut */
.rmk-counter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; }
.rmk-crew { width: clamp(96px, 16vw, 150px); height: auto; flex: none; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.55)); }
.rmk-words { flex: 1 1 260px; min-width: 0; display: grid; gap: 12px; justify-items: start; }
.rmk-shut { display: grid; gap: 10px; justify-items: start; padding: 14px; border-radius: 14px; border: 2px dashed var(--rui-line); background: var(--rui-panel-2); }
.rmk-shut__sign { display: inline-block; padding: 4px 16px; border-radius: 4px; background: #c9a46a; color: #2a1a08; font-family: var(--rui-title-font); font-weight: bold;
  font-size: var(--rui-min); letter-spacing: 0.08em; box-shadow: 0 3px 0 #6b4a22; transform: rotate(-2deg); }

/* the Fountain's purses: one row a level, what it paid and whether it has */
.rvm-purses { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.rvm-purse { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid var(--rui-line); background: rgba(27, 20, 40, 0.88); }
.rvm-purse__level { color: var(--rui-gold); }
.rvm-purse__words { min-width: 0; }
.rvm-purse__state { font-size: var(--rui-min); color: var(--rui-soft); }
.rvm-purse[data-state="paid"] .rvm-purse__state { color: var(--rui-good); }
.rvm-purse[data-state="ahead"] { opacity: 0.75; }

@media (prefers-reduced-motion: reduce) {
  .vr-stage *, .vr-air *, .vr-spot { animation: none !important; transition: none !important; }
  .vr-mote, .vr-comet, .vr-cloud, .vr-moment { display: none; }
}
