:root{
  --container-width: 1140px;
  --container-pad: 20px;
  --grid-gap: 16px;

  /* Sleek neon theme */
  --bg:#070b12;
  --bg2:#0a0f17;
  --glass: rgba(12,18,28,.6);
  --card:#0e1620;
  --muted:#8ea5b8;
  --text:#ecf6ff;

  --accent:#93e0fe;     /* neon cyan */
  --accent-2:#a08bff;   /* neon purple */
  --accent-3:#6cf3c3;   /* mint */

  --border:#1b2a38;
  --glow: 0 0 0 transparent, 0 0 25px rgba(126,252,248,.08);
}


*{box-sizing:border-box}
html,body{
  margin:0; padding:0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(126,252,248,.08), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(160,139,255,.10), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color:var(--text);
  font:16px/1.35 Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
a{color:var(--accent);text-decoration:none}

.container{max-width:var(--container-width);margin:0 auto;padding:0 var(--container-pad);display:flex;flex-direction:column;gap:18px}

/* -------- Topbar (glass, neon) -------- */
.topbar{
  position:sticky; top:0; z-index:10;
  background:linear-gradient(180deg,rgba(10,15,23,.75),rgba(10,15,23,.5));
  backdrop-filter: blur(8px);
  border-bottom:1px solid var(--border);
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px var(--container-pad);
}

.brand{display:flex;align-items:center;gap:14px;min-width:0}
.brand-stack{display:flex;flex-direction:column;gap:4px;min-width:0}
.logo{height:74px;width:auto;filter: drop-shadow(0 2px 18px rgba(126,252,248,.12))}
.brand-title{margin:0;font-size:1.85rem;font-weight:900;letter-spacing:.2px;line-height:1.05}
.ticker{
  display:inline-block; width:max-content;
  margin-bottom: 6px;
  padding:6px 10px; border-radius:999px;
  background:rgba(126,252,248,.12);
  border:1px solid rgba(126,252,248,.35);
  color:var(--accent); font-weight:800; font-size:1rem; letter-spacing:.2px;
}

.nav{display:flex;align-items:center;gap:10px}
.nav .nav-link{padding:8px 12px;border:1px solid var(--border);border-radius:12px;background:#0f1823}

/* -------- Buttons / selects -------- */
.btn{
  padding:10px 14px;border-radius:12px;border:1px solid var(--border);
  background:#122031;color:var(--text);cursor:pointer;transition:.15s transform ease;
}
.btn:hover{transform:translateY(-1px)}
.btn.primary{
  background:linear-gradient(90deg, var(--accent), var(--accent-2));
  color:#001018;border:none;font-weight:900;box-shadow:var(--glow)
}
.btn:disabled{opacity:.6;cursor:not-allowed}
.select{padding:8px 12px;border-radius:10px;background:#0f1823;border:1px solid var(--border);color:inherit}

/* -------- Cards / grids (glass look) -------- */
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--grid-gap)}
.grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--grid-gap)}

.card{
  background: linear-gradient(180deg, rgba(15,24,35,.72), rgba(15,24,35,.56));
  border:1px solid var(--border); border-radius:16px; padding:16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}

.center{text-align:center}
.label{font-size:.92rem;color:var(--muted);margin-bottom:6px}
.big{font-size:2.15rem;font-weight:900;letter-spacing:.2px}
.accent{color:var(--accent)}
.sub{font-size:.94rem;color:var(--muted)}
.small{font-size:.86rem}
.error{color:#ff6b6b}

/* -------- Top cards -------- */
.top-cards .card{min-width:0}

/* Topline rows (make Total Paid + Top Earner match perfectly) */
.topline{
  display:flex;
  align-items:flex-end;          /* align baselines consistently */
  justify-content:space-between; /* amount on left, small text on right */
  gap:.75rem;
  flex-wrap:wrap;
  min-width:0;
}
.topline .big{ line-height:1; }
.topline .sub{ line-height:1; margin-bottom:2px; } /* nudge small text down by ~2px */

/* Ensure the mono link rows under each card have matching spacing */
#tp-last-award-row,
#te-wallet{
  margin-top:.35rem;
}

.mono{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  word-break:break-all; min-width:0
}
.link{color:var(--accent)}
.links{margin-top:6px}


/* -------- Sections -------- */
.section{display:flex;flex-direction:column;gap:10px}
.section-header{display:flex;align-items:end;justify-content:space-between;gap:12px;flex-wrap:wrap}
.section-sub{color:var(--muted)}

/* -------- Eligible wallets (uniform right pills) -------- */
.wallet-list,
.list{list-style:none;margin:0;padding:0;display:grid;gap:10px}

.holder-row{
  display:grid;
  grid-template-columns: 1fr auto;
  align-items:center;
  gap:12px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(16,26,38,.9), rgba(16,26,38,.78));
}
.holder-left{min-width:0; display:flex; flex-direction:column; gap:4px}
.holder-left .addr{font-weight:900; word-break:break-all}
.holder-left .meta{color:var(--muted); font-size:.95rem}

/* Right side: uniform grid pills */
.holder-right{
  display:grid;
  grid-auto-flow: column;
  grid-auto-columns: 148px;
  gap:10px;
  justify-items:end;
}
.pill{
  display:inline-grid; place-items:center;
  min-height:38px;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(18,32,49,.9);
  color:var(--text);
  font-weight:900; font-size:.95rem; letter-spacing:.2px;
  white-space:nowrap; text-align:center;
}
.pill--tickets{
  background:rgba(126,252,248,.12);
  border-color:rgba(126,252,248,.38);
  color:var(--accent);
}
.pill--bonus{
  background:rgba(160,139,255,.12);
  border-color:rgba(160,139,255,.38);
  color:var(--accent-2);
}

/* -------- Winners list -------- */
.winners-list li{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 12px;background:linear-gradient(180deg,rgba(15,24,35,.85),rgba(15,24,35,.7));
  border:1px solid var(--border);border-radius:12px
}
.winner-left{display:flex;flex-direction:column;gap:6px;min-width:0}
.winner-wallet{font-weight:800;word-break:break-all}
.winner-links{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.amount-sol{font-weight:900;color:var(--accent)}
.pager{display:flex;align-items:center;gap:10px;margin:8px 0 12px;flex-wrap:wrap}

/* -------- Footer -------- */
.footer{padding:24px 16px;border-top:1px solid var(--border);text-align:center;color:var(--muted)}
.x-link{color:var(--accent);font-weight:800}

/* -------- Bullets (About) -------- */
.bullets{
  list-style: disc;
  padding-left: 1.25rem;
  display: grid;
  gap: .6rem;
}
.bullets li{margin:.1rem 0}

/* -------- Responsive -------- */
@media (max-width:980px){
  .grid3{grid-template-columns:1fr}
  .grid2{grid-template-columns:1fr}
  .big{font-size:2rem}
}
@media (max-width:760px){
  .logo{height:66px}
  .brand-title{font-size:1.6rem}
}
@media (max-width:640px){
  .holder-row{ grid-template-columns: 1fr }
  .holder-right{
    grid-auto-flow: row;
    grid-auto-rows: 42px;
    grid-auto-columns: unset;
    justify-items:stretch;
  }
  .pill{ width:100%; }
}
@media (max-width:520px){
  .logo{height:58px}
  .brand-title{font-size:1.38rem}
  .ticker{font-size:.95rem}
}

/* Header: place actions to the right of logo+title */
.brand-row{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;            /* graceful wrap on small screens */
}

.brand-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;               /* allow title to ellipsis if needed */
}

.brand-actions{
  margin-left:auto;          /* push actions to the right */
  display:flex;
  align-items:center;
  gap:.6rem;
}

/* Make About link visually consistent next to the button */
.brand-actions .nav-link{
  color: var(--text);
  opacity:.9;
  text-decoration:none;
  font-weight:600;
  padding:.55rem .9rem;
  border:1px solid var(--border);
  border-radius:.75rem;
}
.brand-actions .nav-link:hover{ opacity:1; border-color:var(--accent); }

/* Keep logo size tidy next to actions */
.logo{
  width: 80px;
  height: 80px;
  object-fit: contain;
}

/* Responsive: keep actions on the right when possible,
   but allow wrap under the brand on very narrow screens */
@media (max-width: 560px){
  .brand-actions{
    width:100%;
    justify-content:flex-start;   /* wrapped row under title on small screens */
    margin-left:0;
  }
}

/* Mobile: center brand block and actions */
@media (max-width: 560px){
  .brand-row{
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
  .brand-left{
    justify-content: center;
    text-align: center;
    width: 100%;
  }
  .brand-title, .ticker{
    text-align: center;
    width: 100%;
  }
  .brand-actions{
    margin-left: 0;
    width: 100%;
    justify-content: center;    /* center About + Copy CA */
  }
}
/* Desktop defaults (fine-grained control) */
#tp-last-award-row,
#te-wallet{
  font-size: 0.9rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile: slightly smaller and allow wrapping */
@media (max-width: 560px){
  #tp-last-award-row,
  #te-wallet{
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: normal !important;  /* override any inline nowrap */
    word-break: break-word;
  }
}
/* Winners list: two-column row */
.winner-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.winner-left{
  min-width: 0; /* allow truncation */
}

.winner-wallet a{
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  word-break: break-all; /* graceful on mobile */
}
.winner-wallet a:hover{ color: var(--accent); }

.winner-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;  /* amount + link right-aligned */
  gap: 6px;
  min-width: 120px;      /* keeps layout stable */
}

.amount-sol{
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
}

.view-tx{
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}
.view-tx:hover{ text-decoration: underline; }

/* Mobile polish */
@media (max-width: 560px){
  .winner-row{ gap: 10px; }
  .amount-sol{ font-size: 1rem; }
  .view-tx{ font-size: 0.8rem; }
}