:root {
  --bg: #0d0a06;
  --cave: #17110a;
  --card: #1b150c;
  --line: #3a2d17;
  --gold: #ffc83d;
  --gold2: #e09a14;
  --green: #22c55e;
  --cream: #fff4d6;
  --muted: #b8a67e;
  --red: #ff5a4e;
  --r: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--cream);
  font: 500 16px/1.5 Nunito, system-ui, sans-serif; overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, .brand span, .tick, .hud b, .banner { font-family: 'Lilita One', Nunito, sans-serif; font-weight: 400; letter-spacing: .3px; }
a { color: var(--gold); }
button { font: inherit; }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(13, 10, 6, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--cream); text-decoration: none; min-height: 44px; }
.brand img { border-radius: 50%; }
.brand span { font-size: 24px; color: var(--green); }
.tick { color: var(--gold); font-size: 15px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; }
.iconbtn { margin-left: auto; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--cream); font-size: 18px; cursor: pointer; }
.iconbtn.off { opacity: .55; }

.announce { margin: 8px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--gold); color: #1b1203; font-weight: 800; }

/* CA bar */
.cabar { padding: 10px 16px; }
.preview { text-align: center; font-weight: 800; font-size: 13px; color: var(--muted); padding: 10px; border: 1px dashed var(--line); border-radius: 12px; letter-spacing: .4px; text-transform: uppercase; }
.live { display: flex; gap: 8px; align-items: center; }
.ca { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13px; color: var(--cream); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; font-weight: 900; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.gold { background: var(--gold); color: #1b1203; }
.btn.ghost { background: var(--card); color: var(--cream); border: 1px solid var(--line); }
.btn:active { transform: translateY(1px); }

/* the show */
.stagewrap { padding: 0 16px; }
.stage {
  position: relative; width: 100%; height: min(62vh, 470px); min-height: 360px;
  border-radius: var(--r); overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(120% 80% at 50% 100%, #3a2709 0%, #1a1208 45%, #0b0805 100%);
  touch-action: manipulation;
}
#show { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; pointer-events: none; }
.stat { background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 200, 61, .25); border-radius: 12px; padding: 6px 10px; line-height: 1.1; }
.stat:last-child { text-align: right; }
.stat b { display: block; font-size: 22px; color: var(--gold); }
.stat span { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.banner {
  position: absolute; left: 12px; right: 12px; top: 72px; padding: 12px 14px; border-radius: 14px; text-align: center;
  background: var(--gold); color: #1b1203; font-size: 24px; line-height: 1.1; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: pop .35s cubic-bezier(.2, 1.6, .4, 1);
}
.banner small { display: block; font-family: Nunito, sans-serif; font-weight: 800; font-size: 13px; margin-top: 4px; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.streamca { display: none; }
.next { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 10px 0 4px; font-weight: 800; font-size: 14px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: ping 1.6s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* hero copy */
.hero { padding: 18px 16px 6px; }
.hero h1 { margin: 0 0 10px; font-size: 40px; line-height: 1; color: var(--cream); }
.hero h1 em { font-style: normal; color: var(--green); }
.hero p { margin: 0; color: var(--muted); font-size: 16px; }
.hero b { color: var(--gold); }

/* cards */
.card { margin: 14px 16px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.card h2 { margin: 0 0 8px; font-size: 24px; color: var(--gold); }
.cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sub { color: var(--muted); font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.pill { font-size: 12px; font-weight: 900; padding: 2px 10px; border-radius: 99px; background: #2a2010; color: var(--muted); text-transform: uppercase; }
.pill.on { background: rgba(34, 197, 94, .15); color: var(--green); }

.feed { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.feed li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.feed li:first-child { border-top: 0; }
.feed .ic { flex: none; width: 22px; text-align: center; }
.feed .tx { flex: 1; min-width: 0; }
.feed .w { font-family: ui-monospace, Menlo, monospace; color: var(--cream); font-weight: 700; }
.feed .ago { flex: none; color: var(--muted); font-size: 12px; }
.feed .steal .tx { color: #ffb3ad; }
.feed .event .tx { color: var(--gold); font-weight: 800; }

.find { display: flex; gap: 8px; margin: 6px 0 10px; }
.find input { flex: 1; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #120d07; color: var(--cream); padding: 0 12px; font: 600 14px Nunito, sans-serif; }
.mine { padding: 12px; border-radius: 12px; background: rgba(255, 200, 61, .1); border: 1px solid rgba(255, 200, 61, .35); margin-bottom: 10px; font-weight: 700; }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.board li:first-child { border-top: 0; }
.board li.me { background: rgba(255, 200, 61, .1); border-radius: 10px; }
.board .rk { font-family: 'Lilita One', sans-serif; color: var(--muted); text-align: center; font-size: 16px; }
.board .w { font-family: ui-monospace, Menlo, monospace; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .amt { color: var(--gold); font-weight: 800; }
.board .tag { font-size: 11px; color: var(--muted); font-weight: 800; margin-left: 6px; }
.board .empty { display: block; color: var(--muted); padding: 10px 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 14px; border-left: 3px solid var(--green); margin-left: 4px; }
.timeline li + li { margin-top: 6px; }
.timeline b { display: block; color: var(--cream); }
.timeline span { color: var(--muted); font-size: 14px; }

.file { display: flex; gap: 14px; align-items: flex-start; }
.file img { flex: none; border-radius: 16px; border: 2px solid var(--line); width: 96px; height: 96px; }
.file dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 14px; }
.file dt { color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: 11px; padding-top: 3px; }
.file dd { margin: 0; font-weight: 700; }

.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rule { min-height: 120px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #241b0e; color: var(--cream); text-align: left; cursor: pointer; font: 700 14px/1.35 Nunito, sans-serif; }
.rule .n { display: block; font-family: 'Lilita One', sans-serif; color: var(--gold); font-size: 18px; margin-bottom: 6px; }
.rule .q { display: none; }
.rule.open { background: var(--gold); color: #1b1203; }
.rule.open .n { color: #1b1203; }
.rule.open .q { display: block; }
.rule.open .hint { display: none; }
.rule .hint { color: var(--muted); }

.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.faq p { margin: 0 0 10px; color: var(--muted); }

.foot { text-align: center; padding: 24px 16px 40px; color: var(--muted); font-size: 13px; }
.foot img { border-radius: 50%; }

/* desktop: the show beside the copy */
@media (min-width: 900px) {
  main { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.35fr 1fr; gap: 0 8px; align-items: start; }
  .stagewrap { grid-column: 1; grid-row: 1 / span 3; position: sticky; top: 70px; }
  .stage { height: min(76vh, 640px); }
  .hero, .feedcard { grid-column: 2; }
  .card:not(.feedcard) { grid-column: 1 / -1; }
  .cabar { max-width: 1120px; margin: 0 auto; }
  .hero h1 { font-size: 54px; }
  .rules { grid-template-columns: repeat(3, 1fr); }
}

/* ?stream=1: full-screen show for the pump.fun livestream */
body.stream { overflow: hidden; }
body.stream .top, body.stream .cabar, body.stream .announce, body.stream main > :not(.stagewrap) { display: none !important; }
body.stream main { display: block; max-width: none; }
body.stream .stagewrap { padding: 0; position: static; }
body.stream .stage { height: 100vh; min-height: 0; border: 0; border-radius: 0; }
body.stream .next { position: fixed; left: 0; right: 0; bottom: 56px; margin: 0; color: var(--cream); text-shadow: 0 2px 6px #000; font-size: 20px; }
body.stream .streamca { display: block; position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font: 800 18px ui-monospace, Menlo, monospace; color: var(--gold); text-shadow: 0 2px 6px #000; }
body.stream .stat b { font-size: 34px; }
body.stream .banner { font-size: 40px; top: 110px; left: 15%; right: 15%; }
