:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #171a21;
  --panel-border: #2a3140;
  --text: #eef2f7;
  --muted: #9aa7bd;
  --accent: #f4b942;
  --accent-hover: #ffc85a;
  --danger: #ff6b6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, system-ui, sans-serif;
  background:
    radial-gradient(circle at top, rgba(244, 185, 66, 0.12), transparent 32%),
    linear-gradient(180deg, #12151c 0%, var(--bg) 100%);
  color: var(--text);
}

.shell {
  width: min(760px, calc(100% - 32px));
  margin: 48px auto 64px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.panel,
.result {
  background: rgba(23, 26, 33, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.lookup {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input[type="url"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #30384a;
  background: #0d1016;
  color: var(--text);
  font-size: 1rem;
}

input[type="url"]:focus {
  outline: 2px solid rgba(244, 185, 66, 0.35);
  border-color: var(--accent);
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

button {
  background: var(--accent);
  color: #17130a;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
}

button:hover {
  background: var(--accent-hover);
}

button:disabled,
.btn[disabled] {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  pointer-events: none;
}

.error {
  margin: 14px 0 0;
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.result {
  margin-top: 20px;
  padding: 22px;
}

.preview {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: center;
}

#thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  background: #0d1016;
}

.meta h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.25;
}

#meta-line {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn.primary {
  background: var(--accent);
  color: #17130a;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.secondary {
  background: #252b38;
  color: var(--text);
  border: 1px solid #3a4357;
}

.btn.secondary:hover {
  background: #30384a;
}

.hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.progress {
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: #11151d;
  border: 1px solid #2a3140;
}

.progress-header,
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.progress-header {
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #0d1016;
  overflow: hidden;
  border: 1px solid #30384a;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d89a1e, var(--accent));
  transition: width 0.35s ease;
}

.progress-meta {
  margin-top: 10px;
}

@media (max-width: 640px) {
  .lookup {
    grid-template-columns: 1fr;
  }

  .preview {
    grid-template-columns: 1fr;
  }

  #thumb {
    max-width: 280px;
  }
}
