/* Online gate + small bridges so desktop.css can host /online */

html,
body,
#studio-root {
  margin: 0;
  width: 100%;
  height: 100%;
}

#studio-root:not([hidden]) {
  display: block;
  height: 100%;
}

body.studio-live {
  overflow: hidden;
}

body.studio-live .online-gate-layer {
  display: none !important;
}

/* Height-bound to the viewport: desktop.css locks html/body to
   overflow:hidden, so the ONLY scroll surface is .online-gate-main below.
   min-height:100% alone let the layer GROW past the viewport when the
   acceptance card got tall — the 1fr row then never overflowed, its
   scrollbar never engaged, and the Accept button was unreachable on
   desktop, Mac, and mobile. */
.online-gate-layer {
  height: 100%;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(139, 90, 43, 0.18), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(176, 141, 87, 0.12), transparent 45%),
    var(--bg-deep);
}

.online-gate-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.2rem;
  background: var(--bg-metal);
  border-bottom: 1px solid rgba(196, 163, 90, 0.45);
}

.brand-logo--gate {
  height: 64px;
  max-width: min(360px, 50vw);
}

.online-gate-meta,
.online-gate-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.online-gate-actions {
  margin-left: auto;
}

/* Flex + margin:auto on the card (NOT grid place-items:center): centered
   grid/flex content that overflows its scroll container clips at the TOP
   and can never be scrolled back to. margin:auto centers the card when it
   fits and collapses to 0 when it overflows, so the whole card — including
   the Accept button at the bottom — stays reachable by scrolling. */
.online-gate-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.gate-card {
  margin: auto;
  flex: 0 0 auto;
  width: min(560px, 100%);
  padding: 2rem 1.75rem;
  background: var(--bg-metal);
  border: 1px solid var(--bg-metal-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.gate-card h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.04em;
  margin: 0.35rem 0 0.75rem;
  color: var(--accent-cream);
}

.gate-card .lead {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Legal/policy links inside the card: gold, not default browser blue —
   blue link text is near-unreadable on the dark card. */
.gate-card a:not(.btn) {
  color: var(--accent-gold, #d4af37);
  text-decoration: underline;
  text-decoration-color: rgba(212, 175, 55, 0.55);
  text-underline-offset: 2px;
}
.gate-card a:not(.btn):hover,
.gate-card a:not(.btn):focus-visible {
  color: var(--accent-cream, #f0e6ce);
  text-decoration-color: currentColor;
}

.gate-actions .btn-gold,
.gate-actions .btn.primary {
  background: linear-gradient(180deg, var(--accent-gold), var(--accent-bronze));
  color: #1a140c;
  border-color: var(--accent-gold);
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 163, 90, 0.35);
  color: var(--text-muted);
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.25);
}

.waveform-canvas {
  width: 100%;
  height: 48px;
  display: block;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.waveform-canvas.vertical,
.waveform-slot.vertical .waveform-canvas {
  width: 72px;
  height: 100%;
  min-height: 180px;
}

.file-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.top-actions .chip {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Deck / mixer “coming soon” buttons: keep labels readable (no Preview stamp) */
.coming-soon::after {
  content: none !important;
  display: none !important;
}

.deck-transport .btn[disabled],
.deck-transport .coming-soon {
  opacity: 0.5;
}

@media (max-width: 900px) {
  .online-gate-top {
    flex-wrap: wrap;
  }

  .online-gate-actions {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .online-gate-top { padding: 0.6rem 0.9rem; }
  .brand-logo--gate { height: 48px; }
  .online-gate-main { padding: 1.25rem 0.85rem; }
  .gate-card { padding: 1.5rem 1.15rem; }
  .gate-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
}
