/* =========================================================================
   GLAS presale — phase structure and live allocation stats.
   Every number here is rendered from /presale/status; nothing is hardcoded
   in markup, so spot counts cannot drift from the ledger.
   ========================================================================= */

.presale-board {
  max-width: 1280px; margin: 26px auto 0; padding: 0 var(--gut);
}

/* Official token artwork — distinct from the GLAS navigation mark. */
.presale-hero__layout {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,360px);
  gap: clamp(34px,7vw,92px); align-items: center;
}
.presale-coin { margin: 0; text-align: center; }
.presale-coin img {
  width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 50%; opacity: 0;
}
.presale-coin .coin-webgl--presale { width: 100%; }
.presale-coin figcaption {
  margin-top: 12px; color: var(--muted); font-family: var(--mono);
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
}
@media (max-width: 760px) {
  .presale-hero__layout { grid-template-columns: 1fr; }
  .presale-coin { max-width: 280px; margin: 8px auto 0; }
}
.presale-board__in {
  border: 1px solid var(--rule); background: var(--paper);
  border-radius: 14px; display: grid; gap: 0; grid-template-columns: 1fr; overflow: hidden;
}
@media (min-width: 1080px) {
  /* The phases column needs an explicit floor: its children are min-width:0,
   so `auto` collapses and the fr columns take everything. */
  .presale-board__in {
    grid-template-columns: minmax(210px, .8fr) minmax(160px, .55fr) minmax(430px, 1.5fr) minmax(235px, .85fr);
  }
}

.pb-cell { padding: 22px 24px; border-bottom: 1px solid var(--rule); min-width: 0; }
@media (min-width: 1080px) {
  .pb-cell { border-bottom: 0; border-right: 1px solid var(--rule); }
  .pb-cell:last-child { border-right: 0; }
}

/* ---- live status ---- */
.pb-badge {
  display: inline-block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; padding: 6px 13px; background: var(--accent); color: #fff;
  border-radius: 999px;
}
.pb-phase-live {
  font-family: var(--mono); font-size: 19px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; margin: 14px 0 0; display: flex; align-items: center; gap: 9px;
}
.pb-dot { width: 9px; height: 9px; border-radius: 50%; background: #1a7f4b; flex: none; }
.pb-dot--closed { background: var(--ink-soft); }

.pb-bar { height: 8px; background: var(--rule); margin: 16px 0 14px; overflow: hidden; border-radius: 999px; }
.pb-bar__fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }

.pb-claimed { font-family: var(--mono); font-size: 13px; }
.pb-claimed b { font-size: 19px; color: var(--accent); }
.pb-remaining { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }

/* ---- pitch ---- */
.pb-pitch__k {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--accent);
  font-weight: 600; margin: 0 0 10px;
}
.pb-pitch__v { font-size: 14px; line-height: 1.5; margin: 0; }

/* ---- phase cards ---- */
/* A grid, not a scroll strip: horizontal scrolling hid Phase 3 entirely on
   narrow screens. minmax(0,1fr) lets the cards shrink to whatever fits.
   padding-top leaves room for the "Current" tag. */
.pb-phases {
  container-type: inline-size;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0; padding-top: 14px;
}
/* min-width:0 lets a grid cell shrink below its content width. */
.pb-phase {
  min-width: 0; padding: 18px clamp(6px, 1vw, 14px); text-align: center;
  border-right: 1px solid var(--rule); position: relative;
}
.pb-phase:last-child { border-right: 0; }
.pb-phase--current { border: 2px solid var(--accent); border-radius: 12px; margin: -1px; }
.pb-phase--complete { opacity: .55; }

.pb-phase__tag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  background: var(--accent); color: #fff; padding: 5px 13px; white-space: nowrap; border-radius: 999px;
}
.pb-phase__name {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 10px;
}
.pb-phase__big {
  font-size: clamp(13px, 2.4cqw, 26px); font-weight: 700; line-height: 1.05;
  letter-spacing: -.03em; white-space: nowrap;
}
.pb-phase__sub {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 5px;
}
.pb-phase__rule { height: 1px; background: var(--rule); margin: 13px 0; }
.pb-phase__state {
  display: block; margin-top: 13px; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .13em; text-transform: uppercase; padding: 8px 10px;
  background: var(--rule); color: var(--ink-soft); border-radius: 999px;
}
.pb-phase--current .pb-phase__state { background: var(--accent); color: #fff; }

/* ---- totals ---- */
.pb-total { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; min-width: 0; }
.pb-total:last-child { margin-bottom: 0; }
.pb-total__icon {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
/* 375,000,000 is the widest value here. It must wrap rather than be clipped by
   the panel's overflow:hidden (which exists for the rounded corners). */
/* One line always — "375,000,000" scales down to fit instead of wrapping. */
.pb-total__v {
  font-size: clamp(14px, 1.25vw, 19px); font-weight: 700; line-height: 1.15;
  letter-spacing: -.03em; white-space: nowrap; min-width: 0;
}
.pb-total__k {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft); margin-top: 3px;
  overflow-wrap: break-word;
}

/* ---- where the money goes ---- */
.pb-funds { max-width: 1280px; margin: 20px auto 0; padding: 0 var(--gut); }
.pb-funds__in {
  border: 1px solid var(--rule); background: var(--paper);
  border-radius: 14px; overflow: hidden; display: grid; grid-template-columns: 1fr; gap: 0;
}
@media (min-width: 980px) { .pb-funds__in { grid-template-columns: 1.3fr repeat(4, 1fr); } }
.pb-fund { padding: 20px 22px; border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-soft); }
@media (min-width: 980px) {
  .pb-fund { border-bottom: 0; border-right: 1px solid var(--rule); text-align: center; }
  .pb-fund:last-child { border-right: 0; }
}
.pb-fund--lead { display: flex; gap: 14px; align-items: flex-start; text-align: left; }
.pb-fund--lead .pb-total__icon { width: 42px; height: 42px; font-size: 18px; }
.pb-fund__k {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.pb-fund__tick { color: var(--accent); font-size: 16px; display: block; margin-bottom: 8px; }

/* ---- scarcity note ---- */
.pb-note {
  max-width: 1280px; margin: 18px auto 0; padding: 0 var(--gut);
}
.pb-note__in {
  border: 1px solid var(--rule); background: color-mix(in srgb, var(--accent) 5%, var(--paper));
  padding: 16px 22px; font-size: 12.5px; display: flex; gap: 12px; align-items: center;
  border-radius: 12px;
}
.pb-note__in b { font-weight: 700; }

@media (max-width: 640px) {
  .pb-phase__name { font-size: 9px; letter-spacing: .1em; }
  .pb-phase__sub { font-size: 8px; letter-spacing: .08em; }
  .pb-phase__state { font-size: 8px; padding: 6px 4px; letter-spacing: .06em; }
}

/* Reference styling: circled ticks and a tinted page field. */
.pb-fund__tick {
  width: 26px; height: 26px; margin: 0 auto 10px; border-radius: 50%;
  border: 1.5px solid var(--accent); color: var(--accent); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.pb-fund--lead .pb-fund__tick { margin: 0; }
.presale-board, .pb-funds, .pb-note { position: relative; z-index: 1; }
.pb-note__in .pb-fund__tick { border: 0; width: auto; height: auto; margin: 0; font-size: 17px; }

/* Flex children need min-width:0 too, or the text column keeps its full
   intrinsic width and pushes past the rounded panel's clip boundary. */
.pb-total > div:last-child { min-width: 0; flex: 1; }
