:root {
  --bg: #140a0c;
  --bg2: #1e0f11;
  --panel: #2a1416;
  --ink: #1a0d0a;
  --red: #e3262b;
  --red2: #9e1620;
  --yellow: #ffcc1a;
  --cream: #fff1d6;
  --muted: #d9b9a6;
  --blue: #2fa8ff;
  --green: #3ad16b;
  --pink: #ff8fb0;
  --px: "Press Start 2P", monospace;
  --vt: "VT323", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--vt);
  font-size: 22px;
  line-height: 1.25;
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}
a { color: var(--yellow); }
button { font: inherit; color: inherit; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--yellow); color: var(--ink); padding: 8px 12px; font-family: var(--px); font-size: 10px; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* pixel box */
.px-box {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.35), inset 4px 4px 0 rgba(255, 255, 255, 0.08), 4px 4px 0 #000;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--px); font-size: 11px; line-height: 1; letter-spacing: 0.5px;
  padding: 12px 14px; min-height: 40px;
  color: var(--ink); background: var(--yellow); text-decoration: none; cursor: pointer;
  border: 3px solid var(--ink); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25), 3px 3px 0 #000;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translate(2px, 2px); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25), 1px 1px 0 #000; }
.btn.ghost { background: var(--cream); }
.btn.big { font-size: 13px; padding: 16px 20px; }
.btn.small { font-size: 9px; padding: 8px 10px; min-height: 32px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.6); }
.soon-link { opacity: 0.85; }

/* ================= GAME SECTION ================= */
.play {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
  overflow: hidden;
  background: #120809;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#game { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

.hud {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  pointer-events: none; z-index: 5;
}
.hud > * { pointer-events: auto; }
.hud-left { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; max-width: min(380px, 60vw); }
.hud-right { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 46vw; }
.brand-pill, .px-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(26, 13, 10, 0.88); border: 3px solid var(--ink); box-shadow: 3px 3px 0 #000, inset 0 0 0 2px var(--red);
  padding: 5px 10px 5px 6px; font-family: var(--px); font-size: 10px;
}
.brand-pill img { border: 2px solid var(--ink); object-fit: cover; }
.brand-pill .tick { color: var(--yellow); }
.soon-chip { color: var(--green); font-family: var(--px); font-size: 8px; }
.px-pill { padding: 6px 10px; color: var(--cream); }
.px-pill span { color: var(--pink); }
.px-pill b { color: var(--yellow); font-weight: normal; min-width: 3ch; }
.quest-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
  background: rgba(26, 13, 10, 0.88); border: 3px solid var(--ink); box-shadow: 3px 3px 0 #000, inset 0 0 0 2px var(--yellow);
  padding: 8px 10px; max-width: 100%;
}
.quest-card .qk { font-family: var(--px); font-size: 7px; color: var(--yellow); }
.quest-card .qn { font-family: var(--px); font-size: 9px; color: var(--cream); line-height: 1.3; }
.quest-card .qd { font-size: 18px; color: var(--muted); line-height: 1.05; }
.hbtn {
  font-family: var(--px); font-size: 9px; color: var(--cream); text-decoration: none; cursor: pointer;
  background: rgba(26, 13, 10, 0.88); border: 3px solid var(--ink); box-shadow: 3px 3px 0 #000, inset 0 0 0 2px #5a2c2c;
  padding: 8px 9px; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.hbtn:hover { box-shadow: 3px 3px 0 #000, inset 0 0 0 2px var(--yellow); }
.hbtn.on { box-shadow: 3px 3px 0 #000, inset 0 0 0 2px var(--green); color: var(--green); }
.hbtn.soc { min-width: 36px; justify-content: center; }
.hbtn.buy { background: var(--green); color: var(--ink); box-shadow: 3px 3px 0 #000; }
.ca-hud {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; text-align: left; cursor: pointer; max-width: 100%;
  background: rgba(26, 13, 10, 0.88); border: 3px solid var(--ink); box-shadow: 3px 3px 0 #000, inset 0 0 0 2px var(--green);
  padding: 5px 8px; color: var(--cream);
}
.ca-hud[hidden], .hbtn[hidden], .btn[hidden] { display: none; }
.ca-hud span { font-family: var(--px); font-size: 8px; color: var(--green); }
.ca-hud code { font-family: var(--vt); font-size: 18px; word-break: break-all; line-height: 1; }
.ca-hud em { font-style: normal; font-family: var(--px); font-size: 7px; color: var(--yellow); }
.btn.buy-main { background: var(--green); }

.tip {
  position: absolute; left: 50%; bottom: 74px; transform: translate(-50%, 12px);
  max-width: min(560px, calc(100% - 32px)); width: max-content;
  background: rgba(26, 13, 10, 0.92); border: 3px solid var(--ink); box-shadow: 3px 3px 0 #000, inset 0 0 0 2px var(--yellow);
  padding: 10px 14px; font-size: 22px; text-align: center; color: var(--cream);
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s; z-index: 6;
}
.tip.show { opacity: 1; transform: translate(-50%, 0); }

.toasts { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 8; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast {
  background: var(--ink); border: 3px solid #000; box-shadow: 3px 3px 0 #000, inset 0 0 0 2px var(--yellow);
  padding: 6px 12px; text-align: center; animation: pop 0.25s steps(3);
}
.toast b { display: block; font-family: var(--px); font-size: 9px; color: var(--yellow); font-weight: normal; }
.toast span { display: block; font-size: 18px; color: var(--cream); }
.toast.secret { box-shadow: 3px 3px 0 #000, inset 0 0 0 2px var(--pink); }
.toast.secret b { color: var(--pink); }
.toast.quest { box-shadow: 3px 3px 0 #000, inset 0 0 0 2px var(--green); }
.toast.quest b { color: var(--green); }
.toast.badge { box-shadow: 3px 3px 0 #000, inset 0 0 0 2px var(--blue); }
.toast.badge b { color: var(--blue); }
.toast.out { opacity: 0; transition: opacity 0.4s; }
@keyframes pop { from { transform: scale(0.7); } to { transform: scale(1); } }

.dialog {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  width: min(640px, calc(100% - 32px));
  background: #fff1d6; color: var(--ink);
  border: 4px solid var(--ink); box-shadow: 4px 4px 0 #000, inset 0 0 0 3px #e9c98f;
  padding: 14px 16px 16px; z-index: 9; cursor: pointer;
}
.dialog[hidden] { display: none; }
.dlg-who {
  position: absolute; top: -16px; left: 12px;
  font-family: var(--px); font-size: 9px; background: var(--red); color: #fff; padding: 6px 8px; border: 3px solid var(--ink);
}
.dlg-who[hidden] { display: none; }
.dlg-text { margin: 6px 0 0; font-size: 25px; line-height: 1.12; min-height: 2.3em; }
.dlg-img { display: flex; justify-content: center; margin: 6px 0 2px; }
.dlg-img[hidden] { display: none; }
.px-img { width: 216px; height: 120px; image-rendering: pixelated; border: 3px solid var(--ink); }
.dlg-choices { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.choice {
  text-align: left; background: transparent; border: 0; cursor: pointer; padding: 6px 8px; white-space: pre;
  font-family: var(--px); font-size: 10px; color: var(--ink); min-height: 32px;
}
.choice.sel, .choice:hover { background: var(--yellow); }
.dlg-next { position: absolute; right: 12px; bottom: 6px; font-size: 18px; animation: blink 0.8s steps(2) infinite; }
.dlg-next[hidden] { display: none; }
@keyframes blink { 50% { opacity: 0; } }

/* panels */
.panel-wrap { position: absolute; inset: 0; background: rgba(10, 4, 6, 0.6); display: grid; place-items: center; z-index: 20; padding: 16px; }
.panel-wrap[hidden] { display: none; }
.panel {
  position: relative; width: min(720px, 100%); max-height: calc(100% - 16px); overflow: auto;
  background: var(--panel); border: 4px solid var(--ink); box-shadow: 6px 6px 0 #000, inset 0 0 0 3px var(--red);
  padding: 22px 20px 20px;
}
.panel h2 { font-family: var(--px); font-size: 16px; color: var(--yellow); margin: 0 40px 8px 0; line-height: 1.4; }
.panel h4 { font-family: var(--px); font-size: 10px; color: var(--pink); margin: 18px 0 8px; font-weight: normal; }
.panel-sub { margin: 0 0 14px; color: var(--muted); }
.panel-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; background: var(--red); color: #fff; border: 3px solid var(--ink); cursor: pointer; font-size: 18px; }
.fine { font-size: 18px; color: var(--muted); }
.meter { position: relative; height: 26px; background: var(--ink); border: 3px solid #000; margin-bottom: 12px; }
.meter span { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, var(--pink) 0 10px, #ff6f98 10px 20px); }
.meter b { position: relative; display: block; text-align: center; font-family: var(--px); font-size: 9px; line-height: 20px; font-weight: normal; text-shadow: 2px 2px 0 #000; }

.secret-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.secret-grid li { background: var(--bg2); border: 3px solid var(--ink); padding: 8px 10px; position: relative; opacity: 0.8; }
.secret-grid li.found { opacity: 1; box-shadow: inset 0 0 0 2px var(--pink); }
.secret-grid .num { font-family: var(--px); font-size: 8px; color: var(--pink); }
.secret-grid b { display: block; font-family: var(--px); font-size: 9px; margin: 6px 0 4px; font-weight: normal; line-height: 1.4; }
.secret-grid small { display: block; font-size: 18px; color: var(--muted); line-height: 1.05; }
.badge-row { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badge-row li { background: var(--bg2); border: 3px solid var(--ink); padding: 6px 10px; min-width: 140px; flex: 1 1 140px; opacity: 0.6; }
.badge-row li.found { opacity: 1; box-shadow: inset 0 0 0 2px var(--blue); }
.badge-row b { display: block; font-family: var(--px); font-size: 8px; color: var(--blue); font-weight: normal; }
.badge-row small { font-size: 17px; color: var(--muted); }

.quest-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.quest-list li { display: flex; gap: 10px; background: var(--bg2); border: 3px solid var(--ink); padding: 10px; }
.quest-list li.done { box-shadow: inset 0 0 0 2px var(--green); }
.quest-list .chk { font-family: var(--px); font-size: 14px; color: var(--green); width: 22px; flex: none; }
.quest-list b { display: block; font-family: var(--px); font-size: 10px; font-weight: normal; line-height: 1.4; }
.quest-list small { display: block; color: var(--muted); font-size: 19px; }
.quest-list em { display: block; font-style: normal; color: var(--yellow); font-size: 19px; }

.balance { font-family: var(--px); font-size: 10px; margin-bottom: 12px; }
.balance b { color: var(--yellow); font-weight: normal; }
.shop { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.shop li { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg2); border: 3px solid var(--ink); padding: 8px 10px; }
.shop b { display: block; font-family: var(--px); font-size: 9px; font-weight: normal; line-height: 1.4; }
.shop small { color: var(--muted); font-size: 18px; }
.shop.locked li { opacity: 0.7; }
.tag { font-family: var(--px); font-size: 8px; padding: 5px 7px; border: 2px solid var(--ink); white-space: nowrap; display: inline-block; }
.tag.live { background: var(--green); color: var(--ink); }
.tag.later { background: #5a4a5a; color: var(--cream); }

.keypad { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kp-screen { display: flex; gap: 10px; background: #0e1a14; border: 4px solid var(--ink); padding: 10px 16px; }
.kp-screen span { font-family: var(--px); font-size: 20px; color: var(--green); width: 22px; text-align: center; }
.kp-keys { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; }
.kp-keys button { height: 54px; font-family: var(--px); font-size: 13px; background: #8f8a96; border: 3px solid var(--ink); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.3), 3px 3px 0 #000; cursor: pointer; color: var(--ink); }
.kp-keys button:active { transform: translate(2px, 2px); }
.kp-keys button[data-key="OK"] { background: var(--green); }
.kp-keys button[data-key="CLR"] { background: var(--red); color: #fff; font-size: 10px; }

/* touch */
.touch-ui { display: none; }
body.touch .touch-ui { display: block; }
.joy {
  position: absolute; left: 20px; bottom: max(24px, env(safe-area-inset-bottom)); width: 124px; height: 124px; z-index: 7;
  border-radius: 50%; background: rgba(26, 13, 10, 0.55); border: 4px solid rgba(255, 241, 214, 0.35); touch-action: none;
}
.knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: var(--yellow); border: 4px solid var(--ink); box-shadow: 3px 3px 0 #000; }
.touch-btns { position: absolute; right: 18px; bottom: max(28px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 12px; z-index: 7; }
.tbtn { border: 4px solid var(--ink); box-shadow: 3px 3px 0 #000; cursor: pointer; touch-action: none; }
.tbtn.act { width: 82px; height: 82px; border-radius: 50%; background: #d8b850; font-family: var(--px); font-size: 9px; color: var(--ink); padding: 4px; }
.tbtn.act.ready { background: var(--yellow); animation: pulse 0.9s steps(2) infinite; }
.tbtn.emote { width: 52px; height: 52px; border-radius: 50%; background: var(--pink); font-size: 22px; }
@keyframes pulse { 50% { box-shadow: 3px 3px 0 #000, 0 0 0 5px rgba(255, 204, 26, 0.4); } }
body.touch .controls-hint { display: none; }
body.touch .dialog { bottom: 160px; }
body.touch .tip { bottom: 165px; }

.controls-hint { position: absolute; left: 16px; bottom: 12px; font-family: var(--px); font-size: 8px; color: rgba(255, 241, 214, 0.75); text-shadow: 2px 2px 0 #000; z-index: 4; pointer-events: none; }
.more { position: absolute; right: 16px; bottom: 12px; z-index: 4; font-family: var(--px); font-size: 9px; color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); box-shadow: 3px 3px 0 #000; padding: 8px 10px; cursor: pointer; animation: bob 1.4s steps(2) infinite; }
body.touch .more { bottom: auto; top: 50%; right: 8px; padding: 6px; font-size: 7px; }
@keyframes bob { 50% { transform: translateY(3px); } }

/* ================= SITE ================= */
.site { background: linear-gradient(var(--bg2), var(--bg) 300px); border-top: 6px solid var(--red); }
.sec { max-width: 1080px; margin: 0 auto; padding: 56px 16px 8px; }
.sec-title { font-family: var(--px); font-size: clamp(16px, 3.4vw, 24px); color: var(--yellow); margin: 0 0 10px; line-height: 1.4; text-shadow: 3px 3px 0 #000; font-weight: normal; }
.sec-title .count { color: var(--pink); font-size: 0.6em; vertical-align: middle; }
.sec-sub { margin: 0 0 22px; color: var(--muted); font-size: 24px; }
.mini-title { font-family: var(--px); font-size: 11px; color: var(--blue); margin: 26px 0 10px; font-weight: normal; }

.token-card { display: grid; grid-template-columns: auto 1fr; gap: 26px; padding: 24px; align-items: center; box-shadow: inset -4px -4px 0 rgba(0,0,0,.35), inset 4px 4px 0 rgba(255,255,255,.08), 6px 6px 0 #000, inset 0 0 0 7px var(--red); }
.token-hero { width: 180px; height: 180px; object-fit: cover; background: var(--red); border: 4px solid var(--ink); }
.token-info h1 { font-family: var(--px); font-size: clamp(26px, 5.5vw, 46px); margin: 0; color: var(--yellow); text-shadow: 4px 4px 0 var(--red2), 7px 7px 0 #000; font-weight: normal; line-height: 1.2; }
.ticker-big { font-family: var(--px); font-size: 16px; color: var(--cream); margin: 12px 0 6px; }
.soon-big { font-size: 13px; margin: 0 0 12px; }
.lead { font-size: 26px; margin: 0 0 14px; max-width: 52ch; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chips span { font-family: var(--px); font-size: 8px; background: var(--ink); border: 2px solid #5a2c2c; padding: 6px 8px; }
.ca-box { background: var(--ink); border: 3px solid #000; padding: 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.ca-label { font-family: var(--px); font-size: 8px; color: var(--pink); }
.ca-soon { font-family: var(--px); font-size: 14px; color: var(--green); }
.ca-box small { color: var(--muted); font-size: 18px; }
.ca-value { font-family: var(--vt); font-size: 22px; word-break: break-all; color: var(--cream); }
.ca-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.social-row { display: flex; flex-wrap: wrap; gap: 10px; }
.social-row.center { justify-content: center; }

.wallet { padding: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 18px; }
.wallet-status { margin: 0; flex: 1 1 260px; color: var(--muted); }
.holder { font-family: var(--px); font-size: 9px; padding: 8px 10px; border: 3px solid var(--ink); background: #5a4a5a; }
.holder[hidden] { display: none; }
.holder.yes { background: var(--green); color: var(--ink); }
.holder.no { background: var(--cream); color: var(--ink); }
.util-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.util-grid li { padding: 16px; }
.util-grid h3 { font-family: var(--px); font-size: 11px; margin: 12px 0 8px; color: var(--cream); font-weight: normal; line-height: 1.4; }
.util-grid p { margin: 0; color: var(--muted); font-size: 21px; }

.table-wrap { overflow-x: auto; padding: 6px; }
.board { width: 100%; border-collapse: collapse; min-width: 480px; }
.board th { font-family: var(--px); font-size: 8px; color: var(--yellow); text-align: left; padding: 10px; font-weight: normal; border-bottom: 3px solid var(--ink); }
.board td { padding: 10px; font-size: 22px; border-bottom: 2px solid #3a1e20; }
.board tr.me td { color: var(--yellow); }
.board tr.later td { color: var(--muted); font-size: 19px; text-align: center; }
.secret-grid.big { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.how-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.how-grid > div { padding: 16px; }
.how-grid h3 { font-family: var(--px); font-size: 11px; color: var(--pink); margin: 0 0 10px; font-weight: normal; }
.how-grid p { margin: 0; }
kbd { font-family: var(--px); font-size: 8px; background: var(--cream); color: var(--ink); border: 2px solid var(--ink); padding: 3px 4px; box-shadow: 2px 2px 0 #000; }

.copy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 22px; }
.copy-grid figure { margin: 0; padding: 16px; }
.copy-grid figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--px); font-size: 9px; color: var(--yellow); margin-bottom: 10px; }
.copy-grid p { margin: 0; font-size: 21px; }

.foot { max-width: 900px; margin: 0 auto; padding: 60px 16px 40px; text-align: center; }
.foot img { border: 3px solid var(--ink); }
.disclaimer { font-size: 20px; color: var(--muted); border: 3px dashed #5a2c2c; padding: 14px; }
.foot .fine { font-size: 17px; }

/* ================= RESPONSIVE ================= */
@media (max-width: 760px) {
  body { font-size: 20px; }
  .hud { padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .hud-left { max-width: 62vw; gap: 6px; }
  .brand-pill { font-size: 8px; padding: 4px 8px 4px 4px; }
  .brand-pill img { width: 20px; height: 20px; }
  .brand-pill .soon-chip { display: none; }
  .quest-card { padding: 6px 8px; }
  .ca-hud code { font-size: 15px; }
  .quest-card .qn { font-size: 8px; }
  .quest-card .qd { font-size: 16px; }
  .hud-right { max-width: 36vw; }
  .hbtn { font-size: 7px; padding: 6px; min-height: 32px; }
  #btnSound span, #btnQuests { font-size: 0; }
  #btnQuests::before { content: "Q"; font-size: 8px; }
  .dlg-text { font-size: 22px; }
  .token-card { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 18px; }
  .token-hero { width: 140px; height: 140px; }
  .chips, .social-row { justify-content: center; }
  .ca-box { text-align: left; width: 100%; }
  .lead { font-size: 22px; }
  .kp-keys { grid-template-columns: repeat(3, 58px); }
  .controls-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
