:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101414;
  color: #edf4ef;
}

* {
  box-sizing: border-box;
}

body {
  overflow: hidden;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(39, 174, 128, 0.18), transparent 31rem),
    linear-gradient(135deg, #0e1111 0%, #161a1a 48%, #111716 100%);
}

button,
select,
input,
audio {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  align-items: start;
  gap: 1rem;
  height: 100vh;
  padding: 1rem;
  overflow: hidden;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  height: calc(100vh - 2rem);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #070909;
}

.stage:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #000;
}

canvas {
  display: block;
  width: min(100%, calc((100vh - 2rem) * var(--preview-ratio, 1.7778)));
  height: auto;
  max-height: 100%;
  aspect-ratio: var(--preview-ratio, 1.7778);
}

.stage:fullscreen canvas {
  width: min(100vw, calc(100vh * var(--preview-ratio, 1.7778)));
  max-height: 100vh;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.7rem;
  padding: 2rem;
  text-align: center;
  pointer-events: none;
  background:
    linear-gradient(rgba(7, 9, 9, 0.2), rgba(7, 9, 9, 0.86)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 5rem);
}

.empty-state.is-hidden {
  display: none;
}

.empty-mark {
  width: 6rem;
  height: 6rem;
  border: 2px solid rgba(98, 231, 178, 0.7);
  border-radius: 50%;
  box-shadow:
    0 0 0 1.2rem rgba(98, 231, 178, 0.08),
    0 0 4rem rgba(98, 231, 178, 0.28);
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 8vw, 5rem);
  line-height: 0.95;
}

.empty-state p {
  max-width: 27rem;
  color: #aebbb5;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: calc(100vh - 2rem);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(20, 25, 24, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.25rem;
}

.brand-mark {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 14%, #67e8bd 14% 26%, transparent 26% 38%, #f7c66f 38% 50%, transparent 50% 62%, #8cc7ff 62% 74%, transparent 74%),
    #1a2220;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.track-meta,
.status {
  color: #aebbb5;
  font-size: 0.9rem;
}

.footer {
  font-size: 0.7rem;
}

.file-picker,
button,
.download-link {
  min-height: 2.75rem;
  border: 0;
  border-radius: 6px;
  background: #67e8bd;
  color: #07100d;
  font-weight: 750;
  cursor: pointer;
}

.file-picker {
  display: grid;
  place-items: center;
}

.file-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

#playButton {
  background: #25302d;
  color: #eef7f1;
}

#fullscreenButton {
  background: #1b2422;
  color: #eef7f1;
}

.download-link {
  display: grid;
  place-items: center;
  text-decoration: none;
  background: #f7c66f;
}

audio {
  width: 100%;
  accent-color: #67e8bd;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  color: #d7e1dc;
  font-size: 0.9rem;
  font-weight: 650;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #d7e1dc;
  font-size: 0.9rem;
  font-weight: 650;
}

.check-field input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: #67e8bd;
}

select,
input[type="text"],
input[type="range"] {
  width: 100%;
}

select,
input[type="text"] {
  min-height: 2.5rem;
  padding: 0 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: #111716;
  color: #eef7f1;
}

input[type="text"]::placeholder {
  color: #74817b;
}

input[type="range"] {
  accent-color: #67e8bd;
}

.status {
  margin-top: auto;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .stage {
    height: min(58vh, calc((100vw - 1.2rem) / var(--preview-ratio, 1.7778)));
    max-height: 58vh;
  }

  .controls {
    height: auto;
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 0.6rem;
  }

  .button-row {
    grid-template-columns: 1fr;
  }
}
