:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #efe6dc;
  color: #2f2924;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
}

button {
  font: inherit;
}

.experience-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* mobile: excludes browser toolbars so bottom buttons stay visible */
  min-height: 560px;
  overflow: hidden;
  background: #201c19;
}

#safe-space-canvas {
  display: block;
  width: 100%;
  height: 100%;
  /* Stops the browser from fighting the drag on touch screens */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.entry-screen {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(rgba(239, 230, 220, 0.52), rgba(239, 230, 220, 0.24)),
    radial-gradient(circle at 50% 42%, rgba(255, 246, 232, 0.86), rgba(214, 192, 171, 0.38) 46%, rgba(92, 75, 63, 0.56) 100%);
  transition:
    opacity 520ms ease,
    visibility 520ms ease;
}

.entry-screen.is-hidden {
  visibility: hidden;
}

.entry-copy {
  width: min(620px, calc(100vw - 40px));
  text-align: center;
  color: #342c26;
}

.entry-copy h1 {
  font-size: clamp(2.4rem, 7vw, 5.8rem);
}

.entry-copy p:not(.kicker) {
  max-width: 540px;
  margin: 18px auto 0;
  color: #5d5148;
  font-size: clamp(1rem, 2.2vw, 1.28rem);
  line-height: 1.48;
}

.enter-button {
  min-width: 136px;
  min-height: 48px;
  margin-top: 26px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  color: #24342d;
  background: rgba(224, 240, 224, 0.86);
  box-shadow: 0 18px 42px rgba(47, 41, 36, 0.16);
  cursor: pointer;
  font-weight: 820;
  backdrop-filter: blur(16px);
}

.enter-button:hover,
.enter-button:focus-visible {
  background: rgba(236, 247, 233, 0.96);
  outline: none;
}

.panel {
  position: absolute;
  top: clamp(18px, 3vw, 34px);
  left: clamp(18px, 4vw, 52px);
  z-index: 3;
  width: min(390px, calc(100vw - 36px));
  padding: 18px 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.72);
  box-shadow: 0 20px 60px rgba(47, 41, 36, 0.16);
  backdrop-filter: blur(18px);
  transition: opacity 260ms ease;
}

.kicker {
  margin: 0 0 8px;
  color: #786c61;
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #342c26;
  font-size: clamp(1.65rem, 5vw, 3.1rem);
  line-height: 0.98;
  letter-spacing: 0;
}

#wall-copy {
  margin: 12px 0 0;
  color: #5d5148;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.48;
}

.panel-action,
.submit-note {
  min-height: 42px;
  margin-top: 16px;
  padding: 0 16px;
  border: 1px solid rgba(79, 96, 84, 0.24);
  border-radius: 8px;
  color: #24342d;
  background: rgba(219, 237, 218, 0.82);
  box-shadow: 0 10px 26px rgba(55, 42, 34, 0.1);
  cursor: pointer;
  font-weight: 780;
}

.panel-action:hover,
.panel-action:focus-visible,
.submit-note:hover,
.submit-note:focus-visible {
  background: rgba(229, 244, 226, 0.96);
  outline: none;
}

.wall-arrows {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(12px, 2.4vw, 34px);
  pointer-events: none;
  transition: opacity 260ms ease;
}

.arrow-button {
  display: grid;
  width: clamp(46px, 5vw, 62px);
  height: clamp(46px, 5vw, 62px);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  color: #3b312b;
  background: rgba(255, 250, 244, 0.68);
  box-shadow: 0 14px 36px rgba(55, 42, 34, 0.16);
  cursor: pointer;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  pointer-events: auto;
  backdrop-filter: blur(16px);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.arrow-button:hover,
.arrow-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 250, 0.86);
  outline: none;
}

/* (Dim Lights now lives inside the ambience panel — see .ambience-toggle) */

.side-tray {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: min(440px, calc(100vw - 36px));
  max-height: min(680px, calc(100vh - 72px));
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.9);
  box-shadow: 0 24px 70px rgba(47, 41, 36, 0.2);
  backdrop-filter: blur(18px);
  transform: translate(-50%, calc(-50% + 10px));
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.side-tray.is-open {
  transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: auto;
}

.video-player {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 44px);
  background: rgba(45, 37, 31, 0.5);
  backdrop-filter: blur(14px);
  transition: opacity 220ms ease;
}

.player-shell {
  position: relative;
  width: min(980px, 94vw);
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: #17130f;
  box-shadow: 0 30px 90px rgba(28, 22, 17, 0.36);
  overflow: hidden;
}

.player-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.player-fallback {
  position: absolute;
  right: 58px;
  top: 12px;
  z-index: 2;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  color: #24342d;
  background: rgba(255, 250, 244, 0.82);
  box-shadow: 0 10px 26px rgba(28, 22, 17, 0.16);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.tray-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.tray-header h2 {
  margin: 0;
  color: #342c26;
  font-size: 1.18rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.message-stat {
  margin: 7px 0 0;
  color: #53635a;
  font-size: 0.84rem;
  font-weight: 760;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(93, 81, 72, 0.16);
  border-radius: 999px;
  color: #4d423a;
  background: rgba(255, 255, 250, 0.7);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.prompt-card {
  margin-top: 14px;
}

.prompt-card p {
  margin: 0 0 10px;
  color: #5d5148;
  font-size: 0.94rem;
  font-weight: 720;
}

textarea {
  width: 100%;
  min-height: 94px;
  resize: vertical;
  padding: 12px;
  border: 1px solid rgba(93, 81, 72, 0.18);
  border-radius: 8px;
  color: #342c26;
  background: rgba(255, 255, 250, 0.78);
  font: inherit;
  line-height: 1.42;
}

textarea:focus {
  outline: 2px solid rgba(156, 183, 176, 0.44);
  outline-offset: 2px;
}

.community-feed {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.feed-note {
  padding: 11px 12px;
  border: 1px solid rgba(93, 81, 72, 0.12);
  border-radius: 8px;
  color: #4f453d;
  background: rgba(255, 255, 250, 0.58);
}

.feed-note strong {
  display: block;
  margin-bottom: 4px;
  color: #6b7766;
  font-size: 0.76rem;
}

.video-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.video-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(93, 81, 72, 0.14);
  border-radius: 8px;
  color: #342c26;
  background: rgba(255, 255, 250, 0.62);
  cursor: pointer;
  text-align: left;
}

.profile-button {
  grid-template-columns: 56px minmax(0, 1fr);
}

.profile-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(219, 237, 218, 0.9);
}

.video-button:hover,
.video-button:focus-visible {
  background: rgba(232, 243, 238, 0.88);
  outline: none;
}

.play-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  color: #24342d;
  background: rgba(219, 237, 218, 0.9);
  font-size: 0.9rem;
  font-weight: 900;
}

.video-button strong,
.video-button span {
  display: block;
}

.video-button strong {
  font-size: 0.9rem;
}

.video-button span {
  margin-top: 3px;
  color: #6a5d52;
  font-size: 0.78rem;
  line-height: 1.35;
}

.feed-note p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.xr-enter {
  z-index: 4 !important;
  position: absolute !important;
  right: clamp(18px, 3vw, 34px) !important;
  top: clamp(64px, 9vw, 88px) !important;
  bottom: auto !important;
  min-width: 132px !important;
  height: 42px !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  border-radius: 999px !important;
  color: #2f2924 !important;
  background: rgba(255, 250, 244, 0.78) !important;
  box-shadow: 0 18px 42px rgba(47, 41, 36, 0.18) !important;
  font: 760 0.82rem/1 Inter, ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  backdrop-filter: blur(16px);
}

.loading-note,
.error-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #473e37;
  background: #efe6dc;
  text-align: center;
  font-weight: 720;
}

@media (max-width: 760px) {
  .experience-shell {
    min-height: 620px;
  }

  .panel {
    padding: 15px 16px 17px;
  }

  .xr-enter {
    top: auto !important;
    right: 14px !important;
    bottom: 84px !important;
  }
}

/* ------------------------------------------------------------------ */
/* Update pack: coziness, board view, logo, toast, loading, mobile    */
/* ------------------------------------------------------------------ */

/* Soft vignette over the 3D view for a cozier, enclosed feel */
.vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 46%,
    rgba(0, 0, 0, 0) 52%,
    rgba(43, 32, 24, 0.14) 78%,
    rgba(31, 23, 17, 0.32) 100%
  );
}

/* Brand logo overlay (fed by CMS settings) */
.brand-logo {
  position: absolute;
  top: clamp(14px, 2.6vw, 26px);
  left: 50%;
  z-index: 5;
  max-width: min(200px, 40vw);
  max-height: 54px;
  transform: translateX(-50%);
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(47, 41, 36, 0.22));
  transition: opacity 400ms ease;
  pointer-events: none;
}

.brand-logo.is-hidden {
  opacity: 0;
}

/* Loading veil while textures + content load */
.loading-veil {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: #e8dccd;
  color: #5d5148;
  font-weight: 740;
  transition: opacity 480ms ease, visibility 480ms ease;
}

.loading-veil.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-veil p {
  margin: 0;
}

.loading-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #b96f52;
  animation: veil-pulse 1.2s ease-in-out infinite;
}

@keyframes veil-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.5; }
  50% { transform: scale(1); opacity: 1; }
}

/* Tray refinements */
.char-count {
  margin: 6px 2px 0;
  color: #8a7c6f;
  font-size: 0.76rem;
  font-weight: 700;
}

.tray-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ghost-button {
  min-height: 42px;
  margin-top: 16px;
  padding: 0 16px;
  border: 1px solid rgba(93, 81, 72, 0.24);
  border-radius: 8px;
  color: #4d423a;
  background: rgba(255, 255, 250, 0.55);
  cursor: pointer;
  font-weight: 760;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  background: rgba(255, 255, 250, 0.9);
  outline: none;
}

/* Message board close-up view */
.board-view {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(45, 37, 31, 0.52);
  backdrop-filter: blur(14px);
  transition: opacity 220ms ease;
}

.board-view.is-hidden {
  visibility: hidden;
}

.board-shell {
  display: flex;
  flex-direction: column;
  width: min(1080px, 96vw);
  max-height: min(760px, calc(100vh - 40px));
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(rgba(214, 190, 160, 0.32), rgba(214, 190, 160, 0.32)),
    #cbb08c;
  box-shadow:
    inset 0 0 0 10px rgba(122, 92, 62, 0.4),
    inset 0 0 60px rgba(84, 61, 40, 0.28),
    0 30px 90px rgba(28, 22, 17, 0.4);
  overflow: hidden;
}

.board-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  background: rgba(255, 250, 244, 0.86);
  border-bottom: 1px solid rgba(122, 92, 62, 0.24);
  backdrop-filter: blur(10px);
}

.board-header h2 {
  margin: 0;
  color: #342c26;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  line-height: 1.08;
}

.board-stat {
  margin: 7px 0 0;
  color: #6b5c4e;
  font-size: 0.85rem;
  font-weight: 740;
}

.board-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.board-header-actions .ghost-button {
  margin-top: 0;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: clamp(12px, 2vw, 20px);
  padding: clamp(16px, 3vw, 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.board-note {
  position: relative;
  min-height: 118px;
  padding: 26px 16px 16px;
  border-radius: 4px;
  color: #38302a;
  box-shadow:
    0 12px 26px rgba(50, 37, 26, 0.28),
    0 2px 5px rgba(50, 37, 26, 0.18);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 180ms ease;
}

.board-note:hover {
  transform: rotate(0deg) scale(1.03);
  z-index: 1;
}

.board-note p {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 640;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.board-pin {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #f0d9c4, #a3573b 62%, #6f3421);
  box-shadow: 0 3px 6px rgba(50, 37, 26, 0.4);
  transform: translateX(-50%);
}

.tint-cream { background: #fef8ec; }
.tint-peach { background: #fbe8da; }
.tint-sage  { background: #e8f0e2; }
.tint-lilac { background: #efe7f3; }

/* Toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: clamp(76px, 12vw, 96px);
  z-index: 9;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  color: #f4ede4;
  background: rgba(47, 39, 32, 0.92);
  box-shadow: 0 18px 42px rgba(28, 22, 17, 0.32);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Mobile polish */
@media (max-width: 760px) {
  .side-tray {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 40px);
    padding: 14px;
  }

  .board-shell {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 24px);
  }

  .board-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .board-header {
    flex-wrap: wrap;
  }

  .panel {
    top: auto;
    bottom: 76px;
    left: 12px;
    width: calc(100vw - 24px);
    padding: 12px 14px 14px;
  }

  .panel h1 {
    font-size: 1.35rem;
  }

  #wall-copy {
    font-size: 0.86rem;
    margin-top: 8px;
  }

  .panel-action {
    min-height: 40px;
    margin-top: 10px;
  }

  .arrow-button {
    background: rgba(255, 250, 244, 0.82);
  }

  .brand-logo {
    max-height: 40px;
  }

}

@media (max-height: 480px) and (orientation: landscape) {
  .panel {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* Ambience menu (lights + music)                                     */
/* ------------------------------------------------------------------ */

.menu-button {
  position: absolute;
  left: 50%;
  bottom: calc(clamp(16px, 4vw, 30px) + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  color: #3b312b;
  background: rgba(255, 250, 244, 0.82);
  box-shadow: 0 14px 36px rgba(55, 42, 34, 0.22);
  cursor: pointer;
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
  transition: opacity 260ms ease, background 160ms ease, color 160ms ease;
}

.menu-button:hover,
.menu-button:focus-visible {
  background: rgba(255, 255, 250, 0.95);
  outline: none;
}

.menu-button.is-active {
  color: #f4ede4;
  background: rgba(47, 39, 32, 0.9);
}

.ambience-panel {
  position: absolute;
  left: 50%;
  bottom: calc(clamp(80px, 12vw, 96px) + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  width: min(300px, calc(100vw - 32px));
  padding: 14px 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  background: rgba(255, 250, 244, 0.94);
  box-shadow: 0 24px 70px rgba(47, 41, 36, 0.28);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
  transition: opacity 200ms ease, transform 200ms ease;
}

.ambience-panel.is-hidden {
  transform: translate(-50%, 8px);
}

.ambience-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ambience-header h3 {
  margin: 0;
  color: #342c26;
  font-size: 1.05rem;
  line-height: 1.1;
}

.ambience-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid rgba(93, 81, 72, 0.2);
  border-radius: 10px;
  color: #3b312b;
  background: rgba(255, 255, 250, 0.7);
  cursor: pointer;
  font-weight: 780;
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.ambience-toggle:hover:not(:disabled),
.ambience-toggle:focus-visible {
  background: rgba(255, 255, 250, 0.98);
  outline: none;
}

.ambience-toggle.is-active {
  color: #f4ede4;
  background: rgba(47, 39, 32, 0.9);
  border-color: rgba(47, 39, 32, 0.9);
}

.ambience-toggle:disabled {
  opacity: 0.55;
  cursor: default;
}

.ambience-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(217, 155, 129, 0.22);
  font-size: 0.95rem;
}

.ambience-toggle.is-active .ambience-icon {
  background: rgba(255, 244, 232, 0.2);
}

.track-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(93, 81, 72, 0.14);
}

.track-empty {
  margin: 0;
  color: #8a7c6f;
  font-size: 0.82rem;
  font-weight: 700;
}

.track-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #4d423a;
  background: transparent;
  cursor: pointer;
  font-weight: 720;
  font-size: 0.86rem;
  text-align: left;
}

.track-button:hover,
.track-button:focus-visible {
  background: rgba(219, 237, 218, 0.5);
  outline: none;
}

.track-button.is-current {
  border-color: rgba(180, 95, 61, 0.4);
  background: rgba(217, 155, 129, 0.16);
  color: #8a4529;
}

.track-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(93, 81, 72, 0.12);
  font-size: 0.72rem;
  font-weight: 800;
}

.track-button.is-current .track-mark {
  color: #fff6ec;
  background: #b45f3d;
}
