:root {
  --bg: #fafafa;
  --text: #18181b;
  --text-muted: #71717a;
  --primary: #e5484d;
  --primary-hover: #d6383d;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --surface: #ffffff;
  --radius: 9999px;
  --radius-sm: 8px;
  --max-width: 896px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Disclaimer banner */
.disclaimer-banner {
  background: #fef3f3;
  border-bottom: 1px solid #fecaca;
  color: #71717a;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  line-height: 1.4;
}
.disclaimer-banner strong { color: var(--primary); font-weight: 700; }
.disclaimer-banner a { color: var(--primary); }

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}
.hero h1 {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.live-traffic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.live-traffic strong {
  color: var(--text);
  font-weight: 700;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
  animation: live-pulse 2s infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}
.tagline {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Bid section */
.bid-section {
  padding: 32px 0;
  border-top: 2px solid var(--primary);
}
.bid-section h2 {
  font-size: 40px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.bid-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
}

#bid-form {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-row { display: flex; gap: 12px; }
.form-row.two-col { flex-direction: column; }
@media (min-width: 640px) {
  .form-row.two-col { flex-direction: row; }
  .form-row.two-col > input,
  .form-row.two-col > .amount-input { flex: 1; }
}

#bid-form input[type="text"],
#bid-form input[type="number"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#bid-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12);
}

.amount-input {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.amount-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12);
}
#bid-form .amount-input input[type="number"] {
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.amount-prefix,
.amount-suffix {
  flex-shrink: 0;
  color: var(--text-muted);
  font-weight: 600;
}
.amount-prefix { padding-left: 14px; }
.amount-suffix {
  padding-right: 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

#verify-profile-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
#x-handle { min-width: 0; }
#verify-profile-btn:hover { border-color: var(--primary); }
#verify-profile-btn:disabled { opacity: 0.6; cursor: wait; }
@media (max-width: 480px) {
  #verify-profile-btn { padding-inline: 10px; }
}

.profile-verification:empty { display: none; }
.profile-verification {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
}
.profile-verification.is-error {
  min-height: auto;
  border-color: #fecaca;
  background: #fef3f3;
  color: var(--primary);
}
.verified-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
}
.verified-identity {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  line-height: 1.35;
}
.verified-identity strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.verified-badge {
  flex-shrink: 0;
  color: #15803d;
  font-weight: 700;
}

/* Acknowledgment */
.ack-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  background: #fef3f3;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
}
.ack-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--primary);
  cursor: pointer;
}
.ack-text { line-height: 1.5; }
.ack-text strong { color: var(--text); font-weight: 600; }
.ack-text a { color: var(--primary); }

/* Submit button */
#bid-btn {
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
#bid-btn:hover { background: var(--primary-hover); }
#bid-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.error {
  color: var(--primary);
  font-size: 14px;
  min-height: 1.2em;
  text-align: center;
}

/* Leaderboard */
.leaderboard {
  border-top: 2px solid var(--primary);
  margin-top: 32px;
}
.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  font-style: italic;
}

.current-ruler {
  position: relative;
  margin: 48px 0 30px;
  overflow: visible;
  border: 1px solid #f4b4b7;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff 0%, #fff8f1 55%, #fef3f3 100%);
  box-shadow: 0 8px 24px rgba(229, 72, 77, 0.09);
}
.current-ruler::after {
  position: absolute;
  right: 4px;
  bottom: 0;
  content: '♛';
  color: rgba(229, 72, 77, 0.07);
  font-size: 112px;
  line-height: 1;
  pointer-events: none;
  transform: rotate(-10deg);
}
.ruler-crown {
  position: absolute;
  z-index: 3;
  top: -38px;
  left: 50%;
  display: block;
  font-size: 58px;
  line-height: 1;
  filter: drop-shadow(0 8px 8px rgba(88, 28, 30, 0.2));
  transform: translateX(-50%) rotate(-3deg);
  transform-origin: 50% 80%;
  transition: transform 0.2s ease;
  pointer-events: none;
}
.current-ruler:hover .ruler-crown {
  transform: translateX(-50%) translateY(-3px) rotate(2deg) scale(1.06);
}
.current-ruler-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 0;
}
.current-ruler-title {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.current-ruler-tagline {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}
.current-ruler-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.share-ruler {
  padding: 5px 10px;
  border: 1px solid rgba(229, 72, 77, 0.3);
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.share-ruler:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}
.share-ruler:focus-visible {
  outline: 3px solid rgba(229, 72, 77, 0.2);
  outline-offset: 2px;
}
.court-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.court-heading span:last-child {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

/* Leaderboard item — matches outbid.lol's flex row */
.lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.lb-item:hover { text-decoration: none; background: #f4f4f5; }
.lb-item:hover .lb-name { text-decoration: underline; }
.lb-item.is-current {
  position: relative;
  z-index: 1;
  gap: 16px;
  padding: 18px 20px 22px;
  border-bottom: 0;
}
.lb-item.is-current:hover { background: rgba(255, 255, 255, 0.55); }
.lb-item.is-current .lb-avatar {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #f4b4b7;
}
.lb-item.is-current .lb-name { font-size: 20px; }
.lb-item.is-current .lb-handle { font-size: 15px; }
.lb-item.is-current .lb-amount {
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
}

.lb-rank {
  flex-shrink: 0;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  padding: 1px 6px;
}

.lb-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
}
@media (min-width: 768px) {
  .lb-rank { min-width: 40px; font-size: 16px; padding: 2px 8px; }
}
@media (max-width: 520px) {
  .current-ruler-heading { padding-inline: 14px; }
  .current-ruler-tagline { display: none; }
  .lb-item.is-current { gap: 10px; padding-inline: 14px; }
  .lb-item.is-current .lb-avatar {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }
  .lb-item.is-current .lb-name { font-size: 18px; }
  .lb-item.is-current .lb-amount { font-size: 17px; }
}

.lb-body {
  flex: 1;
  min-width: 0;
}
.lb-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.lb-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.lb-status {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f1f2;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.lb-status.is-reigning {
  background: rgba(229, 72, 77, 0.12);
  color: var(--primary);
}
.lb-rank.is-history {
  background: #e8e8ea;
  color: var(--text);
}
.bid-history {
  margin-top: 48px;
  scroll-margin-top: 20px;
}
.bid-history-heading {
  padding-top: 0;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  color: var(--text-muted);
  font-size: 13px;
}
.pagination button {
  min-width: 88px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.lb-handle {
  font-size: 14px;
  color: var(--text-muted);
}
.lb-blurb {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.lb-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.lb-right {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.lb-amount {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.lb-profile-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Footer */
.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 32px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}
.footer p { margin-bottom: 8px; }
.footer a { color: var(--primary); }
.footer .rules { font-size: 13px; }
.footer .trademark {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 600px;
  margin: 12px auto;
}
.footer .trademark strong { color: var(--text); }

/* Legal page */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 16px 64px;
  line-height: 1.7;
}
.legal-page h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.legal-page .updated {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}
.legal-page section { margin-bottom: 32px; }
.legal-page h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.legal-page p { margin-bottom: 12px; color: var(--text); }
.legal-page a { color: var(--primary); }
.legal-page .back-home { margin-top: 32px; text-align: center; }
.legal-page .back-home a {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
}
