/* ============================================================
   $BYTE — Balatro / 16-bit pixel landing
   ============================================================ */

:root {
  --cream:    #f5ecd6;
  --ink:      #14121a;
  --bg:       #0e1018;
  --bg-2:     #15182a;
  --panel:    #1b1f33;

  --red:      #e3322d;
  --red-deep: #a31f1b;
  --blue:     #2b6def;
  --blue-deep:#1746a8;

  --gold:     #ffcf4d;
  --line:     #000;

  --shadow:   8px 8px 0 #000;
  --shadow-sm:4px 4px 0 #000;

  --font-pixel: 'Press Start 2P', monospace;
  --font-term:  'VT323', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-term);
  background:
    radial-gradient(circle at 50% -10%, #232a4d 0%, var(--bg) 55%, #07080d 100%);
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 20px;
  line-height: 1.4;
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
}

img { image-rendering: pixelated; }

a { color: inherit; text-decoration: none; }

.t-red  { color: var(--red); }
.t-blue { color: var(--blue); }

/* ---------- CRT / noise overlays ---------- */
.crt {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: multiply;
  opacity: .5;
}
.noise {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- floating chips bg ---------- */
.chips { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.chip {
  position: absolute;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  font-family: var(--font-pixel); font-size: 18px;
  border: 4px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  color: var(--cream);
  opacity: .18;
  animation: float 14s ease-in-out infinite;
}
.chip--red  { background: var(--red);  }
.chip--blue { background: var(--blue); }
.chip:nth-child(1){ top:14%; left:6%;  animation-delay:-2s; }
.chip:nth-child(2){ top:62%; left:10%; animation-delay:-5s; }
.chip:nth-child(3){ top:22%; right:8%; animation-delay:-8s; }
.chip:nth-child(4){ top:74%; right:12%;animation-delay:-1s; }
.chip:nth-child(5){ top:44%; left:46%; animation-delay:-6s; }
.chip:nth-child(6){ top:8%;  left:70%; animation-delay:-3s; }

@keyframes float {
  0%,100% { transform: translateY(0) rotate(-6deg); }
  50%     { transform: translateY(-26px) rotate(6deg); }
}

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  background: rgba(14,16,24,.82);
  backdrop-filter: blur(6px);
  border-bottom: 4px solid var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__logo { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--cream); background: #000; object-fit: cover; }
.nav__name { font-family: var(--font-pixel); font-size: 16px; color: var(--cream); }
.nav__links { display: flex; gap: 22px; margin-left: auto; font-size: 22px; }
.nav__links a { color: #b9c2e0; transition: color .15s; }
.nav__links a:hover { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-pixel);
  display: inline-flex; align-items: center; gap: 8px;
  border: 4px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  color: #fff;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  text-shadow: 2px 2px 0 rgba(0,0,0,.45);
  white-space: nowrap;
}
.btn--sm { font-size: 11px; padding: 10px 14px; }
.btn--lg { font-size: 14px; padding: 18px 24px; }
.btn--red   { background: var(--red);  }
.btn--blue  { background: var(--blue); }
.btn--ghost { background: var(--panel); color: var(--cream); }
.btn:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 #000; filter: brightness(1.08); }
.btn:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 #000; }

/* ---------- HERO ---------- */
.hero {
  position: relative; z-index: 1;
  text-align: center;
  padding: 70px 20px 50px;
  max-width: 920px; margin: 0 auto;
}
.hero__logo-wrap {
  width: 230px; height: 230px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #000;
  border: 6px solid var(--cream);
  box-shadow:
    0 0 0 6px #000,
    0 12px 0 6px rgba(0,0,0,.5),
    0 0 40px rgba(0,0,0,.35);
  overflow: hidden;
  will-change: transform;
  animation: bob 4s ease-in-out infinite;
}
.hero__logo {
  width: 108%; height: 108%;
  object-fit: cover;
}
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }

.hero__title {
  font-family: var(--font-pixel);
  font-size: clamp(48px, 12vw, 110px);
  letter-spacing: 2px;
  color: var(--cream);
  text-shadow:
    6px 6px 0 var(--blue),
    -6px -6px 0 var(--red),
    0 0 0 var(--line);
  margin-bottom: 18px;
  animation: wobble 6s ease-in-out infinite;
}
@keyframes wobble {
  0%,100%{ transform: rotate(-1deg); }
  50%{ transform: rotate(1deg); }
}
.hero__tag { font-size: clamp(22px,4vw,32px); color: var(--cream); margin-bottom: 6px; }
.hero__sub { font-size: clamp(18px,3vw,24px); color: #aab4d8; max-width: 640px; margin: 0 auto 28px; }

.hero__cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }

/* ---------- Contract address ---------- */
.ca {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-term); font-size: 20px;
  background: var(--panel);
  border: 4px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  padding: 10px 14px;
  color: var(--cream);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, filter .15s;
  max-width: 100%;
}
.ca:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 #000; filter: brightness(1.1); }
.ca__label {
  font-family: var(--font-pixel); font-size: 11px;
  background: var(--gold); color: #000;
  padding: 5px 7px; border-radius: 5px; border: 2px solid #000;
}
.ca__addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca__copy { color: var(--blue); font-size: 18px; }
.ca--sm { font-size: 16px; }

/* ---------- STAT STRIP ---------- */
.strip {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
  max-width: 1000px; margin: 10px auto 60px;
  padding: 22px;
  background: var(--panel);
  border: 4px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.strip__item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.strip__item b { font-family: var(--font-pixel); font-size: clamp(20px,4vw,30px); }
.strip__item span { font-size: 18px; color: #aab4d8; margin-top: 6px; }
.strip__sep { font-family: var(--font-pixel); color: #4a5480; font-size: 22px; }

/* ---------- SECTIONS ---------- */
.section { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 50px 20px; }
.section__head { text-align: center; margin-bottom: 40px; }
.kicker { font-family: var(--font-pixel); font-size: 12px; letter-spacing: 1px; }
.section__title {
  font-family: var(--font-pixel);
  font-size: clamp(26px,6vw,46px);
  color: var(--cream);
  margin: 14px 0;
  text-shadow: 4px 4px 0 #000;
  line-height: 1.3;
}
.section__lead { font-size: clamp(18px,3vw,24px); color: #aab4d8; max-width: 620px; margin: 0 auto; }

/* ---------- CARDS (Balatro deck) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}
.card {
  position: relative;
  background: var(--cream);
  color: var(--ink);
  border: 5px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 26px 22px;
  transition: transform .1s ease, box-shadow .1s ease;
  will-change: transform;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 6px;
  border: 2px dashed rgba(0,0,0,.25); border-radius: 10px; pointer-events: none;
}
.card--red  { border-top: 14px solid var(--red); }
.card--blue { border-top: 14px solid var(--blue); }
.card__suit {
  position: absolute; top: 14px; right: 16px;
  font-size: 30px; opacity: .9;
}
.card--red  .card__suit { color: var(--red); }
.card--blue .card__suit { color: var(--blue); }
.card__title { font-family: var(--font-pixel); font-size: 15px; margin-bottom: 14px; line-height: 1.5; }
.card__body { font-size: 21px; line-height: 1.45; }
.card:hover { transform: translateY(-8px) rotate(-1.5deg); box-shadow: 12px 14px 0 #000; }

/* ---------- AGENTS ---------- */
.section--agents {
  background: var(--bg-2);
  border-top: 4px solid var(--line);
  border-bottom: 4px solid var(--line);
  max-width: none;
  margin: 30px 0;
}
.agents__grid {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.agents__copy .section__title { text-align: left; }
.agents__copy .section__lead { margin: 0 0 24px 0; text-align: left; }
.vs {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--font-pixel); font-size: 14px;
}
.vs__side {
  padding: 12px 16px; border: 4px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.vs__side--human { background: var(--red); color:#fff; }
.vs__side--agent { background: var(--blue); color:#fff; }
.vs__bolt { color: var(--gold); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.agents__art {
  background: #07080d;
  border: 5px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
  overflow: auto;
}
/* CSS arena (replaces emoji ASCII for clean alignment) */
.arena {
  font-family: var(--font-term);
  color: #7cf3a0;
  border: 3px solid #2f8f55;
  border-radius: 10px;
  box-shadow: inset 0 0 24px rgba(124,243,160,.12), 0 0 0 2px #000;
  background: linear-gradient(180deg, rgba(124,243,160,.05), transparent);
  padding: 16px;
}
.arena__bar {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px dashed #2f8f55; padding-bottom: 10px; margin-bottom: 14px;
}
.arena__title {
  font-family: var(--font-pixel); font-size: 12px; color: #9bffc1;
  text-shadow: 0 0 8px rgba(124,243,160,.6);
}
.arena__dots { letter-spacing: 4px; font-size: 16px; color: #2f8f55; }
.arena__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 14px;
}
.tok {
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  font-size: clamp(20px, 4vw, 30px);
  border: 2px solid #2f8f55;
  border-radius: 8px;
  background: #0b1410;
}
.tok--blue  { background: var(--blue); color:#fff; font-family: var(--font-pixel); font-size: 16px; border-color:#000; }
.tok--red   { background: var(--red);  color:#fff; font-family: var(--font-pixel); font-size: 16px; border-color:#000; }
.tok--prize {
  background: var(--gold); color:#000; font-family: var(--font-pixel);
  font-size: clamp(10px,2vw,13px); border-color:#000;
  box-shadow: 0 0 14px rgba(255,207,77,.6);
}
.arena__pool {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 2px dashed #2f8f55; padding-top: 12px;
}
.arena__poollabel { font-size: 18px; color: #7cf3a0; }
.arena__poolval {
  font-family: var(--font-pixel); font-size: 14px; color: var(--gold);
  text-shadow: 0 0 10px rgba(255,207,77,.5);
}
.arena__prompt { margin-top: 12px; font-size: 19px; color: #7cf3a0; }
.arena__caret { animation: blink 1s steps(2) infinite; }

/* ---------- GAMES ---------- */
.game {
  display: flex; align-items: center; gap: 20px;
  background: var(--cream); color: var(--ink);
  border: 5px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 22px;
  transition: transform .1s, box-shadow .1s;
  will-change: transform;
}
.game:hover { transform: translate(-3px,-3px); box-shadow: 12px 12px 0 #000; }
.game__icon {
  font-size: 46px; width: 70px; height: 70px; flex: none;
  display: grid; place-items: center;
  background: var(--bg-2); border: 4px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.game__icon--img { padding: 0; }
.game__icon--img img { width: 100%; height: 100%; object-fit: cover; }
.game__info { flex: 1; }
.game__title { font-family: var(--font-pixel); font-size: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.game__desc { font-size: 20px; margin-top: 8px; color: #3a3550; }
.game__live {
  font-size: 9px; background: var(--red); color: #fff;
  padding: 4px 7px; border-radius: 5px; border: 2px solid #000;
  animation: pulse 1.4s ease-in-out infinite;
}
.game__soon {
  font-size: 9px; background: #6b6b6b; color: #fff;
  padding: 4px 7px; border-radius: 5px; border: 2px solid #000;
}
@keyframes pulse { 0%,100%{ filter: brightness(1) } 50%{ filter: brightness(1.5) } }
.game__play {
  font-family: var(--font-pixel); font-size: 13px;
  background: var(--blue); color: #fff;
  padding: 14px 16px; border: 4px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-sm); flex: none;
}
.game--soon { opacity: .65; }
.game--soon .game__play { background: #6b6b6b; }

/* ---------- FOOTER ---------- */
.footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 50px 20px 40px;
  border-top: 4px solid var(--line);
  background: rgba(7,8,13,.6);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.footer__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-pixel); font-size: 18px; }
.footer__logo { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--cream); background: #000; object-fit: cover; }
.footer__links { display: flex; gap: 24px; font-size: 22px; }
.footer__links a:hover { color: var(--gold); }
.footer__note { font-size: 16px; color: #6b76a0; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(120px);
  z-index: 10000;
  font-family: var(--font-pixel); font-size: 13px;
  background: var(--blue); color: #fff;
  padding: 14px 20px; border: 4px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav__links { display: none; }
  .agents__grid { grid-template-columns: 1fr; }
  .agents__copy .section__title,
  .agents__copy .section__lead { text-align: center; }
  .vs { justify-content: center; }
  .strip__sep { display: none; }
  .game { flex-wrap: wrap; }
  .game__info { flex-basis: 60%; }
}

/* ============================================================
   DOCS / WHITEPAPER
   ============================================================ */
.doc {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 240px 1fr; gap: 40px;
  padding: 40px 20px 80px;
  align-items: start;
}

/* sidebar TOC */
.toc {
  position: sticky; top: 86px;
  background: var(--panel);
  border: 4px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.toc__title { font-family: var(--font-pixel); font-size: 11px; color: var(--gold); margin-bottom: 14px; }
.toc a {
  display: block; font-size: 20px; color: #aab4d8;
  padding: 6px 8px; border-radius: 6px; border-left: 3px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.toc a:hover { color: var(--cream); background: rgba(255,255,255,.05); border-left-color: var(--blue); }
.toc__num { color: var(--blue); font-family: var(--font-pixel); font-size: 9px; margin-right: 8px; }

/* doc body */
.doc__body { min-width: 0; }
.doc__hero { text-align: center; margin-bottom: 50px; }
.doc__badge {
  display: inline-block; font-family: var(--font-pixel); font-size: 10px;
  background: var(--gold); color: #000; padding: 7px 12px;
  border: 3px solid #000; border-radius: 8px; box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.doc__hero h1 {
  font-family: var(--font-pixel); font-size: clamp(28px,7vw,52px);
  color: var(--cream); text-shadow: 5px 5px 0 var(--blue), -5px -5px 0 var(--red);
  line-height: 1.3; margin-bottom: 16px;
}
.doc__hero p { font-size: clamp(18px,3vw,24px); color: #aab4d8; max-width: 560px; margin: 0 auto; }

.doc h2 {
  font-family: var(--font-pixel); font-size: clamp(18px,4vw,26px);
  color: var(--cream); text-shadow: 3px 3px 0 #000;
  margin: 0 0 18px; padding-top: 14px;
  display: flex; align-items: center; gap: 12px;
}
.doc h2 .sec-num {
  font-size: 12px; background: var(--blue); color: #fff;
  padding: 8px 10px; border: 3px solid #000; border-radius: 8px; box-shadow: var(--shadow-sm);
}
.doc h3 { font-family: var(--font-pixel); font-size: 14px; color: var(--gold); margin: 22px 0 12px; }
.doc p, .doc li { font-size: 21px; line-height: 1.5; color: #d7ddf2; }
.doc p { margin-bottom: 16px; }
.doc b, .doc strong { color: var(--cream); }
.doc .t-red b, .doc b.t-red { color: var(--red); }

.doc__section {
  background: rgba(27,31,51,.5);
  border: 4px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 28px 26px;
  margin-bottom: 26px;
}
.doc__section:target { outline: 4px solid var(--gold); outline-offset: 4px; }

.doc ul { list-style: none; margin: 0 0 16px; padding: 0; }
.doc ul li { position: relative; padding-left: 30px; margin-bottom: 12px; }
.doc ul li::before {
  content: "▸"; position: absolute; left: 6px; top: 0; color: var(--blue); font-size: 18px;
}

/* callout */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--cream); color: var(--ink);
  border: 4px solid var(--line); border-left: 12px solid var(--red);
  border-radius: 12px; box-shadow: var(--shadow-sm);
  padding: 18px 20px; margin: 18px 0;
}
.callout--blue { border-left-color: var(--blue); }
.callout__icon { font-size: 28px; flex: none; }
.callout p { color: var(--ink); margin: 0; font-size: 20px; }
.callout b { color: #000; }

/* fee breakdown table */
.feetable { width: 100%; border-collapse: separate; border-spacing: 0; margin: 14px 0 6px; }
.feetable th, .feetable td {
  text-align: left; padding: 12px 14px; font-size: 19px;
  border-bottom: 3px solid #000;
}
.feetable th {
  font-family: var(--font-pixel); font-size: 11px; color: #000;
  background: var(--gold); border-bottom: 4px solid #000;
}
.feetable th:first-child { border-radius: 8px 0 0 0; }
.feetable th:last-child { border-radius: 0 8px 0 0; }
.feetable td { background: rgba(245,236,214,.06); color: #d7ddf2; }
.feetable tr:last-child td { border-bottom: none; }
.feetable td b { color: var(--gold); }

/* flywheel */
.flywheel {
  background: #07080d; border: 4px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm); padding: 22px; overflow: auto; margin: 8px 0;
}
.flywheel pre {
  font-family: var(--font-term); font-size: clamp(14px,2.2vw,20px);
  color: #7cf3a0; line-height: 1.35; white-space: pre; text-shadow: 0 0 6px rgba(124,243,160,.4);
}

/* step badges */
.steps { display: grid; gap: 14px; margin: 8px 0; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step__n {
  font-family: var(--font-pixel); font-size: 13px; flex: none;
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--blue); color: #fff; border: 4px solid #000; border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.step:nth-child(even) .step__n { background: var(--red); }
.step__t { padding-top: 6px; }

@media (max-width: 860px) {
  .doc { grid-template-columns: 1fr; }
  .toc { position: static; display: none; }
}
