:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  background: #141218;
  color: #fffaf3;
  --muted: #dfd8e4;
  --story-serif: 'Cormorant Garamond', 'Palatino Linotype', Georgia, serif;
  --surface: #23202a;
  --line: #756d82;
  --focus: #edddff;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; isolation: isolate; }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.toolbar {
  width: min(calc(100% - 32px), 1280px);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 12px;
  align-items: center;
  margin: auto;
  padding: 9px 0;
}
.nav-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #f7efff;
  text-underline-offset: 4px;
  padding-inline: 5px;
}
.nav-link:hover { color: white; }
.room-view {
  width: min(calc(100% - 32px), 1280px);
  margin: auto;
  padding-bottom: 18px;
}
:where(.room-view,.index-view):focus { outline: none; }

.scene {
  position: relative;
  isolation: isolate;
  background: #17141a;
}
.room-art { display: block; width: 100%; height: auto; }
.hotspot {
  position: absolute;
  left: 50.5%;
  top: 63%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: max(44px, 6.5%);
  height: max(44px, 14%);
  border-radius: 8px;
  text-decoration: none;
  z-index: 1;
}
.hotspot-marker {
  width: clamp(26px, 4.8vw, 58px);
  aspect-ratio: 1.4;
  border: 2px solid #fff4ff;
  border-radius: 7px;
  background: #edddff17;
  box-shadow: 0 0 0 3px #24202a, 0 0 18px 5px #e5cfffaa;
}
.hotspot:hover .hotspot-marker,
.hotspot:focus-visible .hotspot-marker {
  background: #edddff45;
  box-shadow: 0 0 0 3px #24202a, 0 0 25px 7px #e5cfffbb;
}
.hotspot-card {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  width: min(285px, calc(100vw - 56px));
  display: grid;
  gap: 5px;
  background: #211d29;
  border: 1px solid #cbb8d9;
  color: #fffaf3;
  border-radius: 6px;
  padding: 11px 13px;
  line-height: 1.4;
  font-size: .93rem;
  box-shadow: 0 4px 18px #0d0b12b3;
  opacity: 0;
  pointer-events: none;
}
.hotspot-card::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 6px;
}
.hotspot-card strong { font-size: 1.05rem; }
.hotspot-card > span { color: var(--muted); }
.hotspot:is(:hover,:focus-visible):not([data-dismissed]) .hotspot-card {
  opacity: 1;
  pointer-events: auto;
}
.room-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 12px;
  margin-top: 4px;
}
.room-help { margin: 8px 0; font-size: .92rem; color: var(--muted); }
.motion-control {
  margin-inline-start: auto;
  padding: 0 5px;
  min-height: 44px;
  font: inherit;
  font-size: .9rem;
  background: transparent;
  border: 0;
  color: #f7efff;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.motion-control:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.index-view {
  display: none;
  max-width: 660px;
  padding: 24px 18px 52px;
  margin: 0 auto;
}
.room-link { display: none; }
body:has(#game-index:target) :is(.room-view,.index-link) { display: none; }
body:has(#game-index:target) :is(.index-view,.room-link) { display: block; }
body:has(#game-index:target) .room-link { display: inline-flex; }
.index-view h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); margin: 6px 0 22px; }
.game-list { display: grid; gap: 14px; }
.game-list article { background: var(--surface); border: 1px solid var(--line); padding: 20px; border-radius: 8px; }
.game-list h2 { margin: 0; font-size: 1.25rem; }
.game-list p { max-width: 52ch; color: var(--muted); line-height: 1.6; margin: 8px 0 0; }
.game-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 14px;
  background: #ecdef3;
  color: #21192a;
  border-radius: 4px;
  font-weight: 700;
  text-underline-offset: 4px;
}

@media (min-width: 760px) and (min-height: 550px) {
  .room-view { width: min(calc(100% - 32px), 1280px, calc((100dvh - 112px) * 1.792)); }
}
@media (max-width: 520px) {
  .toolbar, .room-view { width: calc(100% - 24px); }
  .toolbar { padding: 5px 0; }
  .nav-link { font-size: .9rem; }
  .hotspot-card { font-size: .84rem; }
}
@media (hover: none) {
  .room-help { display: none; }
}
@media (forced-colors: active) {
  .hotspot-marker { border: 3px solid LinkText; background: Canvas; }
  .hotspot-card, .game-list article { border: 2px solid CanvasText; background: Canvas; color: CanvasText; }
}

.room-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 12% 10%, #f2e8f3 0%, transparent 57%),
    radial-gradient(ellipse at 86% 84%, #edf0e8 0%, transparent 54%),
    #fffcf7;
}
.room-backdrop > span {
  position: absolute;
}
.botanical {
  opacity: .5;
  background: var(--art) center / contain no-repeat;
}
.botanical-magnolia {
  --art: url("/arcade-assets/magnolia.png");
  --turn: -15deg;
  --drift: 2.2vw;
  top: -42px;
  right: -28px;
  width: clamp(170px, 27vw, 380px);
  aspect-ratio: 1;
}
.botanical-sage {
  --art: url("/arcade-assets/leaf-sage.png");
  --turn: -26deg;
  --drift: 2.6vw;
  bottom: -65px;
  left: -32px;
  width: clamp(190px, 30vw, 450px);
  aspect-ratio: 1.1;
}
.botanical-lilac {
  --art: url("/arcade-assets/flower-lilac.png");
  --turn: 15deg;
  --drift: -1.8vw;
  bottom: -22px;
  right: 11%;
  width: clamp(110px, 17vw, 210px);
  aspect-ratio: 1;
  opacity: .31;
}
.goddess-motif {
  display: grid;
  place-items: center;
  width: clamp(56px, 8vw, 108px);
  aspect-ratio: 1;
  color: #806991;
  border: 1px solid #95819a;
  border-radius: 50%;
  font: 400 clamp(2.4rem, 6vw, 5rem)/1 'Palatino Linotype', Georgia, serif;
  opacity: .34;
}
.motif-moon {
  --turn: -10deg;
  --drift: 2vw;
  bottom: 12%;
  left: 26%;
}
.motif-arrow {
  --turn: 6deg;
  --drift: -2vw;
  right: 6%;
  bottom: 9%;
}
.room-backdrop > span { transform: rotate(var(--turn, 0deg)); }
.room-moving .room-backdrop > span {
  animation: botanical-drift 24s ease-in-out infinite alternate;
}
.room-moving .botanical-magnolia { animation-duration: 29s; }
.room-moving .botanical-lilac { animation-duration: 32s; }
.room-moving .goddess-motif { animation-duration: 36s; }
@keyframes botanical-drift {
  to { transform: translate(var(--drift, 0), -1.7vh) rotate(calc(var(--turn, 0deg) + 5deg)); }
}
body:has(#game-index:target) .room-backdrop { display: none; }


.toolbar { padding: 10px 0; }
.nav-link {
  border-radius: 5px;
  padding-inline: 12px;
  background: #fffdf8e8;
  color: #3c294a;
  border: 1px solid #bcaec4;
}
.nav-link:hover { color: #21152c; background: #ffffff; }
body:has(#game-index:target) .nav-link:focus-visible { outline-color: #edddff; }
.nav-link:focus-visible { outline-color: #513260; }
.scene {
  border-radius: 5px;
  box-shadow: 0 15px 38px #241a2180;
}
.room-art { border-radius: inherit; }

.hotspot-marker {
  width: clamp(30px, 5.2vw, 56px);
  aspect-ratio: 1;
  border: 1.5px solid #fff2ff;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 31%, #fffaff 0%, #e9dafc 24%, #bda1ee 52%, #6e4c9d 76%, #38264d 100%);
  box-shadow: inset 0 -5px 10px #42325b7a, 0 0 16px 5px #d7b7f8b8, 0 0 33px 6px #d9baff75;
}
.room-moving .hotspot-marker { animation: orb-breathe 7s ease-in-out infinite alternate; }
@keyframes orb-breathe {
  to { filter: brightness(1.15); }
}
.hotspot:hover .hotspot-marker,
.hotspot:focus-visible .hotspot-marker {
  background: radial-gradient(circle at 38% 31%, #fffaff, #f3dfff 25%, #ceafff 54%, #7550a3 78%);
  box-shadow: 0 0 21px 8px #e1c2ffcc, 0 0 40px 9px #cfacf98c;
}
.orb-invitation {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 9px 5px;
  white-space: nowrap;
  border: 1px solid #e8d5fa;
  border-radius: 50px;
  background: #2c2037;
  color: #fff6ff;
  font: 700 1rem/1.05 var(--story-serif);
  opacity: 0;
  pointer-events: none;
}
.orb-invitation::before {
  content: "";
  position: absolute;
  bottom: 100%;
  inset-inline: 0;
  height: 6px;
}
.hotspot:is(:hover,:focus-visible):not([data-dismissed]) .orb-invitation {
  opacity: 1;
  pointer-events: auto;
}
.hotspot-card {
  border-color: #caadbd;
  background: #fff5e9;
  color: #302230;
  font: 400 1.07rem/1.35 var(--story-serif);
}
.hotspot-card strong {
  font-size: 1.35rem;
  font-weight: 700;
}
.hotspot-card > span { color: #493649; }
.room-controls {
  background: #fffdf8eb;
  color: #312636;
  border: 1px solid #c5b6c7;
  border-radius: 5px;
  padding: 0 12px;
}
.room-help {
  font: italic 400 1.06rem/1.4 var(--story-serif);
  color: #312636;
}
.motion-control { color: #382943; }
.motion-control:focus-visible { outline-color: #493259; }
@media (max-width: 520px) {
  .hotspot-card { font-size: .99rem; }
  .hotspot-card strong { font-size: 1.2rem; }
}
@media (forced-colors: active) {
  .hotspot-marker { border: 3px solid LinkText; background: Canvas; }
  .hotspot-card, .orb-invitation, .room-controls { border: 2px solid CanvasText; background: Canvas; color: CanvasText; }
  .hotspot-card > span, .room-help, .motion-control { color: CanvasText; }
}
