/* DJ 3rd Derivative — Shared Master Core Stylesheet (assets/core/studio_style.css)
 * Edit this file ONCE to update the Desktop (16:9) & Mobile (1080x1320) layout across all songs!
 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #091d36;
  background: radial-gradient(circle at 15% 15%, #00d2e6 0%, #09355c 35%, #230c38 70%, #12061f 100%);
  color: #ffffff;
  font-family: "Trebuchet MS", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 12px 16px 28px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

/* Block layout avoids WebKit column-flexbox + aspect-ratio cyclic 0px height collapse on iOS/WebViews */
.studio-shell {
  max-width: 1460px;
  margin: 0 auto;
  display: block;
}

/* Top Studio Control Bar (Includes Brand, Play Button, View Toggle, Fullscreen & Export Video) */
.top-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(12, 14, 30, 0.94);
  border: 4px solid #000000;
  box-shadow: 0 0 0 3px #ff007f, 5px 5px 0 #000000;
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 12px;
}

.brand-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-family: "Impact", "Arial Black", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 1px;
  color: #00e5ff;
  background: linear-gradient(180deg, #00e5ff 0%, #2dd4bf 50%, #ff2a85 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(2px 2px 0px #000) drop-shadow(0 0 8px rgba(0, 229, 255, 0.55));
}

.brand-sub {
  font-size: 12px;
  font-weight: 800;
  color: #00ffcc;
  background: #000000;
  padding: 4px 10px;
  border-radius: 8px;
  border: 2px solid #00ffcc;
}

:root,
select {
  color-scheme: dark;
}

.song-select {
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: 13px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 3px solid #000000;
  background-color: #061024;
  color: #f0f9ff;
  box-shadow: 0 0 0 2px #00e5ff, 3px 3px 0 #000000;
  cursor: pointer;
}

.song-select option,
.song-select optgroup,
select option,
select optgroup {
  background-color: #061024 !important;
  color: #f0f9ff !important;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  padding: 6px 10px;
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.comic-btn {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
  -webkit-user-select: none;
  user-select: none;
  font-family: "Arial Black", "Impact", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-weight: 900;
  font-size: 13px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 3px solid #000000;
  background: #1e293b;
  color: #ffffff;
  box-shadow: 3px 3px 0 #000000;
  transition: transform 0.12s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.comic-btn:hover {
  background: #334155;
}

.comic-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #000000;
}

.comic-btn.active-mode {
  background: linear-gradient(180deg, #00e5ff 0%, #38bdf8 100%);
  color: #020814;
}

.comic-btn.play-primary {
  background: #2dd4bf;
  background: linear-gradient(180deg, #2dd4bf 0%, #00c853 100%);
  color: #000000;
  font-size: 15px;
  padding: 9px 20px;
}

.comic-btn.export-btn {
  background: #ff2a85;
  background: linear-gradient(180deg, #ff2a85 0%, #c60055 100%);
  color: #ffffff;
}

.comic-btn.export-btn.recording-active {
  background: #ef4444;
  animation: pulseRec 0.9s infinite alternate;
}

@keyframes pulseRec {
  from {
    box-shadow: 0 0 6px #ef4444, 3px 3px 0 #000;
  }
  to {
    box-shadow: 0 0 20px #ffe600, 3px 3px 0 #000;
  }
}

/* Responsive Master Video Stage Container
 * Uses intrinsic <canvas width height> + height:auto so height NEVER collapses to 0px on any iOS/Android browser!
 */
.video-stage-wrapper {
  position: relative;
  width: 100%;
  background: #080811;
  border: 4px solid #000000;
  border-radius: 16px;
  box-shadow: 0 0 0 3px #00ffcc, 0 14px 35px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  margin: 0 auto 12px auto;
}

.video-stage-wrapper.portrait-stage {
  max-width: 520px;
}

#videoCanvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: manipulation;
}

/* Shown ONLY when a mobile file previewer (iOS Files QuickLook / Google Drive / Android HTML Viewer) blocks JavaScript */
.noscript-panel,
.boot-diag-panel {
  background: linear-gradient(180deg, #0f291e 0%, #143327 50%, #0b1f17 100%);
  color: #ffffff;
  padding: 20px 18px;
  border-radius: 12px;
  line-height: 1.5;
  cursor: default;
}

.noscript-title {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 18px;
  color: #ffe600;
  margin-bottom: 10px;
}

.noscript-box {
  background: rgba(8, 20, 15, 0.92);
  border: 2px solid #00ffcc;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 14px;
}

.noscript-box strong {
  color: #2dd4bf;
}

/* Native Fullscreen (Mac, PC, iPad, Android) & Pseudo-Fullscreen Fallback (iPhone iOS Safari/Chrome) */
.video-stage-wrapper:fullscreen,
.video-stage-wrapper:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #050811;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-stage-wrapper:fullscreen #videoCanvas,
.video-stage-wrapper:-webkit-full-screen #videoCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body.pseudo-fullscreen {
  overflow: hidden;
}

body.pseudo-fullscreen .video-stage-wrapper {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #050811;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.pseudo-fullscreen .video-stage-wrapper #videoCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pseudo-fs-exit-btn {
  display: none;
  position: absolute;
  top: 12px;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 10001;
  background: rgba(15, 23, 42, 0.92);
  color: #ffe600;
  border: 2px solid #ffe600;
  border-radius: 10px;
  padding: 8px 14px;
  font-family: "Arial Black", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

body.pseudo-fullscreen .pseudo-fs-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Bottom Time Slider & Elapsed Time Bar Only */
.transport-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: rgba(12, 14, 30, 0.95);
  border: 4px solid #000000;
  box-shadow: 0 0 0 3px #ffe600, 5px 5px 0 #000000;
  border-radius: 14px;
  padding: 10px 14px;
}

.scrubber-wrap {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#timelineScrubber {
  flex: 1;
  height: 22px;
  accent-color: #ff007f;
  cursor: pointer;
  touch-action: manipulation;
}

#timeDisplay {
  font-family: "Courier New", monospace;
  font-weight: 900;
  font-size: 15px;
  color: #ffe600;
  background: #000000;
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid #ffe600;
  white-space: nowrap;
}

/* Mobile Portrait & Small Screen Optimizations */
@media (max-width: 768px) {
  body {
    padding: 8px 8px 20px;
  }

  .top-nav-bar {
    padding: 8px 10px;
    gap: 8px;
    margin-bottom: 10px;
  }

  .brand-title {
    font-size: 19px;
  }

  .brand-sub {
    font-size: 11px;
    padding: 3px 7px;
  }

  .mode-tabs {
    width: 100%;
    gap: 6px;
  }

  .comic-btn {
    font-size: 12px;
    padding: 8px 10px;
    min-height: 44px;
    flex: 1 1 auto;
  }

  .comic-btn.play-primary {
    flex: 1 1 100%;
    font-size: 15px;
    padding: 10px 14px;
  }

  .video-stage-wrapper {
    margin-bottom: 10px;
  }

  .transport-bar {
    padding: 8px 10px;
    gap: 10px;
  }

  .scrubber-wrap {
    flex: 1 1 100%;
  }

  .video-stage-wrapper.portrait-stage {
    max-width: 100%;
  }
}
