@font-face {
  font-family: 'Anton';
  src: url('/fonts/anton-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/fonts/plexmono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/fonts/plexmono-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #0b0a09;
  --ink-2: #141210;
  --ink-3: #1d1a17;
  --line: #2b2723;
  --bone: #ece5d5;
  --bone-2: #b9b1a1;
  --dim: #7d766a;
  --red: #ff3b1f;
  --red-deep: #c42a12;
  --green: #7fd68a;
  --display: 'Anton', 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
}

h2 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--dim);
}

code {
  font-family: var(--mono);
}

button {
  font: inherit;
  color: inherit;
}

/* ------------------------------------------------------------ top bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--gutter);
  background: rgba(11, 10, 9, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 22px;
  height: 22px;
  color: var(--red);
  flex: none;
}

.brand-name {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.chip {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--bone-2);
}

.chip b {
  color: var(--bone);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
}

.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
}

.live.on i {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(127, 214, 138, 0.6);
  animation: ping 2s infinite;
}

.live.off i {
  background: var(--red);
}

@keyframes ping {
  70% {
    box-shadow: 0 0 0 7px rgba(127, 214, 138, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(127, 214, 138, 0);
  }
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ------------------------------------------------------------ hero */

.hero {
  position: relative;
  text-align: center;
  padding: clamp(28px, 6vw, 64px) 0 0;
}

.kicker {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--bone-2);
}

.clock {
  font-family: var(--display);
  font-size: clamp(112px, 27vw, 300px);
  line-height: 0.92;
  letter-spacing: 0;
  color: var(--bone);
  display: flex;
  justify-content: center;
  user-select: none;
  transition: color 0.3s;
}

.clock .d {
  display: inline-block;
  width: 0.5em;
  text-align: center;
}

.clock .p {
  display: inline-block;
  width: 0.2em;
  text-align: center;
}

.hero.hot .clock {
  color: var(--red);
  animation: throb 1s ease-in-out infinite;
}

.hero.out .clock {
  color: var(--red);
}

.hero.idle .clock {
  color: var(--bone-2);
}

@keyframes throb {
  50% {
    transform: scale(1.025);
  }
}

.clock-sub {
  margin: 10px auto 0;
  max-width: 34em;
  min-height: 3.1em;
  color: var(--bone-2);
  font-size: 14px;
}

.clock-sub b {
  color: var(--bone);
  font-weight: 600;
}

.crowd-wrap {
  position: relative;
  width: 100vw;
  margin: 8px 0 0 calc(50% - 50vw);
  height: clamp(96px, 13vw, 150px);
  border-bottom: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

#crowd {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ------------------------------------------------------------ winner */

.winner {
  margin: 28px 0 0;
  padding: 26px 22px;
  text-align: center;
  background: var(--red);
  color: var(--ink);
  border-radius: var(--radius);
}

.winner-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.winner-addr {
  display: block;
  margin: 10px 0 2px;
  font-family: var(--display);
  font-size: clamp(22px, 5vw, 40px);
  line-height: 1.1;
  word-break: break-all;
  text-decoration: none;
}

.winner-pot {
  font-family: var(--display);
  font-size: clamp(56px, 12vw, 110px);
  line-height: 1;
}

.winner-pot small {
  font-size: 0.4em;
}

.winner-note {
  margin-top: 8px;
  font-size: 13px;
}

.winner-note a {
  font-weight: 600;
}

/* ------------------------------------------------------------ stats */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 28px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  background: var(--ink-2);
  padding: 20px 20px 18px;
  min-width: 0;
}

.big {
  font-family: var(--display);
  font-size: clamp(40px, 5.2vw, 58px);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.big small {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--bone-2);
}

.big.addr {
  font-size: clamp(30px, 3.8vw, 44px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.big.addr.empty {
  color: var(--dim);
}

.stat-leader.has .big.addr {
  color: var(--red);
}

.stat-leader.flash {
  animation: flash 0.9s ease-out;
}

@keyframes flash {
  from {
    background: #3a140c;
  }
}

.sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--bone-2);
  min-height: 1.4em;
}

.note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.5;
}

.actions {
  margin-top: 8px;
  display: flex;
  gap: 14px;
}

.link {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--bone-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link:hover {
  color: var(--bone);
}

/* ------------------------------------------------------------ buy */

.buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
}

.buy-ca {
  min-width: 0;
}

.buy-ca h2 {
  margin-bottom: 6px;
}

.ca-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ca-line code {
  font-size: 14px;
  color: var(--bone);
  overflow-wrap: anywhere;
}

.buy.pending .ca-line code {
  color: var(--dim);
}

.btn {
  flex: none;
  display: inline-block;
  padding: 15px 26px;
  background: var(--red);
  color: var(--ink);
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.15s, transform 0.15s;
}

.btn:hover {
  background: #ff5638;
}

.btn:active {
  transform: translateY(1px);
}

.btn[aria-disabled='true'] {
  background: var(--ink-3);
  color: var(--dim);
  pointer-events: none;
}

/* ------------------------------------------------------------ feeds */

.feeds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 32px 0 0;
}

.feed h2 .count {
  color: var(--bone-2);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  max-height: 420px;
  overflow-y: auto;
}

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.list li.empty {
  color: var(--dim);
}

.list li.new {
  animation: slide 0.6s ease-out;
}

@keyframes slide {
  from {
    background: rgba(255, 59, 31, 0.18);
  }
}

.list .who {
  color: var(--bone);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list .who:hover {
  text-decoration: underline;
}

.list .right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: var(--bone-2);
}

.list .amt {
  color: var(--bone);
  font-weight: 600;
}

.list .t {
  color: var(--dim);
  min-width: 4.5em;
  text-align: right;
}

.tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--bone-2);
}

.tag.lead,
.tag.paid {
  background: var(--red);
  border-color: var(--red);
  color: var(--ink);
}

.tag.held {
  border-color: var(--red);
  color: var(--red);
}

/* ------------------------------------------------------------ rules */

.rules {
  margin: 40px 0 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
}

.rules ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: r;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px 24px;
}

.rules li {
  counter-increment: r;
  font-size: 14px;
  color: var(--bone-2);
}

.rules li::before {
  content: counter(r, decimal-leading-zero);
  display: block;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1.1;
  color: var(--red);
}

.rules li b {
  color: var(--bone);
  font-weight: 600;
}

.fine {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--dim);
  max-width: 62em;
}

/* ------------------------------------------------------------ footer */

.foot {
  max-width: 1120px;
  margin: 44px auto 0;
  padding: 18px var(--gutter) 34px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
}

.foot code {
  color: var(--bone-2);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  padding: 10px 16px;
  background: var(--bone);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 860px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .feeds {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .buy {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    text-align: center;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  .brand-name {
    font-size: 17px;
  }
  .chip {
    display: none;
  }
  .stat {
    padding: 16px;
  }
  .list .t {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero.hot .clock,
  .live.on i,
  .list li.new,
  .stat-leader.flash {
    animation: none;
  }
}
