:root {
  --bg: #0c1017;
  --panel: #111827;
  --panel-2: #151f33;
  --text: #e7ecf7;
  --muted: #9cabbe;
  --line: #223149;
  --accent: #3bc8a0;
  --accent-2: #2f8ff8;
  --danger: #f17a7a;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(1200px 480px at 20% -10%, #1a2640, transparent), var(--bg);
  color: var(--text);
}

.background-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(680px 340px at 82% 4%, rgba(59, 200, 160, 0.14), transparent);
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 42px 18px 56px;
  position: relative;
}

.app-header h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.55rem, 2.8vw, 2.25rem);
  line-height: 1.2;
}

.badge {
  display: inline-flex;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(47, 143, 248, 0.16);
  color: #a8d2ff;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: linear-gradient(180deg, rgba(21, 31, 51, 0.88), rgba(17, 24, 39, 0.88));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
  backdrop-filter: blur(6px);
}

.dropzone {
  border: 1px dashed #365073;
  border-radius: 14px;
  padding: 26px 14px;
  text-align: center;
  background: rgba(13, 19, 32, 0.55);
  transition: all 0.2s ease;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(59, 200, 160, 0.1);
}

.dropzone-title {
  margin: 0 0 4px;
  font-size: 1.06rem;
  font-weight: 700;
}

.dropzone-subtitle,
.dropzone-hint {
  margin: 6px 0 0;
  color: var(--muted);
}

.settings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 16px;
}

.setting-block {
  background: rgba(10, 15, 26, 0.5);
  border: 1px solid #27364f;
  border-radius: 12px;
  padding: 12px;
}

.setting-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.preset-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.preset {
  border: 1px solid #314766;
  background: #0f1829;
  color: #c8d6e8;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}

.preset:hover {
  border-color: #4570a6;
}

.preset.active {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  color: #0b1424;
}

.quality-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#qualityValue {
  font-weight: 700;
}

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

.queue-panel h2,
.result h3 {
  margin: 0;
}

.queue-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.queue-top p {
  margin: 0;
  color: var(--muted);
}

.file-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
  border-top: 1px solid #25344d;
}

.file-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #1f2c42;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--muted);
  font-size: 0.88rem;
}

.remove-file {
  border: 0;
  background: transparent;
  color: #e9a0a0;
  cursor: pointer;
  font-weight: 700;
}

.queue-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-primary {
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  color: #081426;
}

.btn-secondary {
  background: #152238;
  color: #c7d7ea;
  border: 1px solid #34527a;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #324867;
  color: #bfd1e8;
}

.result {
  border-color: rgba(59, 200, 160, 0.4);
}

.result-label {
  margin: 0 0 8px;
  color: #87d7c2;
  font-weight: 700;
}

.result p {
  color: var(--muted);
}

.status {
  min-height: 1.2em;
  margin: 14px 2px 0;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .app {
    padding-top: 24px;
  }

  .file-item {
    grid-template-columns: 1fr auto;
  }

  .file-size {
    display: none;
  }
}
