/* WALL live display. Template tokens arrive as --wt-* custom properties on #wd
   (see services/wall/templates.js). Five modes share the stage; each mode is a
   class on the stage element. Tuned for projectors, TVs and LED walls. */

html.w-html, body.w-shell-display { height: 100%; overflow: hidden; background: #000; }
.wd { position: fixed; inset: 0; background: var(--wt-bg, #000); color: var(--wt-text, #fff); font-family: var(--wt-font, "Inter", sans-serif); overflow: hidden; isolation: isolate; cursor: none; }
.wd.has-cursor { cursor: default; }
.wd-bg { position: absolute; inset: 0; background: var(--wt-bg-accent, none); z-index: 0; transition: opacity 0.8s; }
.wd-bg-blur { position: absolute; inset: -6%; z-index: 0; background: center/cover no-repeat; filter: blur(42px) saturate(1.2) brightness(0.45); opacity: 0; transition: opacity 1.2s, background-image 1.2s; }
.wd[data-background="black"] .wd-bg { opacity: 0; }
.wd[data-background="blur"] .wd-bg-blur { opacity: 1; }
.wd[data-background="blur"] .wd-bg { opacity: 0.3; }

.wd-header { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: clamp(16px, 2.4vw, 40px) clamp(18px, 3vw, 48px); background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent); pointer-events: none; }
.wd-brand { display: flex; align-items: center; gap: clamp(10px, 1.2vw, 18px); }
.wd-logo { width: clamp(40px, 4vw, 68px); height: clamp(40px, 4vw, 68px); border-radius: 28%; background: linear-gradient(135deg, var(--wt-accent, #a855f7), var(--wt-accent2, #ec4899)); display: grid; place-items: center; font-weight: 800; font-size: clamp(1rem, 1.8vw, 1.8rem); color: #fff; overflow: hidden; }
.wd-logo img { width: 100%; height: 100%; object-fit: cover; }
.wd-title { font-family: var(--wt-title-font, inherit); font-weight: var(--wt-title-weight, 600); font-size: clamp(1.3rem, 2.8vw, 3rem); letter-spacing: -0.02em; line-height: 1.05; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5); }
.wd-hashtag { font-size: clamp(0.85rem, 1.3vw, 1.3rem); color: var(--wt-accent, #fff); font-weight: 600; letter-spacing: 0.02em; margin-top: 4px; }
.wd-live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.4); font-size: clamp(0.7rem, 1vw, 0.95rem); font-weight: 700; letter-spacing: 0.1em; backdrop-filter: blur(10px); }
.wd-live i { width: 9px; height: 9px; border-radius: 50%; background: #34d399; animation: wd-pulse 1.6s infinite; }
@keyframes wd-pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); } 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.wd-stage { position: absolute; inset: 0; z-index: 1; }
.wd-card { position: absolute; overflow: hidden; border-radius: var(--wt-radius, 14px); border: var(--wt-frame, none); box-shadow: var(--wt-glow, none); background: var(--wt-surface, rgba(255, 255, 255, 0.04)); will-change: transform, opacity; }
.wd-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wd-card .wd-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(8px, 1vw, 16px) clamp(10px, 1.2vw, 18px); background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent); font-size: clamp(0.72rem, 1vw, 1.05rem); display: flex; align-items: center; gap: 8px; }
.wd-card .wd-cap strong { font-weight: 600; }
.wd-card .wd-cap svg { width: 1em; height: 1em; color: var(--wt-accent, #fff); flex: none; }
.wd[data-usernames="false"] .wd-cap { display: none; }
.wd-card .wd-star { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--wt-accent, #fbbf24); color: #000; display: grid; place-items: center; }
.wd-card .wd-star svg { width: 14px; height: 14px; }

/* Transitions (data-transition on #wd) */
.wd-card.is-entering { animation: wd-fade-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.wd[data-transition="slide"] .wd-card.is-entering { animation-name: wd-slide-in; }
.wd[data-transition="zoom"] .wd-card.is-entering { animation-name: wd-zoom-in; }
.wd[data-transition="flip"] .wd-card.is-entering { animation-name: wd-flip-in; }
.wd-card.is-leaving { animation: wd-fade-out 0.7s ease both; pointer-events: none; }
.wd[data-transition="slide"] .wd-card.is-leaving { animation-name: wd-slide-out; }
.wd[data-transition="zoom"] .wd-card.is-leaving { animation-name: wd-zoom-out; }
.wd[data-transition="flip"] .wd-card.is-leaving { animation-name: wd-flip-out; }
.wd-card.is-new { animation: wd-new-in 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes wd-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wd-fade-out { to { opacity: 0; } }
@keyframes wd-slide-in { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes wd-slide-out { to { opacity: 0; transform: translateY(-30px); } }
@keyframes wd-zoom-in { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: none; } }
@keyframes wd-zoom-out { to { opacity: 0; transform: scale(1.1); } }
@keyframes wd-flip-in { from { opacity: 0; transform: perspective(900px) rotateY(-70deg); } to { opacity: 1; transform: none; } }
@keyframes wd-flip-out { to { opacity: 0; transform: perspective(900px) rotateY(60deg); } }
@keyframes wd-new-in { 0% { opacity: 0; transform: scale(0.5) rotate(-6deg); } 55% { opacity: 1; transform: scale(1.05) rotate(1deg); box-shadow: 0 0 0 6px var(--wt-accent, #fff); } 100% { transform: none; } }

/* ── Mosaic ─────────────────────────────────────────────────────────── */
.wd-stage.is-mosaic { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 1fr; grid-template-rows: repeat(4, 1fr); grid-auto-flow: dense; overflow: hidden; gap: var(--wt-gap, 12px); padding: calc(clamp(60px, 9vw, 130px)) clamp(14px, 2vw, 32px) clamp(14px, 2vw, 32px); }
.wd-stage.is-mosaic .wd-card { position: relative; }
.wd-stage.is-mosaic .wd-card.is-big { grid-column: span 2; grid-row: span 2; }
.wd-stage.is-mosaic .wd-card.is-tall { grid-row: span 2; }
.wd-stage.is-mosaic .wd-card.is-wide { grid-column: span 2; }
@media (orientation: portrait) { .wd-stage.is-mosaic { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(6, 1fr); } }

/* ── Spotlight ──────────────────────────────────────────────────────── */
.wd-stage.is-spotlight { display: grid; grid-template-columns: 1fr minmax(0, 2.2fr) 1fr; grid-template-rows: 1fr; gap: var(--wt-gap, 12px); padding: clamp(70px, 10vw, 140px) clamp(14px, 2vw, 32px) clamp(14px, 2vw, 32px); }
.wd-stage.is-spotlight .wd-ring { display: grid; grid-template-rows: repeat(3, 1fr); gap: var(--wt-gap, 12px); min-height: 0; }
.wd-stage.is-spotlight .wd-ring .wd-card { position: relative; opacity: 0.85; }
.wd-stage.is-spotlight .wd-hero { position: relative; min-height: 0; }
.wd-stage.is-spotlight .wd-hero .wd-card { position: absolute; inset: 0; box-shadow: var(--wt-glow, none), 0 30px 80px rgba(0, 0, 0, 0.6); }
.wd-stage.is-spotlight .wd-hero .wd-card .wd-cap { font-size: clamp(0.9rem, 1.4vw, 1.4rem); padding: clamp(14px, 1.6vw, 26px); flex-direction: column; align-items: flex-start; gap: 4px; }
.wd-stage.is-spotlight .wd-hero .wd-card .wd-cap em { font-style: normal; opacity: 0.8; font-size: 0.85em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (orientation: portrait) { .wd-stage.is-spotlight { grid-template-columns: 1fr; grid-template-rows: minmax(0, 2.4fr) 1fr; } .wd-stage.is-spotlight .wd-ring { grid-template-rows: 1fr; grid-template-columns: repeat(3, 1fr); } .wd-stage.is-spotlight .wd-ring.is-left { display: none; } }

/* ── Cascade ────────────────────────────────────────────────────────── */
.wd-stage.is-cascade { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--wt-gap, 12px); padding: clamp(60px, 9vw, 130px) clamp(14px, 2vw, 32px) 0; align-items: start; }
.wd-stage.is-cascade .wd-col { display: grid; gap: var(--wt-gap, 12px); align-content: start; }
.wd-stage.is-cascade .wd-card { position: relative; aspect-ratio: var(--ratio, 3 / 4); animation: wd-cascade-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.wd-stage.is-cascade .wd-card.is-leaving { animation: wd-fade-out 0.6s ease both; }
@keyframes wd-cascade-in { from { opacity: 0; transform: translateY(-60px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (orientation: portrait) { .wd-stage.is-cascade { grid-template-columns: repeat(2, 1fr); } }

/* ── Carousel ───────────────────────────────────────────────────────── */
.wd-stage.is-carousel .wd-card { inset: 0; border-radius: 0; border: 0; box-shadow: none; background: #000; }
.wd-stage.is-carousel .wd-card img { object-fit: contain; animation: wd-kenburns 14s ease-in-out both; }
.wd-stage.is-carousel .wd-card .wd-cap { font-size: clamp(1rem, 1.8vw, 1.8rem); padding: clamp(24px, 3vw, 48px) clamp(24px, 4vw, 64px) clamp(28px, 4vw, 70px); flex-direction: column; align-items: flex-start; gap: 6px; background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent); }
.wd-stage.is-carousel .wd-card .wd-cap em { font-style: normal; opacity: 0.85; font-size: 0.75em; max-width: 60ch; }
.wd-stage.is-carousel .wd-progress { position: absolute; left: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--wt-accent, #fff), var(--wt-accent2, #fff)); width: 0; z-index: 3; }
.wd-stage.is-carousel .wd-progress.is-running { animation: wd-progress var(--interval, 6s) linear forwards; }
@keyframes wd-kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes wd-progress { from { width: 0; } to { width: 100%; } }

/* ── Party ──────────────────────────────────────────────────────────── */
.wd-stage.is-party { overflow: hidden; }
.wd-stage.is-party .wd-card { width: var(--w, 22vmin); aspect-ratio: var(--ratio, 3 / 4); left: var(--x, 10%); top: var(--y, 10%); transform: rotate(var(--r, 0deg)); animation: wd-party-float var(--dur, 14s) ease-in-out infinite alternate, wd-party-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; box-shadow: var(--wt-glow, none), 0 20px 50px rgba(0, 0, 0, 0.55); }
@keyframes wd-party-float { from { transform: translate(0, 0) rotate(var(--r, 0deg)); } to { transform: translate(var(--dx, 3vw), var(--dy, -4vh)) rotate(calc(var(--r, 0deg) * -1)); } }
@keyframes wd-party-in { from { opacity: 0; transform: scale(0.3) rotate(var(--r, 0deg)); } to { opacity: 1; } }
.wd-reaction { position: absolute; bottom: -10%; left: var(--x, 50%); font-size: clamp(1.4rem, 3vmin, 3rem); animation: wd-reaction 4.5s ease-out forwards; pointer-events: none; z-index: 4; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5)); }
@keyframes wd-reaction { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-110vh) translateX(var(--drift, 0)) scale(1.3) rotate(var(--rot, 10deg)); opacity: 0; } }
.wd-confetti { position: absolute; top: -4vh; left: var(--x, 50%); width: 10px; height: 16px; background: var(--c, var(--wt-accent, #fff)); border-radius: 2px; animation: wd-confetti var(--dur, 5s) linear forwards; pointer-events: none; z-index: 4; }
@keyframes wd-confetti { to { transform: translateY(110vh) rotate(720deg) translateX(var(--drift, 0)); opacity: 0.2; } }

/* ── Overlays ───────────────────────────────────────────────────────── */
.wd-new { position: absolute; z-index: 6; left: 50%; bottom: clamp(20px, 4vh, 48px); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.2); backdrop-filter: blur(16px); font-size: clamp(0.85rem, 1.2vw, 1.1rem); animation: wd-toast 3.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.wd-new[hidden] { display: none; }
.wd-new strong { display: block; } .wd-new span { opacity: 0.7; font-size: 0.85em; }
.wd-new-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--wt-accent, #a855f7), var(--wt-accent2, #ec4899)); display: grid; place-items: center; font-weight: 700; color: #fff; }
@keyframes wd-toast { 0% { opacity: 0; transform: translate(-50%, 20px); } 12% { opacity: 1; transform: translate(-50%, 0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 10px); } }
.wd-qr { position: absolute; right: clamp(14px, 2vw, 32px); bottom: clamp(14px, 2vw, 32px); z-index: 6; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.15); backdrop-filter: blur(12px); font-size: clamp(0.7rem, 0.9vw, 0.9rem); line-height: 1.3; opacity: 0.9; }
.wd-qr img { width: clamp(64px, 6vw, 110px); height: auto; }
.wd-qr[hidden] { display: none; }
.wd-empty { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; text-align: center; gap: 8px; color: var(--wt-muted, #aaa); font-size: clamp(1rem, 1.6vw, 1.5rem); }
.wd-empty strong { color: var(--wt-text, #fff); font-family: var(--wt-title-font, inherit); font-size: 1.6em; font-weight: var(--wt-title-weight, 600); }
.wd-empty[hidden] { display: none; }
.wd-controls { position: absolute; left: 50%; bottom: clamp(14px, 2vw, 32px); transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.15); backdrop-filter: blur(14px); opacity: 0; transition: opacity 0.4s; pointer-events: none; }
.wd.has-cursor .wd-controls { opacity: 1; pointer-events: auto; }
.wd-controls-modes { display: flex; gap: 2px; }
.wd-controls-modes button { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: rgba(255, 255, 255, 0.7); font-family: "Inter", sans-serif; }
.wd-controls-modes button:hover { color: #fff; }
.wd-controls-modes button.is-active { background: rgba(255, 255, 255, 0.16); color: #fff; }
.wd-fs { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, 0.1); }
.wd-fs svg { width: 16px; height: 16px; }
.wd-conn { font-size: 0.7rem; color: rgba(255, 255, 255, 0.55); padding: 0 8px; font-family: "Inter", sans-serif; }
.wd.is-embed .wd-controls, .wd.is-embed .wd-qr { display: none; }
.wd.is-embed .wd-header { padding: 14px 18px; } .wd.is-embed .wd-title { font-size: 1rem; } .wd.is-embed .wd-hashtag { font-size: 0.7rem; } .wd.is-embed .wd-logo { width: 30px; height: 30px; font-size: 0.8rem; } .wd.is-embed .wd-live { font-size: 0.6rem; padding: 4px 8px; }
.wd.is-embed .wd-stage.is-mosaic, .wd.is-embed .wd-stage.is-cascade { padding-top: 58px; padding-left: 10px; padding-right: 10px; gap: 6px; }
.wd.is-embed .wd-stage.is-spotlight { padding: 58px 10px 10px; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  .wd-card, .wd-card.is-entering, .wd-card.is-leaving, .wd-card.is-new, .wd-stage.is-party .wd-card, .wd-stage.is-cascade .wd-card { animation: none !important; transition: opacity 0.3s !important; }
  .wd-stage.is-carousel .wd-card img { animation: none; }
  .wd-reaction, .wd-confetti { display: none; }
  .wd-live i { animation: none; }
}
