:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-dark: #0b5e58;
  --danger: #b91c1c;
  --border: #d1d5db;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  background: radial-gradient(circle at top left, #d1fae5 0, #f3f4f6 45%);
  color: var(--text);
}

.container {
  width: min(980px, 92vw);
  margin: 28px auto;
}

.auth-card {
  max-width: 420px;
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}

h1,
h2 {
  margin: 0 0 10px;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.stack {
  display: flex;
  flex-direction: column;
}

.gap-12 {
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

button,
.button-link {
  background: var(--accent);
  color: #fff;
  border: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
}

button.danger {
  background: var(--danger);
}

.message {
  min-height: 1.2em;
  margin: 0;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.topbar nav {
  display: flex;
  gap: 14px;
}

.topbar a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.poster {
  width: 86px;
  border-radius: 8px;
  object-fit: cover;
}

.media-summary {
  display: flex;
  gap: 14px;
  align-items: center;
}

.waveform {
  width: 100%;
  height: 170px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.region-info,
.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}

.hidden {
  display: none;
}

audio {
  width: 100%;
}

@media (max-width: 640px) {
  .media-summary {
    flex-direction: column;
    align-items: flex-start;
  }

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