/* PLAYGROUND COMPOSITION: primitives live in ui/. Keep visualizer-specific
   layouts, canvas treatments and responsive behavior here. */
@import "./ui/ui.css";

header {
  height: 86px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  border-bottom: 1px solid var(--line);
}
.brand {
  text-decoration: none;
  color: inherit;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -1.5px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-icon {
  font-size: 31px;
}
.beta {
  font-family: monospace;
  font-weight: 400;
  font-size: var(--vb-text-sm);
  letter-spacing: 1px;
  border: 1px solid var(--line);
  padding: 5px 7px;
  border-radius: 4px;
  margin-left: 7px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: var(--vb-text-control);
  color: var(--muted);
}
main {
  max-width: 1600px;
  margin: auto;
  padding: 48px 5% 24px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}
.eyebrow {
  font: var(--vb-text-xs) var(--vb-font-mono);
  letter-spacing: 2px;
  color: var(--vb-color-muted);
}
h1 {
  font-size: clamp(30px, 3.1vw, 48px);
  font-weight: 500;
  letter-spacing: -1.2px;
  margin: 13px 0 10px;
}
h1 span {
  color: #8d9d63;
}
.intro p {
  font-size: var(--vb-text-control);
  color: var(--muted);
  margin: 0;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
}
.preview {
  min-width: 0;
}
.preview-toolbar {
  height: auto;
  min-height: 54px;
  flex-wrap: wrap;
  gap: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.render-label {
  margin-left: auto;
  font: var(--vb-text-xs) var(--vb-font-mono);
  letter-spacing: 1px;
  color: var(--muted);
}
.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #a4b68c;
  border-radius: 50%;
  margin-right: 7px;
}
.stage {
  position: relative;
  height: clamp(380px, 47vw, 620px);
  background: #09131b;
  border-radius: var(--vb-radius-panel);
  overflow: hidden;
  margin-top: 9px;
}
.stage:fullscreen {
  height: 100vh;
  width: 100vw;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.stage-top,
.stage-bottom {
  position: absolute;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #aab6b8;
  font: var(--vb-text-xs) var(--vb-font-mono);
  letter-spacing: 1.3px;
  pointer-events: none;
}
.stage-top {
  top: 20px;
}
.stage-top button {
  pointer-events: auto;
  color: inherit;
  border-color: #ffffff20;
}
.stage-bottom {
  bottom: 23px;
  letter-spacing: 0.7px;
}
.stage-bottom > span:first-child {
  display: flex;
  align-items: center;
}
.audio-bar {
  display: flex;
  align-items: center;
  gap: 17px;
  padding-top: 19px;
}
.meter {
  height: 4px;
  max-width: 130px;
  flex: 1;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.meter div {
  height: 100%;
  width: 0;
  background: #99ae70;
}
#level {
  font: var(--vb-text-xs) var(--vb-font-mono);
  color: var(--muted);
  min-width: 48px;
}
.upload {
  margin-left: auto;
  font-size: var(--vb-text-control);
  cursor: pointer;
  white-space: nowrap;
}
.upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
#audio-message {
  font-size: var(--vb-text-sm);
  color: var(--muted);
  margin: 13px 0;
}
audio {
  width: 100%;
  height: 32px;
  margin-top: 12px;
}
aside {
  min-width: 0;
  padding: 23px;
  margin-top: 9px;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-title h2 {
  font-size: var(--vb-text-title);
  font-weight: 550;
  margin: 0;
}
.panel-title > span {
  color: var(--muted);
}
.control-section {
  border-bottom: 1px solid var(--line);
  padding: 25px 0 20px;
}
.control-heading {
  display: flex;
  justify-content: space-between;
  font-size: var(--vb-text-control);
  font-weight: 550;
  margin-bottom: 17px;
}
.control-heading span {
  font: var(--vb-text-xs) var(--vb-font-mono);
  color: var(--vb-color-muted);
}
.presets {
  display: flex;
  gap: 8px;
}
.presets button {
  color: var(--vb-color-text);
  cursor: pointer;
  flex: 1;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--vb-radius-control);
  font-size: var(--vb-text-sm);
  padding: 10px 4px;
}
.presets button.active {
  background: var(--soft);
  border-color: var(--vb-color-control-border);
}
.mini-orb {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 9px;
  border-radius: 50%;
  box-shadow: inset -6px -3px 7px #0005;
}
.green {
  background: radial-gradient(at 35% 30%, #fbffa6, #c9db73 40%, #5b7c54);
}
.blue {
  background: radial-gradient(at 35% 30%, #ddfaff, #82cacc 40%, #536fba);
}
.orange {
  background: radial-gradient(at 35% 30%, #fff0c6, #efad70 40%, #b96b65);
}
.export-button { width: 100%; margin-top: var(--vb-space-6); justify-content: center; }
.export-hint {
  text-align: center;
  font-size: var(--vb-text-sm);
}
footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 21px;
  font: var(--vb-text-xs) var(--vb-font-mono);
  letter-spacing: 1px;
  color: var(--muted);
}
.tiny-mark {
  font-size: var(--vb-text-body);
  vertical-align: middle;
  margin-right: 6px;
}
footer b {
  margin: 0 10px;
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
  aside {
    padding: 28px;
  }
}
@media (max-width: 850px) {
  main {
    padding: 30px 5%;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  aside {
    margin: 0;
  }
  .header-right > span {
    display: none;
  }

  .control-section {
    padding: 20px 0;
  }
  .presets button {
    padding: 12px;
  }

  footer {
    font-size: 8px;
  }
}
#voxel-hint {
  position: absolute;
  bottom: 64px;
  left: 20px;
  right: 20px;
  text-align: center;
  font: var(--vb-text-xs) var(--vb-font-mono);
  color: #e5eee6;
  background: #10201bcc;
  border-radius: 5px;
  padding: 7px;
  width: fit-content;
  max-width: calc(100% - 40px);
  margin: 0 auto;
  pointer-events: none;
}
.tabs {
  flex-wrap: wrap;
}
#orb:focus-visible {
  outline: 2px solid #adca83;
  outline-offset: -4px;
}
@media (max-width: 480px) {
  header {
    height: 70px;
  }
  .brand {
    font-size: 24px;
  }
  h1 {
    letter-spacing: -1.2px;
  }
  .intro p {
    font-size: var(--vb-text-control);
  }

  .render-label {
    font-size: 8px;
  }
  .tabs button {
    padding: 8px 9px;
  }
  .preview-toolbar {
    padding-bottom: 4px;
  }
  .audio-bar {
    gap: 10px;
  }


  .stage-bottom {
    left: 16px;
    right: 16px;
    font-size: 8px;
  }
  footer > span:last-child {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
.stage-top,
.stage-bottom {
  text-shadow: 0 1px 8px #0007;
}
#performance {
  position: absolute;
  top: 65px;
  left: 24px;
  font: var(--vb-text-xs) var(--vb-font-mono);
  color: #e4f3e5;
  background: #09131bd9;
  padding: 6px 9px;
  border-radius: 5px;
  pointer-events: none;
}
.companions {
  margin-top: 76px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}
.companions-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.companions h2 {
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 500;
  letter-spacing: -1px;
  margin: 12px 0;
}
.companions h2 span {
  color: #8d9d63;
}
.companions-heading p,
.companion-card > p {
  font-size: var(--vb-text-control);
  color: var(--muted);
  line-height: 1.6;
}
.source-link,
.integration-actions a {
  color: var(--ink);
  font-size: var(--vb-text-control);
  text-underline-offset: 4px;
}
.companion-status {
  font: var(--vb-text-xs) var(--vb-font-mono);
  color: var(--muted);
  margin: 26px 0 16px;
  line-height: 1.7;
}
.companion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.companion-card {
  min-width: 0;
  padding: 22px;
}
.companion-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.companion-title h3 {
  font-size: var(--vb-text-body);
  font-weight: 550;
  margin: 0;
}
.companion-title > span {
  font: var(--vb-text-xs) var(--vb-font-mono);
  color: var(--muted);
}
.companion-card > p {
  min-height: 38px;
  margin: 9px 0 16px;
}
.companion-preview {
  position: relative;
  height: 172px;
  padding: 26px 18px 42px;
  border-radius: var(--vb-radius-control);
  background: #09131b;
  overflow: hidden;
}
.companion-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(#adc6b008 1px, transparent 1px),
    linear-gradient(90deg, #adc6b008 1px, transparent 1px);
  background-size: 18px 18px;
}
.signal-axis {
  position: absolute;
  bottom: 16px;
  left: 18px;
  right: 18px;
  color: #a6b4b5;
  font: var(--vb-text-xs) var(--vb-font-mono);
  letter-spacing: 1.4px;
}
.companion-controls {
  padding: 0 0 24px;
}
.companion-controls .color-row {
  margin-top: 0;
}
.companion-controls .follow-color {
  padding: 8px 0 0;
  font-size: var(--vb-text-sm);
}
.integration p {
  font-size: var(--vb-text-control);
  line-height: 1.7;
  color: var(--muted);
}
.integration pre {
  max-height: 280px;
  font-size: var(--vb-text-sm);
  line-height: 1.6;
  padding: 12px;
}
.integration-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.integration-actions .text-button {
  padding-left: 0;
  color: var(--ink);
}
.companion-footnote {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: var(--vb-text-sm);
  line-height: 1.7;
}
@media (max-width: 1000px) {
  .companion-grid {
    gap: 12px;
  }
  .companion-card {
    padding: 16px;
  }
}
@media (max-width: 700px) {
  .companion-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .companions-heading {
    display: block;
  }
  .source-link {
    display: inline-block;
    margin-top: 8px;
  }
  .companions {
    margin-top: 48px;
  }
  .companion-card > p {
    min-height: 0;
  }
}
.companion-card[data-canvas-theme="light"] .companion-preview {
  background: #e9eee3;
}
.companion-card[data-canvas-theme="light"] .signal-axis {
  color: #42513f;
}
.companion-card[data-canvas-theme="light"] .companion-preview::before {
  background-image:
    linear-gradient(#354c3509 1px, transparent 1px),
    linear-gradient(90deg, #354c3509 1px, transparent 1px);
}
.export-button { justify-content: center; }
.intro p { max-width: 52ch; line-height: 1.6; font-size: var(--vb-text-body); }
h1 { line-height: 1.15; }
#audio-message, .export-hint { font-size: var(--vb-text-sm); line-height: var(--vb-leading); }
.presets button { font-size: 13px; }
.control-heading { font-size: var(--vb-text-control); font-weight: 600; }
.companion-status, .companion-footnote { font: var(--vb-text-sm)/var(--vb-leading) var(--vb-font-sans); }
.fine-tune { margin-top: 20px; border-top: 1px solid var(--line); }
.preview { min-width: 0; }
@media (max-width: 850px) {
  .workspace { display: block; }
  .preview { display: contents; }
  .stage { position: sticky; top: 8px; z-index: 2; height: clamp(180px, 28svh, 260px); box-shadow: 0 0 0 8px var(--vb-color-page); }
  .stage:fullscreen { height: 100vh; top: 0; }
  .stage-top { top: 12px; left: 16px; right: 16px; }
  .stage-bottom { bottom: 12px; }
  aside { margin-top: 28px; }
  .intro { align-items: start; gap: 16px; flex-direction: column; margin-bottom: 20px; }
  .intro .text-button { padding: 0; }
  .intro p { font-size: 15px; margin-bottom: 0; }
  .tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; gap: 2px; }
  .tabs button { font-size: var(--vb-text-sm); padding: 12px 2px; min-height: 44px; }
  .render-label { display: none; }
  .audio-bar { flex-wrap: wrap; gap: 12px; }
  .audio-bar .meter { order: 3; max-width: none; flex-basis: calc(100% - 65px); }
  #level { order: 4; }
  .upload { margin-left: auto; font-size: var(--vb-text-control); }
  .companions { margin-top: 40px; }
}
@media (max-width: 850px) and (min-height: 501px) {
  aside :is(button, input, select, summary), #mic {
    scroll-margin-top: calc(clamp(180px, 28svh, 260px) + 32px);
  }
}
@media (max-width: 850px) and (max-height: 500px) {
  .stage { position: relative; top: 0; }
}

.fine-tune > summary { padding-bottom: 0; }
.source-link, .integration-actions a { display: inline-flex; align-items: center; gap: var(--vb-space-2); }

/* Local dark plates keep HUD text readable over every scene and canvas theme. */
#scene-label,
.stage-bottom > span,
#voxel-hint {
  color: #edf3ee;
  background: rgb(9 19 27 / 85%);
  border-radius: 6px;
  padding: 7px 9px;
  text-shadow: none;
}
.stage-top button {
  color: #edf3ee;
  background: rgb(9 19 27 / 85%);
}
