/* ============================================================
   Baby Doge Pepe — the board
   ------------------------------------------------------------
   The whole page is the picture: the low-poly street stays
   fixed behind everything, the hero is a heads-up display laid
   over it (the clock is the next round, the bars are the split,
   the money is what holders were paid), and everything below is
   a pause menu drawn over the same street.

   Two faces. Pirata One for the things a menu would letter by
   hand; Archivo, pushed wide and heavy, for every number.
   ============================================================ */

:root {
  --asphalt: #2b2623;
  --panel: rgba(24, 20, 18, 0.84);
  --panel-solid: #1d1917;
  --line: rgba(255, 244, 228, 0.13);
  --paper: #fff6e6;
  --dim: #c9bda9;
  --money: #7fd45f;
  --stock: #e08a5b;
  --dope: #f4b63f;
  --baby: #86b8f2;
  --ops: #8d8478;

  --display: "Pirata One", "Old English Text MT", serif;
  --body: "Archivo", system-ui, sans-serif;
  --outline: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 3px 0 #000, 0 5px 14px rgba(0, 0, 0, 0.55);
  --outline-s: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 2px 0 #000;
  --r: 14px;
  --pad: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--asphalt);
  color: var(--paper);
  font: 500 16px/1.5 var(--body);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 0.95; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---- the street, fixed behind everything ---- */
.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--asphalt) url("/assets/img/scene.jpg") 50% 62% / cover no-repeat;
}
.scene::after {
  /* Scanlines and a vignette: the picture is a game screen, so it gets one. */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.5) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 3px);
}

/* ---- top bar ---- */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px var(--pad);
  background: linear-gradient(rgba(0, 0, 0, 0.62), transparent);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 10px; border: 2px solid #000; image-rendering: pixelated; }
.brand span { font: 400 26px/1 var(--display); text-shadow: var(--outline-s); white-space: nowrap; }
.nav { display: flex; gap: 22px; margin-left: 20px; }
.nav a { font-weight: 800; font-stretch: 110%; font-size: 14px; text-decoration: none; text-shadow: var(--outline-s); }
.nav a:hover { color: var(--dope); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-link { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: rgba(0, 0, 0, 0.55); }
.icon-link svg { width: 18px; height: 18px; fill: var(--paper); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid #000;
  border-radius: 10px;
  background: var(--dope);
  color: #1a1206;
  font: 900 15px/1 var(--body);
  font-stretch: 112%;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 #000;
  transition: transform 0.08s, box-shadow 0.08s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(1px); box-shadow: 0 3px 0 #000; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 #000; }
.btn.big { min-height: 54px; padding: 0 26px; font-size: 18px; }
.btn.ghost { background: rgba(0, 0, 0, 0.6); color: var(--paper); border-color: var(--paper); }
.btn[aria-disabled="true"] { background: #6d655c; color: #e9dfd0; cursor: default; pointer-events: none; }

/* ---- hero ---- */
.hero {
  position: relative;
  min-height: 100svh;
  padding: 84px var(--pad) 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "copy hud" ". ." "foot foot";
  gap: 16px 24px;
}
.hero-copy { grid-area: copy; }
.hero h1 {
  font-size: clamp(44px, 6.2vw, 96px);
  text-shadow: var(--outline);
  letter-spacing: 0.005em;
}

/* the HUD */
.hud { grid-area: hud; justify-self: end; text-align: right; width: min(300px, 44vw); }
.hud-top { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.hud-face { border-radius: 12px; border: 3px solid #000; image-rendering: pixelated; background: #000; }
.hud-clock { display: flex; justify-content: flex-end; font: 900 46px/1 var(--body); font-stretch: 118%; text-shadow: var(--outline); }
.hud-clock b { font-weight: 900; min-width: 0.66em; text-align: center; }
.hud-clock i { font-style: normal; padding: 0 2px; }
.hud-cap { font-weight: 800; font-size: 13px; font-stretch: 108%; text-shadow: var(--outline-s); color: var(--paper); }
.hud-bars { margin: 12px 0 10px; display: grid; gap: 7px; }
.hud-bar { position: relative; height: 20px; border: 3px solid #000; background: rgba(0, 0, 0, 0.55); }
.hud-bar span { position: absolute; inset: 0 auto 0 0; width: var(--w, 50%); background: var(--c); transition: width 0.6s; }
.hud-bar em {
  position: absolute; inset: 0; padding-right: 6px;
  display: flex; align-items: center; justify-content: flex-end; gap: 5px;
  font: 800 12px/1 var(--body); font-style: normal; text-shadow: var(--outline-s); white-space: nowrap;
}
.hud-money { font: 900 40px/1 var(--body); font-stretch: 118%; color: var(--money); text-shadow: var(--outline); letter-spacing: 0.01em; }

.leg-stock { --c: var(--stock); }
.leg-doge { --c: #e6cf7c; }
.leg-pepe { --c: #6fbf96; }
.leg-dope { --c: var(--dope); }
.leg-baby { --c: var(--baby); }
.leg-ops { --c: var(--ops); }

/* the foot of the hero: the pitch on the left, the last payouts on the right */
.hero-foot { grid-area: foot; display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 350px); justify-content: space-between; align-items: end; gap: 24px; }
.pitch { background: var(--panel); border: 2px solid #000; border-radius: var(--r); padding: 18px; backdrop-filter: blur(6px); }
.pitch p { font-size: 16px; line-height: 1.45; color: var(--paper); }
.ca { margin-top: 14px; display: flex; align-items: center; gap: 10px; background: #000; border-radius: 10px; padding: 6px 6px 6px 12px; min-height: 44px; }
.ca-label { font-weight: 900; color: var(--dope); font-stretch: 112%; }
.ca code { flex: 1; min-width: 0; font: 600 13px/1.2 var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--paper); }
.ca button { border: 0; border-radius: 7px; min-height: 32px; padding: 0 12px; background: var(--paper); color: #000; font: 800 13px/1 var(--body); cursor: pointer; }
.cta { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: var(--dim); }
.live i { width: 10px; height: 10px; border-radius: 50%; background: #8d8478; }
.live.on { color: var(--money); }
.live.on i { background: var(--money); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(127, 212, 95, 0); } 0% { box-shadow: 0 0 0 0 rgba(127, 212, 95, 0.6); } }

.feed-mini { display: grid; gap: 6px; }
.feed-mini .row { backdrop-filter: blur(6px); }
.feed-mini:empty { display: none; }

/* a payout row — used in the hero and on the board */
.row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: var(--panel);
  border: 2px solid #000;
  border-left: 5px solid var(--c, #000);
  border-radius: 10px;
  text-decoration: none;
}
.row:hover { background: rgba(0, 0, 0, 0.9); }
.coin {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c, #555) center / cover; color: #1a1206;
  font: 900 15px/1 var(--body); border: 2px solid #000; flex: none;
}
.coin.has-img { color: transparent; image-rendering: auto; }
.row-main { min-width: 0; display: grid; }
.row-main b { font-weight: 900; font-size: 15px; font-stretch: 104%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main span { font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; display: grid; }
.row-end b { font-weight: 800; color: var(--money); white-space: nowrap; }
.row-end span { font-size: 12px; color: var(--dim); }

/* round passed */
.passed {
  position: fixed; inset: 0; z-index: 30; pointer-events: none;
  display: grid; place-content: center; text-align: center; gap: 6px;
  opacity: 0;
}
.passed strong { font: 400 clamp(54px, 10vw, 132px)/0.9 var(--display); color: var(--dope); text-shadow: var(--outline); }
.passed span { font: 900 clamp(20px, 3vw, 34px)/1 var(--body); font-stretch: 115%; color: var(--money); text-shadow: var(--outline); }
.passed.go { animation: passed 3.4s ease-out both; }
@keyframes passed {
  0% { opacity: 0; transform: scale(1.5); }
  10% { opacity: 1; transform: scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---- the pause menu: every section below the hero ---- */
.menu { background: var(--panel); backdrop-filter: blur(10px) saturate(0.8); border-top: 2px solid #000; padding: clamp(40px, 7vw, 88px) var(--pad); }
.menu + .menu { border-top-color: var(--line); }
.shell { max-width: 1160px; margin: 0 auto; }
.menu h2 { font-size: clamp(36px, 5vw, 60px); color: var(--paper); }
.sub { margin-top: 10px; max-width: 62ch; color: var(--dim); font-size: 17px; }
.fine { margin-top: 18px; color: var(--dim); font-size: 14px; max-width: 78ch; }
.fine a, .opsline a { color: var(--paper); }

.splitbar { margin-top: 28px; display: flex; height: 26px; border: 3px solid #000; background: #000; gap: 3px; }
.splitbar i { background: var(--c); flex: 1; min-width: 0; transition: flex 0.6s; }

.legs { margin-top: 26px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.legcol { border-top: 5px solid var(--c); padding-top: 16px; min-width: 0; }
.leg-head { display: flex; align-items: center; gap: 12px; }
.leg-head .coin { width: 52px; height: 52px; font-size: 22px; }
.coins { display: flex; flex: none; }
.coins .coin + .coin { margin-left: -14px; }
.basket { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.basket div { border-top: 3px solid var(--c); padding-top: 8px; min-width: 0; }
.leg-head div { display: grid; min-width: 0; }
.pct { font: 900 44px/0.95 var(--body); font-stretch: 118%; color: var(--c); }
.legcol.leg-stock .pct { font-size: clamp(56px, 8vw, 96px); }
.leg-head span { font-weight: 800; font-stretch: 108%; }
.legcol p { margin-top: 12px; color: var(--dim); max-width: 46ch; }
.legcol dl { margin: 16px 0 0; }
.legcol dt { font-size: 13px; color: var(--dim); }
.legcol dd { margin: 2px 0 0; font: 900 26px/1.1 var(--body); font-stretch: 112%; overflow-wrap: anywhere; }
.opsline { margin-top: 22px; color: var(--dim); font-size: 15px; }

/* board */
.board { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.rows { margin-top: 20px; display: grid; gap: 7px; }
.empty { padding: 22px; border: 2px dashed var(--line); border-radius: 10px; color: var(--dim); }
.stats { margin: 20px 0 0; }
.stats div { display: flex; align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.stats dt { color: var(--dim); }
.stats dd { margin: 0 0 0 auto; font-weight: 900; font-stretch: 110%; font-size: 18px; text-align: right; white-space: nowrap; }
.backed { display: inline-flex; align-items: center; gap: 8px; color: var(--money); }
.backed i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.backed.short { color: #ff7a6b; }

/* wallet */
.check { margin-top: 22px; display: flex; gap: 10px; max-width: 720px; }
.check input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 14px;
  background: #000; color: var(--paper); border: 2px solid var(--line); border-radius: 10px;
  font: 600 15px/1 var(--body);
}
.check input::placeholder { color: #8d8478; }
.result { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.res { background: #000; border-top: 5px solid var(--c); border-radius: 0 0 10px 10px; padding: 14px; display: grid; gap: 4px; min-width: 0; }
.res span { color: var(--dim); font-size: 14px; }
.res b { font: 900 26px/1.1 var(--body); font-stretch: 112%; }
.res small { color: var(--dim); font-size: 13px; min-height: 1.4em; }
.res-note, .res-list { grid-column: 1 / -1; color: var(--dim); }
.res-list { margin: 0; padding-left: 18px; }
.res-list a { color: var(--paper); }

/* rounds */
.tabs { display: flex; gap: 22px; align-items: baseline; }
.tab { background: none; border: 0; padding: 4px 0; cursor: pointer; font: 400 clamp(30px, 4.4vw, 52px)/1 var(--display); color: #8d8478; min-height: 44px; }
.tab.on { color: var(--paper); }
.r-row {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr 0.7fr 1.1fr; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600;
}
.r-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-head { margin-top: 18px; color: var(--dim); font-size: 13px; font-weight: 700; }
.r-row a { color: var(--money); }
.quiet { color: #8d8478; }
#rounds-list, .log { max-height: 440px; overflow: auto; }
.log { margin-top: 18px; font-size: 14px; color: var(--dim); }
.log div { padding: 7px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.log time { color: #8d8478; margin-right: 10px; }
.log .lv-warn { color: var(--dope); }
.log .lv-error { color: #ff7a6b; }

.foot { padding-top: 36px; padding-bottom: 48px; background: var(--panel-solid); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-links a { font-weight: 800; min-height: 32px; display: inline-flex; align-items: center; }
.foot-links a:not([href]) { display: none; }

/* ---- narrower screens ---- */
@media (max-width: 900px) {
  .nav { display: none; }
  .legs { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: minmax(0, 1fr); }
  .hero-foot { grid-template-columns: minmax(0, 1fr); }
  .feed-mini .row:nth-child(n + 3) { display: none; }
}
@media (max-width: 640px) {
  .scene { background-position: 50% 62%; }
  .brand span { font-size: 21px; }
  .brand img { width: 34px; height: 34px; }
  .bar .btn { padding: 0 12px; font-size: 13px; min-height: 40px; }
  .icon-link { display: none; }
  .hero { padding-top: 70px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "hud" "copy" "." "foot"; grid-template-rows: auto auto minmax(41svh, 1fr) auto; gap: 6px; }
  .hud { width: 190px; }
  .hud-face { width: 40px; height: 40px; border-width: 2px; }
  .hud-clock { font-size: 30px; }
  .hud-money { font-size: 26px; }
  .hud-bar { height: 17px; border-width: 2px; }
  .hud-bar em { font-size: 11px; }
  .hud-bars { margin: 8px 0 6px; gap: 5px; }
  .hud-cap { font-size: 11px; }
  .hero h1 { font-size: clamp(34px, 10.4vw, 46px); }
  .result { grid-template-columns: minmax(0, 1fr); }
  .basket { grid-template-columns: minmax(0, 1fr); }
  .check { flex-direction: column; }
  .r-row { grid-template-columns: 1.2fr 1fr 0.8fr 1fr; font-size: 13px; }
  .r-row > span:nth-child(3), .r-row > span:nth-child(4), .r-row > span:nth-child(5) { display: none; }
  .stats dd { font-size: 16px; }
}

@media (max-width: 380px) {
  .brand span { font-size: 18px; }
  .bar { gap: 8px; }
  .bar .btn { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .passed.go { animation: none; }
  .live.on i { animation: none; }
}
