:root {
  --cabinet: #1f242c;
  --cabinet-2: #14181f;
  --faceplate: #c8c8c3;
  --faceplate-hi: #f5f5f1;
  --faceplate-lo: #9ea29f;
  --smoke: #2c333c;
  --smoke-hi: #414b56;
  --ink: #0f141b;
  --muted: #505b67;
  --edge: #7f878d;
  --accent: #d95a2b;
  --led: #d63e2f;
  --ok: #3aa064;
  --radius: 10px;
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  --font-ui: "Chakra Petch", "Trebuchet MS", sans-serif;
  --font-display: "Audiowide", "Trebuchet MS", sans-serif;
  --font-tech: "Share Tech Mono", "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 32%),
    radial-gradient(circle at 85% 12%, rgba(214, 62, 47, 0.08) 0%, transparent 28%),
    linear-gradient(165deg, var(--cabinet) 0%, var(--cabinet-2) 100%);
  padding: 28px 16px 44px;
}

.app-shell {
  max-width: 1020px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.hero {
  padding: 10px 4px 4px;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-tech);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #d8dee4;
  font-size: 0.8rem;
  opacity: 0.9;
}

h1 {
  margin: 4px 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.8vw, 2.9rem);
  line-height: 1.05;
  color: #f0f2f4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.subtitle {
  margin: 0;
  color: #b2bcc8;
}

.panel {
  background:
    repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.15) 0 2px, rgba(0, 0, 0, 0.02) 2px 4px),
    linear-gradient(180deg, #d7d8d3 0%, #bdbfb9 100%);
  border: 1px solid #8d9193;
  border-radius: var(--radius);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.82),
    inset -1px -1px 0 rgba(73, 79, 84, 0.4),
    var(--shadow);
  padding: 15px;
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 10px;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #151a20;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.text-input {
  width: 100%;
  border: 1px solid #6d7680;
  border-radius: 8px;
  font: inherit;
  padding: 12px;
  color: var(--ink);
  background: linear-gradient(180deg, #f8f9fb 0%, #d9dde4 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.85), inset -1px -1px 0 rgba(119, 128, 139, 0.35);
}

.text-input:focus {
  outline: 2px solid rgba(217, 90, 43, 0.45);
  outline-offset: 1px;
}

.dropzone {
  margin-top: 12px;
  border: 1px solid #5f6771;
  border-radius: 8px;
  padding: 26px 14px;
  text-align: center;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(46, 55, 65, 0.96) 0%, rgba(34, 41, 49, 0.96) 100%);
  color: #dde4eb;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.08),
    inset -1px -1px 0 rgba(0, 0, 0, 0.35);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.dropzone:hover,
.dropzone:focus,
.dropzone.dragover {
  transform: translateY(-1px);
  border-color: #8c97a3;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), inset 1px 1px 0 rgba(255, 255, 255, 0.08), inset -1px -1px 0 rgba(0, 0, 0, 0.35);
}

.drop-title {
  margin: 0;
  font-weight: 700;
  color: #f3f5f7;
  letter-spacing: 0.04em;
}

.drop-sub {
  margin: 4px 0 0;
  color: #b8c1cc;
  font-size: 0.95rem;
}

.cover-grid {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.cover-card {
  border: 1px solid #81888d;
  border-radius: 8px;
  background: linear-gradient(180deg, #d9dbd7 0%, #c6c8c3 100%);
  padding: 12px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.86), inset -1px -1px 0 rgba(94, 99, 103, 0.35);
}

.cover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cover-label {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #2e3945;
  font-size: 0.74rem;
}

.cover-name {
  margin-top: 4px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.cover-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.link-row {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.link-controls {
  display: grid;
  gap: 10px;
}

.link-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.yt-preview-card {
  border: 1px solid #81888d;
  border-radius: 8px;
  background: linear-gradient(180deg, #d9dbd7 0%, #c6c8c3 100%);
  padding: 10px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.86), inset -1px -1px 0 rgba(94, 99, 103, 0.35);
}

.yt-preview-head {
  font-family: var(--font-tech);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #2b3642;
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.yt-preview-empty {
  margin: 0;
  color: #4f5964;
  font-size: 0.88rem;
}

.yt-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #5f6771;
  border-radius: 8px;
  background: #131820;
}

.split {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #20262e;
}

.item-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #70787f;
  background: linear-gradient(180deg, #ebedee 0%, #d6dbe0 100%);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.93rem;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.88), inset -1px -1px 0 rgba(101, 110, 117, 0.35);
}

.item-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.item-order {
  color: #2f3945;
  font-family: var(--font-tech);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.item-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-family: var(--font-tech);
}

.item-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.empty-text {
  margin: 8px 0 0;
  color: #4f5964;
  font-size: 0.94rem;
}

.actions {
  display: grid;
  gap: 10px;
  background:
    linear-gradient(180deg, #343b44 0%, #262d35 100%);
  border-color: #525a64;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.12),
    inset -1px -1px 0 rgba(0, 0, 0, 0.42),
    var(--shadow);
}

.stats {
  font-family: var(--font-tech);
  color: #d4dbe4;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.stats::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 10px rgba(214, 62, 47, 0.8);
  vertical-align: middle;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: 16px;
  font-family: var(--font-ui);
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.7), inset -1px -1px 0 rgba(12, 15, 18, 0.35), 0 2px 0 rgba(0, 0, 0, 0.22);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #f8a63a 0%, #d96f07 100%);
  color: #1c1005;
  border-color: #7a4303;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #ffba59 0%, #ea7e14 100%);
}

.btn-secondary {
  background: linear-gradient(180deg, #dde4ed 0%, #b7c0cb 100%);
  color: #111721;
  border-color: #5e6670;
}

.btn-secondary:hover {
  background: linear-gradient(180deg, #edf2f8 0%, #c7d1dd 100%);
}

.btn-ghost {
  border-color: #6a727a;
  background: linear-gradient(180deg, #e7ebf0 0%, #c4ccd6 100%);
  color: #151b24;
}

.btn-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-small {
  padding: 8px 11px;
  font-size: 0.82rem;
}

.btn-remove {
  background: linear-gradient(180deg, #fdfdfd 0%, #dce2eb 100%);
  border: 1px solid #7f8994;
  color: #3e4752;
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.77rem;
  padding: 6px 8px;
}

.btn-remove:hover {
  color: #111827;
  border-color: #546171;
}

.btn-item {
  border: 1px solid #6a727a;
  background: linear-gradient(180deg, #e7ebf0 0%, #c2cad3 100%);
  color: #151c24;
  border-radius: 14px;
  font-family: var(--font-tech);
  font-size: 0.78rem;
  padding: 6px 10px;
}

.btn-item:hover:not(:disabled) {
  border-color: #525a64;
  background: linear-gradient(180deg, #f1f4f8 0%, #cdd5de 100%);
}

.btn-item.danger {
  color: #8c3022;
}

.btn-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  margin: 2px 2px 0;
  min-height: 22px;
  font-size: 0.95rem;
  font-family: var(--font-tech);
  color: #d1d9e3;
}

.status.ok {
  color: #8de5b2;
}

.status.error {
  color: #f8a09f;
}

.burning {
  overflow: hidden;
}

.burn-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.08) 0%, rgba(13, 16, 20, 0.78) 40%, rgba(8, 10, 14, 0.94) 100%);
}

.burn-overlay[hidden] {
  display: none !important;
}

.burn-card {
  width: min(90vw, 560px);
  border-radius: 10px;
  border: 1px solid #888f97;
  background: linear-gradient(180deg, #dadad5 0%, #bfc2bc 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), inset 1px 1px 0 rgba(255, 255, 255, 0.88), inset -1px -1px 0 rgba(80, 84, 90, 0.5);
  padding: 24px;
}

.burn-machine {
  position: relative;
  height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 50%, rgba(214, 62, 47, 0.14) 0%, transparent 42%),
    linear-gradient(180deg, rgba(50, 58, 68, 0.96) 0%, rgba(34, 41, 50, 0.96) 100%);
  border: 1px solid rgba(108, 118, 129, 0.4);
}

.burn-machine::before,
.burn-machine::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.burn-machine::after {
  inset: auto 22px 26px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(79, 90, 103, 0.46) 0%, rgba(38, 47, 58, 0.6) 100%);
  border: none;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.32);
}

.burn-disc {
  position: absolute;
  width: 182px;
  height: 182px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #f8f9fa 0 14%, #d9dee2 15% 26%, #a8b0b7 27% 41%, #717b84 42% 44%, transparent 45%),
    conic-gradient(from 0deg, #9eaab5 0deg, #e5ebef 84deg, #6b7680 172deg, #c8cfd5 266deg, #9eaab5 360deg);
  border: 8px solid rgba(12, 16, 21, 0.44);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.2), 0 0 26px rgba(214, 62, 47, 0.12);
  animation: disc-spin 1.05s linear infinite, disc-pulse 1.8s ease-in-out infinite;
}

.burn-disc::before {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95) 0 8%, rgba(255, 255, 255, 0.06) 18%, rgba(0, 0, 0, 0.08) 70%, transparent 100%);
}

.burn-beam {
  position: absolute;
  width: 12px;
  height: 178px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 176, 142, 0.94) 36%, rgba(214, 62, 47, 0.9) 100%);
  transform: translate(104px, -54px) rotate(22deg);
  box-shadow: 0 0 20px rgba(214, 62, 47, 0.7), 0 0 44px rgba(214, 62, 47, 0.22);
  animation: beam-flicker 0.24s steps(2, end) infinite;
}

.burn-flame {
  position: absolute;
  width: 50px;
  height: 76px;
  border-radius: 50% 50% 60% 60%;
  background: radial-gradient(circle at 50% 24%, #fbe5df 0 18%, #ea8f77 34%, #d63e2f 60%, rgba(94, 25, 20, 0.08) 100%);
  filter: blur(0.3px) saturate(1.15);
  transform-origin: bottom center;
  opacity: 0.96;
}

.burn-flame-a {
  bottom: 40px;
  left: 50%;
  transform: translateX(-136px) rotate(-10deg);
  animation: flame-flicker-a 0.18s infinite alternate;
}

.burn-flame-b {
  bottom: 38px;
  left: 50%;
  transform: translateX(86px) rotate(8deg);
  animation: flame-flicker-b 0.16s infinite alternate;
}

.burn-stage {
  margin-top: 18px;
  text-align: center;
  font-family: var(--font-tech);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #161c24;
}

@keyframes disc-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes disc-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(214, 62, 47, 0.14)); }
  50% { filter: drop-shadow(0 0 18px rgba(214, 62, 47, 0.3)); }
}

@keyframes beam-flicker {
  0% { opacity: 0.72; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

@keyframes flame-flicker-a {
  from { transform: translateX(-136px) rotate(-12deg) scaleY(0.95); }
  to { transform: translateX(-136px) rotate(-7deg) scaleY(1.12); }
}

@keyframes flame-flicker-b {
  from { transform: translateX(86px) rotate(6deg) scaleY(1); }
  to { transform: translateX(86px) rotate(11deg) scaleY(1.15); }
}

@media (min-width: 760px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .cover-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (min-width: 980px) {
  .link-row {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }
}
