:root {
  --pitch: #0a3d2e;
  --pitch-dark: #062a20;
  --gold: #f5c518;
  --gold-dim: #c9a012;
  --cream: #f4f1ea;
  --white: #ffffff;
  --red: #e63946;
  --green: #2ecc71;
  --green-dim: #1e8449;
  --card: rgba(12, 45, 36, 0.85);
  --card-border: rgba(245, 197, 24, 0.25);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --font-display: "Bebas Neue", sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--pitch-dark);
  color: var(--cream);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.pitch-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(6, 42, 32, 0.3) 0%, var(--pitch-dark) 70%),
    repeating-linear-gradient(
      90deg,
      var(--pitch) 0px,
      var(--pitch) 80px,
      #0d4a38 80px,
      #0d4a38 160px
    );
  background-size: 100% 100%, 160px 100%;
}

.pitch-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(245, 197, 24, 0.08), transparent 60%);
  pointer-events: none;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.15;
  background-image:
    radial-gradient(circle, var(--gold) 1px, transparent 1px),
    radial-gradient(circle, var(--white) 1px, transparent 1px);
  background-size: 48px 48px, 72px 72px;
  background-position: 0 0, 24px 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(6, 42, 32, 0.92);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 8px rgba(245, 197, 24, 0.5));
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  line-height: 1.1;
  display: block;
}

.brand-sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.live-pill {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--green);
  background: rgba(46, 204, 113, 0.15);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(46, 204, 113, 0.4);
}

@media (min-width: 640px) {
  .live-pill { display: flex; }
}

.pulse {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--pitch-dark);
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px rgba(245, 197, 24, 0.35);
}

.btn-buy:hover {
  box-shadow: 0 6px 24px rgba(245, 197, 24, 0.5);
  color: var(--pitch-dark);
}

/* Hero */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2.5rem 0 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1.2fr 0.8fr;
    padding: 3.5rem 0 2.5rem;
  }
}

.hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  background: rgba(245, 197, 24, 0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid var(--card-border);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.hero h1 .gold {
  color: var(--gold);
  text-shadow: 0 0 40px rgba(245, 197, 24, 0.35);
}

.hero-desc {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 480px;
  margin-bottom: 1.75rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

.trophy-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.trophy {
  font-size: clamp(6rem, 20vw, 9rem);
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 32px rgba(245, 197, 24, 0.4));
}

.trophy-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245, 197, 24, 0.25), transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Official CA */
.official-ca-section {
  margin: 0 0 2rem;
}

.official-ca-card {
  max-width: 100%;
  padding: 1rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.official-ca-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.official-ca-badge {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.official-ca-network {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(153, 69, 255, 0.2);
  color: #c9b3ff;
  border: 1px solid rgba(153, 69, 255, 0.35);
}

.official-ca-body {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.official-ca-address {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: clamp(0.72rem, 2.5vw, 0.9rem);
  font-weight: 600;
  line-height: 1.4;
  word-break: break-all;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(245, 197, 24, 0.35);
  border-radius: 10px;
}

.btn-copy-ca {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 1.15rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--pitch-dark);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-copy-ca:hover {
  box-shadow: 0 4px 16px rgba(245, 197, 24, 0.45);
}

.btn-copy-ca:active {
  transform: scale(0.97);
}

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

@media (max-width: 520px) {
  .official-ca-body {
    flex-direction: column;
  }

  .btn-copy-ca {
    width: 100%;
  }
}

/* Leaderboard */
.leaderboard-section {
  margin-top: 0;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.section-head p {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-bottom: 1rem;
}

.sort-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sort-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sort-btn:hover,
.sort-btn.active {
  background: var(--gold);
  color: var(--pitch-dark);
  border-color: var(--gold);
}

/* Meme list cards */
.meme-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meme-card {
  display: grid;
  grid-template-columns: minmax(6.5rem, auto) minmax(0, 1fr) minmax(7.5rem, auto);
  grid-template-areas: "player info actions";
  column-gap: 1.25rem;
  row-gap: 0.75rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, transform 0.2s;
  animation: slideIn 0.4s ease backwards;
}

.meme-player-col {
  grid-area: player;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.meme-info {
  grid-area: info;
}

.meme-card:hover {
  border-color: rgba(245, 197, 24, 0.5);
  transform: translateY(-2px);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.meme-rank {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--gold);
  opacity: 0.75;
  width: 1.75rem;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
  align-self: center;
}

/* Avatar with jersey */
.avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  position: relative;
  background: #1a1a2e;
}

.avatar-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  z-index: 2;
  padding-bottom: 8px;
}

.jersey {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4px;
}

.jersey-stripes {
  position: absolute;
  inset: 0;
  opacity: 0.95;
}

.jersey-number {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  line-height: 1;
}

.team-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: var(--pitch-dark);
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.meme-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.meme-name-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  line-height: 1.2;
}

.meme-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  color: var(--white);
}

.meme-ticker {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  background: rgba(245, 197, 24, 0.2);
  color: var(--gold);
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.meme-team {
  font-size: 0.8rem;
  opacity: 0.7;
  margin: 0;
  line-height: 1.3;
}

.meme-meta {
  display: grid;
  grid-template-columns: minmax(5.5rem, 1fr) minmax(6.5rem, 1.35fr) minmax(5.5rem, auto);
  gap: 0.5rem 1rem;
  align-items: end;
  font-size: 0.8rem;
  width: 100%;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.meta-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
}

.meta-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ca-value {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  color: rgba(244, 241, 234, 0.9);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ca-value:hover {
  color: var(--gold);
}

.price-change {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.price-change.up {
  color: var(--green);
  background: rgba(46, 204, 113, 0.15);
}

.price-change.down {
  color: var(--red);
  background: rgba(230, 57, 70, 0.15);
}

.meme-actions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.5rem;
  min-width: 7.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(245, 197, 24, 0.12);
}

.odds-tag {
  font-size: 0.75rem;
  opacity: 0.7;
  text-align: center;
}

.odds-tag strong {
  color: var(--gold);
}

.btn-bet {
  width: 100%;
  text-align: center;
  padding: 0.65rem 1.4rem;
  background: linear-gradient(135deg, var(--red), #c1121f);
  color: var(--white);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.35);
  white-space: nowrap;
}

.btn-bet:hover {
  box-shadow: 0 6px 24px rgba(230, 57, 70, 0.5);
}

@media (max-width: 768px) {
  .meme-card {
    grid-template-columns: minmax(5.5rem, auto) 1fr;
    grid-template-areas:
      "player info"
      "actions actions";
    column-gap: 1rem;
    row-gap: 0.85rem;
    padding: 1rem;
  }

  .meme-actions {
    border-left: none;
    border-top: 1px solid rgba(245, 197, 24, 0.15);
    padding: 0.75rem 0 0;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .odds-tag {
    text-align: left;
  }

  .btn-bet {
    width: auto;
    flex-shrink: 0;
  }

  .meme-meta {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 0.75rem;
  }

  .meme-meta .meta-item:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .meme-player-col {
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
  }

  .meme-rank {
    font-size: 1.25rem;
    width: auto;
  }

  .meme-meta {
    grid-template-columns: 1fr;
  }

  .meme-meta .meta-item:last-child {
    grid-column: auto;
  }

  .meme-name {
    font-size: 1.25rem;
  }
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1.25rem 2.5rem;
  font-size: 0.8rem;
  opacity: 0.75;
  border-top: 1px solid var(--card-border);
  margin-top: 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  background: rgba(245, 197, 24, 0.1);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.footer-link:hover {
  background: var(--gold);
  color: var(--pitch-dark);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.footer-link-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.footer-chain {
  margin-top: 0.35rem;
}

/* Modal */
.bet-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 2rem);
  width: 420px;
}

.bet-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: linear-gradient(160deg, #0f4a38, var(--pitch-dark));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  color: var(--cream);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream);
  font-size: 1.4rem;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-player {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.modal-player .avatar-wrap {
  width: 96px;
  height: 96px;
}

.modal-card h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  text-align: center;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.modal-ca {
  text-align: center;
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  opacity: 0.75;
  word-break: break-all;
  margin-bottom: 1rem;
}

.odds-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.odds-row strong {
  color: var(--gold);
  font-size: 1.2rem;
}

.amount-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.amount-input-wrap input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  font-family: var(--font-body);
  font-weight: 700;
  border: 2px solid var(--card-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.amount-input-wrap input:focus {
  outline: none;
  border-color: var(--gold);
}

.quick-amounts {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.quick-amt {
  flex: 1;
  padding: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}

.quick-amt:hover {
  background: var(--gold);
  color: var(--pitch-dark);
  border-color: var(--gold);
}

.potential-win {
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  opacity: 0.85;
}

.potential-win span {
  color: var(--green);
  font-weight: 800;
}

.btn-bet-submit {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--pitch-dark);
  font-size: 1rem;
  font-weight: 800;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--pitch);
  border: 1px solid var(--gold);
  color: var(--cream);
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 200;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}
