/* Henlabs V2 · Coop view: today, tomorrow, the week, supply. */

.bars { display: block; width: 100%; height: 92px; margin-top: 14px; }
.bars .bar { transition: opacity .15s ease; }
.bars .bar:hover { opacity: .8; }
.bars .bar.is-today { opacity: .45; }
.bars .bar-missing { fill: var(--line); }
.bars-sky .bar { fill: var(--sky); }
.bars-lime .bar { fill: var(--lime-bar); }
.bars-fuchsia .bar { fill: var(--fuchsia); }
.bars-ink .bar { fill: var(--text); }

.bar-labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  column-gap: 2.14%;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}
.bar-labels .is-today { color: var(--text); }
.bar-labels.is-sparse { display: flex; justify-content: space-between; gap: 8px; }

/* ----------------------------------------------------------------- Today -- */

.pool-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px 28px;
  padding: 32px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(255, 255, 255, .35), transparent 60%),
    var(--sky);
  box-shadow: var(--shadow);
}
.pool-main { min-width: 0; }
.pool-main .sub { color: var(--muted); }
.pool-main .sub strong { color: var(--text); }

.paidbar {
  height: 14px;
  margin: 16px 0 10px;
  border-radius: 999px;
  background: rgba(14, 14, 18, .14);
  overflow: hidden;
}
.paidbar span { display: block; height: 100%; border-radius: 999px; background: #0e0e12; }

.pool-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pool-stats div { min-width: 0; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .5); }
.pool-stats dt { font-size: var(--fs-label); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pool-stats dd { margin-top: 2px; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pool-stats dd.mono { font-family: var(--mono); font-weight: 700; }
.pool-stats small { font-family: var(--body); font-size: .62em; color: var(--muted); letter-spacing: 0; white-space: nowrap; }

.pool-hen { width: 128px; margin-bottom: -32px; align-self: end; }

/* -------------------------------------------------- Tomorrow · egg maths -- */

.coop-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.tomorrow-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.tomorrow-value {
  margin: 12px 0 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 3.6vw, 46px);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.tomorrow-value span { font-size: .45em; letter-spacing: -.01em; color: var(--muted); }

.build-bar {
  display: flex;
  gap: 3px;
  height: 14px;
  margin: 20px 0 18px;
  border-radius: 999px;
  overflow: hidden;
}
.build-bar span { min-width: 4px; }

/* Solid parts are in tomorrow's pool already or likely; hatched could still be collected. */
.build-carried { background: var(--text); }
.build-funding { background: var(--sky); }
.build-leftover { background: var(--lime-bar); }
.build-maybe {
  background: repeating-linear-gradient(135deg, var(--lime-bar) 0 3px, color-mix(in srgb, var(--lime-bar) 22%, transparent) 3px 7px);
}
.build-list dt i { width: 10px; height: 10px; flex: none; align-self: center; border-radius: 3px; }
.build-list dt i.build-leftover {
  background: linear-gradient(90deg, var(--lime-bar) 50%, transparent 50%),
    repeating-linear-gradient(135deg, var(--lime-bar) 0 2px, color-mix(in srgb, var(--lime-bar) 22%, transparent) 2px 4px);
}

.egg-maths {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(160deg, var(--good-bg), var(--surface) 75%);
}
.egg-hen { display: block; width: 112px; height: auto; margin: auto 4px -30px auto; padding-top: 14px; }
.egg-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 18px;
  font-weight: 700;
}
.egg-input input {
  width: 7ch;
  height: 52px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  text-align: center;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.egg-input input:focus { border-color: var(--text); box-shadow: var(--ring); }
.egg-out { margin-top: 14px; font-size: 18px; }
.egg-out strong { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; }

/* --------------------------------------------------------------- History -- */

.week,
.supply-section { margin-top: 48px; }

.history-head { align-items: flex-end; }
.history-head .muted { margin-top: 4px; }
.mini-skeleton { height: 214px; border-radius: var(--r-lg); }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.mini {
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.mini-value { margin-top: 6px; font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -.025em; }
.mini-value small { font-family: var(--body); font-size: .56em; color: var(--muted); letter-spacing: 0; }
.mini .sub { margin-top: 10px; font-size: var(--fs-small); }

/* ---------------------------------------------------------------- Supply -- */

.supply-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  gap: 16px;
}

.mint-card { position: relative; overflow: hidden; }
.mint-value {
  margin: 8px 0 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.mint-value small { font-family: var(--body); font-size: .5em; color: var(--muted); letter-spacing: 0; }
.mint-card > p:not(.label):not(.mint-value) { max-width: calc(100% - 100px); margin-top: 8px; color: var(--muted); }
.mint-card p strong { color: var(--text); }
.mint-card img { position: absolute; right: 12px; bottom: -6px; width: 104px; }

.supply-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 18px;
}
.supply-loading { display: flex; align-items: center; gap: 18px; }
.supply-loading img { width: 72px; flex: none; }

.supply-bar {
  display: flex;
  gap: 3px;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
}
.supply-bar span { min-width: 4px; }

.seg-circulating { background: var(--sky); }
.seg-reserve { background: var(--lime-bar); }
.seg-burned { background: var(--fuchsia); }
.seg-today { background: var(--text); }

.supply-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  margin-top: 20px;
}
.supply-stats div { min-width: 0; }
.supply-stats dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.supply-stats dt i { width: 10px; height: 10px; flex: none; border-radius: 3px; }
.supply-stats dd:first-of-type { margin-top: 4px; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.supply-stats .sub { margin-top: 2px; font-size: var(--fs-small); }

/* ------------------------------------------------------------ Provenance -- */

.provenance { margin-top: 48px; }
.provenance summary { font-size: 17px; }
.provenance[open] summary { margin-bottom: 14px; }
.provenance p + p { margin-top: 10px; }
.provenance > p { color: var(--muted); }
.provenance .pill { color: var(--text); }

.contracts { display: grid; gap: 8px; margin: 16px 0 4px; }
.contracts a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--soft);
  color: var(--text);
  text-decoration: none;
  transition: background-color .15s ease;
}
.contracts a:hover { background: var(--soft-2); }
.contracts span { font-weight: 700; }
.contracts code { min-width: 0; color: var(--link); font-size: 13px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ Responsive -- */

@media (max-width: 1080px) {
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pool-hen { display: none; }
}

@media (max-width: 900px) {
  .coop-pair,
  .supply-grid { grid-template-columns: minmax(0, 1fr); }
  .egg-hen { display: none; }
}

@media (max-width: 760px) {
  .history-head .segmented { display: flex; width: 100%; }
  .history-head .segmented button { flex: 1 1 0; }
  .pool-card { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; border-radius: 24px; }
  .week,
  .supply-section,
  .provenance { margin-top: 36px; }
}

@media (max-width: 560px) {
  .mini-grid { grid-template-columns: minmax(0, 1fr); }
  /* Today's stats read as a list on phones, label left and figure right. */
  .pool-stats { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pool-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .pool-stats dd { margin: 0; font-size: 18px; text-align: right; }
  .egg-input { gap: 8px; font-size: 16px; }
  .egg-input input { width: 6ch; height: 46px; font-size: 20px; }
  .egg-out { font-size: 16.5px; }
  /* Supply reads as a list on phones: label and figure on one line, note beneath. */
  .supply-stats { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .supply-stats div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; }
  .supply-stats dd:first-of-type { margin: 0; font-size: 19px; text-align: right; }
  .supply-stats .sub { grid-column: 1 / -1; }
  .mint-card > p:not(.label):not(.mint-value) { max-width: none; }
  .mint-card img { position: static; display: block; width: 84px; margin: 12px 0 -26px auto; }
}

@media (max-width: 380px) {
  .pool-stats dt { font-size: 11px; }
  .pool-stats dd { font-size: 16px; }
}
