:root {
  color-scheme: dark;
  --gold: #d9a542;
  --gold-bright: #ffd985;
  --ink: #25190f;
  --cream: #f3dfb0;
  --night-progress: 0;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; overflow: hidden; background: #0c0a08; }
body { min-width: 320px; }
button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.experience {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, #2a1c0e 0, #0c0a08 66%),
    #0c0a08;
}

.room-stage {
  --stage-w: min(100vw, calc(100dvh * 1.77683));
  position: relative;
  width: var(--stage-w);
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  box-shadow: 0 0 80px #000;
}

.scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.scene-day { z-index: 0; }
.scene-night { z-index: 1; opacity: var(--night-progress); transition: opacity 1.4s cubic-bezier(.22,.75,.2,1); }
.room-stage.is-dragging .scene-night { transition: none; }

.night-vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: calc(var(--night-progress) * .44);
  background: radial-gradient(circle at 36% 45%, transparent 20%, rgba(0,18,48,.48) 100%);
  transition: opacity 1.2s ease;
}

.scene-title {
  position: absolute; z-index: 8; top: 3.2%; left: 3.2%;
  color: #fff1cd; text-shadow: 0 2px 12px #000;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.45));
  transition: opacity .35s ease;
}
.scene-title p { margin: 0 0 .25rem; font: 600 clamp(.45rem, .7vw, .72rem)/1.2 Arial, sans-serif; letter-spacing: .25em; opacity: .78; }
.scene-title h1 { margin: 0; font-size: clamp(.9rem, 1.55vw, 1.65rem); font-weight: 500; letter-spacing: .09em; }

.sound-toggle {
  position: absolute; z-index: 12; left: 3.2%; bottom: 4%;
  min-height: 36px; padding: .5rem .75rem; border: 1px solid rgba(255,217,133,.5); border-radius: 999px;
  color: #ffe7ac; background: rgba(20,13,8,.62); backdrop-filter: blur(8px); cursor: pointer;
  display: flex; align-items: center; gap: .45rem; box-shadow: 0 4px 18px rgba(0,0,0,.28);
}
.sound-toggle[aria-pressed="false"] { opacity: .62; }
.sound-text { font: 600 clamp(.7rem, .8vw, .85rem)/1 Arial, sans-serif; letter-spacing: .08em; }

.hotspots { position: absolute; inset: 0; z-index: 10; }
.hotspot {
  --size: clamp(30px, 3.15vw, 54px);
  position: absolute; left: var(--x); top: var(--y); width: var(--size); height: var(--size);
  padding: 0; border: 0; background: none; color: var(--gold-bright); cursor: pointer;
  transform: translate(-50%, -50%) translateY(var(--drag-y, 0px));
  touch-action: none;
}
.hotspot-core {
  position: absolute; inset: 16%; display: grid; place-items: center; border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(240,188,78,.62);
  box-shadow: 0 2px 7px rgba(0,0,0,.55), inset 0 0 10px rgba(255,206,94,.12), 0 0 0 0 rgba(255,200,79,.28);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease, filter .28s ease;
  animation: hotspotPulse 3.2s ease-in-out infinite;
}
.hotspot:nth-child(2n) .hotspot-core { animation-delay: -.8s; }
.hotspot:nth-child(3n) .hotspot-core { animation-delay: -1.6s; }
.hotspot-core svg { width: 78%; height: 78%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; filter: drop-shadow(0 0 3px rgba(255,196,65,.6)); }
.hotspot-core svg path:first-of-type { fill: none; }
.hotspot:hover .hotspot-core, .hotspot:focus-visible .hotspot-core {
  transform: scale(1.13); filter: brightness(1.28);
  box-shadow: 0 4px 12px rgba(0,0,0,.55), inset 0 0 16px rgba(255,206,94,.24), 0 0 24px rgba(255,200,79,.42);
}
.hotspot:focus-visible { outline: none; }
.hotspot:focus-visible .hotspot-core { outline: 2px solid #fff4ca; outline-offset: 3px; }

.hotspot-label {
  position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translate(-50%, 8px);
  width: max-content; max-width: 180px; padding: .42rem .65rem; border: 1px solid rgba(226,178,79,.42); border-radius: 6px;
  color: #fff0c9; background: rgba(19,14,10,.86); box-shadow: 0 5px 18px rgba(0,0,0,.42);
  font: 500 clamp(.66rem, .76vw, .82rem)/1.2 "Noto Serif SC", serif; letter-spacing: .08em;
  pointer-events: none; opacity: 0; transition: opacity .2s ease, transform .2s ease; white-space: nowrap;
}
.hotspot-label::after { content: ""; position: absolute; left: 50%; top: 100%; border: 5px solid transparent; border-top-color: rgba(226,178,79,.5); transform: translateX(-50%); }
.hotspot:hover .hotspot-label, .hotspot:focus-visible .hotspot-label, .clock-hotspot.is-dragging .hotspot-label { opacity: 1; transform: translate(-50%, 0); }

.clock-hotspot { z-index: 2; }
.clock-hotspot .hotspot-core { background: transparent; }
.clock-hotspot.is-dragging .hotspot-core { transform: scale(1.14); box-shadow: 0 0 32px rgba(255,204,91,.72); }
.drag-thread { position: absolute; z-index: -1; left: 50%; top: 50%; width: 1px; height: 0; background: linear-gradient(#ffd77d, transparent); transform: translateX(-50%); opacity: 0; }
.clock-hotspot.is-dragging .drag-thread { height: calc(var(--drag-distance, 0px) * -1); opacity: .7; }

.clock-guide {
  position: absolute; z-index: 7; right: 2.1%; top: 58%; width: 13%;
  display: flex; flex-direction: column; align-items: center; gap: .25rem; pointer-events: none;
  color: rgba(255,239,199,.8); text-shadow: 0 1px 5px #000; font: 500 clamp(.42rem, .62vw, .68rem)/1.2 Arial, sans-serif; letter-spacing: .08em;
}
.guide-line { width: 1px; height: clamp(12px, 2vw, 30px); background: linear-gradient(#f6c65b, transparent); position: relative; animation: guideNudge 1.8s ease-in-out infinite; }
.guide-line::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 5px; height: 5px; border-right: 1px solid #f6c65b; border-bottom: 1px solid #f6c65b; transform: translateX(-50%) rotate(45deg); }

.time-state {
  position: absolute; z-index: 8; left: 50%; bottom: 3.5%; transform: translateX(-50%);
  display: flex; gap: .6rem; align-items: center; min-width: clamp(150px, 13vw, 210px); padding: .55rem .85rem;
  color: #fff0ca; background: rgba(26,17,10,.66); border: 1px solid rgba(230,179,75,.38); border-radius: 999px;
  backdrop-filter: blur(10px); box-shadow: 0 7px 24px rgba(0,0,0,.25); pointer-events: none;
}
.state-orb { width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; color: #482e0c; background: #f7c967; box-shadow: 0 0 14px rgba(255,205,93,.62); transition: .8s ease; }
.state-copy { display: flex; flex-direction: column; }
.state-copy small { font: .58rem/1.2 Arial, sans-serif; letter-spacing: .13em; opacity: .7; }
.state-copy strong { font-size: clamp(.67rem, .83vw, .9rem); font-weight: 500; letter-spacing: .11em; }
.room-stage.is-night .state-orb { color: #dce9ff; background: #17385c; box-shadow: 0 0 15px rgba(97,167,255,.55); }

.magic-dust { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.dust { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #ffe69d; box-shadow: 0 0 7px #ffd36d; opacity: .2; animation: dustFloat var(--d, 7s) ease-in-out var(--delay, 0s) infinite; }

.magic-flare { position: absolute; z-index: 6; left: 54%; top: 43%; width: 12%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; opacity: 0; transform: translate(-50%,-50%) scale(.2); background: radial-gradient(circle, rgba(255,239,175,.85), rgba(218,163,66,.25) 35%, transparent 70%); }
.magic-flare.active { animation: flare 1.65s cubic-bezier(.2,.7,.2,1); }
.crest-sheen { position: absolute; z-index: 6; left: 75.5%; top: 20%; width: 12%; height: 34%; opacity: 0; pointer-events: none; transform: rotate(18deg); background: linear-gradient(90deg, transparent, rgba(255,242,192,.6), transparent); filter: blur(5px); }
.crest-sheen.active { animation: crestSweep 1.5s ease; }

.toast {
  position: absolute; z-index: 30; left: 50%; top: 10%; transform: translate(-50%,-10px); padding: .65rem 1rem;
  border: 1px solid rgba(247,205,116,.5); border-radius: 6px; color: #ffedc2; background: rgba(19,13,8,.86);
  font-size: clamp(.7rem,.85vw,.9rem); letter-spacing: .08em; opacity: 0; pointer-events: none; transition: .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%,0); }

.intro {
  position: absolute; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center;
  color: #f8e6bc; text-align: center;
  background: radial-gradient(circle at 50% 45%, rgba(54,37,21,.74), rgba(10,8,7,.93));
  backdrop-filter: blur(4px); transition: opacity .8s ease, visibility .8s;
}
.intro.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-mark { width: clamp(58px,7vw,110px); aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 1rem; border: 1px solid #d7a444; border-radius: 50%; color: #e8bd63; box-shadow: inset 0 0 24px rgba(222,166,60,.16), 0 0 36px rgba(222,166,60,.16); font-size: clamp(1.8rem,3vw,3.2rem); }
.intro p { margin: 0 0 .65rem; font: 600 clamp(.6rem,.8vw,.84rem)/1 Arial,sans-serif; letter-spacing: .3em; color: #d5ae60; }
.intro h2 { margin: 0 0 1.5rem; font-size: clamp(1.6rem,3.4vw,3.8rem); font-weight: 400; letter-spacing: .14em; }
.intro button, .primary-button {
  min-height: 42px; padding: .65rem 1.25rem; border: 1px solid #e3b759; border-radius: 4px;
  color: #21160c; background: linear-gradient(#f4d083,#c8912f); box-shadow: 0 6px 24px rgba(0,0,0,.25); cursor: pointer; font-weight: 700; letter-spacing: .12em;
}
.intro button:hover, .primary-button:hover { filter: brightness(1.1); }

.artifact-dialog {
  width: min(92vw, 740px); max-height: 88dvh; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible;
}
.artifact-dialog::backdrop { background: rgba(6,6,8,.64); backdrop-filter: blur(7px); animation: backdropIn .35s ease; }
.artifact-dialog[open] .dialog-shell { animation: dialogOpen .55s cubic-bezier(.18,.86,.22,1); }
.artifact-dialog.is-closing .dialog-shell { animation: dialogClose .32s ease forwards; }
.artifact-dialog.is-closing::backdrop { animation: backdropOut .32s ease forwards; }
.dialog-shell { position: relative; width: 100%; padding: clamp(1.8rem,5vw,3.8rem); border: 1px solid #b98b3f; border-radius: 8px; box-shadow: 0 24px 80px rgba(0,0,0,.6); text-align: center; overflow: hidden; }
.close-dialog { position: absolute; z-index: 5; top: 1rem; right: 1rem; min-height: 34px; padding: .35rem .65rem; border: 1px solid currentColor; border-radius: 4px; color: inherit; background: rgba(255,255,255,.14); cursor: pointer; font-size: .78rem; letter-spacing: .08em; }
.eyebrow { margin: 0 0 .55rem; font: 700 .7rem/1.2 Arial,sans-serif; letter-spacing: .26em; opacity: .6; }
.dialog-shell h2 { margin: 0; font-weight: 500; letter-spacing: .12em; font-size: clamp(1.5rem,4vw,2.6rem); }
.dialog-subtitle { margin: .55rem 0 1.5rem; opacity: .7; letter-spacing: .1em; }

.paper-shell { background: #d8bd7e; background-image: radial-gradient(circle at 40% 30%, rgba(255,245,200,.7), transparent 45%), repeating-linear-gradient(4deg, transparent 0 19px, rgba(88,55,19,.025) 20px); border-color: #6d481f; clip-path: polygon(.7% 1.8%,99% .4%,98.4% 98.2%,1.2% 99.4%); }
.paper-shell::before, .paper-shell::after { content:""; position:absolute; inset:14px; border:1px solid rgba(85,53,17,.42); pointer-events:none; }
.paper-shell::after { inset:20px; border-style:double; }
.paper-corner { position:absolute; right:0; bottom:0; width:75px; height:75px; background:linear-gradient(135deg,rgba(92,59,22,.3) 0 49%,#f0d99d 50%); box-shadow:-4px -4px 12px rgba(58,36,12,.2); animation: cornerLift 1.1s ease .3s both; }
.schedule-table { position: relative; z-index: 1; display:grid; margin:1.5rem auto; max-width:580px; border:1px solid rgba(58,35,12,.55); text-align:left; }
.schedule-table > div { display:grid; grid-template-columns:.72fr repeat(3,1fr); }
.schedule-table span { padding:.58rem .45rem; border-right:1px solid rgba(58,35,12,.26); border-bottom:1px solid rgba(58,35,12,.26); font-size:clamp(.72rem,2vw,.92rem); }
.schedule-table div:first-child { font-weight:700; background:rgba(82,48,13,.09); }
.hand-note { margin:1rem 0 0; font-style:italic; transform:rotate(-1deg); }

.leather-shell { color:#f0d9a2; background:radial-gradient(circle at 45% 20%,#5a321c,#26150e 74%); border:10px double #7b4d26; }
.open-book { position:relative; display:grid; grid-template-columns:1fr 1fr; width:min(100%,580px); min-height:260px; margin:1.6rem auto; perspective:1000px; filter:drop-shadow(0 12px 15px rgba(0,0,0,.42)); }
.book-page { padding:2rem 1.5rem; color:#3d2a17; background:#e3c98d; background-image:repeating-linear-gradient(0deg,transparent 0 26px,rgba(83,59,29,.08) 27px); border:1px solid #9c753d; text-align:left; line-height:1.9; }
.left-page { border-radius:16px 3px 3px 16px; box-shadow:inset -16px 0 18px rgba(71,47,18,.12); }
.right-page { border-radius:3px 16px 16px 3px; box-shadow:inset 16px 0 18px rgba(71,47,18,.12); }
.book-page p { margin:0 0 .8rem; font-weight:700; letter-spacing:.12em; }
.turning-page { position:absolute; z-index:3; top:0; right:0; width:50%; height:100%; transform-origin:left center; border-radius:3px 16px 16px 3px; background:linear-gradient(90deg,#c4a66d,#efd8a0); opacity:0; }
.diary-book.turn .turning-page { animation:pageTurn 1.1s ease; }
.secondary-button { min-height:38px; padding:.55rem .9rem; border:1px solid currentColor; border-radius:4px; color:inherit; background:transparent; cursor:pointer; letter-spacing:.08em; }
.secondary-button:hover { background:rgba(255,255,255,.1); }

.grimoire-shell { color:#e9d8b1; background:radial-gradient(circle at 50% 10%,#3d3928,#131810 72%); border:8px ridge #7f6c39; }
.grimoire-book .book-page { background:#cdb77f; }
.rune-ring { text-align:center; font-size:2rem; line-height:1.5; color:#55401d; animation:runeGlow 2.2s ease-in-out infinite; }
.page-shimmer { position:absolute; z-index:4; inset:0; pointer-events:none; background:linear-gradient(105deg,transparent 25%,rgba(255,240,157,.45) 45%,transparent 64%); transform:translateX(-100%); animation:pageShimmer 2.4s ease-in-out infinite; }
.incantation { color:#d2bd7d; letter-spacing:.12em; font-style:italic; }

.wand-shell {
  --spell-color: #ffd36f;
  color: #f1dfb6;
  background:
    radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--spell-color) 18%, transparent), transparent 38%),
    linear-gradient(145deg, #261a11, #0f1014 68%);
  border: 1px solid #8a652c;
  transition: background .45s ease;
}
.wand-shell:has(.wand-lab[data-spell="protego"]) { --spell-color: #8dccff; }
.wand-shell:has(.wand-lab[data-spell="herbivicus"]) { --spell-color: #9ad46f; }
.wand-lab {
  --rx: 0deg; --ry: 0deg;
  position: relative; width: min(100%, 610px); aspect-ratio: 2.6 / 1; margin: 1.4rem auto 1rem;
  overflow: hidden; border: 1px solid color-mix(in srgb, var(--spell-color) 48%, transparent); border-radius: 10px;
  background: radial-gradient(circle at 72% 26%, color-mix(in srgb, var(--spell-color) 18%, transparent), transparent 26%), rgba(2,5,9,.54);
  box-shadow: inset 0 0 34px rgba(0,0,0,.55); cursor: crosshair; outline: none;
}
.wand-lab:focus-visible { box-shadow: inset 0 0 34px rgba(0,0,0,.55), 0 0 0 2px #fff0c7, 0 0 22px var(--spell-color); }
.interactive-wand {
  position: absolute; inset: 3% 2% 2%; width: 96%; height: 95%; overflow: visible;
  transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry)); transform-origin: 48% 55%;
  filter: drop-shadow(0 12px 9px rgba(0,0,0,.72)); transition: transform .16s ease-out;
}
.wand-shadow { fill:none; stroke:rgba(0,0,0,.48); stroke-width:17; stroke-linecap:round; }
.wand-body { fill:none; stroke:url(#wandWood); stroke-width:12; stroke-linecap:round; }
.wand-carving { fill:none; stroke:rgba(240,191,105,.55); stroke-width:1.8; stroke-linecap:round; stroke-dasharray:6 9; }
.wand-handle { fill:url(#wandWood); stroke:#bd8843; stroke-width:2; }
.wand-tip { fill:var(--spell-color); opacity:.72; transform-origin:452px 34px; animation:wandTip 1.8s ease-in-out infinite; }
.spell-aura { position:absolute; z-index:2; left:86.6%; top:16%; width:13%; aspect-ratio:1; border-radius:50%; transform:translate(-50%,-50%) scale(.2); opacity:0; pointer-events:none; background:radial-gradient(circle,var(--spell-color),color-mix(in srgb,var(--spell-color) 25%,transparent) 34%,transparent 68%); }
.spell-shield { position:absolute; z-index:1; left:50%; top:52%; width:43%; aspect-ratio:1; border:2px solid var(--spell-color); border-radius:50%; opacity:0; transform:translate(-50%,-50%) scale(.45); box-shadow:inset 0 0 28px color-mix(in srgb,var(--spell-color) 24%,transparent),0 0 20px color-mix(in srgb,var(--spell-color) 36%,transparent); pointer-events:none; }
.spell-runes { position:absolute; inset:0; pointer-events:none; color:var(--spell-color); opacity:.5; }
.spell-runes i { position:absolute; font-style:normal; text-shadow:0 0 10px currentColor; animation:runeDrift 4s ease-in-out infinite; }
.spell-runes i:nth-child(1){left:12%;top:19%}.spell-runes i:nth-child(2){left:27%;top:72%;animation-delay:-1s}.spell-runes i:nth-child(3){left:55%;top:15%;animation-delay:-2s}.spell-runes i:nth-child(4){left:76%;top:74%;animation-delay:-3s}.spell-runes i:nth-child(5){left:91%;top:42%;animation-delay:-1.7s}
.wand-instruction { position:absolute; left:50%; bottom:.6rem; transform:translateX(-50%); font:600 .68rem/1 Arial,sans-serif; letter-spacing:.14em; color:rgba(255,239,202,.62); }
.wand-lab.is-casting .spell-aura { animation:spellBurst 1.25s cubic-bezier(.2,.8,.2,1); }
.wand-lab.is-casting .interactive-wand { animation:wandCast .78s cubic-bezier(.2,.8,.2,1); }
.wand-lab.is-casting[data-spell="protego"] .spell-shield { animation:shieldCast 1.35s ease; }
.wand-lab.is-casting[data-spell="herbivicus"]::after { content:"❧  ❧  ❧"; position:absolute; z-index:2; left:30%; bottom:13%; color:var(--spell-color); font-size:2rem; letter-spacing:.9rem; text-shadow:0 0 15px currentColor; animation:vinesGrow 1.3s ease both; }
.spell-picker { display:grid; grid-template-columns:repeat(3,1fr); gap:.7rem; width:min(100%,610px); margin:0 auto 1rem; }
.spell-option { min-height:72px; padding:.65rem .5rem; border:1px solid rgba(219,178,93,.32); border-radius:7px; color:#ddcba7; background:rgba(255,255,255,.035); cursor:pointer; display:grid; grid-template-columns:auto 1fr; grid-template-rows:auto auto; column-gap:.55rem; text-align:left; transition:.25s ease; }
.spell-option > span { grid-row:1/3; align-self:center; font-size:1.25rem; color:var(--spell-color); }
.spell-option strong { font-size:.85rem; font-weight:500; letter-spacing:.08em; }
.spell-option small { margin-top:.2rem; font:600 .63rem/1 Arial,sans-serif; letter-spacing:.12em; opacity:.55; }
.spell-option:hover,.spell-option:focus-visible,.spell-option.is-active { border-color:var(--spell-color); color:#fff1d0; background:color-mix(in srgb,var(--spell-color) 10%,transparent); box-shadow:inset 0 0 18px color-mix(in srgb,var(--spell-color) 8%,transparent); outline:none; }
.cast-button { margin-top:.25rem; }
.spell-result { min-height:1.5em; margin:.85rem 0 0; color:var(--spell-color); letter-spacing:.08em; }

@keyframes wandTip { 50%{opacity:1;transform:scale(1.35);filter:drop-shadow(0 0 8px var(--spell-color))} }
@keyframes runeDrift { 50%{transform:translateY(-8px) rotate(8deg);opacity:.9} }
@keyframes spellBurst { 0%{opacity:0;transform:translate(-50%,-50%) scale(.15)}25%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(4.2)} }
@keyframes wandCast { 0%,100%{transform:perspective(700px) rotate(0)}35%{transform:perspective(700px) rotate(-7deg) translateY(-5px)}60%{transform:perspective(700px) rotate(3deg)} }
@keyframes shieldCast { 0%{opacity:0;transform:translate(-50%,-50%) scale(.35)}40%{opacity:.88}100%{opacity:0;transform:translate(-50%,-50%) scale(1.35)} }
@keyframes vinesGrow { from{opacity:0;transform:translateY(30px) scale(.5)}to{opacity:1;transform:translateY(0) scale(1)} }

.message-shell { text-align:left; color:#392718; background:#e1c68e; background-image:repeating-linear-gradient(0deg,transparent 0 31px,rgba(90,58,24,.1) 32px); }
.message-shell h2,.message-shell .eyebrow,.message-shell .dialog-subtitle { text-align:center; }
.message-shell label { display:block; margin-bottom:.5rem; font-weight:700; }
.message-shell textarea { width:100%; min-height:170px; resize:vertical; padding:1rem; border:1px solid #8e672f; border-radius:4px; color:#312013; background:rgba(255,248,216,.5); outline:none; line-height:1.7; }
.message-shell textarea:focus { box-shadow:0 0 0 3px rgba(126,84,25,.18); }
.message-actions { display:flex; justify-content:space-between; align-items:center; margin-top:1rem; }
.message-actions span { font: .75rem Arial,sans-serif; opacity:.6; }

.gallery-shell { color:#f0d9a4; background:radial-gradient(circle at 50% 0,#39291b,#160f0a 75%); }
.art-frame { position:relative; width:min(100%,560px); aspect-ratio:16/9; margin:1.5rem auto; padding:14px; border:8px ridge #a9752f; background:#4a2f16; box-shadow:0 12px 35px #000; overflow:hidden; }
.art-frame img { width:100%; height:100%; object-fit:cover; transition:opacity .35s ease,transform .7s ease; }
.art-frame.changing img { opacity:0; transform:scale(1.03); }
.frame-glow { position:absolute; inset:0; box-shadow:inset 0 0 25px rgba(255,216,117,.32); pointer-events:none; animation:frameGlow 2.4s ease-in-out infinite; }
.gallery-controls { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:1rem; }
.gallery-controls p { margin:0; display:flex; flex-direction:column; }
.gallery-controls small { margin-top:.3rem; opacity:.58; font-family:Arial,sans-serif; }

.drawer-shell { min-height:560px; color:#f0d9a7; background:linear-gradient(135deg,#24170e,#120c08); overflow:hidden; }
.wood-drawer { position:absolute; left:12%; right:12%; bottom:10%; height:42%; border:12px solid #352013; background:linear-gradient(90deg,#170e08,#4a2d18,#170e08); box-shadow:inset 0 20px 30px #080504,0 22px 35px #000; transform:translateY(-120%); animation:drawerOpen .9s cubic-bezier(.2,.8,.2,1) .15s forwards; }
.drawer-front { position:absolute; left:-12px; right:-12px; bottom:-12px; height:54%; border:9px ridge #6a4122; background:linear-gradient(#59351d,#321b0f); transform:translateY(18%); }
.drawer-front i { position:absolute; left:50%; top:25%; width:38px; height:15px; border:4px solid #b47b2d; border-top:0; border-radius:0 0 18px 18px; transform:translateX(-50%); }
.secret-card { position:relative; z-index:2; width:min(82%,430px); min-height:250px; margin:2rem auto 0; padding:2.2rem; color:#3b2818; background:#e4cc94; border:1px solid #8a642c; box-shadow:0 15px 35px rgba(0,0,0,.55); transform:translateY(180%) rotate(-2deg); animation:cardRise .8s cubic-bezier(.2,.9,.2,1) .72s forwards; }
.card-monogram { display:grid; place-items:center; width:52px; height:52px; margin:0 auto 1rem; border:1px solid #76501e; border-radius:50%; font-size:1.6rem; }
.secret-card h3 { margin:.45rem 0; font-size:1.3rem; }
.secret-card p { margin:.35rem 0; line-height:1.6; }
.secret-card p:first-of-type,.secret-card small { font: .64rem Arial,sans-serif; letter-spacing:.18em; opacity:.68; }
.card-rule { width:70px; height:1px; margin:.9rem auto; background:#7d5723; }

@keyframes hotspotPulse { 0%,100%{box-shadow:0 2px 7px rgba(0,0,0,.55),inset 0 0 10px rgba(255,206,94,.12),0 0 0 0 rgba(255,200,79,.22)} 50%{box-shadow:0 2px 7px rgba(0,0,0,.55),inset 0 0 12px rgba(255,206,94,.18),0 0 0 7px rgba(255,200,79,0)} }
@keyframes guideNudge { 0%,100%{transform:translateY(-2px);opacity:.5}50%{transform:translateY(5px);opacity:1} }
@keyframes dustFloat { 0%,100%{transform:translate(0,7px);opacity:.1}50%{transform:translate(8px,-12px);opacity:.7} }
@keyframes flare { 0%{opacity:0;transform:translate(-50%,-50%) scale(.15)}30%{opacity:1;transform:translate(-50%,-50%) scale(.7)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.5)} }
@keyframes crestSweep { 0%{opacity:0;transform:translateX(-80%) rotate(18deg)}35%{opacity:.9}100%{opacity:0;transform:translateX(95%) rotate(18deg)} }
@keyframes clockChime { 0%,100%{transform:scale(1) rotate(0)}15%{transform:scale(1.1) rotate(-10deg)}30%{transform:scale(1.1) rotate(10deg)}45%{transform:scale(1.07) rotate(-7deg)}65%{transform:scale(1.04) rotate(4deg)} }
.room-stage.chiming .clock-hotspot .hotspot-core { animation:clockChime 1.4s ease; }
@keyframes backdropIn { from{opacity:0}to{opacity:1} } @keyframes backdropOut { to{opacity:0} }
@keyframes dialogOpen { from{opacity:0;transform:translateY(35px) scale(.94)}to{opacity:1;transform:none} }
@keyframes dialogClose { to{opacity:0;transform:translateY(22px) scale(.96)} }
@keyframes cornerLift { from{transform:translate(25px,25px) rotate(8deg);opacity:0}to{transform:none;opacity:1} }
@keyframes pageTurn { 0%{opacity:0;transform:rotateY(0)}10%{opacity:1}80%{opacity:1}100%{opacity:0;transform:rotateY(-180deg)} }
@keyframes runeGlow { 50%{color:#9a7027;text-shadow:0 0 12px #d4a53e;transform:scale(1.04)} }
@keyframes pageShimmer { 0%,20%{transform:translateX(-100%)}70%,100%{transform:translateX(100%)} }
@keyframes frameGlow { 50%{box-shadow:inset 0 0 30px rgba(255,224,141,.65),0 0 18px rgba(215,158,54,.3)} }
@keyframes drawerOpen { to{transform:translateY(0)} }
@keyframes cardRise { to{transform:translateY(0) rotate(-2deg)} }

@media (max-width: 720px) {
  .scene-title { top:2.2%;left:2.5%; }
  .scene-title p,.sound-text,.clock-guide,.time-state small { display:none; }
  .sound-toggle { left:2.5%;bottom:2.5%;min-height:30px;padding:.35rem .55rem; }
  .time-state { bottom:2.5%;min-width:0;padding:.35rem .55rem;gap:.35rem; }
  .state-orb { width:1.4rem;height:1.4rem;font-size:.72rem; }
  .artifact-dialog { max-height:94dvh; }
  .dialog-shell { max-height:90dvh; overflow:auto; padding:2.7rem 1.2rem 1.6rem; }
  .open-book { min-height:210px; }
  .book-page { padding:1.2rem .8rem; font-size:.78rem; }
  .drawer-shell { min-height:480px; }
  .spell-picker { grid-template-columns:1fr; }
  .spell-option { min-height:58px; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; scroll-behavior:auto!important; transition-duration:.01ms!important; }
}
