/* Minimal + Soft Bloom: hub presentation only. Existing state, hit targets,
   pointer coordinates, transition timing and experience styles remain owned by
   the current app. First Spark, portal, toast and recovery UI are untouched. */
#app {
  -webkit-tap-highlight-color:transparent;
  --aw-ivory: #fff4de;
  --aw-muted: #e8d4b9;
  --aw-shadow: #21130e;
  --aw-ui-shadow: 0 1px 3px #21130eee, 0 0 5px #21130e8c;
  --aw-chapter-shade-strength: .94;
  --aw-calendar-shade-strength: .94;
  --aw-calendar-closed-shade: .18;
  --aw-identity-shade-strength: .62;
  --aw-label-size: 11px;
  --aw-label-tracking: .20em;
}

#app .room-identity.wonder-glass,
#app #room-return,
#app #cal-toggle,
#app #calendar-popover,
#app #day-panel,
#app #wonder-label,
#app .keyboard-action:focus-visible,
#app #object-actions button:focus-visible {
  color: var(--aw-ivory);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  text-shadow: var(--aw-ui-shadow);
}

#app .room-identity h1,
#app #day-panel .day-panel-meta,
#app #cal-toggle > span:first-child,
#app #wonder-label {
  color: #f1d6b0;
  font: 550 var(--aw-label-size)/1.25 PPMori, Arial, sans-serif;
  letter-spacing: var(--aw-label-tracking);
  text-transform: uppercase;
  text-shadow: var(--aw-ui-shadow);
}
/* One anchored corner slot: identity in the room, return icon in the calendar.
   Neither control moves the other or changes the camera's existing timing. */
#app .room-navigation { isolation:isolate; min-width:44px; min-height:44px; }
#app .room-navigation .room-identity.wonder-glass {
  position:absolute;
  inset:0 auto auto 0;
  width:max-content;
  opacity:0;
  visibility:hidden;
  transform:translateY(-3px);
  transition:opacity 240ms cubic-bezier(.4,0,.6,1),transform 300ms cubic-bezier(.22,.61,.36,1),visibility 0s 240ms;
}
body[data-mode="intro"] #app .room-navigation .room-identity.wonder-glass {
  opacity:1;
  visibility:visible;
  transform:none;
  transition:opacity 380ms cubic-bezier(.22,.61,.36,1),transform 420ms cubic-bezier(.22,.61,.36,1),visibility 0s;
}
#app #room-return {
  opacity:0;
  visibility:hidden;
  transform:translateY(-2px);
  transition:opacity 230ms cubic-bezier(.4,0,.6,1),transform 300ms cubic-bezier(.22,.61,.36,1),visibility 0s 230ms;
}
body[data-mode="browse"] #app #room-return {
  opacity:1;
  visibility:visible;
  transform:none;
  transition:opacity 320ms cubic-bezier(.22,.61,.36,1),transform 380ms cubic-bezier(.22,.61,.36,1),visibility 0s;
}
#app .room-navigation::before {
  content:"";
  position:fixed;
  inset:0 auto auto 0;
  width:min(720px,68vw);
  height:clamp(110px,32dvh,300px);
  z-index:-1;
  pointer-events:none;
  opacity:var(--aw-identity-shade-strength);
  transition:opacity 380ms ease-out;
  background:radial-gradient(ellipse 100% 100% at 0 0,#140e0be8 0%,#1b120ebd 18%,#24170e70 40%,#291b1024 68%,transparent 100%);
}
body:is([data-mode="approach"],[data-mode="browse"]) #app .room-navigation::before { opacity:calc(var(--aw-identity-shade-strength) * .45); }
#app #look-word { text-transform: inherit; }
#app .room-identity img,
#app .room-identity[data-tone="light"] img {
  filter: drop-shadow(0 1px 2px #21130ed9);
}
#app #look-word:hover,
#app #look-word:focus-visible,
#app #room-return:hover,
#app #room-return:focus-visible {
  color: #fff8e7;
  text-shadow: var(--aw-ui-shadow), 0 0 5px #ffe1b040;
}

#app #day-panel {
  isolation: isolate;
  width: min(560px, calc(100vw - 32px));
}
#app::before {
  content: "";
  position: fixed;
  inset: auto auto 0 0;
  width: clamp(660px, 83vw, 1200px);
  height: clamp(360px, 62dvh, 780px);
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease-out;
  background: radial-gradient(ellipse 100% 100% at 0 100%, #140e0bfa 0%, #1b120ef0 17%, #24170eb3 38%, #291b1061 60%, #2b1c1019 80%, transparent 100%);
}
body[data-mode="browse"] #app::before { opacity: var(--aw-chapter-shade-strength); }
#app #day-panel .day-panel-meta {
  opacity: 1;
}
#app #day-state {
  color: var(--aw-muted);
  font: inherit;
  letter-spacing: .09em;
}
#app #day-panel h2 {
  margin: 7px 0 0;
  color: var(--aw-ivory);
  font: 500 clamp(32px, 3.65vw, 48px)/1.08 PPMori, Arial, sans-serif;
  letter-spacing: -.042em;
  text-transform: none;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 4px #23130de0, 0 0 8.5px #ffd59b75, 0 0 20.4px #ffbc6e35;
}
/* Optional descriptive copy stays in the accessible document. The existing
   availability notice and live instructions remain visible in their own nodes. */
#app #day-description {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

#app #cal-toggle {
  min-height: 44px;
  height: 44px;
  color: var(--aw-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
#app #cal-toggle #mini-date {
  min-width: 2ch;
  text-align: center;
  color: #fff3db;
  opacity: 1;
  font: italic 400 29px/.98 Georgia, serif;
  letter-spacing: -.045em;
  text-shadow: 0 1px 3px #26160eea, 0 0 7px #ffd69744;
}
#app #cal-toggle:hover,
#app #cal-toggle[aria-expanded="true"] {
  color: var(--aw-ivory);
  text-shadow: var(--aw-ui-shadow), 0 0 7px #ffd69755;
}
/* Corner shading belongs to the composition, outside the scrolling grid. The
   existing header visibility and expanded state own it, including during travel. */
#app #topbar { isolation: isolate; }
#app::after {
  content: "";
  position: fixed;
  inset: 0 0 auto auto;
  width: clamp(640px, 58vw, 1040px);
  height: clamp(620px, 92dvh, 1100px);
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  transition: opacity 320ms cubic-bezier(.22,.61,.36,1);
  background: radial-gradient(ellipse 100% 100% at 100% 0, #140e0bfc 0%, #19110ef5 18%, #20150ee0 38%, #25180fbf 59%, #291b1052 79%, transparent 100%);
}
body[data-mode="browse"]:not([data-camera-moving="true"]) #app::after { opacity: calc(var(--aw-calendar-shade-strength) * var(--aw-calendar-closed-shade)); }
body[data-mode="browse"]:not([data-camera-moving="true"]) #app:has(#cal-toggle[aria-expanded="true"])::after {
  opacity: var(--aw-calendar-shade-strength);
}
#app #calendar-popover .popover-head {
  color: #f1d6b0;
  font-weight: 550;
  letter-spacing: .15em;
}
#app #calendar-popover { animation:aw-calendar-in 260ms cubic-bezier(.22,.61,.36,1); }
@keyframes aw-calendar-in { from {opacity:.3;} to {opacity:1;} }
#app #calendar-close {
  color: var(--aw-ivory);
  text-shadow: var(--aw-ui-shadow);
}
#app #calendar-grid .day-cell {
  color: #fff1d9;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
  font: 500 18px/1 PPMori, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  text-shadow: var(--aw-ui-shadow);
}
#app #calendar-grid .day-cell.visited:not(.selected):not(.locked):not(.reserved) { color: #e5d5be; }
#app #calendar-grid .day-cell:is(.locked, .reserved) {
  color: #c0ac98;
  font-weight: 400;
}
#app #calendar-grid .day-cell.selected {
  color: #fff6e1;
  font: italic 400 29px/1 Georgia, serif;
  text-shadow: 0 1px 3px #23140c, 0 0 9px #ffdd9d8c;
}
#app #calendar-grid .day-cell.selected:is(.locked, .reserved) {
  color: #e6d5bd;
  text-shadow: var(--aw-ui-shadow);
}
/* Today remains distinct from selection and from the existing visited dot. */
#app #calendar-grid .day-cell.today:not(.selected) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
#app #calendar-grid .day-cell.selected { text-decoration: none; }
#app #calendar-grid .day-cell.selected.visited::after { opacity: .35; }
@media (hover: hover) and (pointer: fine) {
  #app #calendar-grid .day-cell:hover:not(.locked):not(.reserved) {
    color: #fff9e8;
    text-shadow: var(--aw-ui-shadow), 0 0 9px #ffce8b90;
  }
}

#app #wonder-label {
  isolation: isolate;
}
#app #wonder-label::before {
  content: "";
  position: absolute;
  inset: -18px -30px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse, #25140c80 0%, #29170d4a 31%, #29170d15 60%, transparent 78%);
}
#app :is(#room-return, #look-word, #cal-toggle, #calendar-close, .day-cell, .keyboard-action, #object-actions button):focus-visible {
  outline: 2px solid var(--aw-ivory);
  outline-offset: 3px;
}

@media (max-width: 700px) {
  #app { --aw-label-size: 10px; --aw-label-tracking: .15em; }
  #app #day-panel { width: min(360px, calc(100vw - 32px)); }
  #app #day-panel h2 { font-size: clamp(27px, 7.7vw, 35px); letter-spacing: -.04em; }
  #app #cal-toggle { font-size: 10px; letter-spacing: .09em; }
  #app #cal-toggle > span:first-child { width:auto; max-width:none; white-space:nowrap; text-align:left; }
  #app #cal-toggle #mini-date { font-size: 25px; }
  #app #calendar-grid .day-cell { font-size: 19px; }
  #app #calendar-grid .day-cell.selected { font-size: 26px; }
}

#scene{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#app :is(button,a,summary){-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}
@media(pointer:coarse){#app #wonder-label{display:none!important}}
#app #day-title{text-wrap:balance}
/* A floating glint leads the scene's quiet, warm contextual help. */
#app #action-hint {
  position:fixed;
  z-index:18;
  top:0;
  left:0;
  width:max-content;
  max-width:min(230px,calc(100vw - 40px));
  margin:0;
  color:var(--aw-ivory);
  padding:0 8px;
  font:400 13px/1.4 PPMori,Arial,sans-serif;
  letter-spacing:.025em;
  text-align:center;
  text-shadow:0 1px 5px #382113,0 0 10px #ffd9a9b3,0 0 22px #ffd08b75;
  pointer-events:none;
  opacity:0;
  visibility:hidden;
  transition:opacity 420ms ease-out,visibility 420ms;
}
#app #action-hint::before {
  content:"";
  display:block;
  width:14px;
  height:19px;
  margin:0 auto 7px;
  background:currentColor;
  clip-path:polygon(50% 0,61% 38%,100% 50%,61% 62%,50% 100%,39% 62%,0 50%,39% 38%);
  filter:drop-shadow(0 0 6px #ffdb9c);
}
#app #action-hint[data-visible="true"] { opacity:1; visibility:visible; animation:aw-hint-float 3800ms ease-in-out infinite; }
#app #action-hint[data-cue="move"]::before{display:inline-block;width:9px;height:13px;margin:0 8px 0 0;vertical-align:-2px}
@keyframes aw-hint-float { 0%,100%{translate:0 0} 50%{translate:0 -5px} }
@media(max-width:700px) { #app #action-hint{font-size:12px;max-width:min(215px,calc(100vw - 40px))} }
@media(prefers-reduced-motion:reduce) { #app #action-hint { transition:none;animation:none!important;translate:none; } }
/* The larger serif date needs a little room beside the existing return target. */
@media (max-width: 400px) {
  #app .room-identity.wonder-glass { padding-inline: 0; }
  #app #cal-toggle { padding-inline:10px; }
}
@media (min-width: 360px) and (max-width: 374px) {
  #app #cal-toggle { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #app #wonder-label { text-shadow: var(--aw-ui-shadow); }
}

/* Glyph cores and optical copies are separate; the readable phrase remains a
   single screen-reader text node. Only decorative spans are transformed. */
#app .aw-readable { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); clip:rect(0,0,0,0); white-space:nowrap; }
#app .aw-visual { pointer-events:none; }
#app .aw-word { display:inline-block; white-space:nowrap; vertical-align:baseline; }
#app .aw-glyph { display:inline-block; position:relative; vertical-align:baseline; --aw-energy:0; }
#app .aw-glyph::before { content:attr(data-glyph); }
#app .aw-glyph::after { content:attr(data-glyph); position:absolute; inset:0; color:#fffdf5; pointer-events:none; opacity:clamp(0,calc(var(--aw-energy) * var(--aw-letter-glow,.7)),.68); text-shadow:0 0 5px #fff4d8,0 0 11px #ffd18a9c,0 0 24px #ffb86860; }
#app #day-title .aw-word { max-width:100%; white-space:normal; }
#app .aw-text-echo { z-index:26; pointer-events:none; white-space:normal; }
#app .aw-text-echo .aw-glyph { animation:none!important; }
#app #calendar-grid .day-cell .aw-word { margin-inline:0!important; }
#app #calendar-grid .day-cell.today:not(.selected):not(.locked):not(.reserved) .aw-glyph::after { animation:aw-today-breathe 3800ms ease-in-out infinite; }
@keyframes aw-today-breathe { 0%,100% {opacity:calc(.07 + var(--aw-energy) * var(--aw-letter-glow,.7));} 50% {opacity:calc(.19 + var(--aw-energy) * var(--aw-letter-glow,.7));} }

/* Keep the corner available while its contents dissolve during camera travel. */
body[data-mode="approach"] #app .room-navigation { opacity:1; visibility:visible; pointer-events:none; }
body[data-mode="approach"] #app .room-identity .identity-mark,
body[data-mode="approach"] #app #look-word { pointer-events:none; }
@media(prefers-reduced-motion:reduce) {
 #app .room-navigation .room-identity.wonder-glass,
 #app #room-return { transition:none!important; transform:none!important; }
 #app .room-navigation::before { transition:none; }
 #app::before,#app::after {transition:none;}
 #app #calendar-popover {animation:none;}
 #app .aw-glyph {animation:none!important;transform:none!important;opacity:1!important;}
 #app #calendar-grid .day-cell.today .aw-glyph::after {animation:none;opacity:.1;}
}
