*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #1DB954;
  --green-dim: #158a3e;
  --bg: #0a0a0a;
  --surface: #121212;
  --surface2: #1a1a1a;
  --border: #2a2a2a;
  --text: #f0f0f0;
  --muted: #888;
  --red: #e84545;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── AUTH SCREEN ── */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(29,185,84,.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(29,185,84,.07) 0%, transparent 60%),
    var(--bg);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 3.5rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 40px 80px rgba(0,0,0,.5);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2.5rem;
}

.auth-logo svg { width: 36px; height: 36px; }

.auth-logo span {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -.02em;
}

.auth-card h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.auth-card p {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.auth-card a {
  color: var(--green);
  text-decoration: none;
}

.auth-card a:hover { text-decoration: underline; }

.token-input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.token-input-wrap input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .85rem 3rem .85rem 1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  letter-spacing: .03em;
  outline: none;
  transition: border-color .2s;
}

.token-input-wrap input:focus { border-color: var(--green); }

.toggle-vis {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: .25rem;
  display: flex;
}

.btn-primary {
  width: 100%;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: .9rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

.btn-primary:hover { background: #1ed760; }
.btn-primary:active { transform: scale(.98); }

.auth-error {
  color: var(--red);
  font-size: .82rem;
  margin-top: .5rem;
  min-height: 1.2em;
}

.steps {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.steps h3 {
  font-family: 'Syne', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.steps ol {
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 2;
}

.steps ol li a { color: var(--green); text-decoration: none; }
.steps ol li a:hover { text-decoration: underline; }

/* ── MAIN APP ── */
#app-screen { display: none; }

header {
  background: rgba(10,10,10,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
}

.logo svg { width: 28px; height: 28px; }

.logo span {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
}

.search-bar {
  flex: 1;
  display: flex;
  gap: .5rem;
  max-width: 560px;
}

.search-bar input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .65rem 1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}

.search-bar input:focus { border-color: var(--green); }

.btn-search {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: .65rem 1.4rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}

.btn-search:hover { background: #1ed760; }

.btn-logout {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: .55rem 1rem;
  font-size: .8rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: color .2s, border-color .2s;
  flex-shrink: 0;
}

.btn-logout:hover { color: var(--text); border-color: var(--text); }

main { padding: 2rem; max-width: 1400px; margin: 0 auto; }

/* ── FEATURED ── */
.featured-section { margin-bottom: 3rem; }

.section-label {
  font-family: 'Syne', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 700px) { .featured-grid { grid-template-columns: 1fr; } }

.featured-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.featured-card-title {
  padding: 1rem 1.25rem .5rem;
  font-family: 'Syne', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green);
}

.featured-card iframe {
  width: 100%;
  height: 232px;
  border: none;
  display: block;
}

/* ── RESULTS ── */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

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

.result-section h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.result-section h2 .count {
  font-size: .75rem;
  font-weight: 400;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: .15rem .6rem;
  border-radius: 100px;
}

.items-list { display: flex; flex-direction: column; gap: .75rem; }

.embed-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color .2s;
}

.embed-wrap:hover { border-color: #3a3a3a; }

.embed-wrap iframe { display: block; width: 100%; border: none; }

.load-more {
  width: 100%;
  margin-top: 1rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .7rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.load-more:hover { background: var(--surface2); border-color: var(--green); color: var(--green); }
.load-more.hidden { display: none; }

/* ── STATES ── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}

.empty-state .big-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: .4;
}

.empty-state h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  margin-bottom: .5rem;
  color: var(--text);
}

.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: .75rem;
  color: var(--muted);
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  background: rgba(232,69,69,.1);
  border: 1px solid rgba(232,69,69,.3);
  border-radius: 10px;
  padding: .9rem 1.2rem;
  color: var(--red);
  font-size: .88rem;
  margin-bottom: 1.5rem;
}
