/* public/assets/app.css */

/* =========================
   XRPLottery — Base Theme
   Noir/Blanc, simple & net
   ========================= */

:root{
  --bg: #ffffff;
  --card: #ffffff;
  --text: #0b0b0b;
  --muted: #666666;
  --border: #e6e6e6;
  --border-2: #f0f0f0;
  --shadow: 0 18px 60px rgba(0,0,0,0.18);
  --radius: 14px;
  --radius-lg: 16px;
  --max: 980px;

  --focus: rgba(0,0,0,0.10);
  --pill: #f3f3f3;

  --ok: #0b7a0b;
  --bad: #b00020;

  --font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{ box-sizing: border-box; }
html, body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

img{ max-width:100%; display:block; }

/* =========================
   Title tag — pixel perfect
   ========================= */
.brand__text{
  position: relative;
  display: inline-block;
}

.brand__tag{
  position: absolute;

  /* anchor on text baseline */
  left: 100%;
  top: 0;

  /* 👇 fine alignment */
  transform: translate(-20px, -0.55em);

  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--muted);
  white-space: nowrap;
}

/* =========================
   Layout utils
   ========================= */
.container{
  max-width: var(--max);
  margin: 24px auto;
  padding: 0 12px;
}

.stack{ display:flex; flex-direction:column; gap:12px; }
.row{ display:flex; gap:12px; flex-wrap:wrap; }
.row > .card{ flex: 1; min-width: 320px; }

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ✅ FIX GRID OVERFLOW:
   In CSS grid, children default min-width:auto which prevents shrinking.
   This enables ellipsis instead of overflow/overlapping. */
.grid-2 > *{ min-width: 0; }

@media (max-width: 800px){
  .grid-2{ grid-template-columns: 1fr; }
}

.muted{ color: var(--muted); }
.mono{ font-family: var(--mono); }
.full{ white-space: normal !important; overflow: visible !important; text-overflow: clip !important; word-break: break-all; }

.hr{
  height:1px;
  background: var(--border-2);
  border:0;
  margin: 12px 0;
}

/* =========================
   Card
   ========================= */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card--soft{ border-color: var(--border-2); }
.card--warn{
  background: #fff3cd;
  border-color: #ffe69c;
}

/* Spacing between blocs */
.card + .card { margin-top: 12px; }
.row + .card, .grid-2 + .card { margin-top: 12px; }
.card + .row, .card + .grid-2 { margin-top: 12px; }
.grid-2 > .card, .row > .card{ margin-top: 0; }
.mb-12 { margin-bottom: 12px; }
.mt-10 { margin-top: 10px; }

.kpi{
  font-size: 34px;
  font-weight: 900;
  line-height: 1.1;
  margin: 6px 0 0 0;
}
.label{
  color: var(--muted);
  font-size: 13px;
}
.value{
  font-weight: 800;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* =========================
   Header / Topbar
   ========================= */
.topbar{
  display:grid;
  grid-template-rows: auto auto;
  grid-template-areas:
    "left center right"
    "sub  sub    sub";
  column-gap: 12px;
  row-gap: 8px;
  align-items:center;
  margin-bottom: 10px;
}

.topbar__left{ grid-area:left; justify-self:start; min-width:0; display:flex; align-items:center; }
.topbar__center{ grid-area:center; justify-self:center; min-width:0; display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:nowrap; }
.topbar__right{ grid-area:right; justify-self:end; display:flex; align-items:center; }
.topbar__sub{ grid-area:sub; justify-self:start; }

.brand{
  display:flex;
  align-items:center;
  gap:0;
  margin:0;
  font-weight: 950;
  font-size: 34px;
  line-height: 1.05;
  white-space: nowrap;
}
.brand svg{
  height: 0.70em;
  width: auto;
  margin-right: 3px;
  transform: translateY(0.02em);
  flex: 0 0 auto;
}
.brand__text{ display:inline-block; }

.nav{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:center;
}

/* Responsive header */
@media (max-width: 920px){
  .topbar{
    grid-template-columns: 1fr;
    grid-template-areas: "left" "center" "right" "sub";
    row-gap: 10px;
  }
  .topbar__left, .topbar__center, .topbar__right, .topbar__sub{ justify-self: stretch; }
  .topbar__right{ justify-content:flex-start; }
  .topbar__center{ justify-content: space-between; }
}

/* =========================
   Buttons / Controls
   ========================= */
.btn, .cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 850;
  font-size: 14px;
  line-height: 1;
  cursor:pointer;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
}
.btn:hover, .cta:hover{
  background:#000;
  color:#fff;
  border-color:#000;
  text-decoration:none;
  transform: translateY(-1px);
}
.btn:active, .cta:active{ transform: translateY(0); }
.btn--sm{ height: 30px; padding: 0 10px; border-radius: 10px; font-size: 13px; }
.btn--ghost{ background:#fff; }
.btn--block{ width:100%; }

select.lang{
  height: 34px;
  border:1px solid var(--border);
  border-radius: 11px;
  padding: 0 10px;
  background:#fff;
  font-size: 14px;
}

/* =========================
   Search
   ========================= */
.search{
  display:flex;
  align-items:center;
  border:1px solid var(--border);
  border-radius: 999px;
  background:#fff;
  padding: 0 8px;
  height: 34px;
  width: 260px;
  max-width: 260px;
  min-width: 220px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.search:focus-within{
  border-color: #bdbdbd;
  box-shadow: 0 0 0 3px var(--focus);
}
.search__input{
  border:0;
  outline:none;
  background:transparent;
  font-size: 13px;
  width: 100%;
  padding: 0 8px;
  height: 100%;
  min-width:0;
}
.iconbtn{
  border:0;
  background: var(--pill);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: background 120ms ease, transform 120ms ease;
  flex: 0 0 auto;
}
.iconbtn:hover{
  background:#000;
  transform: translateY(-1px);
}
.iconbtn:hover svg{ stroke:#fff; }
.iconbtn svg{ width:14px; height:14px; stroke:#666; }

@media (max-width: 980px){
  .search{ width: 280px; max-width: 280px; }
}
@media (max-width: 920px){
  .search{ width:100%; max-width:100%; min-width:0; }
}

/* =========================
   Pills & meta
   ========================= */
.pill{
  background: var(--pill);
  border-radius: 999px;
  padding: 6px 10px;
  display:inline-block;
  font-weight: 750;
  font-size: 13px;
}
.kpi-sub{
  margin-top: 10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

/* =========================
   Hash rows / copy buttons
   ========================= */
/* ✅ Buttons must be right after the hash (not pushed to the far right) */
.hashRow{
  display:inline-flex;          /* shrink-wrap to content */
  align-items:center;
  gap:8px;
  max-width:100%;
}

/* show full hash and allow wrapping */
.hashRow .value{
  flex: 0 1 auto;               /* do NOT take all available space */
  min-width: 0;
  max-width: calc(100% - 32px); /* keep room for 24px button + gap */
  white-space: normal;          /* allow wrap */
  overflow: visible;            /* no clipping */
  text-overflow: clip;          /* no ellipsis */
  word-break: break-all;        /* long hashes wrap cleanly */
}

.copyBtn, .linkBtn{
  border:0;
  background: var(--pill);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: background 120ms ease, transform 120ms ease;
  flex: 0 0 auto;
}
.copyBtn:hover, .linkBtn:hover{
  background:#000;
  transform: translateY(-1px);
}
.copyBtn:hover svg, .linkBtn:hover svg{ stroke:#fff; }
.copyBtn svg, .linkBtn svg{ width: 13px; height: 13px; stroke:#666; }

/* =========================
   Lists (Latest)
   ========================= */
.latest{
  list-style:none;
  padding-left:0;
  margin: 10px 0 0 0;
}
.latest__row{
  display:grid;
  grid-template-columns: 170px 1fr 170px;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.latest__row:last-child{ border-bottom:0; }

.latest__ticket{ white-space:nowrap; min-width:0; }
.latest__addr{
  min-width:0;
  word-break: break-all;
  display:flex;
  align-items:center;
  gap:8px;
}
.latest__when{
  text-align:right;
  color: var(--muted);
  white-space:nowrap;
  font-variant-numeric: tabular-nums;
}
.latest__badge{
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 720px){
  .latest__row{ grid-template-columns: 1fr; gap: 4px; }
  .latest__when{ text-align:left; }
}

/* =========================
   Tables
   ========================= */
.tableWrap{
  overflow:auto;
  border:1px solid var(--border-2);
  border-radius: 12px;
}
.table{
  width:100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td{
  padding: 9px 8px;
  border-bottom: 1px solid var(--border-2);
  text-align:left;
  vertical-align: top;
}
.table th{
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
}
.table--loose th, .table--loose td{
  padding: 10px 8px;
}
.right{ text-align:right; font-variant-numeric: tabular-nums; white-space:nowrap; }
.rank{ width:70px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* =========================
   Modal
   ========================= */
.modalBack{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 9999;
}
.modal{
  width: min(980px, 100%);
  max-height: min(82vh, 820px);
  overflow:auto;
  background:#fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  padding: 16px;
}
.modalHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  position: sticky;
  top: 0;
  background:#fff;
  padding: 4px 0 10px 0;
  border-bottom:1px solid var(--border-2);
  margin-bottom: 10px;
}
.modalTitle{
  font-size: 18px;
  font-weight: 950;
  margin:0;
}
.pre{
  background:#fafafa;
  border:1px solid var(--border-2);
  border-radius: 12px;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 12px;
  overflow:auto;
}
.ok{ color: var(--ok); font-weight: 950; }
.bad{ color: var(--bad); font-weight: 950; }

/* =========================
   Footer
   ========================= */
.footer{
  margin: 24px 0;
  text-align:center;
  font-size: 13px;
  color: var(--muted);
}

/* =========================
   Buy page (tickets grid / QR)
   ========================= */
.ticketsGrid{
  display:grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}
@media (max-width: 720px){
  .ticketsGrid{ grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 520px){
  .ticketsGrid{ grid-template-columns: repeat(6, 1fr); }
}

.ticketBtn{
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor:pointer;
  font-weight: 850;
}
.ticketBtn:hover{
  background:#000;
  color:#fff;
  border-color:#000;
}
.ticketBtn--sold{
  background:#eee;
  cursor:not-allowed;
  color:#555;
}
.ticketBtn--sold:hover{
  background:#eee;
  color:#555;
  border-color: var(--border);
  transform:none;
}
.ticketBtn--active{
  background:#fff3cd;
  border-color:#e6c870;
}

.payGrid{
  display:grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  align-items:start;
}
@media (max-width: 820px){
  .payGrid{ grid-template-columns: 1fr; }
}
.qrWrap{
  border:1px solid var(--border-2);
  border-radius: 12px;
  padding: 8px;
  background:#fff;
  width: 176px;
}
.qrMedia{
  width:160px;
  height:160px;
}
.hidden{ display:none; }
.err{ color: var(--bad); font-size: 13px; margin-top:6px; }

/* =========================
   Profile: Progress bar & badges
   ========================= */
.bar{
  width:100%;
  height: 10px;
  background: #f1f1f1;
  border-radius: 999px;
  overflow:hidden;
  margin-top: 10px;
}
.bar > span{
  display:block;
  height:100%;
  width:0%;
  background:#111;
}

.badgesGrid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.badgeItem{
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 10px 8px;
  background:#fff;
  text-align:center;
}
.badgeIcon{
  width:64px;
  height:64px;
  object-fit: contain;
  margin: 0 auto 8px;
}
.badgeTitle{
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}
.badgeItem.locked .badgeIcon{
  filter: grayscale(1);
  opacity: 0.25;
}
.badgeItem.locked .badgeTitle{
  color:#888;
  font-weight: 700;
}

/* =========================
   Pager / Tabs
   ========================= */
.pager{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-top: 10px;
}
.pager a{
  border:1px solid var(--border);
  padding: 6px 10px;
  border-radius: 11px;
}
.pager a:hover{
  background: #f8f8f8;
  text-decoration:none;
}

.tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
.tab{
  border:1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 13px;
  background:#fff;
}
.tab:hover{ text-decoration:none; }
.tab.active{
  background:#000;
  color:#fff;
  border-color:#000;
}

.subgrid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}
@media (max-width: 820px){
  .subgrid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px){
  .subgrid{ grid-template-columns: 1fr; }
}
.pillCard{
  border:1px solid var(--border-2);
  border-radius: 12px;
  padding: 10px;
  background:#fff;
}
.pillCard .label{ font-size: 12px; font-weight: 950; }
.pillCard .value{ font-size: 18px; font-weight: 950; margin-top:6px; }

/* =========================
   Terms page steps
   ========================= */
.steps{ margin-top: 10px; }
.step{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--border-2);
}
.step:first-child{ border-top:0; padding-top:0; }
.stepNum{
  width:28px;
  height:28px;
  border-radius: 999px;
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  background:#fff;
  flex: 0 0 28px;
}
code.inline{
  font-family: var(--mono);
  font-size: 12px;
  background: var(--pill);
  padding: 2px 6px;
  border-radius: 8px;
}