/* ============================================================
   EpicQuest.bio Landing Page — Styles
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --landing-bg: #0a0e14;
  --landing-text: #ffffff;
  --landing-accent: #00c7a4;
  --landing-accent2: #39FF14;
  --landing-border: rgba(255, 255, 255, 0.12);
  --drawer-speed: 0.35s;
  --btn-radius: 6px;
}

/* --- Reset --- */
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--landing-bg);
  color: var(--landing-text);
  font-family: 'Fira Sans', 'Open Sans', sans-serif;
}
* { box-sizing: border-box; }

/* --- Landing mode container --- */
#landing-mode {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
}

/* ============================================================
   LANDING MODE — 5 Button Layout
   ============================================================ */

/* Mobile default: flex column */
#landing-mode {
  flex-direction: column;
  gap: 4px;
  padding: 3px;
}

/* --- Individual buttons --- */
.landing-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-width: 2px;
  border-style: solid;
  cursor: pointer;
  overflow: visible;
  user-select: none;
  margin: 0; padding: 0;
  border-radius: 8px;
  transition: height 0.35s ease, flex 0.35s ease, order 0.35s ease, background 0.3s, border-color 0.3s, box-shadow 0.3s;
  /* Deep bevelled look */
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.10),
    inset 0 -3px 0 rgba(0,0,0,0.35),
    inset 0 1px 4px rgba(255,255,255,0.04),
    0 1px 2px rgba(0,0,0,0.3);
}
.landing-btn:hover {
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.14),
    inset 0 -3px 0 rgba(0,0,0,0.30),
    inset 0 1px 6px rgba(255,255,255,0.06),
    0 2px 6px rgba(0,0,0,0.35);
}
.landing-btn .btn-label {
  font-size: clamp(16px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: 0.05em;
  pointer-events: none;
  text-align: center;
  padding: 4px 8px;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ---- Button 1: Login/Sign Up (blue) ---- */
#landing-btn-1 {
  border-color: #5b9cf5;
  background: linear-gradient(135deg,
    rgba(45, 75, 130, 0.55) 0%,
    rgba(40, 65, 115, 0.45) 30%,
    rgba(30, 50, 95, 0.50) 60%,
    rgba(20, 35, 70, 0.60) 100%);
}
#landing-btn-1 .btn-label { color: #a8cdfa; }
#landing-btn-1:hover {
  border-color: #7ab4ff;
  background: linear-gradient(135deg,
    rgba(55, 90, 150, 0.60) 0%,
    rgba(48, 78, 135, 0.50) 30%,
    rgba(38, 62, 112, 0.55) 60%,
    rgba(25, 45, 85, 0.65) 100%);
}
#landing-btn-1:hover .btn-label { color: #c4ddfd; }

/* ---- Button 2: AI + RLMF (purple) ---- */
#landing-btn-2 {
  border-color: #a855f7;
  background: linear-gradient(135deg,
    rgba(75, 30, 110, 0.55) 0%,
    rgba(65, 25, 95, 0.45) 30%,
    rgba(50, 20, 78, 0.50) 60%,
    rgba(35, 15, 58, 0.60) 100%);
}
#landing-btn-2 .btn-label { color: #c9a0f8; }
#landing-btn-2:hover {
  border-color: #c070ff;
  background: linear-gradient(135deg,
    rgba(90, 40, 130, 0.60) 0%,
    rgba(78, 32, 112, 0.50) 30%,
    rgba(62, 26, 94, 0.55) 60%,
    rgba(44, 18, 72, 0.65) 100%);
}
#landing-btn-2:hover .btn-label { color: #ddc0fc; }

/* ---- Button 4: Memberships (gold) ---- */
#landing-btn-4 {
  border-color: #e0b000;
  background: linear-gradient(135deg,
    rgba(90, 65, 10, 0.55) 0%,
    rgba(78, 55, 8, 0.45) 30%,
    rgba(62, 44, 6, 0.50) 60%,
    rgba(44, 30, 4, 0.60) 100%);
}
#landing-btn-4 .btn-label { color: #ffe280; }
#landing-btn-4:hover {
  border-color: #ffcc00;
  background: linear-gradient(135deg,
    rgba(108, 78, 15, 0.60) 0%,
    rgba(94, 66, 12, 0.50) 30%,
    rgba(76, 54, 10, 0.55) 60%,
    rgba(54, 38, 6, 0.65) 100%);
}
#landing-btn-4:hover .btn-label { color: #fff0b0; }

/* ---- Button 5: Invest (orange/amber) ---- */
#landing-btn-5 {
  border-color: #e07830;
  background: linear-gradient(135deg,
    rgba(100, 40, 10, 0.55) 0%,
    rgba(88, 34, 8, 0.45) 30%,
    rgba(70, 28, 6, 0.50) 60%,
    rgba(50, 18, 4, 0.60) 100%);
}
#landing-btn-5 .btn-label { color: #ffb888; }
#landing-btn-5:hover {
  border-color: #ff9040;
  background: linear-gradient(135deg,
    rgba(120, 50, 15, 0.60) 0%,
    rgba(105, 42, 12, 0.50) 30%,
    rgba(86, 34, 10, 0.55) 60%,
    rgba(62, 24, 6, 0.65) 100%);
}
#landing-btn-5:hover .btn-label { color: #ffccaa; }

/* Mobile button sizing: buttons 1,2,4,5 at 12.5vh, button 3 at 50vh */
#landing-btn-1, #landing-btn-2, #landing-btn-4, #landing-btn-5 {
  height: 12.5vh;
}
#landing-btn-3 {
  height: 50vh;
}

/* Button 1 shrunk state (logged in — just "account" link) */
#landing-btn-1.shrunk {
  height: 5vh !important;
  min-height: 38px;
}
#landing-btn-1.shrunk .btn-label {
  font-size: 14px;
  color: #8ab4f8;
  text-decoration: underline;
  cursor: pointer;
  pointer-events: auto;
}
#landing-btn-1.shrunk .btn-label:hover {
  color: #a8c7fa;
}

/* --- Button 3 centerpiece --- */
#landing-btn-3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  background: linear-gradient(160deg,
    rgba(5, 45, 20, 0.88) 0%,
    rgba(8, 55, 28, 0.82) 40%,
    rgba(4, 35, 15, 0.90) 100%);
  border: 3px solid rgba(57, 255, 20, 0.28);
  box-shadow:
    inset 0 3px 0 rgba(57, 255, 20, 0.08),
    inset 0 -4px 0 rgba(0, 0, 0, 0.40),
    inset 0 1px 6px rgba(57, 255, 20, 0.04),
    0 0 18px rgba(57, 255, 20, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.40);
  cursor: pointer;
  border-radius: 8px;
}
#landing-btn-3:hover {
  border-color: rgba(57, 255, 20, 0.55);
  box-shadow:
    inset 0 3px 0 rgba(57, 255, 20, 0.12),
    inset 0 -4px 0 rgba(0, 0, 0, 0.35),
    inset 0 2px 10px rgba(57, 255, 20, 0.06),
    0 0 30px rgba(57, 255, 20, 0.12),
    0 3px 12px rgba(0, 0, 0, 0.45);
}

/* Preview frame — a bordered inset panel within the button */
#btn3-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 92%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
  padding: 8px;
  gap: 5px;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(57, 255, 20, 0.12);
  border-radius: 5px;
}
#btn3-cams {
  display: flex;
  gap: 5px;
  width: 100%;
  justify-content: center;
  flex: 0 1 50%;
  max-height: 55%;
  min-height: 0;
}
.btn3-cam-thumb {
  flex: 1 1 0;
  aspect-ratio: 16 / 9;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  background: #060f06;
  border: 1px solid rgba(57, 255, 20, 0.13);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.btn3-cam-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.78;
}
.btn3-cam-thumb .cam-label {
  position: absolute; top: 2px; left: 3px;
  font-size: 9px; color: rgba(57, 255, 20, 0.45);
  background: rgba(0, 0, 0, 0.65); padding: 1px 4px;
  border-radius: 2px; font-family: 'Roboto Mono', monospace;
}
.btn3-cam-nodata {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px; color: #333; font-family: 'Roboto Mono', monospace;
  text-align: center; white-space: nowrap;
}
#btn3-adv-preview {
  width: 100%;
  height: clamp(36px, 12%, 90px);
  min-height: 36px;
  flex-shrink: 0;
  background: #060f06;
  border: 1px solid rgba(57, 255, 20, 0.10);
  border-radius: 3px;
  overflow: hidden;
}
#btn3-adv-preview canvas {
  width: 100%; height: 100%;
  display: block;
}
#btn3-chat-preview {
  width: 100%;
  height: 18px;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 8px;
  color: rgba(57, 255, 20, 0.22);
  font-family: 'Roboto Mono', monospace;
  text-align: center;
  line-height: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#btn3-centerpiece-label {
  font-size: clamp(16px, 3.5vw, 30px);
  font-weight: 700;
  color: rgba(57, 255, 20, 0.58);
  letter-spacing: 0.05em;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.15);
  margin-top: 6px;
}
#btn3-stream-status {
  font-size: 9px;
  color: rgba(57, 255, 20, 0.35);
  font-family: 'Roboto Mono', monospace;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* No data placeholder */
#btn3-no-data {
  display: none;
  text-align: center;
  color: rgba(255, 255, 255, 0.25);
  padding: 12px;
}
#btn3-no-data .no-data-title {
  font-size: clamp(14px, 3vw, 22px);
  font-weight: 600;
  margin-bottom: 4px;
}
#btn3-no-data .no-data-sub {
  font-size: 10px;
  opacity: 0.5;
}

/* ============================================================
   DRAWERS — Accordion panels
   ============================================================ */

.landing-drawer {
  position: absolute;
  top: 100%;
  left: 2%;
  width: 96%;
  max-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: none;
  z-index: 50;
  transition: max-height var(--drawer-speed) ease-in-out, padding var(--drawer-speed) ease;
  box-sizing: border-box;
  border-radius: 0 0 var(--btn-radius) var(--btn-radius);
}
.landing-drawer.open {
  max-height: 85vh;
  overflow-y: auto;
  padding: 10px 14px;
}
.landing-drawer.drawer-wide {
  /* Buttons 2,4,5 on desktop: extend left to cover full left column */
}
.landing-drawer.drawer-full {
  /* Join form: expand to cover virtually the whole screen below the button */
  max-height: calc(100vh - 40px);
  z-index: 100;
  border-color: rgba(255,255,255,0.18);
}

/* Drawer content sliding (login ↔ register) */
.drawer-slide-container {
  position: relative;
  overflow: hidden;
  min-height: 180px;
}
.drawer-slide-pane {
  transition: transform 0.3s ease, opacity 0.3s ease;
  width: 100%;
}
.drawer-slide-pane.pane-left {
  opacity: 1; transform: translateX(0);
}
.drawer-slide-pane.pane-left.slid-left {
  opacity: 0; transform: translateX(-30%);
  pointer-events: none;
  position: absolute; top: 0; left: 0;
}
.drawer-slide-pane.pane-right {
  opacity: 0; transform: translateX(30%);
  pointer-events: none;
  position: absolute; top: 0; left: 0; width: 100%;
}
.drawer-slide-pane.pane-right.slid-in {
  opacity: 1; transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

/* Drawer forms */
.drawer-form input[type="text"],
.drawer-form input[type="email"],
.drawer-form input[type="password"],
.drawer-form input[type="tel"],
.drawer-form input[type="number"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 8px 10px;
  color: #fff;
  font-size: 13px;
  margin-bottom: 6px;
  outline: none;
  box-sizing: border-box;
  font-family: 'Fira Sans', sans-serif;
}
.drawer-form input:focus {
  border-color: rgba(138, 180, 248, 0.5);
}
.drawer-form select {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 8px 10px;
  color: #fff;
  font-size: 13px;
  margin-bottom: 6px;
  outline: none;
  box-sizing: border-box;
  font-family: 'Fira Sans', sans-serif;
}
.drawer-form select option {
  background: #111;
  color: #fff;
}
.drawer-form .drawer-link {
  color: rgba(138, 180, 248, 0.8);
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
  display: inline-block;
}
.drawer-form .drawer-link:hover {
  color: #a8c7fa;
}
.drawer-form .drawer-submit-link {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px;
  color: #8ab4f8;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.drawer-form .drawer-submit-link:hover {
  color: #a8c7fa;
}
.drawer-form .drawer-error {
  color: #ff6859;
  font-size: 11px;
  margin: 2px 0;
  min-height: 16px;
}

/* Radio buttons for membership preference */
.drawer-radio-group {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  margin: 4px 0 8px 0;
}
.drawer-radio-group label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.drawer-radio-group input[type="radio"] {
  accent-color: var(--landing-accent);
  cursor: pointer;
}

/* Help section */
.drawer-help-row {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 6px;
}

/* Account info display */
.account-info-block {
  font-size: 13px;
  line-height: 1.6;
}
.account-info-block .ai-label {
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.account-info-block .ai-value {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
}
.account-info-block .ai-xp {
  color: #39FF14;
  font-weight: 700;
  font-size: 18px;
}
.account-logout-link {
  display: inline-block;
  color: #ff6859;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
  margin-top: 8px;
}
.account-logout-link:hover { color: #ff8a7d; }

/* Exit/close button for drawers/modals */
.drawer-exit {
  position: absolute;
  top: 6px; right: 10px;
  background: none; border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  z-index: 5;
  padding: 0 4px;
  line-height: 1;
}
.drawer-exit:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* Invest drawer: narrower with side margins, per spec */
#drawer-invest.open {
  left: 12%;
  width: 76%;
}

/* Scrollable content area */
.drawer-scroll {
  max-height: 70vh;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  padding-right: 4px;
}

/* Store items in memberships drawer */
.store-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.store-item h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}
.store-item .store-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}
.store-item .checkout-btn {
  display: inline-block;
  background: rgba(255, 213, 64, 0.15);
  color: #ffd540;
  border: 1px solid rgba(255, 213, 64, 0.35);
  border-radius: 3px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.store-item .checkout-btn:hover {
  background: rgba(255, 213, 64, 0.25);
}

/* Loading spinner */
.landing-spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--landing-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   BUTTON 3 EXPANDED STATE — becomes the streaming site
   ============================================================ */

/* Hide sibling buttons when streaming is active */
.streaming-active #landing-btn-1,
.streaming-active #landing-btn-2,
.streaming-active #landing-btn-4,
.streaming-active #landing-btn-5 {
  display: none !important;
}

/* Fullscreen state: static layout applied after animation completes.
   During animation, JS sets these inline with transitions. */
#landing-btn-3.expanded {
  background: #0a0e14 !important;
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important;
  z-index: 500 !important;
  border-radius: 0 !important;
  border-width: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* In expanded state, preview and expanded layers overlap via absolute positioning.
   This allows smooth opacity crossfade between them. */
#landing-btn-3.expanded #btn3-preview {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1;
  border-radius: 0;
  border: none;
  background: none;
}
#landing-btn-3.expanded #btn3-expanded {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 2;
}

/* Preview and expanded layers — opacity crossfade */
#btn3-preview {
  transition: opacity 0.2s ease;
}
#btn3-expanded {
  display: none;
  flex-direction: column;
  width: 100%; height: 100%;
  opacity: 0;
}
#btn3-expanded.visible {
  display: flex;
  opacity: 1;
  transition: opacity 0.2s ease;
}

/* Top banner in expanded mode */
#btn3-expanded-banner {
  flex: 0 0 auto;
  height: 38px; min-height: 38px;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
  padding: 0 8px;
}

/* sm-link styles (used in expanded banner) */
.sm-link {
  flex: 1 1 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: clamp(11px, 2vw, 14px);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Fira Sans', sans-serif;
  transition: color 0.2s;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.sm-link:hover { color: var(--landing-accent); }
.sm-link.sm-exit {
  flex: 0 0 auto;
  padding: 0 8px;
  color: rgba(255, 104, 89, 0.5);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}
.sm-link.sm-exit:hover { color: #ff6859; }

/* Main streaming area */
#btn3-expanded-main {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--landing-bg);
}
#btn3-streaming-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

/* Drawer toggle bar (bottom) */
#btn3-drawer-bar {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.90);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 101;
  justify-content: center;
}
.btn3-drawer-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-family: 'Fira Sans', sans-serif;
  padding: 4px 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn3-drawer-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}
.btn3-drawer-toggle.active {
  background: rgba(0, 199, 164, 0.18);
  border-color: rgba(0, 199, 164, 0.35);
  color: var(--landing-accent);
}
.btn3-drawer-toggle:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Drawer panels (slide up from bottom) */
.btn3-drawer-panel {
  position: absolute;
  left: 0; right: 0; bottom: 40px; /* above drawer bar */
  max-height: 0;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  z-index: 90;
  transition: max-height 0.3s ease;
  padding: 0 12px;
}
.btn3-drawer-panel.open {
  max-height: 55vh;
  padding: 10px 12px;
}

/* ============================================================
   EXPANDED STREAMING LAYOUT (v2: cams / ADV / chat stack)
   ============================================================ */

/* Webcam row in expanded mode — side-by-side at top */
#streaming-cams-row {
  flex: 0 0 auto;
  height: 22%;
  min-height: 80px;
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
#streaming-cams-row .streaming-cam-box-overlay {
  position: relative !important;
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 16 / 9;
  max-height: 100%;
  background: #000;
  border: 1px solid rgba(var(--stream-accent2-rgb,0,199,164),0.3);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}
#streaming-cams-row .streaming-cam-box-overlay video {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
/* Hide resize handles and drag cursors in new layout */
#streaming-cams-row .streaming-cam-resize-handle { display: none; }
#streaming-cams-row .streaming-cam-box-overlay { cursor: default !important; }

/* ADV section in expanded mode */
#streaming-adv-section {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}

/* Chat section in expanded mode — bottom 2/5 */
#streaming-chat-section {
  flex: 0 0 40%;
  min-height: 100px;
  display: flex; flex-direction: column;
  border-top: 1px solid rgba(var(--stream-accent2-rgb,0,199,164),0.18);
  background: rgba(5, 18, 8, 0.85);
}
#streaming-chat-section.collapsed {
  flex: 0 0 auto;
  height: 32px; min-height: 32px;
}
#streaming-chat-section .chat-collapse-bar {
  flex: 0 0 auto; height: 24px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px;
  background: rgba(var(--stream-accent2-rgb,0,199,164),0.06);
  border-bottom: 1px solid rgba(var(--stream-accent2-rgb,0,199,164),0.06);
  cursor: pointer; user-select: none;
  font-size: 10px; color: rgba(var(--stream-accent-rgb,57,255,20),0.45);
  letter-spacing: 1px;
}
#streaming-chat-section .chat-collapse-bar:hover {
  background: rgba(var(--stream-accent2-rgb,0,199,164),0.12);
}
#streaming-chat-section.collapsed #streaming-chat-messages,
#streaming-chat-section.collapsed #streaming-chat-input-wrap { display: none; }

/* In expanded mode, container fills the main area */
#btn3-streaming-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

/* ============================================================
   DESKTOP: Horizontal split layout
   ============================================================ */

@media (min-width: 769px) {
  #landing-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr 1fr;
    gap: 4px;
    padding: 3px;
  }
  /* Button 3: fixed in right column, full height — never reorders */
  #landing-btn-3 {
    grid-column: 2;
    grid-row: 1 / 5;
    height: auto;
  }
  /* Left-column buttons: auto-place in column 1, ordered by CSS order property */
  #landing-btn-1 { grid-column: 1; grid-row: auto; height: auto; }
  #landing-btn-2 { grid-column: 1; grid-row: auto; height: auto; }
  #landing-btn-4 { grid-column: 1; grid-row: auto; height: auto; }
  #landing-btn-5 { grid-column: 1; grid-row: auto; height: auto; }

  #btn3-preview { width: 86%; padding: 12px; gap: 8px; }
  #btn3-adv-preview { height: clamp(50px, 15%, 90px); }
  #btn3-cams { gap: 8px; }
  #btn3-chat-preview { height: 26px; font-size: 10px; }

  /* Drawers on desktop: wide drawers extend across both columns */
  .landing-drawer.drawer-wide {
    left: -100%;
    width: 196%;
    max-width: 96vw;
  }
}

/* ============================================================
   MOBILE: Stacked layout refinements
   ============================================================ */

@media (max-width: 768px) {
  .landing-btn .btn-label {
    font-size: clamp(13px, 4vw, 18px);
  }
  .landing-drawer.open {
    max-height: 70vh;
    padding: 8px 10px;
  }
  .drawer-form input,
  .drawer-form select {
    padding: 6px 8px;
    font-size: 12px;
    margin-bottom: 4px;
  }
  #btn3-centerpiece-label {
    font-size: clamp(13px, 4.5vw, 20px);
  }
  #btn3-expanded-banner { height: 34px; min-height: 34px; }
  .sm-link { font-size: clamp(9px, 2.2vw, 12px); }
  .btn3-drawer-panel { bottom: 36px; }
  .btn3-drawer-toggle { font-size: 11px; padding: 3px 10px; }
}
