/* Portal Room — faux-3D LED slice viewer */

.portal-page {
  --portal-void: #070b14;
  --portal-glow: rgba(96, 165, 250, 0.35);
  --portal-bezel: #0c1424;
  --portal-edge: rgba(143, 164, 200, 0.35);
}

.portal-main {
  padding-bottom: 40px;
}

.portal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.portal-status {
  flex: 0 0 auto;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--portal-edge);
  background: rgba(14, 22, 38, 0.9);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portal-status.is-live {
  color: #fff;
  border-color: rgba(255, 80, 80, 0.55);
  background: rgba(80, 16, 24, 0.85);
  box-shadow: 0 0 18px rgba(255, 60, 60, 0.2);
}

.portal-status.is-error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.5);
}

.portal-stage-wrap {
  margin: 12px 0 16px;
  border: 1px solid rgba(143, 164, 200, 0.22);
  background:
    linear-gradient(180deg, rgba(5, 8, 16, 0.18), rgba(5, 8, 16, 0.35)),
    url('/assets/denfur/portal-room-bg.webp') center / cover no-repeat;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}

.portal-stage {
  position: relative;
  height: min(62vh, 640px);
  min-height: 360px;
  perspective: 1100px;
  perspective-origin: 50% 48%;
  overflow: hidden;
}

.portal-room {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3px; /* hard buffer — screens must not overlap */
  padding: 0 2%;
  box-sizing: border-box;
}

.portal-ceiling,
.portal-floor {
  /* Real room plate comes from portal-room-bg.webp — keep faux planes subtle */
  opacity: 0.22;
  pointer-events: none;
}

.portal-ceiling {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 6%;
  height: 18%;
  transform: rotateX(-78deg) translateZ(-40px);
  transform-origin: center top;
  background: linear-gradient(180deg, rgba(10, 16, 28, 0.35), transparent);
  border-bottom: 1px solid rgba(143, 164, 200, 0.08);
}

.portal-floor {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 4%;
  height: 34%;
  transform: rotateX(76deg) translateZ(-20px);
  transform-origin: center bottom;
  background: linear-gradient(180deg, transparent, rgba(5, 8, 16, 0.45));
  box-shadow: none;
}

.portal-wall {
  position: relative;
  top: auto;
  left: auto;
  flex: 0 0 auto;
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 1;
}

/* Soft float — screens gently hover in place */
@keyframes portalFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -5px, 0); }
}
@keyframes portalFloatLeft {
  0%, 100% { transform: rotateY(var(--portal-yaw, 34deg)) translate3d(0, 0, 0); }
  50% { transform: rotateY(var(--portal-yaw, 34deg)) translate3d(0, -5px, 0); }
}
@keyframes portalFloatRight {
  0%, 100% { transform: rotateY(calc(var(--portal-yaw, 34deg) * -1)) translate3d(0, 0, 0); }
  50% { transform: rotateY(calc(var(--portal-yaw, 34deg) * -1)) translate3d(0, -5px, 0); }
}
@keyframes portalFloatStack {
  0%, 100% { transform: translateZ(36px) translate3d(0, 0, 0); }
  50% { transform: translateZ(36px) translate3d(0, -4px, 0); }
}

/* Hinge sides on the edge facing center so they angle like room walls
   without sliding under the middle screen. */
.portal-wall-left {
  transform: rotateY(var(--portal-yaw, 34deg));
  transform-origin: right center;
  z-index: 1;
  animation: portalFloatLeft 5.2s ease-in-out infinite;
}

.portal-wall-right {
  transform: rotateY(calc(var(--portal-yaw, 34deg) * -1));
  transform-origin: left center;
  z-index: 1;
  animation: portalFloatRight 5.8s ease-in-out infinite;
  animation-delay: -1.4s;
}

.portal-center-stack {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  z-index: 2;
  transform: translateZ(36px);
  animation: portalFloatStack 6.4s ease-in-out infinite;
  animation-delay: -0.7s;
}

.portal-wall-center {
  /* No scale() — scaling would grow into the 3px buffer and hide side screens */
  transform: none;
  z-index: 2;
}

.portal-wall-under {
  transform: none;
  z-index: 2;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .portal-wall-left,
  .portal-wall-right,
  .portal-center-stack {
    animation: none !important;
  }
}

.portal-bezel {
  width: min(30vw, 360px);
  aspect-ratio: 16 / 9;
  padding: 7px;
  border-radius: 10px;
  background:
    linear-gradient(160deg, rgba(40, 56, 86, 0.95), rgba(10, 16, 28, 0.98));
  border: 1px solid var(--portal-edge);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 28px rgba(56, 120, 220, 0.12);
  display: grid;
  overflow: hidden;
  transition: box-shadow 0.35s ease;
}
.portal-wall-left .portal-bezel,
.portal-wall-right .portal-bezel,
.portal-center-stack .portal-bezel {
  animation: portalGlowPulse 5.6s ease-in-out infinite;
}
@keyframes portalGlowPulse {
  0%, 100% {
    box-shadow:
      0 16px 36px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(255, 255, 255, 0.04) inset,
      0 0 28px rgba(56, 120, 220, 0.12);
  }
  50% {
    box-shadow:
      0 20px 42px rgba(0, 0, 0, 0.48),
      0 0 0 1px rgba(255, 255, 255, 0.05) inset,
      0 0 34px rgba(96, 165, 250, 0.2);
  }
}

.portal-bezel-center {
  width: min(44vw, 540px);
  padding: 8px;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 40px rgba(96, 165, 250, 0.22);
}

.portal-bezel-under {
  width: 100%; /* match center stack width */
  max-width: min(44vw, 540px);
  aspect-ratio: 32 / 9;
  padding: 6px;
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 24px rgba(250, 204, 21, 0.14);
}

.portal-screen {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: 4px;
  background: #05080f;
  object-fit: cover;
}

.portal-wall-label {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(203, 213, 225, 0.7);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.portal-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  gap: 12px;
  background: rgba(5, 10, 20, 0.55);
  backdrop-filter: blur(2px);
  text-align: center;
  color: #e2e8f0;
  font-weight: 800;
}

.portal-overlay[hidden] {
  display: none !important;
}

.portal-play-orb {
  width: 74px;
  height: 74px;
  margin: 0 auto;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #3d5f9a, #1a2740);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 24px rgba(61, 95, 154, 0.35);
}

.portal-play-orb:hover {
  transform: scale(1.04);
}

.portal-source-video {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: 0;
}

.portal-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(143, 164, 200, 0.28);
  background: rgba(26, 39, 64, 0.92);
  color: #f1f5f9;
  font: inherit;
  font-weight: 850;
  font-size: 0.86rem;
  text-decoration: none;
  cursor: pointer;
}

.portal-btn:hover {
  border-color: rgba(143, 164, 200, 0.5);
  background: rgba(40, 58, 92, 0.95);
}

.portal-btn.ghost {
  background: transparent;
}

/* Debug tuner */
.portal-debug-panel {
  margin-top: 8px;
  border: 1px solid rgba(143, 164, 200, 0.28);
  background: rgba(14, 20, 34, 0.94);
  padding: 14px;
}

.portal-debug-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.portal-debug-head strong {
  font-size: 1.05rem;
}

.portal-debug-head span {
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
}

.portal-debug-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 14px;
}

.portal-debug-map-wrap {
  position: relative;
  border: 1px solid rgba(143, 164, 200, 0.2);
  background: #000;
  overflow: hidden;
}

.portal-debug-map,
.portal-debug-overlay {
  display: block;
  width: 100%;
  height: auto;
}

.portal-debug-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.portal-debug-fields {
  display: grid;
  gap: 10px;
  align-content: start;
}

.portal-debug-card {
  border: 1px solid rgba(143, 164, 200, 0.2);
  background: rgba(8, 12, 22, 0.8);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.portal-debug-card h3 {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.portal-debug-row {
  display: grid;
  grid-template-columns: 28px 1fr 64px;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 750;
  color: #cbd5e1;
}

.portal-debug-row input[type="range"] {
  width: 100%;
}

.portal-debug-row input[type="number"] {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(143, 164, 200, 0.25);
  border-radius: 6px;
  background: #0a101c;
  color: #fff;
  padding: 0 6px;
  font: inherit;
}

.portal-debug-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.portal-debug-hint {
  margin: 12px 0 0;
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.4;
  font-weight: 650;
}

.portal-debug-hint code {
  color: #7dd3fc;
}

@media (max-width: 900px) {
  .portal-stage {
    height: min(62vh, 560px);
    perspective: 900px;
  }
  .portal-room { gap: 3px; }
  .portal-bezel {
    width: min(28vw, 240px);
  }
  .portal-bezel-center,
  .portal-bezel-under {
    width: min(42vw, 340px);
    max-width: min(42vw, 340px);
  }
  .portal-debug-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .portal-stage {
    min-height: 320px;
    height: 56vh;
  }
  .portal-room { gap: 3px; padding: 0 1%; }
  .portal-wall-label { display: none; }
  .portal-bezel {
    width: min(26vw, 150px);
    padding: 4px;
  }
  .portal-bezel-center,
  .portal-bezel-under {
    width: min(42vw, 220px);
    max-width: min(42vw, 220px);
  }
  .portal-btn span {
    display: none;
  }
  .portal-btn {
    min-width: 44px;
    justify-content: center;
    padding: 0 12px;
  }
}

/* Fullscreen experience shell */
.portal-experience {
  position: relative;
}
.portal-fs-brand {
  display: none;
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 40;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.portal-fs-logo {
  display: block;
  text-decoration: none;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .55));
}
.portal-fs-logo img {
  display: block;
  height: clamp(48px, 8vh, 84px);
  width: auto;
  max-width: min(42vw, 360px);
  object-fit: contain;
}
.portal-fs-right {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 40;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.portal-fs-scan {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(143, 164, 200, .35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.portal-fs-scan img {
  display: block;
  width: clamp(112px, 14vh, 168px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.portal-fs-exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(143, 164, 200, .35);
  background: rgba(8, 12, 22, .82);
  color: #fff;
  font: inherit;
  font-weight: 850;
  font-size: .86rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}
.portal-fs-exit:hover {
  background: rgba(20, 30, 48, .92);
  border-color: rgba(143, 164, 200, .55);
}
.portal-fs-zoom {
  display: none;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(143, 164, 200, .35);
  background: rgba(8, 12, 22, .82);
  color: #e2e8f0;
  font: inherit;
  font-weight: 850;
  font-size: .82rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  cursor: default;
}
.portal-fs-zoom input[type="range"] {
  width: min(28vw, 220px);
  accent-color: #7dd3fc;
  cursor: pointer;
}
.portal-fs-zoom-pct {
  min-width: 3.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #7dd3fc;
}
.portal-fs-chat-pop {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  z-index: 45;
  width: min(720px, 86vw);
  pointer-events: none;
  opacity: 0;
}
.portal-fs-chat-pop.is-on {
  display: block;
  animation: portalChatPop 4s ease forwards;
}
.portal-fs-chat-pop-card {
  padding: 22px 26px;
  border-radius: 16px;
  border: 1px solid rgba(125, 211, 252, .35);
  background: rgba(8, 12, 22, .88);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, .55),
    0 0 40px rgba(56, 120, 220, .22);
  backdrop-filter: blur(10px);
  text-align: center;
}
.portal-fs-chat-pop-card strong {
  display: block;
  margin-bottom: 8px;
  color: #7dd3fc;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 950;
  letter-spacing: .02em;
}
.portal-fs-chat-pop-card span {
  display: block;
  color: #f1f5f9;
  font-size: clamp(1.35rem, 3.2vw, 2.1rem);
  font-weight: 800;
  line-height: 1.3;
  word-break: break-word;
}
@keyframes portalChatPop {
  0% { opacity: 0; transform: translateX(-50%) translateY(18px) scale(0.96); }
  12% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  72% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.98); }
}

/* Party Mode DJ lower thirds */
.portal-fs-lt {
  display: none;
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 64px;
  z-index: 42;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}
.portal-fs-lt-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: min(420px, 38vw);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(143, 164, 200, .28);
  background: rgba(8, 12, 22, .86);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .5);
  backdrop-filter: blur(10px);
}
.portal-fs-lt-now {
  margin-left: auto;
  border-color: rgba(125, 211, 252, .4);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, .5),
    0 0 28px rgba(56, 120, 220, .18);
}
.portal-fs-lt-kicker {
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.portal-fs-lt-next .portal-fs-lt-kicker { color: #fde68a; }
.portal-fs-lt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.portal-fs-lt-logo {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(143, 164, 200, .25);
}
.portal-fs-lt-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portal-fs-lt-copy { min-width: 0; }
.portal-fs-lt-name {
  color: #f8fafc;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 950;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-fs-lt-time {
  margin-top: 3px;
  color: rgba(226, 232, 240, .75);
  font-size: .82rem;
  font-weight: 750;
}
.portal-fs-ticker {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 0;
  min-height: 48px;
  padding: 0 14px;
  border-top: 1px solid rgba(143, 164, 200, .22);
  background: rgba(6, 10, 18, .94);
  overflow: hidden;
}
.portal-fs-ticker-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #7dd3fc;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.portal-fs-ticker-track {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.portal-fs-ticker-inner {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
  will-change: transform;
  animation: portalTicker 42s linear infinite;
  color: #e2e8f0;
  font-size: .95rem;
  font-weight: 750;
}
.portal-fs-ticker-inner .tick-name {
  color: #7dd3fc;
  font-weight: 900;
}
.portal-fs-ticker-inner .tick-sep {
  color: rgba(143, 164, 200, .45);
}
@keyframes portalTicker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.portal-experience:fullscreen,
.portal-experience:-webkit-full-screen {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(5, 8, 16, 0.2), rgba(5, 8, 16, 0.4)),
    url('/assets/denfur/portal-room-bg.webp') center / cover no-repeat;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.portal-experience:fullscreen .portal-fs-brand,
.portal-experience:-webkit-full-screen .portal-fs-brand {
  display: flex;
  position: fixed;
}
.portal-experience:fullscreen .portal-fs-right,
.portal-experience:-webkit-full-screen .portal-fs-right {
  display: flex;
  position: fixed;
}
.portal-experience:fullscreen .portal-fs-zoom,
.portal-experience:-webkit-full-screen .portal-fs-zoom {
  display: inline-flex;
  position: fixed;
}
.portal-experience:fullscreen .portal-fs-chat-pop.is-on,
.portal-experience:-webkit-full-screen .portal-fs-chat-pop.is-on {
  display: block;
  position: fixed;
  bottom: 22%;
}
.portal-experience:fullscreen .portal-fs-lt,
.portal-experience:-webkit-full-screen .portal-fs-lt {
  display: flex;
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex: 0 0 auto;
  order: 2; /* directly above control bar */
  z-index: 6;
  margin: 0;
  padding: 10px 16px 8px;
  background: linear-gradient(180deg, transparent, rgba(5, 8, 16, .55));
}
.portal-experience:fullscreen .portal-room,
.portal-experience:-webkit-full-screen .portal-room {
  transform: scale(var(--portal-room-zoom, 1));
  transform-origin: center center;
  transition: transform 0.12s ease-out;
}
.portal-experience:fullscreen .portal-fs-ticker,
.portal-experience:-webkit-full-screen .portal-fs-ticker {
  display: flex;
  flex: 0 0 auto;
  order: 4;
}
.portal-experience:fullscreen .portal-stage-wrap,
.portal-experience:-webkit-full-screen .portal-stage-wrap {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  order: 1;
}
.portal-experience:fullscreen .portal-stage,
.portal-experience:-webkit-full-screen .portal-stage {
  height: 100%;
  min-height: 100%;
  perspective: 1400px;
}
.portal-experience:fullscreen .portal-player-controls,
.portal-experience:-webkit-full-screen .portal-player-controls {
  flex: 0 0 auto;
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  order: 3; /* below DJ lower thirds */
  z-index: 5;
}
.portal-experience:fullscreen .portal-live-chat,
.portal-experience:-webkit-full-screen .portal-live-chat,
.portal-experience:fullscreen .portal-below,
.portal-experience:-webkit-full-screen .portal-below,
.portal-experience:fullscreen .portal-vrc-invite,
.portal-experience:-webkit-full-screen .portal-vrc-invite {
  display: none !important; /* keep Party Mode clean — no chat/group add-on */
}
.portal-experience:fullscreen .portal-wall-label,
.portal-experience:-webkit-full-screen .portal-wall-label {
  display: none;
}
.portal-experience:fullscreen .portal-bezel,
.portal-experience:-webkit-full-screen .portal-bezel {
  width: min(30vw, 560px);
}
.portal-experience:fullscreen .portal-bezel-center,
.portal-experience:-webkit-full-screen .portal-bezel-center {
  width: min(48vw, 920px);
}
.portal-experience:fullscreen .portal-bezel-under,
.portal-experience:-webkit-full-screen .portal-bezel-under {
  width: 100%;
  max-width: min(48vw, 920px);
}
.portal-experience:fullscreen .portal-room,
.portal-experience:-webkit-full-screen .portal-room {
  padding: 0 1.5%;
  gap: 3px;
}
.portal-experience:fullscreen .portal-ceiling,
.portal-experience:fullscreen .portal-floor,
.portal-experience:-webkit-full-screen .portal-ceiling,
.portal-experience:-webkit-full-screen .portal-floor {
  opacity: .55;
}

/* —— Homepage-matching player chrome + live chat (portal) —— */
.portal-player-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 12px 0 0;
  padding: 12px 14px 13px;
  border-radius: 12px;
  border: 1px solid rgba(168, 190, 230, .16);
  background: linear-gradient(180deg, rgba(36, 48, 72, .92), rgba(18, 26, 42, .96));
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}
.portal-player-controls .control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  font-weight: 900;
  font-size: .86rem;
}
.portal-player-controls .control-left,
.portal-player-controls .control-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
}
.portal-player-controls .control-left { flex: 1 1 auto; }
.portal-player-controls .player-control {
  flex: 0 0 auto;
  min-width: 42px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(143, 164, 200,.24);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.portal-player-controls .player-control:hover:not(:disabled) {
  background: rgba(255,255,255,.14);
  border-color: rgba(168, 190, 230, .4);
}
.portal-player-controls .player-control:disabled { cursor: not-allowed; opacity: .52; }
.portal-player-controls .player-control-icon { width: 42px; min-width: 42px; padding: 0; font-size: 1rem; }
.portal-player-controls .player-control-resync { padding: 0 14px; font-size: .82rem; letter-spacing: .02em; }
.portal-player-controls .player-control-resync i { font-size: .92rem; opacity: .95; }
.portal-player-controls .volume-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 280px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(143, 164, 200, .2);
  background: rgba(0, 0, 0, .28);
}
.portal-player-controls .volume-wrap .player-control {
  width: 36px; min-width: 36px; height: 36px; border-radius: 50%;
  border-color: transparent; background: rgba(255,255,255,.06);
}
.portal-player-controls .volume-slider-wrap {
  display: inline-flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; margin: 0;
}
.portal-player-controls .volume-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 7px; border-radius: 999px;
  background: linear-gradient(90deg, #8fa4c8 0%, #8fa4c8 var(--vol, 15%), rgba(229,248,252,.18) var(--vol, 15%));
  outline: none; cursor: pointer; flex: 1 1 auto; min-width: 72px;
}
.portal-player-controls .volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #f8fafc; border: 2px solid #3d5f9a; box-shadow: 0 1px 6px rgba(0,0,0,.4); cursor: pointer;
}
.portal-player-controls .volume-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #f8fafc; border: 2px solid #3d5f9a;
  box-shadow: 0 1px 6px rgba(0,0,0,.4); cursor: pointer;
}
.portal-player-controls .volume-pct {
  flex: 0 0 auto; min-width: 2.6em; color: rgba(255,255,255,.88);
  font-size: .78rem; font-weight: 850; font-variant-numeric: tabular-nums; text-align: right;
}

.portal-below {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 60%) minmax(0, 40%);
  gap: 14px;
  align-items: stretch;
}
.portal-live-chat {
  margin-top: 0;
  border: 2px solid rgba(143, 164, 200,.28);
  background: rgba(21, 29, 46,.90);
  min-width: 0;
}
.portal-vrc-invite {
  min-width: 0;
  border: 2px solid rgba(143, 164, 200,.28);
  background:
    radial-gradient(80% 70% at 80% 0%, rgba(61, 95, 154, .28), transparent 65%),
    rgba(21, 29, 46,.92);
  display: grid;
  place-items: center;
  padding: 18px 16px;
}
.portal-vrc-invite-inner {
  width: min(100%, 360px);
  display: grid;
  gap: 12px;
  justify-items: start;
}
.portal-vrc-kicker {
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.portal-vrc-invite h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1.2;
}
.portal-vrc-invite p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.45;
  font-weight: 700;
}
.portal-vrc-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, .35);
  background: linear-gradient(145deg, #3d5f9a, #1a2740);
  color: #fff;
  text-decoration: none;
  font-weight: 950;
  font-size: .92rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}
.portal-vrc-btn:hover {
  border-color: rgba(125, 211, 252, .6);
  filter: brightness(1.06);
}
.portal-vrc-note {
  font-size: .78rem !important;
  color: rgba(163, 157, 184, .95) !important;
  font-weight: 650 !important;
}
.portal-live-chat .chat-head {
  min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 14px; border-bottom: 2px solid rgba(143, 164, 200,.18); background: rgba(61, 95, 154,.10);
}
.portal-live-chat .chat-head strong { color: var(--ink); font-size: 1rem; }
.portal-live-chat .chat-count { color: var(--ink-soft); font-size: .82rem; font-weight: 900; }
.portal-live-chat .chat-userline {
  display: none; padding: 9px 14px; border-bottom: 2px solid rgba(143, 164, 200,.14);
  color: var(--ink-soft); font-size: .84rem; font-weight: 850;
}
.portal-live-chat.joined .chat-userline { display: block; }
.portal-live-chat .chat-feed {
  display: grid; gap: 12px; min-height: 280px; max-height: 380px; overflow: auto; padding: 16px;
}
.portal-live-chat .chat-notice {
  padding: 10px 12px; border: 2px solid rgba(143, 164, 200,.20); border-radius: 6px;
  background: rgba(61, 95, 154,.10); color: var(--ink); font-size: .88rem; font-weight: 850; line-height: 1.35;
}
.portal-live-chat .chat-inline-error {
  display: none; padding: 0 16px 14px; color: #ffb7c5; font-size: .84rem; font-weight: 900;
}
.portal-live-chat .chat-inline-error.show { display: block; }
.portal-live-chat .chat-locked {
  padding: 14px 16px 16px; border-top: 2px solid rgba(143, 164, 200,.18); display: grid; gap: 10px;
}
.portal-live-chat .chat-locked p { margin: 0; color: var(--ink-soft); font-size: .88rem; line-height: 1.35; font-weight: 750; }
.portal-live-chat .join-chat-btn {
  width: fit-content; min-height: 40px; border: 0; border-radius: 4px; padding: 0 16px;
  background: var(--purple); color: #fff; font: inherit; font-weight: 950; cursor: pointer;
}
.portal-live-chat .chat-message { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.portal-live-chat .chat-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--chrome); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 950; font-size: .78rem;
}
.portal-live-chat .chat-bubble {
  min-width: 0; padding: 11px 13px; border-radius: 6px; background: rgba(255,255,255,.06);
}
.portal-live-chat .chat-bubble strong { color: var(--ink); font-size: .86rem; }
.portal-live-chat .chat-bubble span { color: var(--ink-soft); font-size: .88rem; line-height: 1.35; }
.portal-live-chat .chat-form {
  display: none; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
  padding: 14px 16px 16px; border-top: 2px solid rgba(143, 164, 200,.18);
}
.portal-live-chat.joined .chat-form { display: grid; }
.portal-live-chat.joined .chat-locked { display: none; }
.portal-live-chat .chat-form input {
  min-width: 0; height: 42px; border: 0; border-radius: 4px; padding: 0 12px;
  color: var(--ink); background: rgba(255,255,255,.08); font: inherit; font-weight: 700;
}
.portal-live-chat .chat-form button {
  height: 42px; border: 0; border-radius: 4px; padding: 0 18px;
  background: var(--purple); color: #fff; font: inherit; font-weight: 950; cursor: pointer;
}
.portal-live-chat.chat-disabled .chat-form button,
.portal-live-chat.chat-disabled .join-chat-btn { opacity: .5; pointer-events: none; }

.chat-modal {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  padding: 20px; background: rgba(8,18,26,.62);
}
.chat-modal.open { display: flex; }
.chat-modal-card {
  width: min(520px, 100%); border: 2px solid rgba(143, 164, 200,.30);
  background: var(--panel); box-shadow: 0 22px 60px rgba(0,0,0,.32);
}
.chat-modal-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 14px 16px; background: var(--chrome); color: #fff;
}
.chat-modal-head strong { font-size: 1.05rem; }
.chat-modal-close {
  width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.24); border-radius: 4px;
  background: rgba(255,255,255,.10); color: #fff; font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.chat-policy { display: grid; gap: 12px; padding: 16px; }
.chat-policy p { margin: 0; color: var(--ink-soft); line-height: 1.45; font-weight: 750; }
.chat-policy ul { margin: 0; padding-left: 20px; color: var(--ink); line-height: 1.45; font-weight: 800; }
.chat-policy label { display: grid; gap: 6px; color: var(--ink); font-weight: 950; }
.chat-policy input[type="text"] {
  height: 42px; border: 2px solid rgba(143, 164, 200,.24); border-radius: 4px; padding: 0 11px;
  color: var(--ink); background: rgba(255,255,255,.08); font: inherit; font-weight: 800;
}
.policy-check {
  display: flex !important; flex-direction: row; align-items: flex-start; gap: 9px !important;
  font-weight: 800 !important; line-height: 1.35;
}
.policy-check input { margin-top: 3px; }
.chat-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 16px 16px; }
.chat-modal-actions button {
  min-height: 40px; border: 0; border-radius: 4px; padding: 0 15px; font: inherit; font-weight: 950; cursor: pointer;
}
.chat-modal-actions .secondary { background: rgba(143, 164, 200,.14); color: var(--ink); }
.chat-modal-actions .primary { background: var(--purple); color: #fff; }
.chat-error { display: none; padding: 0 16px 12px; color: #a81738; font-size: .88rem; font-weight: 850; }
.chat-error.show { display: block; }

@media (max-width: 820px) {
  .portal-player-controls .volume-wrap { max-width: none; }
  .portal-player-controls .volume-slider { min-width: 96px; height: 10px; touch-action: none; }
  .portal-player-controls .volume-slider::-webkit-slider-thumb { width: 22px; height: 22px; }
  .portal-player-controls .volume-slider::-moz-range-thumb { width: 22px; height: 22px; }
}
@media (max-width: 900px) {
  .portal-below {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .portal-player-controls .player-control-resync span { display: none; }
  .portal-player-controls .player-control-resync { width: 42px; min-width: 42px; padding: 0; }
  .portal-live-chat .chat-feed { min-height: 220px; max-height: 300px; }
}

/* 18+ age gate — blocks portal stream until confirmed */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 16, 0.88);
  backdrop-filter: blur(6px);
}
.age-gate.open { display: flex; }
html.df-age-ok .age-gate { display: none !important; }
.age-gate-card {
  position: relative;
  width: min(460px, 100%);
  border: 2px solid rgba(168, 50, 80, 0.45);
  background: var(--panel, #151d2e);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  overflow: hidden;
}
.age-gate-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 48px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #a83250;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-align: center;
}
.age-gate-head {
  padding: 16px 18px;
  background: var(--chrome, #101828);
  color: #fff;
  padding-right: 72px;
}
.age-gate-head strong {
  font-size: 1.15rem;
  font-weight: 950;
}
.age-gate-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}
.age-gate-body p {
  margin: 0;
  color: var(--ink-soft, #a39db8);
  line-height: 1.45;
  font-weight: 750;
}
.age-gate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 18px;
}
.age-gate-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  padding: 0 16px;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}
.age-gate-actions .secondary {
  background: rgba(143, 164, 200, 0.14);
  color: var(--ink, #ebe8f2);
}
.age-gate-actions .primary {
  background: var(--purple, #6b4de6);
  color: #fff;
}
