@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Geist+Mono:wght@100..900&display=swap');

:root {
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --primary: #003399;        /* Official EU Reflex Blue */
  --primary-foreground: #ffffff;
  --primary-hover: #002266;
  --eu-gold: #ffcc00;        /* Official EU Flag Star Gold */
  --eu-gold-dark: #d97706;
  --eu-gold-light: rgba(255, 204, 0, 0.15);
  --live: #009f31;
  --secondary: #eef2f6;
  --secondary-foreground: #0f172a;
  --muted: #edf2f7;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --input: #cbd5e1;
  --ring: #003399;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  color: var(--foreground);
}

.tabular-nums {
  font-family: var(--font-mono), var(--font-sans);
  font-variant-numeric: tabular-nums;
}

/* Animations */
@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.animate-ping {
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Container */
.app-container {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 56rem; /* 896px / 4xl */
  flex: 1;
  padding: 1.5rem 1rem 4rem 1rem;
}

.app-container-sm {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 42rem; /* 672px / 2xl */
  flex: 1;
  padding: 1.5rem 1rem 4rem 1rem;
}

/* Header */
.site-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 2.25rem;
  text-decoration: none;
  color: var(--foreground);
  transition: opacity 0.15s;
}

.logo-link:hover {
  opacity: 0.9;
}

.text-primary {
  color: var(--primary);
}

.text-gold {
  color: var(--eu-gold-dark);
}

.bg-primary {
  background-color: var(--primary);
}

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

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

/* Live Stats Pill */
.stats-pill {
  display: inline-block;
  max-width: 100%;
  border-radius: 9999px;
  background-color: #ffffff;
  border: 1px solid var(--border);
  padding: 0.375rem 0.875rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 51, 153, 0.04);
  transition: color 0.15s ease, border-color 0.15s ease;
  margin-top: 1.25rem;
}

.stats-pill:hover {
  color: var(--foreground);
  border-color: var(--primary);
}

.live-dot-wrap {
  position: relative;
  display: inline-flex;
  width: 0.5rem;
  height: 0.5rem;
  flex-shrink: 0;
  margin-right: 0.375rem;
}

.live-dot-ping {
  position: absolute;
  display: inline-flex;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background-color: var(--live);
  opacity: 0.75;
}

.live-dot-solid {
  position: relative;
  display: inline-flex;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: var(--live);
}

.tagline {
  margin-top: 1.25rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 42rem;
  font-size: 1.125rem;
  line-height: 1.625;
  color: var(--muted-foreground);
  text-wrap: balance;
}

/* Claim Section */
.claim-card {
  margin-bottom: 2rem;
}

.claim-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

@media (min-width: 768px) {
  .claim-title {
    font-size: 2.5rem;
  }
}

.stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 9999px;
  border: none;
  background-color: rgba(0, 51, 153, 0.1);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.125rem;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  user-select: none;
}

.stepper-btn:hover {
  background-color: rgba(0, 51, 153, 0.2);
  transform: scale(1.05);
}

.stepper-btn:active {
  transform: scale(0.95);
}

.amount-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  color: var(--primary);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  cursor: text;
}

.amount-input {
  width: 5.5rem;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-align: center;
  padding: 0;
}

.claim-description {
  margin-top: 0.5rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 28rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* Claim Form */
.claim-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.claim-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .claim-form-row {
    flex-direction: row;
    align-items: center;
  }
}

.input-container {
  position: relative;
  flex: 1;
  min-width: 0;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-input {
  width: 100%;
  height: 2.75rem;
  padding-left: 2.5rem;
  padding-right: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--input);
  background-color: #ffffff;
  font-size: 1rem;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.text-input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.18);
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0 1.5rem;
  border-radius: 9999px;
  border: none;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 51, 153, 0.25);
  transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
  user-select: none;
}

.submit-btn:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 18px rgba(0, 51, 153, 0.35);
}

.submit-btn:active {
  transform: translateY(1px);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.claim-helper {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* Leaderboard Controls */
.leaderboard-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background-color: #ffffff;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s;
}

.refresh-btn:hover {
  background-color: var(--muted);
  border-color: var(--primary);
}

/* Leaderboard Main Card */
.leaderboard-card {
  background-color: #ffffff;
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  box-shadow: 0 12px 50px rgba(0, 51, 153, 0.05);
}

@media (min-width: 768px) {
  .leaderboard-card {
    border-radius: 1.25rem;
    padding: 0.75rem 1.75rem;
  }
}

/* Leaderboard Item */
.board-item {
  position: relative;
  transition: all 0.15s;
}

.board-item a.item-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0;
  text-decoration: none;
  color: inherit;
  transition: color 0.15s;
}

@media (min-width: 768px) {
  .board-item a.item-link {
    gap: 0.875rem;
    padding: 1.125rem 0;
  }
}

.board-item a.item-link:hover .item-title {
  color: var(--primary);
}

/* EU Champion & Top Ranks Highlighting */
.rank-1-wrap {
  margin: 0.375rem -0.5rem;
  padding: 0 0.5rem;
  border-radius: 0.75rem;
  border: 2px solid var(--eu-gold);
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.16) 0%, rgba(255, 204, 0, 0.06) 100%);
  box-shadow: 0 4px 16px rgba(255, 204, 0, 0.15);
}

@media (min-width: 768px) {
  .rank-1-wrap {
    margin: 0.75rem -0.75rem;
    padding: 0 0.75rem;
    border-radius: 0.875rem;
  }
}

.rank-2-wrap {
  margin: 0.375rem -0.5rem;
  padding: 0 0.5rem;
  border-radius: 0.75rem;
  border: 2px solid rgba(0, 51, 153, 0.35);
  background-color: rgba(0, 51, 153, 0.05);
}

@media (min-width: 768px) {
  .rank-2-wrap {
    margin: 0.75rem -0.75rem;
    padding: 0 0.75rem;
    border-radius: 0.875rem;
  }
}

.rank-3-wrap {
  margin: 0.375rem -0.5rem;
  padding: 0 0.5rem;
  border-radius: 0.75rem;
  border: 2px solid rgba(0, 51, 153, 0.18);
  background-color: rgba(0, 51, 153, 0.02);
}

@media (min-width: 768px) {
  .rank-3-wrap {
    margin: 0.75rem -0.75rem;
    padding: 0 0.75rem;
    border-radius: 0.875rem;
  }
}

.rank-other-wrap {
  border-top: 1px solid var(--border);
}

/* Rank Badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .rank-badge {
    min-width: 2.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.9375rem;
  }
}

.rank-badge-gold {
  background: linear-gradient(135deg, #ffcc00 0%, #f59e0b 100%);
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.rank-badge-solid {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.rank-badge-neutral {
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Avatar */
.item-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: var(--muted);
  flex-shrink: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .item-avatar {
    width: 2.75rem;
    height: 2.75rem;
  }
}

.item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-avatar-fallback {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

/* Item Text Info */
.item-info {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .item-title {
    font-size: 1rem;
  }
}

.item-desc {
  font-size: 0.75rem;
  font-weight: 450;
  color: var(--muted-foreground);
  line-height: 1.4;
  margin-top: 0.125rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  .item-desc {
    font-size: 0.875rem;
    -webkit-line-clamp: 2;
  }
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  margin-top: 0.25rem;
}

@media (min-width: 768px) {
  .item-meta {
    font-size: 0.75rem;
  }
}

.time-recent {
  color: var(--primary);
  font-weight: 600;
}

.time-older {
  color: var(--muted-foreground);
}

.clicks-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--foreground);
}

.item-price {
  flex-shrink: 0;
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary);
}

@media (min-width: 768px) {
  .item-price {
    font-size: 0.9375rem;
  }
}

/* Hover Action Pill */
.hover-claim-btn {
  position: absolute;
  left: 50%;
  top: -0.625rem;
  transform: translateX(-50%);
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 51, 153, 0.25);
  z-index: 20;
}

.board-item:hover .hover-claim-btn,
.board-item:focus-within .hover-claim-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.hover-claim-btn:hover {
  background-color: var(--primary-hover);
  transform: translateX(-50%) scale(1.05);
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding-bottom: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.footer-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}

.footer-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Toast Message */
.toast-notice {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--foreground);
  color: var(--background);
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   Checkout Account Type Modal Dialog
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 15, 45, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 32rem;
  background: #ffffff;
  border-radius: 1.25rem;
  border: 1px solid rgba(0, 51, 153, 0.12);
  box-shadow: 0 25px 60px -12px rgba(0, 34, 102, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.02);
  padding: 1.75rem;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.modal-header {
  margin-bottom: 1.5rem;
  text-align: left;
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: rgba(0, 51, 153, 0.08);
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--foreground);
  line-height: 1.25;
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.4;
  margin: 0;
}

.checkout-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.checkout-option-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 1.125rem 1.25rem;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.checkout-option-card:hover {
  border-color: var(--primary);
  background: rgba(0, 51, 153, 0.02);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 51, 153, 0.08);
}

.checkout-option-card:active {
  transform: scale(0.99);
}

.option-icon-wrap {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.company-icon {
  background: rgba(0, 51, 153, 0.1);
  color: var(--primary);
}

.private-icon {
  background: rgba(0, 159, 49, 0.1);
  color: var(--success);
}

.option-text {
  flex: 1;
  min-width: 0;
}

.option-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.option-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--foreground);
}

.option-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 204, 0, 0.2);
  color: #8a6800;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  letter-spacing: 0.02em;
}

.option-badge-neutral {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  letter-spacing: 0.02em;
}

.option-desc {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.35;
  margin: 0;
}

.option-arrow {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--muted-foreground);
  transition: transform 0.15s, color 0.15s;
}

.checkout-option-card:hover .option-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.25rem;
}

.modal-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

