:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #162031;
  --muted: #657187;
  --border: #dbe2ee;
  --accent: #1d4ed8;
  --accent-soft: #dbeafe;
  --up: #15803d;
  --up-soft: #dcfce7;
  --down: #b91c1c;
  --down-soft: #fee2e2;
  --shadow: 0 18px 40px rgba(18, 32, 60, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(219, 226, 238, 0.8);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 18px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
}

.hero {
  padding: 28px 16px 18px;
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  background: linear-gradient(135deg, #ffffff 0%, #edf4ff 100%);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px 20px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.hero-text {
  margin: 14px 0 0;
  max-width: 650px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 22px;
}

.meta-box {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
}

.meta-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-head h2 {
  margin: 0;
  font-size: 1.7rem;
}

.ghost-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}

.ghost-btn:hover {
  background: var(--surface-2);
}

.ranking-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.rank-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #dce6f8;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(22, 32, 49, 0.85);
  color: #fff;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.card-body {
  padding: 16px;
}

.card-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
}

.score-pill {
  white-space: nowrap;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.card-subtext {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.card-flip-area {
  position: relative;
  min-height: 110px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 16px;
  overflow: hidden;
}

.card-face {
  padding: 14px;
}

.front-label,
.back-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.front-copy,
.card-description {
  margin: 0;
  line-height: 1.5;
}

.card-back {
  display: none;
}

.rank-card.flipped .card-front {
  display: none;
}

.rank-card.flipped .card-back {
  display: block;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.vote-btn,
.details-btn {
  border: none;
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 700;
}

.upvote-btn {
  background: var(--up-soft);
  color: var(--up);
}

.downvote-btn {
  background: var(--down-soft);
  color: var(--down);
}

.details-btn {
  background: #e8edf7;
  color: var(--text);
}

.vote-btn:hover,
.details-btn:hover {
  filter: brightness(0.98);
}

.info-block {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px 18px;
}

.info-block h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.info-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (min-width: 700px) {
  .hero {
    padding: 34px 20px 20px;
  }

  .hero-inner {
    padding: 38px 30px;
  }

  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ranking-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-body {
    padding: 18px;
  }
}

@media (min-width: 1040px) {
  .ranking-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.auth-shell {
  display: flex;
  justify-content: center;
  padding: 30px 0 10px;
}

.auth-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px 18px;
}

.auth-title {
  margin: 0 0 10px;
  font-size: 2rem;
}

.auth-text {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-label {
  font-weight: 700;
  font-size: 0.95rem;
}

.auth-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

.auth-input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.auth-button {
  margin-top: 6px;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.auth-button:hover {
  filter: brightness(0.97);
}

.auth-switch {
  margin: 18px 0 0;
  color: var(--muted);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.message {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid;
}

.message p {
  margin: 0;
}

.message p + p {
  margin-top: 8px;
}

.message-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.message-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.notification-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.95rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, top 0.3s ease;
}

.notification-banner.show {
  opacity: 1;
  top: 40px;
}

.notification-banner.error {
  background: #dc2626;
}

.notification-banner.success {
  background: #16a34a;
}