/* ibis Bangkok IMPACT LIVE - Concert Stage 3D Theme */
:root {
  --bg-dark: #0E0E12;
  --bg-card: #17171F;
  --bg-elevated: #22222E;
  --border-subtle: rgba(255, 255, 255, 0.12);
  --text-main: #FFFFFF;
  --text-muted: #A0A3B1;
  --ibis-red: #E2001A;
  --ibis-red-glow: rgba(226, 0, 26, 0.45);
  --persona-pink: #FF4FA3;
  --persona-blue: #2F80ED;
  --persona-green: #27AE60;
  --persona-orange: #F2994A;
  --persona-accent: #E2001A;
  --persona-glow: rgba(226, 0, 26, 0.42);
  --font: 'Vibis Text', 'Prompt', 'Poppins', system-ui, sans-serif;
  --font-sans: var(--font);
}

body[data-persona="pink"] {
  --persona-accent: #FF4FA3;
  --persona-glow: rgba(255, 79, 163, 0.42);
}
body[data-persona="blue"] {
  --persona-accent: #2F80ED;
  --persona-glow: rgba(47, 128, 237, 0.42);
}
body[data-persona="green"] {
  --persona-accent: #27AE60;
  --persona-glow: rgba(39, 174, 96, 0.42);
}
body[data-persona="orange"] {
  --persona-accent: #F2994A;
  --persona-glow: rgba(242, 153, 74, 0.42);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.4;
  min-height: 100%;
  overflow-x: hidden;
}

h1, h2, h3, h4, .headline {
  font-family: var(--font);
  font-weight: 900;
}

button, .btn, .option-btn, .btn-top, .star-btn, .predict-choice-btn, .reaction-btn {
  font-family: var(--font);
  font-weight: 700;
}

/* Concert stage spotlight background */
.stage-bg {
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(226, 0, 26, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 82% 15%, rgba(255, 79, 163, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 50% 88%, rgba(47, 128, 237, 0.14) 0%, transparent 55%);
}

/* Persona color helpers */
.persona-bg-pink { background-color: var(--persona-pink); color: #fff; }
.persona-bg-blue { background-color: var(--persona-blue); color: #fff; }
.persona-bg-green { background-color: var(--persona-green); color: #fff; }
.persona-bg-orange { background-color: var(--persona-orange); color: #fff; }

.persona-border-pink { border-color: var(--persona-pink) !important; }
.persona-border-blue { border-color: var(--persona-blue) !important; }
.persona-border-green { border-color: var(--persona-green) !important; }
.persona-border-orange { border-color: var(--persona-orange) !important; }

.persona-text-pink { color: var(--persona-pink) !important; }
.persona-text-blue { color: var(--persona-blue) !important; }
.persona-text-green { color: var(--persona-green) !important; }
.persona-text-orange { color: var(--persona-orange) !important; }

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  color: var(--text-main);
  background: var(--bg-elevated);
  user-select: none;
  text-decoration: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--persona-accent, var(--ibis-red));
  box-shadow: 0 4px 18px var(--persona-glow, var(--ibis-red-glow));
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  background: #2b2b3a;
}

.btn-block {
  width: 100%;
}

.input-field {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 1.1rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--persona-accent, var(--ibis-red));
  box-shadow: 0 0 12px var(--persona-glow, var(--ibis-red-glow));
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================
   PLAYER SCREEN (360px to 430px portrait)
   ========================================== */
#player-confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 110;
}

.player-flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 105;
  opacity: 0;
}

.player-flash-overlay.flash-green {
  background: radial-gradient(circle, rgba(39, 174, 96, 0.55) 0%, rgba(39, 174, 96, 0.22) 100%);
  animation: flashFadeOut 0.85s ease-out forwards;
}

.player-flash-overlay.flash-red {
  background: radial-gradient(circle, rgba(226, 0, 26, 0.5) 0%, rgba(226, 0, 26, 0.2) 100%);
  animation: flashFadeOut 0.85s ease-out forwards;
}

@keyframes flashFadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes wrongGentleShake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-10px) rotate(-1deg); }
  36% { transform: translateX(9px) rotate(1deg); }
  54% { transform: translateX(-7px); }
  72% { transform: translateX(5px); }
}

.shake-wrong {
  animation: wrongGentleShake 0.52s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.player-shell {
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 10px 14px 86px;
  position: relative;
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--persona-accent, var(--ibis-red));
  box-shadow: 0 0 8px var(--persona-accent, var(--ibis-red));
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-top {
  min-height: 40px;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
}

.player-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--persona-accent, var(--border-subtle));
  box-shadow: 0 4px 16px var(--persona-glow, rgba(0, 0, 0, 0.25));
  border-radius: 12px;
  padding: 9px 13px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.strip-left, .strip-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strip-room-tag {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.strip-score-tag {
  font-weight: 900;
  color: #F2C94C;
}

.strip-rank-tag {
  color: var(--text-muted);
  font-weight: 700;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(242, 153, 74, 0.22);
  border: 1px solid #F2994A;
  color: #F2C94C;
  font-weight: 900;
  font-size: 0.82rem;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(242, 153, 74, 0.35);
}

/* Layout fix: Content starts right under the header; only center vertically when screen is taller than content */
.player-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.join-card-panel {
  margin: auto 0;
}

#view-game {
  margin-top: 0;
  margin-bottom: auto;
  width: 100%;
}

.card-panel {
  background: var(--bg-card);
  border: 1.5px solid var(--persona-accent, var(--border-subtle));
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 18px var(--persona-glow, transparent);
}

/* Holographic 3D Digital Room Key Card */
.keycard-scene {
  perspective: 1000px;
  width: 100%;
  margin: 10px 0 14px;
  touch-action: none;
  user-select: none;
}

.keycard {
  width: 100%;
  border-radius: 20px;
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #222232 0%, #12121A 100%);
  border: 2px solid var(--persona-accent, var(--border-subtle));
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.6),
    0 0 22px var(--persona-glow, rgba(255, 255, 255, 0.08));
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.12s ease-out, box-shadow 0.2s ease;
  cursor: grab;
}

.keycard.flip-entrance {
  animation: keycardFlipIn 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.keycard.is-dragging {
  transition: none;
  cursor: grabbing;
}

.keycard-holo-shine {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(
      circle at var(--holo-x, 50%) var(--holo-y, 50%),
      rgba(255, 255, 255, 0.32) 0%,
      transparent 48%
    ),
    linear-gradient(
      var(--holo-angle, 125deg),
      transparent 20%,
      rgba(255, 79, 163, 0.22) 34%,
      rgba(47, 128, 237, 0.24) 44%,
      rgba(39, 174, 96, 0.22) 54%,
      rgba(242, 201, 76, 0.25) 64%,
      rgba(226, 0, 26, 0.22) 74%,
      transparent 86%
    );
  mix-blend-mode: screen;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

@keyframes keycardFlipIn {
  0% {
    opacity: 0;
    transform: rotateY(-180deg) scale(0.88);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
  }
}

.keycard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  z-index: 2;
  transform: translateZ(18px);
}

.keycard-hotel {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
}

.keycard-room {
  font-size: 1.2rem;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.keycard-persona {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
  transform: translateZ(24px);
}

.keycard-emoji {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.95rem;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.keycard-story {
  font-size: 0.94rem;
  color: #E2E4F0;
  background: rgba(0, 0, 0, 0.34);
  padding: 11px 14px;
  border-radius: 12px;
  line-height: 1.42;
  position: relative;
  z-index: 2;
  transform: translateZ(14px);
}

.keycard-tilt-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

/* 3D Pressable Bright Color Option Buttons (Phone) */
.options-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.option-btn {
  width: 100%;
  min-height: 58px;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 2px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  font-size: 1.06rem;
  font-weight: 700;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  position: relative;
  transform: translateY(0);
  box-shadow: 0 6px 0 var(--opt-edge, #111118), 0 10px 20px rgba(0, 0, 0, 0.38);
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.22s ease, filter 0.22s ease;
}

/* 4 bright colors: ibis red #E2001A, blue #2F80ED, yellow #F2C94C (dark text), green #27AE60 */
.option-btn.opt-color-0 {
  background: #E2001A;
  --opt-edge: #8F0010;
  color: #FFFFFF;
}
.option-btn.opt-color-1 {
  background: #2F80ED;
  --opt-edge: #194E96;
  color: #FFFFFF;
}
.option-btn.opt-color-2 {
  background: #F2C94C;
  --opt-edge: #A88412;
  color: #111118;
}
.option-btn.opt-color-3 {
  background: #27AE60;
  --opt-edge: #156938;
  color: #FFFFFF;
}
.option-btn.opt-color-4 {
  background: #FF4FA3;
  --opt-edge: #A61C5E;
  color: #FFFFFF;
}
.option-btn.opt-color-5 {
  background: #F2994A;
  --opt-edge: #A35B18;
  color: #111118;
}

.option-btn:active:not(:disabled),
.option-btn.selected,
.option-btn.selected-lit {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--opt-edge, #111118), 0 0 22px rgba(255, 255, 255, 0.35);
  border-color: #FFFFFF;
}

.option-btn.faded-out {
  opacity: 0.32 !important;
  filter: grayscale(0.45) brightness(0.75);
  transform: translateY(2px);
}

.opt-left-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.opt-letter-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.28);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.option-btn.opt-color-2 .opt-letter-badge,
.option-btn.opt-color-5 .opt-letter-badge {
  background: rgba(17, 17, 24, 0.82);
  color: #F2C94C;
}

.locked-in-banner {
  margin-top: 16px;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(39, 174, 96, 0.2);
  border: 1.5px solid #27AE60;
  color: #27AE60;
  font-weight: 900;
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: 0.03em;
}

/* Reaction Bar (Phone Bottom) */
.reaction-bar {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 412px;
  background: rgba(23, 23, 31, 0.94);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--persona-accent, var(--border-subtle));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6), 0 0 16px var(--persona-glow, transparent);
  border-radius: 18px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 90;
}

.reaction-btn {
  flex: 1;
  min-height: 48px;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.15s ease;
}

.reaction-btn:active,
.reaction-btn.pop-active {
  transform: scale(1.32) translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
}

/* Phone Shake to Cheer Card */
.shake-cheer-box {
  background: linear-gradient(145deg, rgba(226, 0, 26, 0.2), rgba(242, 153, 74, 0.18));
  border: 2px solid var(--persona-accent, #F2994A);
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
  margin-bottom: 14px;
}

.shake-phone-icon {
  font-size: 3rem;
  display: inline-block;
  animation: pulseShakeIcon 0.7s ease-in-out infinite alternate;
}

@keyframes pulseShakeIcon {
  0% { transform: scale(0.95) rotate(-10deg); }
  100% { transform: scale(1.12) rotate(10deg); }
}

.cheer-btn-3d {
  margin-top: 12px;
  min-height: 58px;
  font-size: 1.25rem;
  font-weight: 900;
  background: linear-gradient(180deg, #F2C94C 0%, #F2994A 100%);
  color: #111118;
  border: 2px solid #FFFFFF;
  box-shadow: 0 6px 0 #9E5812, 0 10px 24px rgba(242, 153, 74, 0.45);
}

.cheer-btn-3d:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #9E5812;
}

.rank-delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1rem;
  margin-top: 8px;
}

.rank-delta-badge.up {
  background: rgba(39, 174, 96, 0.22);
  border: 1px solid #27AE60;
  color: #27AE60;
}

.rank-delta-badge.down {
  background: rgba(226, 0, 26, 0.22);
  border: 1px solid #E2001A;
  color: #ff5c70;
}

.rank-delta-badge.same {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Star rating buttons */
.stars-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

.star-btn {
  flex: 1;
  min-height: 58px;
  border-radius: 12px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 #101016;
  transition: all 0.15s ease;
}

.star-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #101016;
}

.star-btn.active {
  border-color: #F2C94C;
  background: rgba(242, 201, 76, 0.22);
  color: #F2C94C;
  box-shadow: 0 5px 0 #8E6E11;
}

/* Post image and missing image placeholder */
.post-image-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  margin: 12px 0;
  background: #12121A;
  border: 1px solid var(--border-subtle);
}

.post-image-wrap img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.image-placeholder {
  min-height: 180px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(226, 0, 26, 0.18), rgba(47, 128, 237, 0.18));
  color: var(--text-main);
}

/* Timer bar */
.timer-bar-wrap {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 14px;
}

.timer-bar-fill {
  height: 100%;
  background: var(--persona-accent, var(--ibis-red));
  box-shadow: 0 0 10px var(--persona-glow, var(--ibis-red-glow));
  transition: width 0.2s linear;
}

/* Modal / Drawer Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 10, 0.85);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 420px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1.5px solid var(--persona-accent, var(--border-subtle));
  border-radius: 20px;
  padding: 20px;
}

.hidden {
  display: none !important;
}

/* ==========================================
   PROJECTOR SCREEN (16:9, 1920x1080 & 1366x768)
   ========================================== */
.stage-3d-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  perspective: 750px;
}

.stage-led-wall {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 9%;
  height: 56%;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(226, 0, 26, 0.16) 0%, rgba(47, 128, 237, 0.1) 50%, transparent 80%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 2px, transparent 2px, transparent 6px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 2px, transparent 2px, transparent 6px);
  border: 1px solid rgba(226, 0, 26, 0.24);
  box-shadow: 0 0 60px rgba(226, 0, 26, 0.15), inset 0 0 50px rgba(47, 128, 237, 0.12);
  transition: transform 0.14s ease-out, box-shadow 0.14s ease-out, border-color 0.14s ease-out;
}

.stage-3d-bg.beat-pulse .stage-led-wall {
  border-color: rgba(255, 79, 163, 0.55);
  box-shadow: 0 0 95px rgba(226, 0, 26, 0.42), inset 0 0 70px rgba(255, 79, 163, 0.26);
  transform: scale(1.008);
}

.stage-spotlights {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.spotlight-beam {
  position: absolute;
  top: -15%;
  width: 38vw;
  height: 125vh;
  transform-origin: 50% 0%;
  mix-blend-mode: screen;
  opacity: 0.48;
  transition: opacity 0.12s ease-out;
}

.stage-3d-bg.beat-pulse .spotlight-beam {
  opacity: 0.82;
}

.spotlight-beam.beam-1 {
  left: 8%;
  background: radial-gradient(ellipse at 50% 0%, rgba(226, 0, 26, 0.34) 0%, rgba(226, 0, 26, 0.08) 45%, transparent 75%);
  clip-path: polygon(46% 0%, 54% 0%, 100% 100%, 0% 100%);
  animation: sweepBeam1 9s ease-in-out infinite alternate;
}

.spotlight-beam.beam-2 {
  left: 31%;
  background: radial-gradient(ellipse at 50% 0%, rgba(47, 128, 237, 0.3) 0%, rgba(47, 128, 237, 0.07) 45%, transparent 75%);
  clip-path: polygon(46% 0%, 54% 0%, 100% 100%, 0% 100%);
  animation: sweepBeam2 11s ease-in-out infinite alternate;
}

.spotlight-beam.beam-3 {
  right: 8%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 79, 163, 0.32) 0%, rgba(255, 79, 163, 0.07) 45%, transparent 75%);
  clip-path: polygon(46% 0%, 54% 0%, 100% 100%, 0% 100%);
  animation: sweepBeam3 8.5s ease-in-out infinite alternate;
}

@keyframes sweepBeam1 {
  0% { transform: rotate(-22deg); }
  100% { transform: rotate(16deg); }
}
@keyframes sweepBeam2 {
  0% { transform: rotate(18deg); }
  100% { transform: rotate(-18deg); }
}
@keyframes sweepBeam3 {
  0% { transform: rotate(20deg); }
  100% { transform: rotate(-20deg); }
}

.stage-floor-perspective {
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: -18%;
  height: 55%;
  perspective: 450px;
  transform-style: preserve-3d;
}

.stage-floor-grid {
  width: 100%;
  height: 100%;
  transform-origin: 50% 0%;
  transform: rotateX(70deg);
  background-image:
    linear-gradient(to right, rgba(226, 0, 26, 0.26) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(47, 128, 237, 0.28) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.85) 35%, rgba(0, 0, 0, 1) 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.85) 35%, rgba(0, 0, 0, 1) 100%);
  animation: floorGridMove 2.8s linear infinite;
}

.stage-3d-bg.beat-pulse .stage-floor-grid {
  filter: brightness(1.45);
}

@keyframes floorGridMove {
  0% { background-position: 0 0; }
  100% { background-position: 0 64px; }
}

#stage-haze-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Floating Emoji Reactions Layer on Screen */
.reactions-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 88;
  overflow: hidden;
}

.floating-reaction {
  position: absolute;
  bottom: -60px;
  font-size: 2.8rem;
  will-change: transform, opacity;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
  animation: reactionFloatUp var(--dur, 3.2s) cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes reactionFloatUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(calc(var(--depth, 1) * 0.5));
  }
  12% {
    opacity: 1;
    transform: translate3d(calc(var(--wobble, 24px) * -0.5), -12vh, 0) scale(var(--depth, 1));
  }
  45% {
    transform: translate3d(var(--wobble, 24px), -45vh, 0) scale(var(--depth, 1)) rotate(8deg);
  }
  75% {
    opacity: 0.92;
    transform: translate3d(calc(var(--wobble, 24px) * -0.6), -76vh, 0) scale(var(--depth, 1)) rotate(-8deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, -102vh, 0) scale(calc(var(--depth, 1) * 0.85));
  }
}

.screen-shell {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.2vh 3.2vw;
  position: relative;
  z-index: 5;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.screen-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.screen-badge-red {
  background: var(--ibis-red);
  color: #fff;
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 10px;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  box-shadow: 0 0 20px var(--ibis-red-glow);
}

.screen-corner-qr {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(23, 23, 31, 0.9);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: 14px;
}

.screen-corner-qr img {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  background: #fff;
}

.screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 1.5vh 0;
  z-index: 5;
}

/* Lobby layout & Mini 3D Key Cards flying in */
.lobby-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 3vw;
  align-items: center;
  height: 100%;
}

.lobby-qr-card {
  background: rgba(23, 23, 31, 0.92);
  border: 2px solid var(--ibis-red);
  border-radius: 24px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 35px rgba(226, 0, 26, 0.25);
}

.lobby-qr-card img {
  width: 240px;
  height: 240px;
  border-radius: 16px;
  background: #fff;
  padding: 8px;
  margin: 14px auto;
  display: block;
}

.persona-quad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8vh 1.8vw;
  perspective: 1000px;
}

.persona-group-card {
  background: rgba(23, 23, 31, 0.88);
  border: 2px solid var(--border-subtle);
  border-radius: 20px;
  padding: 16px 20px;
  min-height: 175px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform-style: preserve-3d;
}

.avatar-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  perspective: 800px;
}

.mini-keycard-3d {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 9px;
  background: linear-gradient(135deg, #252536 0%, #151520 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  transform-style: preserve-3d;
}

.mini-keycard-3d .mini-key-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mini-keycard-3d .mini-key-room {
  font-size: 0.72rem;
  color: #F2C94C;
  font-weight: 900;
}

.mini-keycard-3d.fly-in-3d {
  animation: miniKeycardFlyIn 0.68s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes miniKeycardFlyIn {
  0% {
    opacity: 0;
    transform: translate3d(0, -90px, 260px) rotateX(55deg) rotateY(-35deg) scale(1.75);
  }
  70% {
    opacity: 1;
    transform: translate3d(0, 6px, 20px) rotateX(-8deg) rotateY(5deg) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg) scale(1);
  }
}

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Question 3D Entrance & LED Wall Card */
.question-stage-header {
  perspective: 1100px;
}

.led-question-card {
  background: linear-gradient(180deg, rgba(28, 28, 40, 0.92) 0%, rgba(18, 18, 26, 0.92) 100%);
  border: 2px solid rgba(226, 0, 26, 0.45);
  border-radius: 22px;
  padding: 18px 26px;
  margin-bottom: 1.6vh;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55), 0 0 40px rgba(226, 0, 26, 0.2);
  transform-origin: 50% 0%;
  transform-style: preserve-3d;
}

.led-question-card.flip-in-question {
  animation: questionFlipIn 0.62s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes questionFlipIn {
  0% {
    opacity: 0;
    transform: perspective(1000px) rotateX(-90deg) translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) rotateX(0deg) translateY(0);
  }
}

.screen-question-title {
  font-size: clamp(1.9rem, 3.1vw, 3.3rem);
  font-weight: 900;
  line-height: 1.16;
  text-shadow: 0 2px 18px rgba(226, 0, 26, 0.35);
}

.option-stagger-in {
  opacity: 0;
  animation: optionDropStagger 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--stagger-idx, 0) * 95ms);
}

@keyframes optionDropStagger {
  0% {
    opacity: 0;
    transform: perspective(800px) translateY(-34px) rotateX(28deg) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: perspective(800px) translateY(0) rotateX(0deg) scale(1);
  }
}

/* 3D Result Bars */
.screen-bars-list {
  display: flex;
  flex-direction: column;
  gap: 1.8vh;
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  perspective: 1100px;
  transform-style: preserve-3d;
}

.screen-bar-row {
  background: rgba(23, 23, 31, 0.9);
  border: 2px solid var(--border-subtle);
  border-radius: 16px;
  padding: 15px 22px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease, border-color 0.4s ease, box-shadow 0.45s ease;
}

.screen-bar-row.correct-highlight,
.screen-bar-row.is-correct {
  border-color: var(--persona-green);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.6), 0 0 34px rgba(39, 174, 96, 0.55);
  transform: translateZ(34px) scale(1.02);
  z-index: 4;
}

.screen-bar-row.is-dimmed {
  opacity: 0.42;
  transform: translateZ(-16px) scale(0.985);
  filter: saturate(0.55) brightness(0.8);
}

/* 3D Box Prism inside Result Bar */
.bar-3d-prism {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  transform-style: preserve-3d;
  transition: width 0.68s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
  pointer-events: none;
}

.bar-face-front {
  position: absolute;
  inset: 0;
  border-radius: 14px 4px 4px 14px;
  background: linear-gradient(90deg, rgba(226, 0, 26, 0.42) 0%, rgba(255, 79, 163, 0.48) 100%);
  box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.22);
}

.bar-face-top {
  position: absolute;
  left: 6px;
  right: 0;
  top: -8px;
  height: 8px;
  transform-origin: bottom;
  transform: skewX(-35deg);
  background: linear-gradient(90deg, rgba(255, 110, 140, 0.55), rgba(255, 160, 210, 0.65));
  border-radius: 4px 4px 0 0;
}

.bar-face-side {
  position: absolute;
  top: -4px;
  right: -8px;
  bottom: 4px;
  width: 8px;
  transform: skewY(-45deg);
  background: rgba(160, 0, 20, 0.72);
  border-radius: 0 3px 3px 0;
}

.screen-bar-row.correct-highlight .bar-face-front,
.screen-bar-row.is-correct .bar-face-front {
  background: linear-gradient(90deg, rgba(39, 174, 96, 0.48) 0%, rgba(86, 232, 144, 0.58) 100%);
}

.screen-bar-row.correct-highlight .bar-face-top,
.screen-bar-row.is-correct .bar-face-top {
  background: linear-gradient(90deg, rgba(86, 232, 144, 0.65), rgba(160, 255, 195, 0.75));
}

.screen-bar-row.correct-highlight .bar-face-side,
.screen-bar-row.is-correct .bar-face-side {
  background: rgba(22, 115, 62, 0.85);
}

.screen-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(226, 0, 26, 0.28);
  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}

.screen-bar-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: clamp(1.25rem, 1.9vw, 1.9rem);
  font-weight: 900;
}

.persona-split-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 2;
}

.persona-split-segment {
  height: 100%;
  transition: width 0.6s ease;
}

/* 3D Rotating Word Cloud Tag Sphere */
.wordcloud-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 50%, rgba(34, 34, 52, 0.75) 0%, rgba(18, 18, 26, 0.9) 100%);
  border: 1.5px solid var(--border-subtle);
  border-radius: 26px;
  min-height: 48vh;
  overflow: hidden;
  perspective: 950px;
}

.wordcloud-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.2vw;
}

.tag-sphere-3d {
  position: relative;
  width: 100%;
  height: 44vh;
  transform-style: preserve-3d;
}

.sphere-word-tag {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  white-space: nowrap;
  font-weight: 900;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  will-change: transform, opacity;
  pointer-events: none;
}

/* 3D Podium & Shake Energy Meter */
.podium-stage-wrapper {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2.5vw;
  align-items: center;
  height: 60vh;
  max-width: 1460px;
  margin: 0 auto;
  width: 100%;
}

.podium-3d-scene {
  perspective: 1200px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3vh;
}

.podium-3d-camera {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2.8vw;
  transform-style: preserve-3d;
  animation: podiumCameraOrbit 7.5s ease-in-out infinite alternate;
}

@keyframes podiumCameraOrbit {
  0% { transform: rotateX(-7deg) rotateY(-15deg); }
  100% { transform: rotateX(-7deg) rotateY(15deg); }
}

.podium-column {
  width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-style: preserve-3d;
  transition: opacity 0.55s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.podium-winner-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-style: preserve-3d;
  transform: translateZ(20px);
}

.podium-winner-drop.bounce-drop {
  animation: winnerDropBounce 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes winnerDropBounce {
  0% {
    opacity: 0;
    transform: translate3d(0, -180px, 20px) scale(0.6);
  }
  50% {
    opacity: 1;
    transform: translate3d(0, 8px, 20px) scale(1.08, 0.92);
  }
  72% {
    transform: translate3d(0, -18px, 20px) scale(0.97, 1.03);
  }
  88% {
    transform: translate3d(0, 4px, 20px) scale(1.02, 0.98);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 20px) scale(1);
  }
}

.podium-cube-3d {
  width: 220px;
  position: relative;
  transform-style: preserve-3d;
  transform-origin: bottom center;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.podium-1 .podium-cube-3d { height: 280px; --cube-color: rgba(242, 201, 76, 0.42); --cube-border: #F2C94C; }
.podium-2 .podium-cube-3d { height: 215px; --cube-color: rgba(189, 195, 199, 0.36); --cube-border: #BDC3C7; }
.podium-3 .podium-cube-3d { height: 165px; --cube-color: rgba(230, 126, 34, 0.36); --cube-border: #E67E22; }

.cube-face {
  position: absolute;
  inset: 0;
  border: 2px solid var(--cube-border, #F2C94C);
  backface-visibility: visible;
}

.cube-face-front {
  transform: translateZ(45px);
  background: linear-gradient(180deg, var(--cube-color), rgba(20, 20, 28, 0.96));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 22px;
  font-weight: 900;
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.5);
}

.cube-face-back {
  transform: translateZ(-45px) rotateY(180deg);
  background: rgba(16, 16, 22, 0.92);
}

.cube-face-left {
  width: 90px;
  left: -45px;
  transform: rotateY(-90deg);
  background: linear-gradient(180deg, var(--cube-color), rgba(14, 14, 20, 0.96));
  filter: brightness(0.82);
}

.cube-face-right {
  width: 90px;
  left: auto;
  right: -45px;
  transform: rotateY(90deg);
  background: linear-gradient(180deg, var(--cube-color), rgba(14, 14, 20, 0.96));
  filter: brightness(0.7);
}

.cube-face-top {
  height: 90px;
  top: -45px;
  bottom: auto;
  transform: rotateX(90deg);
  background: var(--cube-color);
  filter: brightness(1.3);
  box-shadow: 0 0 24px var(--cube-color);
}

/* Vertical Shake Energy Meter on Screen */
.shake-meter-wrap {
  background: rgba(23, 23, 31, 0.92);
  border: 2px solid var(--border-subtle);
  border-radius: 22px;
  padding: 18px 16px;
  height: 52vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.shake-meter-wrap.meter-maxed {
  border-color: #F2C94C;
  box-shadow: 0 0 42px rgba(242, 201, 76, 0.65);
}

.shake-meter-tube {
  width: 54px;
  flex: 1;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.shake-meter-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(0deg, #E2001A 0%, #F2994A 45%, #F2C94C 78%, #27AE60 100%);
  box-shadow: 0 0 24px rgba(242, 201, 76, 0.75);
  transition: height 0.22s ease-out;
  border-radius: 999px;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}

/* Screen Overlays (Leaderboard, Team Battle & Q&A) */
.screen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.94);
  backdrop-filter: blur(10px);
  z-index: 80;
  padding: 3.5vh 4.2vw;
  display: flex;
  flex-direction: column;
}

.leaderboard-split-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 2.6vw;
  flex: 1;
  min-height: 0;
  margin-top: 2vh;
  align-items: stretch;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
  align-content: start;
  perspective: 900px;
}

.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 1.28rem;
  font-weight: 900;
  will-change: transform;
}

.lb-row.lb-flip-in {
  animation: lbRowFlipIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--row-idx, 0) * 55ms);
}

@keyframes lbRowFlipIn {
  0% {
    opacity: 0;
    transform: perspective(700px) rotateX(-90deg);
  }
  100% {
    opacity: 1;
    transform: perspective(700px) rotateX(0deg);
  }
}

.lb-delta-up {
  color: #27AE60;
  font-size: 0.95rem;
  margin-left: 8px;
  font-weight: 900;
}

.lb-delta-down {
  color: #E2001A;
  font-size: 0.95rem;
  margin-left: 8px;
  font-weight: 900;
}

/* 3D Team Battle Towers */
.team-battle-panel {
  background: rgba(23, 23, 31, 0.9);
  border: 1.5px solid var(--border-subtle);
  border-radius: 22px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.team-towers-stage {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: end;
  width: 100%;
  height: 42vh;
  padding: 24px 12px 8px;
  perspective: 900px;
}

#auto-team-battle-stage,
#auto-team-battle-stage > div {
  width: 100%;
}

#auto-team-battle-stage .tower-3d-prism {
  width: 120px;
}

.team-tower-col > *:first-child {
  white-space: nowrap;
}

.team-tower-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  transform-style: preserve-3d;
}

.tower-3d-prism {
  width: 66px;
  min-height: 22px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-8deg) rotateY(-22deg);
  transition: height 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.tower-face-front {
  position: absolute;
  inset: 0;
  border-radius: 6px 6px 0 0;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.45);
}

.tower-face-top {
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
  transform-origin: bottom;
  transform: skewX(-40deg);
  filter: brightness(1.28);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.tower-face-side {
  position: absolute;
  top: -6px;
  right: -14px;
  bottom: 0;
  width: 14px;
  transform: skewY(-40deg);
  filter: brightness(0.72);
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.team-battle-auto-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 16, 0.84);
  backdrop-filter: blur(8px);
  z-index: 78;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 6vw;
  animation: popIn 0.32s ease forwards;
}

.team-battle-auto-card {
  width: 100%;
  max-width: 1080px;
  background: var(--bg-card);
  border: 2px solid var(--ibis-red);
  border-radius: 26px;
  padding: 28px 34px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 42px rgba(226, 0, 26, 0.3);
}

@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================
   HOST DASHBOARD
   ========================================== */
.host-layout {
  display: grid;
  grid-template-columns: 300px 1fr 380px;
  min-height: 100vh;
  gap: 16px;
  padding: 16px;
}

@media (max-width: 1100px) {
  .host-layout {
    grid-template-columns: 1fr;
  }
}

.host-col {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.host-act-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.host-act-item.active {
  border-color: var(--ibis-red);
  background: rgba(226, 0, 26, 0.2);
}

.state-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.state-ready { background: #3A3A4A; color: #ccc; }
.state-open { background: #27AE60; color: #fff; }
.state-closed { background: #F2994A; color: #fff; }
.state-revealed { background: #2F80ED; color: #fff; }

.screen-preview-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 2px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
  background: #000;
}

.screen-preview-frame iframe {
  width: 1920px;
  height: 1080px;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

/* ==========================================
   STAGE AUDIO UNLOCK & PRESENTER CONTROLS
   ========================================== */
.screen-speaker-btn {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.screen-speaker-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--bg-elevated);
}

.screen-speaker-btn.muted {
  opacity: 0.65;
  border-color: rgba(226, 0, 26, 0.5);
}

.audio-unlock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(6px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.audio-unlock-btn {
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 900;
  padding: 24px 48px;
  border-radius: 20px;
  box-shadow: 0 12px 42px rgba(226, 0, 26, 0.6);
  letter-spacing: 0.02em;
}

.presenter-controls {
  position: fixed;
  right: 2.2vw;
  bottom: 4.2vh;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.9;
  transition: opacity 0.45s ease;
}

.presenter-controls.idle-fade {
  opacity: 0.2;
}

.presenter-controls:hover {
  opacity: 1;
}

.presenter-nav-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(23, 23, 31, 0.78);
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.presenter-nav-btn:hover {
  background: rgba(42, 42, 58, 0.92);
  border-color: rgba(255, 255, 255, 0.55);
}

.presenter-nav-btn:active {
  transform: scale(0.94);
}

.presenter-nav-next {
  background: rgba(226, 0, 26, 0.82);
  border-color: rgba(255, 255, 255, 0.4);
}

.presenter-nav-next:hover {
  background: rgba(255, 20, 48, 0.95);
}

.presenter-hint {
  position: fixed;
  left: 50%;
  bottom: 0.8vh;
  transform: translateX(-50%);
  z-index: 95;
  background: rgba(14, 14, 18, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 5px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.45s ease;
}

.presenter-hint.idle-fade {
  opacity: 0;
}

.predict-prompt-card {
  background: rgba(23, 23, 31, 0.96);
  border: 2px solid #F2C94C;
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.predict-prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.predict-choice-btn {
  min-height: 60px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.16s ease;
}

.predict-choice-btn:hover {
  border-color: #F2C94C;
  background: rgba(242, 201, 76, 0.14);
}

.predict-choice-btn.selected {
  border-color: var(--persona-green);
  background: rgba(39, 174, 96, 0.25);
  box-shadow: 0 0 20px rgba(39, 174, 96, 0.35);
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .stage-floor-grid,
  .spotlight-beam,
  .podium-3d-camera,
  .shake-phone-icon,
  .keycard.flip-entrance,
  .led-question-card.flip-in-question,
  .option-stagger-in,
  .mini-keycard-3d.fly-in-3d,
  .podium-winner-drop.bounce-drop,
  .lb-row.lb-flip-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
