/* Material, spacing and light shared by the main Auberge surfaces. */
body[data-local-lab=true] {
  --polish-brass: #d6b985;
  --polish-panel-shadow: inset 0 1px #f4dcb31f, 0 12px 32px #07181335, 0 2px 5px #07181328;
}

body[data-local-lab=true] :is(.lab-register,.community-panel,.account-panel-wrap,.prog-daily,.prog-item,.prog-quest) {
  box-shadow: var(--polish-panel-shadow);
}
body[data-local-lab=true] :is(.prog-nav,.prog-category-tabs,.account-social-actions,.lab-periods) .auberge-button {
  min-height: 44px;
  justify-content: center;
}
body[data-local-lab=true] :is(.lab-periods,.community-tabs,.community-feed-filters) a:active {
  box-shadow: inset 0 2px 5px #07181338;
}
body[data-local-lab=true] .lab-register :is(.lab-periods a,.lab-filter-panel summary) {
  min-height: 44px;
}
body[data-local-lab=true] .invitation-notice > .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body[data-local-lab=true] .lab-home-heading .lab-day-progress {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  min-width: 0;
  padding: 6px 14px;
  border-radius: 12px;
  background: linear-gradient(115deg,#d9b67a13,#162b222e);
  box-shadow: inset 0 1px #f3d8ae12;
}
body[data-local-lab=true] .lab-day-progress[hidden] { display: none; }
body[data-local-lab=true] .lab-day-progress a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-inline-start: auto;
  white-space: nowrap;
}
body[data-local-lab=true] #home-view[data-home-v2] .world-grid {
  margin-top: 14px;
}
body[data-local-lab=true] #home-view[data-home-v2] [data-home-v2] .world-footer {
  margin: 0 0 11px;
  padding-top: 0;
  border-top: 0;
}
body[data-local-lab=true] #home-view[data-home-v2] [data-home-v2] .world-footer > :is(span,strong) {
  display: none;
}
body[data-local-lab=true] #home-view[data-home-v2] [data-home-v2] .world-footer .lab-world-enter {
  padding-block: 8px;
  line-height: 1.4;
  background: color-mix(in srgb,var(--home-accent) 15%,transparent);
  box-shadow: inset 0 1px #f8ecbf22, 0 3px 9px #07181330;
}
#home-view[data-home-v2] .home-world-light {
  background:
    radial-gradient(ellipse at var(--scene-x, 52%) var(--scene-y, 35%), var(--scene-light), transparent 48%),
    linear-gradient(123deg, transparent 24%, var(--scene-tint) 50%, transparent 68%);
  background-size: 100% 100%, 210% 210%;
  background-position: center, var(--scene-x, 58%) var(--scene-y, 38%);
}
body[data-local-lab=true] #home-view[data-home-v2] .world-card[data-home-v2] .world-scene {
  box-shadow: 0 12px 24px #030d0c61, 0 1px 2px #0006;
}
body[data-local-lab=true] #home-view[data-home-v2] .home-world-seal {
  box-shadow: inset 0 0 0 3px #d9ba7820, 0 3px 12px #0008;
}
body[data-local-lab=true] .world-game-frame[data-world-frame] {
  box-shadow: inset 0 1px #fff5d82b, 0 5px 13px #142c302a;
}
@media (min-width: 601px) and (max-width: 1100px) {
  body[data-local-lab=true] #home-view[data-home-v2] [data-home-v2=guild] .home-world-art { object-position: 76% center; }
  body[data-local-lab=true] #home-view[data-home-v2] [data-home-v2=scriptorium] .home-world-art { object-position: 64% center; }
}

/* Tavern: warm light above the rooms, and enough space to see the next door. */
body[data-local-lab=true].tavern-interface:not(.lab-immersive) .lab-tavern-topbar {
  background:
    repeating-linear-gradient(2deg,#4d28130f 0 1px,transparent 1px 10px),
    linear-gradient(#a46741,#8b542f 48%,#714022);
  box-shadow: inset 0 1px #f8cf9b38, 0 5px 12px #4d2b223e;
}
body[data-local-lab=true].tavern-interface:not(.lab-immersive):not(.is-game-open) .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at var(--scene-x, 50%) 64%, #ffcb802c, transparent 57%),
    radial-gradient(ellipse at 14% 76%, #fdac4750, transparent 27%),
    radial-gradient(ellipse at 86% 76%, #fdac4750, transparent 27%);
  border-radius: inherit;
  pointer-events: none;
}
body[data-local-lab=true].tavern-interface #epreuves .trial-card__door {
  min-height: clamp(238px, 24vw, 296px);
  transform: none;
}
body[data-local-lab=true].tavern-interface #epreuves .trial-card__door .character {
  top: clamp(28px,3.6vw,51px);
  width: min(65%,176px);
}
body[data-local-lab=true].tavern-interface #epreuves .trial-card__caption {
  padding: clamp(11px, 1.3vw, 17px);
  background: linear-gradient(147deg,#fff3d6,#ead8ad);
  box-shadow: inset 0 1px #fffaec, 0 6px 16px #673a1f23;
}
body[data-local-lab=true].tavern-interface #epreuves .trial-card__caption > p {
  min-height: 0;
  margin: 0 0 7px;
  font-size: 14px;
}
body[data-local-lab=true].tavern-interface #epreuves .daily-score-summary {
  flex: none;
  min-height: 0;
  gap: 3px;
  margin-block: 6px 0;
  padding-top: 6px;
  font-size: 12px;
}
body[data-local-lab=true].tavern-interface #epreuves .tavern-entry {
  min-height: 44px;
  margin-top: auto;
  border-radius: 10px;
  box-shadow: inset 0 1px #fff3, 0 3px 7px #59381e26;
}
body[data-local-lab=true].tavern-interface #epreuves .trial-card__door:hover .door__light,
body[data-local-lab=true].tavern-interface #epreuves .trial-card__door:focus-visible .door__light {
  background: radial-gradient(ellipse at var(--scene-x, 50%) var(--scene-y, 46%), #ffcd808f, transparent 57%);
  opacity: .7 !important;
}

/* Gallery: a window frame, legible paper and one baseline for the actions. */
body[data-local-lab=true].gallery-interface .site-header {
  background: radial-gradient(ellipse at var(--scene-x, 72%) 12%,#fff0b580,transparent 53%),#f8faf0;
  box-shadow: inset 0 1px #fffff4, 0 6px 20px #26575729;
}
body[data-local-lab=true].gallery-interface #home-view .game-card.world-window {
  border-radius: 16px;
  background: linear-gradient(145deg,#fcf9ed,#eff1e4 80%);
  box-shadow: 0 4px 0 #c8d3c4, 0 13px 26px #24565222, inset 0 1px #fffdf8;
}
body[data-local-lab=true].gallery-interface #home-view .world-window .card-visual {
  aspect-ratio: 2.15;
  min-height: 0;
  height: auto;
  overflow: hidden;
}
body[data-local-lab=true].gallery-interface #home-view .world-window .card-content {
  gap: 7px;
  padding: clamp(11px,1.25vw,18px);
}
body[data-local-lab=true].gallery-interface #home-view .world-window .card-title {
  min-height: 0;
  margin: 2px 0 0;
  font-size: clamp(22px,2vw,29px);
  line-height: 1.15;
}
body[data-local-lab=true].gallery-interface #home-view .world-window .card-description {
  min-height: 0;
  margin: 1px 0 4px;
  font-size: 14px;
  line-height: 1.48;
}
body[data-local-lab=true].gallery-interface #home-view .world-window .daily-score-summary {
  min-height: 0;
  margin-bottom: 0;
  gap: 3px;
  padding-top: 7px;
  font-size: 12px;
}
body[data-local-lab=true].gallery-interface #home-view .world-window .card-action {
  margin-top: auto;
  min-height: 44px;
  background: linear-gradient(135deg,#3a736d,#285855);
  box-shadow: inset 0 1px #f1f5de2a, 0 3px 7px #23494232;
}
body[data-local-lab=true].gallery-interface #home-view .world-window .card-visual::after {
  background: radial-gradient(ellipse at var(--scene-x, 48%) var(--scene-y, 35%), #fff4bdab, transparent 53%);
  opacity: .2;
  pointer-events: none;
}
body[data-local-lab=true].gallery-interface #home-view .world-window:focus-within .card-visual::after,
body[data-local-lab=true].gallery-interface #home-view .world-window:hover .card-visual::after { opacity: .75; }

/* Scriptorium: moonlit ink, brass and quiet book spines. */
body[data-local-lab=true].lab-world-scriptorium .lab-scriptorium-hub .lab-world-hero {
  position: relative;
  isolation: isolate;
  padding: 13px clamp(13px,2vw,26px);
  border: 1px solid #839fbc52;
  border-radius: 15px;
  background:
    radial-gradient(ellipse at var(--scene-x, 82%) var(--scene-y, 24%),#6c9bbc41,transparent 58%),
    linear-gradient(126deg,#263c50,#142638);
  box-shadow: inset 0 1px #c1d8e022, 0 8px 21px #050f1d40;
}
.lab-scriptorium-hub .lab-world-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  opacity: .68;
  pointer-events: none;
  background:
    radial-gradient(circle at 90% 40%, #a8c5da 0 1.5px, transparent 2.4px),
    radial-gradient(circle at 85% 73%, #b3d1e4 0 1px, transparent 2px),
    radial-gradient(circle at 95% 65%, #b3d1e4 0 1px, transparent 2px),
    radial-gradient(circle at 91.5% 50%, #28425c 0 12px, transparent 13px),
    radial-gradient(circle at 91% 55%, #c8deee 0 13px, #8bb5da28 14px, transparent 40px);
}
body[data-local-lab=true].lab-world-scriptorium .lab-manuscript-card {
  border-color: #9db8cd50;
  background: linear-gradient(154deg,#294254,#192d41);
  box-shadow: inset 3px 0 #54728655, inset 0 1px #ddc59823, 0 10px 26px #07131f5c;
}
body[data-local-lab=true] .lab-manuscript-illustration {
  position: relative;
  height: clamp(125px,14vw,188px);
  padding: 8px 12px;
}
.lab-manuscript-illustration::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .17;
  background: radial-gradient(ellipse at var(--scene-x, 55%) var(--scene-y, 40%),#add8ff8c,transparent 62%);
}
.lab-manuscript-card:is(:hover,:focus-within) .lab-manuscript-illustration::after { opacity: .74; }
body[data-local-lab=true].lab-world-scriptorium .lab-manuscript-copy {
  padding: 15px clamp(13px,1.5vw,22px) 10px;
}
body[data-local-lab=true].lab-world-scriptorium .lab-manuscript-copy h2 { margin: 7px 0 6px; }
body[data-local-lab=true].lab-world-scriptorium .lab-manuscript-copy p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.48;
}
body[data-local-lab=true].lab-world-scriptorium .lab-manuscript-progress {
  min-height: 0;
  margin: 2px 0 10px;
  gap: 2px;
}
body[data-local-lab=true] .lab-manuscript-copy .lab-card-action {
  align-items: center;
  min-height: 44px;
  margin: auto 0 0;
  padding: 7px 12px;
  border: 1px solid #aabece56;
  border-radius: 10px;
  background: linear-gradient(135deg,#3b586c,#263e51);
  color: #f4e0af;
}
.lab-manuscript-copy .lab-card-action::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-inline-end: 3px;
  border: solid currentColor;
  border-width: 1px 1px 0 0;
  rotate: 45deg;
}

/* A feedback line still grows when a vote produces a message. */
body[data-local-lab=true] :is(.world-window,.trial-card,.lab-manuscript-card) .game-rating {
  margin-block: 5px;
  padding-top: 3px;
}
body[data-local-lab=true] .game-rating .game-rating__status:empty { min-height: 0; }
body[data-local-lab=true] .game-rating .game-rating__summary { min-height: 16px; }
body[data-local-lab=true] .lab-manuscript-card > .game-rating { margin: 2px 14px 10px; }
body[data-local-lab=true].tavern-interface #epreuves .trial-card__caption > .game-rating { margin-top: auto; }
body[data-local-lab=true].tavern-interface #epreuves .trial-card__caption:has(> .game-rating) > .tavern-entry {
  margin-top: 7px;
}
body[data-local-lab=true].gallery-interface #home-view .world-window:is(:hover,:active),
body[data-local-lab=true].lab-world-scriptorium .lab-manuscript-card:hover,
body[data-local-lab=true] #home-view[data-home-v2] .world-card[data-home-v2]:hover {
  transform: none;
}

@media (max-width: 520px) {
  body[data-local-lab=true].lab-world-scriptorium .lab-world-header {
    min-height: 54px;
    margin-top: 12px;
    padding: 4px 8px;
    gap: 6px;
  }
  body[data-local-lab=true].lab-world-scriptorium .lab-world-header .lab-world-brand { display: none; }
  body[data-local-lab=true] .lab-home-heading .lab-day-progress { padding: 3px 9px; gap: 2px 9px; }
  body[data-local-lab=true] .lab-day-progress strong { font-size: 14px; }
  body[data-local-lab=true] .lab-day-progress a { font-size: 12px; }
  body[data-local-lab=true] .lab-scriptorium-hub .lab-world-hero::after { opacity: .25; }
  body[data-local-lab=true].tavern-interface #epreuves .trial-card__door { min-height: 238px; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #home-view[data-home-v2] .home-world-seal {
    transition: translate .28s ease;
    translate: calc(var(--scene-shift-x, 0px) * -.65) calc(var(--scene-shift-y, 0px) * -.65);
  }
  body[data-local-lab=true].tavern-interface:not(.is-game-open) .hero .lantern {
    rotate: var(--scene-turn, 0deg);
    transition: rotate .4s ease-out;
  }
  body[data-local-lab=true].tavern-interface #epreuves .trial-card__door .character {
    translate: var(--scene-shift-x, 0px) var(--scene-shift-y, 0px);
    transition: translate .22s ease-out, transform .26s ease-out;
  }
  body[data-local-lab=true] :is(.lab-manuscript-illustration,.gallery-card-art) > img {
    translate: var(--scene-shift-x, 0px) var(--scene-shift-y, 0px);
    transition: translate .25s ease-out;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .lab-scriptorium-hub .lab-world-hero::after { animation: atelier-moon 6s ease-in-out infinite alternate; }
  @keyframes atelier-moon { from { opacity: .42; } to { opacity: .88; } }
}
@media (prefers-reduced-motion: reduce) {
  body[data-local-lab=true] :is(.lantern,.lantern__flame,.lab-scriptorium-atmosphere .lab-letter) {
    animation: none !important;
  }
  body[data-local-lab=true] :is(.world-window,.lab-manuscript-card,.world-card[data-home-v2]) {
    transition: none !important;
    transform: none !important;
  }
}
