/* Guarida — the mining strip above the room (iteration 24, js/ui/lair.js mineDash()).
   Three groups instead of eight equal boxes, read left to right (stacked on phones):
     .mine-next  WHEN    a recessed window: «Próximo bloque en», a big countdown, a chunky cheese bar
                         that fills (gliding) as the block is mined, and «Llevas ≈ x RBIT» ticking up;
     .mine-earn  WHAT    the stars: a warm lantern-lit plate with two gold rows, «Te llevas por bloque»
                         (big Ratbit coin) and «Al día» (a little pile of coins);
     .mine-net   CONTEXT quieter, on the panel itself: «La red» with the reward, the network hash and
                         the miners online (pixel icons), and a «Tu parte de la red» meter: your hash
                         (gold) against everybody's (violet), with «Ver toda la red ›».
   A paid block: the bar flashes, the «Te llevas» plate glows, its coin hops and "+x RBIT" floats up
   (.is-flash / .is-paid set by lair.js; delays continue across re-renders). No motion when reduced.
   Jersey 10 only at 20/30/40 px. Gold stays for Ratbit amounts. */

.mine-dash {
  --warm: #36233F;          /* the lantern-lit plate */
  --warm-hi: #57385A;
  --warm-lo: #1B1028;
  --cheese-hi: #FFE89A;
  --cheese: #F7C948;
  --cheese-lo: #E89B2A;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

/* ------------------------------------------------------------ 1 · next block */
.mine-next {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 12px 9px;
  background: var(--well);
  box-shadow: var(--sunk-2), var(--ring2);
}
.mine-next-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mine-next-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--px-s);
  line-height: 1;
  padding-top: 2px;
  color: var(--text-2);
  white-space: nowrap;
}
.mine-height {
  padding: 3px 6px 1px;
  font: var(--px-s)/1 var(--f-display);
  font-variant-numeric: tabular-nums;
  color: var(--violet-text);
  background: #1C1536;
  box-shadow: var(--ring2);
  white-space: nowrap;
}
.mine-next-head .tip-btn { flex: none; margin-left: auto; }
.mine-clock {
  font-family: var(--f-display);
  font-size: var(--px-l);
  line-height: 0.9;
  padding-top: 4px;
  color: var(--text);
  text-shadow: 0 3px 0 var(--ink);
  font-variant-numeric: tabular-nums;
  transition: color var(--t) steps(2);
}
.mine-next:has(.mine-bar.is-soon) .mine-clock { color: var(--gold); }
/* the countdown, and what this block already gave you beside it */
.mine-clock-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2px 12px; min-width: 0; }
.mine-clock { flex: none; }

/* the bar: a chunky cheese fill under 20 pixel blocks (30 s each); the fill glides one short linear
   step per tick and snaps back to empty on a new block (lair.js toggles .no-glide) */
.mine-bar { height: 22px; margin-top: 2px; }
.mine-bar .px-bar-fill {
  width: calc(100% - 4px);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: var(--cheese);
  box-shadow: inset 0 3px 0 var(--cheese-hi), inset 0 -4px 0 var(--cheese-lo), inset -2px 0 0 var(--cheese-hi);
  transition: transform 260ms linear, background-color var(--t) steps(2);
  will-change: transform;
}
.mine-bar .px-bar-fill.no-glide { transition: none; }
.mine-bar.is-soon .px-bar-fill { background: var(--cheese-hi); }
.mine-bar::after {
  background-image: linear-gradient(90deg, transparent calc(100% - 3px), var(--well) 0);
  background-size: calc((100% - 4px) / 20) 100%;
  background-position: 2px 0;
  background-repeat: repeat-x;
}
.mine-accrued {
  padding-bottom: 1px;
  font-size: var(--fs-6);
  font-weight: 500;
  line-height: 1.3;
  text-align: right;
  color: var(--text-2);
}
.mine-accrued > span { display: block; }
.mine-accrued strong { font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------ 2 · what you get (the stars) */
.mine-earn {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(247, 201, 72, 0.16), transparent 60%),
    var(--warm);
  box-shadow: inset 3px 3px 0 var(--warm-hi), inset -3px -3px 0 var(--warm-lo), var(--ring2);
}
.mine-prize {
  --prize-sh: inset 2px 2px 0 var(--ink), inset -2px -2px 0 rgba(255, 226, 143, 0.10);
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 10px;
  min-width: 0;
  padding: 5px 12px 5px 8px;
  background: rgba(7, 4, 15, 0.38);
  box-shadow: var(--prize-sh);
}
.mine-prize-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mine-prize-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; line-height: 0; }
.mine-prize-words { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mine-prize-words > span { font: var(--px-s)/1 var(--f-display); padding-top: 2px; color: var(--text); white-space: nowrap; }
.mine-prize-words small { font-size: 12px; font-weight: 500; line-height: 1.2; color: var(--text-2); white-space: nowrap; }
.mine-prize-label .tip-btn { flex: none; }
.mine-prize-num {
  margin: 0 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  font-family: var(--f-display);
  font-size: var(--px-m);
  line-height: 1;
  padding-top: 2px;
  color: var(--gold);
  text-shadow: 0 2px 0 var(--ink);
  font-variant-numeric: tabular-nums;
}
.mine-prize-num .mine-unit { text-shadow: none; }
/* a little pile: two coins, one on top */
.mine-pile { position: relative; display: block; width: 32px; height: 32px; }
.mine-pile > .rr-sprite { position: absolute; }
.mine-pile > :nth-child(1) { left: 1px; top: 15px; }
.mine-pile > :nth-child(2) { left: 15px; top: 15px; }
.mine-pile > :nth-child(3) { left: 8px; top: 3px; }

.mine-unit { font-family: var(--f-body); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-2); }

/* ------------------------------------------------------------ 3 · the network (secondary) */
.mine-net {
  container: dashnet / inline-size;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.mine-net-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.mine-net-title { font: var(--px-s)/1 var(--f-display); font-weight: 400; padding-top: 2px; color: var(--text); }
.mine-net-note { flex: 1 1 auto; min-width: 0; font-size: var(--fs-6); font-weight: 500; color: var(--text-3); }
.mine-net-open { flex: none; margin-left: auto; min-height: 32px; padding-inline: 10px; }

.mine-facts { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.mine-fact {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 5px 10px 5px 8px;
  background: var(--tint);
  box-shadow: inset 0 -2px 0 rgba(7, 4, 15, 0.35);
}
.mine-fact dt {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: var(--fs-6);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-2);
}
.mine-fact-label { min-width: 0; }
.mine-fact dt .tip-btn { flex: none; }
.mine-ico { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; line-height: 0; }
.mine-fact dd {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  font: var(--px-s)/1 var(--f-display);
  padding-top: 2px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.mine-fact.is-reward dd { color: var(--gold); }

/* «Tu parte de la red»: your hash (gold) against the network's (violet) */
.mine-share {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label nums" "meter meter";
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}
.mine-share-label { grid-area: label; display: flex; align-items: center; gap: 6px; font-size: var(--fs-6); font-weight: 500; color: var(--text-2); white-space: nowrap; }
.mine-meter {
  grid-area: meter;
  position: relative;
  display: block;
  height: 14px;
  margin: 0 2px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(7, 4, 15, 0.35) 10px 12px),
    #3A2D63;
  box-shadow: inset 0 2px 0 #4F3F86, var(--ring2);
  overflow: hidden;
}
.mine-meter-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: calc(var(--share, 0) * 100%);
  min-width: 4px;
  max-width: 100%;
  background: var(--gold);
  box-shadow: inset 0 2px 0 var(--gold-hi), inset 0 -2px 0 var(--gold-lo), 2px 0 0 var(--ink);
  transition: width 400ms steps(4);
}
.mine-meter-fill.is-zero { min-width: 0; box-shadow: none; }
.mine-share-nums { grid-area: nums; display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; white-space: nowrap; }
.mine-share-pct { font: var(--px-s)/1 var(--f-display); font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }
.mine-share-mine { display: inline-flex; align-items: center; gap: 3px; font: var(--px-s)/1 var(--f-display); color: var(--text-2); font-variant-numeric: tabular-nums; }
.mine-share-mine .mine-ico { width: 18px; height: 18px; align-self: center; }

/* a narrow network group (phones): no side note, so the title and the button share a line */
@container dashnet (max-width: 429.98px) {
  .mine-net-note { display: none; }
}
/* the network group has room: the three facts side by side, the meter on the label's line */
@container dashnet (min-width: 430px) {
  .mine-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mine-fact { flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 5px 8px 5px 38px; }
  .mine-fact .mine-ico { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); }
  .mine-share { grid-template-columns: auto minmax(60px, 1fr) auto; grid-template-areas: "label meter nums"; }
}

/* ------------------------------------------------------------ layouts */
/* tablets and small laptops: the block and the stars side by side, the network under them */
@media (min-width: 640px) {
  .mine-dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px 14px; gap: 12px 14px; }
  .mine-net { grid-column: 1 / -1; padding-top: 10px; box-shadow: 0 -3px 0 var(--s1-lo); }
}
/* desktop: one row — block · stars · network (about as tall as the old strip, so the room keeps
   its size) */
@media (min-width: 1280px) {
  .mine-dash { grid-template-columns: minmax(250px, 0.9fr) minmax(320px, 1fr) minmax(0, 1.9fr); gap: 14px; padding: 12px 14px; }
  .mine-net { grid-column: auto; padding: 0 0 0 16px; box-shadow: -3px 0 0 var(--s1-lo); }
}
@media (max-width: 639.98px) {
  .mine-net { padding-top: 10px; box-shadow: 0 -3px 0 var(--s1-lo); }
  .mine-clock { font-size: var(--px-xl); line-height: 0.85; }
}

/* ------------------------------------------------------------ a paid block */
.mine-dash.is-flash .mine-bar { animation: mine-flash 900ms steps(4) var(--block-at, 0ms) both; }
@keyframes mine-flash {
  0%, 50% { box-shadow: var(--sunk-2), 0 -2px 0 var(--gold), 0 2px 0 var(--gold), -2px 0 0 var(--gold), 2px 0 0 var(--gold); }
  100% { box-shadow: var(--sunk-2), var(--ring2); }
}
.mine-dash.is-paid .mine-prize.is-per-block { animation: prize-glow 1400ms steps(7) var(--paid-at, 0ms) both; }
.mine-dash.is-paid .mine-prize.is-per-day { animation: prize-glow 1100ms steps(5) calc(var(--paid-at, 0ms) + 200ms) both; }
@keyframes prize-glow {
  0%, 35% {
    background-color: rgba(247, 201, 72, 0.22);
    box-shadow: var(--prize-sh), 0 -2px 0 var(--gold), 0 2px 0 var(--gold), -2px 0 0 var(--gold), 2px 0 0 var(--gold);
  }
  100% { background-color: rgba(7, 4, 15, 0.38); box-shadow: var(--prize-sh); }
}
.mine-dash.is-paid .is-per-block .mine-prize-ico { animation: coin-hop 800ms steps(8) var(--paid-at, 0ms) both; }
@keyframes coin-hop {
  0% { transform: none; }
  25% { transform: translateY(-9px); }
  50% { transform: none; }
  65% { transform: translateY(-3px); }
  80%, 100% { transform: none; }
}
.mine-dash.is-paid .mine-prize-num { animation: num-glint 900ms steps(3) var(--paid-at, 0ms) both; }
@keyframes num-glint {
  0%, 40% { color: var(--gold-hi); transform: translateY(-2px); }
  100% { color: var(--gold); transform: none; }
}
.mine-pop {
  position: absolute;
  right: 12px;
  bottom: calc(100% - 10px);
  z-index: 3;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 8px 2px;
  font: var(--px-s)/1 var(--f-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--gold);
  background: var(--surface-3);
  box-shadow: var(--ring2), 0 4px 0 var(--drop);
  pointer-events: none;
  animation: mine-pop 1800ms steps(12) var(--paid-at, 0ms) both;
}
.mine-pop small { font: 600 12px/1 var(--f-body); letter-spacing: 0.04em; color: var(--text-2); }
@keyframes mine-pop {
  0% { opacity: 0; transform: translateY(8px); }
  14% { opacity: 1; transform: translateY(-2px); }
  75% { opacity: 1; transform: translateY(-12px); }
  100% { opacity: 0; transform: translateY(-18px); }
}

/* ------------------------------------------------------------ reduced motion */
html[data-reduced-motion="true"] .mine-bar .px-bar-fill,
html[data-reduced-motion="true"] .mine-meter-fill,
html[data-reduced-motion="true"] .mine-clock { transition: none; }
html[data-reduced-motion="true"] .mine-dash *,
html[data-reduced-motion="true"] .mine-dash { animation: none !important; }
html[data-reduced-motion="true"] .mine-pop { display: none; }
@media (prefers-reduced-motion: reduce) {
  .mine-bar .px-bar-fill, .mine-meter-fill, .mine-clock { transition: none; }
  .mine-dash, .mine-dash * { animation: none !important; }
  .mine-pop { display: none; }
}

/* ------------------------------------------------------------ main column: room + «Últimos retiros»
   (iteration 28, js/ui/recentwd.js). The list sits right under the room in the same column. */
.lair-main { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
@media (min-width: 1240px) { .lair-main { gap: 20px; } }

.recent-wd .panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.rwd-list {
  list-style: none;
  margin: var(--sp-3) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
@media (min-width: 900px) { .rwd-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; } }
.rwd-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  grid-template-areas: "user amount coin status" "when when when when";
  align-items: center;
  gap: 2px 10px;
  padding: 8px 12px;
  background: var(--well);
  box-shadow: var(--sunk-2);
  min-width: 0;
}
.rwd-user { grid-area: user; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rwd-amount { grid-area: amount; display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rwd-amount strong { font: 400 var(--px-s)/1 var(--f-display); color: var(--gold); }
.rwd-amount small { font-size: var(--fs-6); color: var(--text-2); }
.rwd-coin {
  grid-area: coin;
  padding: 3px 6px 2px;
  font: 400 var(--px-s)/1 var(--f-display);
  color: var(--violet-text);
  background: #1C1536;
  box-shadow: var(--ring2);
}
.rwd-status { grid-area: status; font-size: var(--fs-6); font-weight: 600; white-space: nowrap; }
.rwd-status.is-paid { color: var(--success); }
.rwd-status.is-paid::before { content: '✓ '; }
.rwd-status.is-sim { color: var(--text-3); }
.rwd-when { grid-area: when; font-size: var(--fs-6); color: var(--text-3); }
.rwd-empty { padding: 10px 12px; color: var(--text-2); background: var(--well); box-shadow: var(--sunk-2); }
.rwd-note { margin: var(--sp-3) 0 0; font-size: var(--fs-6); }
@media (max-width: 420px) {
  .rwd-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "user amount coin" "status when when"; }
}
