:root {
  --bg: #000000;
  --card-bg: #09090b;
  --card-border: #1e1e24;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #52525b;
  --up-color: #10b981;
  --up-bg: rgba(16, 185, 129, 0.14);
  --down-color: #f43f5e;
  --down-bg: rgba(244, 63, 94, 0.14);
  --accent: #e2e8f0;
}

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

html, body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.stage {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.25rem;
}

.counter {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.quote-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 3.25rem 2.75rem 2.5rem;
  min-height: 290px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.2s ease;
}

.quote-card.loading {
  opacity: 0.45;
  transform: translateY(3px);
}

.quote-mark {
  position: absolute;
  top: 0.9rem;
  left: 1.75rem;
  font-size: 4.2rem;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
  color: #27272a;
  user-select: none;
  pointer-events: none;
}

.quote-text {
  position: relative;
  z-index: 1;
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  line-height: 1.5;
  font-weight: 500;
  color: var(--text-primary);
  white-space: pre-line;
  margin-bottom: 2rem;
}

.quote-meta {
  border-top: 1px solid #18181b;
  padding-top: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.quote-author {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

.quote-author::before {
  content: "— ";
  color: var(--text-muted);
}

.quote-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding-left: 1.2rem;
}

.hidden {
  display: none !important;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.vote-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--card-border);
  background: #0c0c0f;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.78rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: all 0.15s ease;
  user-select: none;
}

.btn:hover:not(:disabled) {
  border-color: #3f3f46;
  background: #141418;
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn-up[aria-pressed="true"],
.btn-up:hover:not(:disabled) {
  border-color: var(--up-color);
  color: var(--up-color);
}

.btn-up[aria-pressed="true"] {
  background: var(--up-bg);
}

.btn-down[aria-pressed="true"],
.btn-down:hover:not(:disabled) {
  border-color: var(--down-color);
  color: var(--down-color);
}

.btn-down[aria-pressed="true"] {
  background: var(--down-bg);
}

.badge {
  background: #18181b;
  color: var(--text-secondary);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.btn-up[aria-pressed="true"] .badge {
  background: rgba(16, 185, 129, 0.25);
  color: #ecfdf5;
}

.btn-down[aria-pressed="true"] .badge {
  background: rgba(244, 63, 94, 0.25);
  color: #fff1f2;
}

.score-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #18181b;
  background: #070709;
  min-width: 68px;
}

.score-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.score-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.btn-next {
  background: #f8fafc;
  color: #000000;
  border-color: #f8fafc;
  padding: 0.82rem 1.5rem;
  margin-left: auto;
}

.btn-next:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #e2e8f0;
  color: #000000;
}

.icon-next {
  font-size: 1.1rem;
  line-height: 1;
}

.status-msg {
  min-height: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
}

@media (max-width: 600px) {
  .quote-card {
    padding: 2.5rem 1.5rem 1.75rem;
    min-height: 240px;
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .vote-group {
    justify-content: space-between;
  }
  .btn-next {
    margin-left: 0;
    justify-content: center;
  }
}
