/* =============================================================================
   THE VAULT — experience.css
   Styling for the immersive "Vault Experience" layer. Uses the design tokens
   from styles.css (loaded first). Everything here is additive and degrades
   gracefully; a full prefers-reduced-motion block sits at the foot of the file.
============================================================================= */

/* ======================================================= F1  VAULT DOOR === */
.vault-door {
  position: fixed; inset: 0; z-index: 4000; overflow: hidden;
  background:
    radial-gradient(120% 100% at 50% 40%, #2a2016 0%, #17110b 55%, #0c0906 100%);
  display: grid; place-items: center;
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}
.vault-door[hidden] { display: none; }
.vault-door.opening { /* JS drives the sequence via stage classes below */ }
.vault-door.done { opacity: 0; visibility: hidden; }

/* Stone frame around the door */
.vd-frame {
  position: relative; width: min(86vw, 560px); aspect-ratio: 1;
  display: grid; place-items: center;
}

/* The circular brass door itself */
.vd-door {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(0,0,0,0.18) 0deg 2deg, transparent 2deg 6deg),
    radial-gradient(circle at 38% 32%, #d8b878 0%, #b0894f 34%, #7c5c31 70%, #4b3820 100%);
  box-shadow:
    inset 0 0 60px rgba(0,0,0,0.55), inset 0 0 0 10px rgba(0,0,0,0.25),
    0 30px 80px -20px rgba(0,0,0,0.8), 0 0 120px -30px rgba(201,169,106,0.4);
  border: 3px solid #3a2c18;
  transform-origin: 12% 50%;
  transition: transform 2s cubic-bezier(0.7, 0, 0.2, 1);
}
/* concentric rings */
.vd-door::before {
  content: ""; position: absolute; inset: 9%; border-radius: 50%;
  border: 2px solid rgba(60,44,24,0.7);
  background: radial-gradient(circle at 40% 35%, rgba(216,184,120,0.5), transparent 60%);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}
.vd-door::after {
  content: ""; position: absolute; inset: 24%; border-radius: 50%;
  border: 2px solid rgba(60,44,24,0.6);
}

/* Combination wheel (centre) */
.vd-wheel {
  position: absolute; top: 50%; left: 50%; width: 34%; aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, #2b2013 0deg 1deg, transparent 1deg 12deg),
    radial-gradient(circle, #caa869 0%, #8a6a3b 60%, #4b3820 100%);
  box-shadow: inset 0 0 26px rgba(0,0,0,0.6), 0 4px 14px rgba(0,0,0,0.5);
  display: grid; place-items: center;
  animation: vd-spin 6s cubic-bezier(0.5, 0, 0.2, 1) forwards;
}
.vd-wheel::before { /* handle spokes */
  content: ""; position: absolute; width: 12%; height: 92%;
  background: linear-gradient(#efe0bf, #7c5c31); border-radius: 40%;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}
.vd-wheel::after {
  content: ""; position: absolute; width: 92%; height: 12%;
  background: linear-gradient(90deg, #7c5c31, #efe0bf, #7c5c31); border-radius: 40%;
}
.vd-wheel-hub { position: relative; z-index: 2; width: 30%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #efe0bf, #6e5227); box-shadow: inset 0 0 8px rgba(0,0,0,0.6); }

/* Locking bolts (four) retract outward */
.vd-bolt {
  position: absolute; width: 15%; height: 5%; background: linear-gradient(#e2caa0, #8a6a3b);
  border-radius: var(--radius-sm); box-shadow: 0 2px 6px rgba(0,0,0,0.5); top: 50%; left: 50%;
  transition: transform 0.9s var(--ease);
}
.vd-bolt.b1 { transform: translate(-50%,-50%) rotate(0deg)   translateX(160%); }
.vd-bolt.b2 { transform: translate(-50%,-50%) rotate(90deg)  translateX(160%); }
.vd-bolt.b3 { transform: translate(-50%,-50%) rotate(180deg) translateX(160%); }
.vd-bolt.b4 { transform: translate(-50%,-50%) rotate(270deg) translateX(160%); }
.vault-door.bolts-out .vd-bolt.b1 { transform: translate(-50%,-50%) rotate(0deg)   translateX(230%); }
.vault-door.bolts-out .vd-bolt.b2 { transform: translate(-50%,-50%) rotate(90deg)  translateX(230%); }
.vault-door.bolts-out .vd-bolt.b3 { transform: translate(-50%,-50%) rotate(180deg) translateX(230%); }
.vault-door.bolts-out .vd-bolt.b4 { transform: translate(-50%,-50%) rotate(270deg) translateX(230%); }

/* Logo + word */
.vd-logo { position: absolute; z-index: 5; width: 84px; height: 84px; border-radius: 50%;
  border: 1px solid var(--brass); background: var(--cream); opacity: 0; top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.9); animation: vd-logo 1s var(--ease) 0.2s forwards; }
.vault-door.wheel-done .vd-logo { animation: vd-logo-out 0.6s var(--ease) forwards; }
.vd-caption { position: absolute; bottom: 12%; left: 0; right: 0; text-align: center; z-index: 6;
  font-family: var(--f-display); text-transform: uppercase; letter-spacing: 0.4em; color: var(--gold);
  font-size: 0.72rem; opacity: 0; animation: fade 1s ease 0.6s forwards; }

/* The escaping warm light + doorway pass-through */
.vd-light {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,224,170,0.9), rgba(255,200,120,0.3) 30%, transparent 62%);
  mix-blend-mode: screen;
}
.vault-door.opening-door .vd-door { transform: perspective(1200px) rotateY(-105deg); }
.vault-door.opening-door .vd-light { animation: vd-light 1.8s ease forwards; }
.vault-door.opening-door .vd-frame { animation: vd-through 1.6s cubic-bezier(0.7,0,0.3,1) 0.5s forwards; }

/* Dust particles */
.vd-dust { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.vd-dust i { position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(230,205,150,0.7); filter: blur(0.4px); animation: vd-float linear infinite; }

/* Controls */
.vd-controls { position: absolute; bottom: 1.4rem; right: 1.4rem; z-index: 10; display: flex; gap: 0.7rem; align-items: center; }
.vd-skip { background: transparent; border: 1px solid rgba(176,137,79,0.5); color: var(--gold);
  padding: 0.6rem 1.1rem; border-radius: var(--radius); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.68rem; }
.vd-skip:hover { border-color: var(--gold); background: rgba(201,169,106,0.08); }
.vd-remember { display: flex; align-items: center; gap: 0.5rem; color: var(--on-dark-muted); font-size: 0.7rem; letter-spacing: 0.08em; }
.vd-remember input { accent-color: var(--gold); }

@keyframes vd-spin { 0% { transform: translate(-50%,-50%) rotate(0deg); } 30% { transform: translate(-50%,-50%) rotate(-220deg); } 60% { transform: translate(-50%,-50%) rotate(120deg); } 100% { transform: translate(-50%,-50%) rotate(-30deg); } }
@keyframes vd-logo { to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes vd-logo-out { to { opacity: 0; transform: translate(-50%,-50%) scale(1.4); } }
@keyframes vd-light { 0% { opacity: 0; } 60% { opacity: 1; } 100% { opacity: 1; } }
@keyframes vd-through { to { transform: scale(6); opacity: 0; } }
@keyframes vd-float { from { transform: translateY(100%) translateX(0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 0.6; } to { transform: translateY(-20%) translateX(20px); opacity: 0; } }

/* ================================================= F4  VENUE STATUS PILL === */
.vault-status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.9rem; border: 1px solid rgba(176,137,79,0.45); border-radius: 40px;
  background: rgba(20,15,10,0.5); color: var(--gold);
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap;
}
.vault-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(201,169,106,0.6); animation: pulse 2.4s ease-out infinite; }
.vault-status[data-tone="busy"] .dot { background: #d98a4a; }
.vault-status[data-tone="full"] .dot { background: #c0563f; }
.vault-status[data-tone="live"] .dot { background: #8FBF7F; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(201,169,106,0.55); } 70% { box-shadow: 0 0 0 8px rgba(201,169,106,0); } 100% { box-shadow: 0 0 0 0 rgba(201,169,106,0); } }

/* ================================================ F7  TONIGHT DASHBOARD === */
.tonight { border-block: 1px solid rgba(176,137,79,0.22); }
.tonight__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(176,137,79,0.18); border: 1px solid rgba(176,137,79,0.18); border-radius: var(--radius); overflow: hidden; }
.tonight__cell { background: var(--espresso); padding: 1.3rem 1.2rem; display: grid; gap: 0.35rem; align-content: start; min-height: 116px; transition: background 0.4s; }
.tonight__cell:hover { background: var(--espresso-2); }
.tonight__cell .k { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.tonight__cell .v { font-family: var(--f-serif); font-size: 1.25rem; color: var(--on-dark); line-height: 1.25; }
.tonight__cell .s { font-size: 0.78rem; color: var(--on-dark-muted); }
.tonight__cell.wide { grid-column: span 2; }

/* ================================================= F14 EVENT COUNTDOWN ===== */
.countdown { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.countdown__unit { min-width: 84px; text-align: center; border: 1px solid rgba(176,137,79,0.35); border-radius: var(--radius); padding: 0.9rem 0.6rem; background: rgba(20,15,10,0.4); }
.countdown__num { font-family: var(--f-display); font-size: clamp(1.8rem, 5vw, 2.8rem); color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; display: block; }
.countdown__num.flip { animation: flip 0.5s var(--ease); }
.countdown__label { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--on-dark-muted); margin-top: 0.4rem; display: block; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(-90deg); opacity: 0.3; } 100% { transform: rotateX(0); opacity: 1; } }

/* ============================================ SHARED: XP OVERLAY / MODAL === */
.xp-overlay { position: fixed; inset: 0; z-index: 2600; display: none; place-items: center; padding: 1.2rem; }
.xp-overlay.open { display: grid; }
.xp-overlay__bg { position: absolute; inset: 0; background: rgba(8,5,3,0.82); backdrop-filter: blur(4px); animation: fade 0.3s; }
.xp-panel { position: relative; z-index: 1; width: 100%; max-width: 480px; background: linear-gradient(var(--espresso), var(--charcoal));
  border: 1px solid var(--brass); border-radius: var(--radius); padding: 2rem 1.8rem; text-align: center;
  box-shadow: var(--shadow-lift); animation: modal-in 0.5s var(--ease); }
.xp-panel h3 { font-family: var(--f-display); text-transform: uppercase; letter-spacing: 0.1em; color: var(--on-dark); font-size: var(--step-2); margin-bottom: 0.4rem; }
.xp-panel .eyebrow { display: block; margin-bottom: 1rem; }
.xp-panel p { color: var(--on-dark-muted); font-family: var(--f-serif); font-size: 1.08rem; }
.xp-panel ul { display: grid; gap: 0.5rem; margin: 1.1rem 0; text-align: left; }
.xp-panel ul li { color: var(--on-dark-muted); padding-left: 1.2rem; position: relative; }
.xp-panel ul li::before { content: "◇"; position: absolute; left: 0; color: var(--gold); }
.xp-close { position: absolute; top: 0.7rem; right: 0.7rem; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(176,137,79,0.4); background: transparent; color: var(--gold); }
.xp-seal { width: 92px; height: 92px; margin: 0 auto 1rem; }

/* ============================================ F2  MEMBERS / PASSWORD ====== */
.members-trigger {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 880; width: 50px; height: 50px; border-radius: 50%;
  background: rgba(20,15,10,0.85); border: 1px solid var(--brass); color: var(--gold);
  display: grid; place-items: center; box-shadow: var(--shadow-lift); transition: transform 0.3s var(--ease), background 0.3s;
}
.members-trigger:hover { transform: translateY(-3px); background: var(--espresso); }
.members-trigger svg { width: 22px; height: 22px; }
.pw-input { display: flex; gap: 0.5rem; margin: 1.2rem 0 0.4rem; }
.pw-input input { text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-family: var(--f-display); }
.pw-error { color: #e6a6a0; font-size: 0.85rem; min-height: 1.2em; }
.pw-shake { animation: shake 0.4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.members-tabs { display: flex; gap: 0.4rem; justify-content: center; margin-bottom: 1rem; }
.members-tabs button { padding: 0.45rem 0.9rem; border: 1px solid rgba(176,137,79,0.35); background: transparent; color: var(--on-dark-muted); border-radius: 40px; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; }
.members-tabs button.active { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* ============================================ F20 COMBINATION DIAL ========= */
.combo { display: grid; gap: 1rem; place-items: center; }
.combo__dials { display: flex; gap: 0.8rem; }
.combo__d { width: 70px; text-align: center; }
.combo__val { font-family: var(--f-display); font-size: 1.8rem; color: var(--gold); border: 1px solid var(--brass); border-radius: var(--radius); padding: 0.5rem 0; background: rgba(20,15,10,0.5); font-variant-numeric: tabular-nums; }
.combo__btns { display: flex; justify-content: space-between; margin-top: 0.3rem; }
.combo__btns button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(176,137,79,0.4); background: transparent; color: var(--gold); }
.combo__found { font-size: 0.75rem; color: var(--on-dark-muted); }

/* ============================================ F6  COLLECTIBLES ============ */
.collectible {
  position: absolute; z-index: 700; width: 40px; height: 40px; cursor: pointer;
  display: grid; place-items: center; color: var(--gold); filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
  animation: coll-bob 3.4s ease-in-out infinite; transition: transform 0.3s;
}
.collectible:hover { transform: scale(1.2) rotate(6deg); }
.collectible svg { width: 30px; height: 30px; }
.collectible.collected { animation: coll-collect 0.7s var(--ease) forwards; pointer-events: none; }
@keyframes coll-bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes coll-collect { to { transform: translateY(-40px) scale(0.2); opacity: 0; } }

.coll-counter {
  position: fixed; left: 1rem; bottom: 4.6rem; z-index: 880; display: none; align-items: center; gap: 0.5rem;
  background: rgba(20,15,10,0.85); border: 1px solid var(--brass); border-radius: 40px; padding: 0.5rem 0.9rem;
  color: var(--gold); font-size: 0.72rem; letter-spacing: 0.1em; box-shadow: var(--shadow-lift); cursor: pointer;
}
.coll-counter.show { display: flex; }
.coll-counter svg { width: 18px; height: 18px; }
/* keep fixed controls clear of the sticky mobile book bar */
body:has(.sticky-book) .members-trigger { bottom: 84px; }
body:has(.sticky-book) .coll-counter { bottom: 140px; }
@media (min-width: 1024px) {
  body:has(.sticky-book) .members-trigger { bottom: 1rem; }
  body:has(.sticky-book) .coll-counter { bottom: 4.6rem; }
}

/* ============================================ F5  CONCIERGE =============== */
.concierge-trigger {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 890; display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--gold); color: var(--ink); border: none; border-radius: 40px; padding: 0.7rem 1.1rem;
  font-family: var(--f-sans); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.68rem;
  box-shadow: var(--shadow-lift); transition: transform 0.3s var(--ease);
}
.concierge-trigger:hover { transform: translateY(-3px); }
.concierge-trigger svg { width: 18px; height: 18px; }
body:has(.sticky-book) .concierge-trigger { bottom: 84px; }
@media (min-width: 1024px) { body:has(.sticky-book) .concierge-trigger { bottom: 1rem; } }

.concierge {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 1600; width: min(92vw, 380px); max-height: min(78vh, 620px);
  display: none; flex-direction: column; background: linear-gradient(var(--espresso), var(--charcoal));
  border: 1px solid var(--brass); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lift);
  transform: translateY(20px) scale(0.98); opacity: 0; transition: transform 0.4s var(--ease), opacity 0.4s;
}
.concierge.open { display: flex; transform: none; opacity: 1; }
.concierge__head { padding: 1.1rem 1.2rem; border-bottom: 1px solid rgba(176,137,79,0.25); display: flex; align-items: center; gap: 0.7rem; }
.concierge__head img { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--brass); background: var(--cream); }
.concierge__head .t { font-family: var(--f-display); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; color: var(--gold); }
.concierge__head .s { font-size: 0.66rem; color: var(--on-dark-muted); letter-spacing: 0.1em; }
.concierge__close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(176,137,79,0.3); background: transparent; color: var(--gold); }
.concierge__log { flex: 1; overflow-y: auto; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.cx-msg { max-width: 88%; padding: 0.7rem 0.9rem; border-radius: 12px; font-size: 0.92rem; line-height: 1.5; }
.cx-msg.bot { background: rgba(201,169,106,0.1); border: 1px solid rgba(176,137,79,0.25); color: var(--on-dark); align-self: flex-start; border-bottom-left-radius: 3px; font-family: var(--f-serif); font-size: 1.02rem; }
.cx-msg.user { background: var(--gold); color: var(--ink); align-self: flex-end; border-bottom-right-radius: 3px; }
.cx-typing { display: inline-flex; gap: 4px; align-items: center; }
.cx-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: cx-dot 1.2s infinite; }
.cx-typing i:nth-child(2) { animation-delay: 0.2s; } .cx-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes cx-dot { 0%,60%,100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.concierge__prompts { padding: 0.8rem 1rem 1.1rem; border-top: 1px solid rgba(176,137,79,0.25); display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cx-prompt { border: 1px solid rgba(176,137,79,0.35); background: transparent; color: var(--on-dark-muted); border-radius: 40px; padding: 0.45rem 0.8rem; font-size: 0.72rem; transition: all 0.3s; text-align: left; }
.cx-prompt:hover { color: var(--gold); border-color: var(--gold); }

/* ============================================ ACHIEVEMENTS =============== */
.achv-toast {
  position: fixed; top: calc(var(--nav-h) + 0.8rem); right: 1rem; z-index: 2300; width: min(88vw, 320px);
  display: flex; gap: 0.8rem; align-items: center; padding: 0.9rem 1rem;
  background: linear-gradient(var(--espresso), var(--charcoal)); border: 1px solid var(--gold); border-radius: var(--radius);
  box-shadow: var(--shadow-lift); transform: translateX(120%); transition: transform 0.5s var(--ease);
}
.achv-toast.show { transform: none; }
.achv-toast__seal { flex: 0 0 auto; width: 44px; height: 44px; }
.achv-toast .k { font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.achv-toast .n { font-family: var(--f-display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--on-dark); font-size: 0.95rem; }
.achv-toast .d { font-size: 0.76rem; color: var(--on-dark-muted); }

.achv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 1rem; text-align: left; }
.achv-item { border: 1px solid rgba(176,137,79,0.25); border-radius: var(--radius); padding: 0.7rem 0.8rem; opacity: 0.5; }
.achv-item.got { opacity: 1; border-color: var(--gold); background: rgba(201,169,106,0.06); }
.achv-item .n { font-family: var(--f-display); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; color: var(--gold); }
.achv-item .d { font-size: 0.72rem; color: var(--on-dark-muted); }

/* small reusable seal (reuses .dial structure) */
.xp-seal .dial__ring--ticks, .achv-toast__seal .dial__ring--ticks, .confirm__seal .dial__ring--ticks { }

/* ============================================ RESPONSIVE ================== */
@media (max-width: 900px) {
  .tonight__grid { grid-template-columns: repeat(2, 1fr); }
  .tonight__cell.wide { grid-column: span 2; }
}
@media (max-width: 560px) {
  .tonight__grid { grid-template-columns: 1fr 1fr; }
  .members-trigger { width: 44px; height: 44px; }
  .vd-controls { bottom: 1rem; right: 1rem; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
  .achv-grid { grid-template-columns: 1fr; }
}

/* ============================================ REDUCED MOTION ============== */
@media (prefers-reduced-motion: reduce) {
  .vd-wheel, .collectible, .vault-status .dot, .cx-typing i { animation: none !important; }
  .vd-door { transition: none !important; }
  .vault-door.opening-door .vd-frame { animation: none !important; }
  .countdown__num.flip { animation: none !important; }
  .members-trigger, .concierge-trigger { transition: none !important; }
}

/* ---- Smoother corners (experience layer) ---------------------------------- */
.xp-panel, .concierge, .achv-toast, .tonight__grid, .countdown__unit,
.vault-status, .members-tabs button { border-radius: var(--radius-lg); }
.vault-status, .members-tabs button, .cx-prompt { border-radius: 999px; }
.tonight__grid { overflow: hidden; }
.concierge { border-radius: var(--radius-xl); }
.cx-msg { border-radius: 16px; }
