:root {
  --ink: #0B0B0F;
  --goo: #FFF6E0;
  --pink: #FF2E88;
  --yolk: #FFD21F;
  --sky: #2EE6FF;
  --drip: 'Rubik Wet Paint', 'Rubik', system-ui, sans-serif;
  --ui: 'Rubik', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--goo);
  font-family: var(--ui);
  overflow: hidden;
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
@media (hover: none) { body { cursor: auto; } }
::selection { background: var(--pink); color: var(--goo); }
button, a { font: inherit; color: inherit; cursor: none; }
@media (hover: none) { button, a { cursor: pointer; } }
:focus-visible { outline: 3px solid var(--yolk); outline-offset: 3px; }

/* ---------- the wall ---------- */
#wall {
  position: fixed;
  inset: 0;
  display: flex;
  gap: 8px;
  padding: 0 8px;
  overflow: hidden;
}
.col { flex: 1 1 0; min-width: 0; overflow: visible; }
.col-inner { display: flex; flex-direction: column; gap: 8px; will-change: transform; }
.col.up .col-inner { animation: up var(--dur, 80s) linear infinite; }
.col.down .col-inner { animation: down var(--dur, 80s) linear infinite; }
@keyframes up { from { transform: translateY(0); } to { transform: translateY(calc(-50% - 4px)); } }
@keyframes down { from { transform: translateY(calc(-50% - 4px)); } to { transform: translateY(0); } }

.tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #222;
  transition: transform .15s;
  container-type: inline-size;
}
.tile > img.babe { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tile .splat {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  filter: drop-shadow(0 0 1px rgba(60,40,20,.55)) drop-shadow(1px 3px 2px rgba(0,0,0,.3));
  opacity: 1;
  animation: land .18s ease-out;
}
@keyframes land { from { transform: translate(-50%, -50%) rotate(var(--r)) scale(.3); opacity: 0; } }
.tile.hit { animation: shake .22s; }
@keyframes shake {
  25% { transform: translate(3px, -2px) rotate(.6deg); }
  50% { transform: translate(-3px, 2px) rotate(-.6deg); }
  75% { transform: translate(2px, 1px); }
}
.tile .stamp {
  position: absolute;
  left: 50%; top: 46%;
  transform: translate(-50%, -50%) rotate(-14deg) scale(0);
  font-family: var(--drip);
  font-size: 15cqw;
  color: var(--goo);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke;
  text-shadow: 3px 3px 0 var(--pink);
  white-space: nowrap;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.2, 1.8, .4, 1);
}
.tile.glazed .stamp { transform: translate(-50%, -50%) rotate(-14deg) scale(1); }
.tile.glazed > img.babe { filter: saturate(1.25) brightness(1.08); }
.tile.glazed::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,246,224,.45), rgba(255,246,224,0) 40%);
  pointer-events: none;
}

/* vignette so the HUD reads */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11,11,15,.85) 0, rgba(11,11,15,0) 150px),
    linear-gradient(0deg, rgba(11,11,15,.8) 0, rgba(11,11,15,0) 200px);
}

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }

#gun {
  position: fixed;
  left: 0; top: 0;
  width: 150px;
  pointer-events: none;
  z-index: 60;
  transform-origin: 6% 6%;
  filter: drop-shadow(4px 6px 0 rgba(0,0,0,.45));
  display: none;
}
body.armed #gun { display: block; }
@media (hover: none) { #gun { display: none !important; } }

#pops { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.pop {
  position: absolute;
  font-family: var(--drip);
  color: var(--yolk);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: pop .9s ease-out forwards;
}
.pop.big { font-size: clamp(34px, 5vw, 70px); color: var(--goo); text-shadow: 4px 4px 0 var(--pink); }
.pop.small { font-size: 22px; }
@keyframes pop {
  0% { transform: translate(-50%, -50%) scale(.2) rotate(-10deg); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.15) rotate(4deg); opacity: 1; }
  100% { transform: translate(-50%, -140%) scale(1) rotate(-3deg); opacity: 0; }
}
body.shake #wall { animation: bigshake .35s; }
@keyframes bigshake {
  20% { transform: translate(-8px, 5px); }
  40% { transform: translate(7px, -6px); }
  60% { transform: translate(-5px, -3px); }
  80% { transform: translate(4px, 4px); }
}

/* ---------- top HUD ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 30; }
.ticker {
  background: var(--pink);
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .02em;
  padding: 6px 0;
}
.ticker-track { display: inline-flex; animation: tick 40s linear infinite; }
.ticker-track span { padding-right: 34px; }
.ticker-track b { background: var(--ink); color: var(--goo); padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
@keyframes tick { to { transform: translateX(-50%); } }

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
}
.logo { text-decoration: none; margin-right: auto; }
.logo-word {
  font-family: var(--drip);
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1;
  color: var(--goo);
  text-shadow: 3px 3px 0 var(--pink);
}
.ca {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11,11,15,.82);
  border: 2px solid var(--goo);
  border-radius: 999px;
  padding: 6px 8px 6px 6px;
  max-width: 340px;
  backdrop-filter: blur(6px);
}
.ca-k { background: var(--goo); color: var(--ink); font-weight: 900; font-size: 11px; border-radius: 999px; padding: 3px 8px; }
.ca code { font-family: var(--ui); font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca-copy { font-weight: 900; font-size: 11px; color: var(--yolk); text-transform: uppercase; }
.links { display: flex; gap: 6px; }
.links a, .icon-btn {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(11,11,15,.82);
  border: 2px solid var(--goo);
  font-weight: 900;
  font-size: 13px;
  text-decoration: none;
  backdrop-filter: blur(6px);
}
.icon-btn { font-size: 16px; padding: 0; width: 42px; }
.links a:hover, .icon-btn:hover { background: var(--goo); color: var(--ink); }
.buy {
  display: inline-grid;
  place-items: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--yolk);
  color: var(--ink);
  font-weight: 900;
  font-size: 15px;
  text-decoration: none;
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 2px var(--yolk), 4px 4px 0 2px var(--pink);
  transition: transform .08s;
}
.buy:hover { transform: translate(-1px, -2px) rotate(-2deg); }

/* ---------- stats (bottom-left) ---------- */
.stats {
  position: fixed;
  left: 18px; bottom: 18px;
  z-index: 30;
  width: 240px;
  background: rgba(11,11,15,.88);
  border: 2px solid var(--goo);
  border-radius: 18px;
  padding: 14px 16px;
  backdrop-filter: blur(8px);
}
.stat-head { display: flex; justify-content: space-between; align-items: baseline; }
#rank { font-family: var(--drip); font-size: 24px; color: var(--yolk); line-height: 1.1; }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; opacity: .8; }
.gooned { margin: 6px 0 8px; font-weight: 800; }
.gooned b { font-size: 46px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.gooned span { font-size: 15px; opacity: .85; margin-left: 4px; }
.gooned i { font-style: normal; }
.bar-track { height: 12px; border-radius: 999px; background: #26262e; overflow: hidden; margin-bottom: 10px; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--goo), var(--yolk)); border-radius: 999px; transition: width .3s; }
.stat-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; padding: 2px 0; }
.stat-row span { opacity: .7; }
.stat-row b { font-variant-numeric: tabular-nums; }

/* ---------- weapons (bottom-center) ---------- */
.weapons {
  position: fixed;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 10px;
}
.weapon {
  position: relative;
  width: 112px;
  padding: 8px 8px 10px;
  background: rgba(11,11,15,.88);
  border: 2px solid rgba(255,246,224,.35);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(8px);
  transition: transform .1s, border-color .1s;
}
.weapon img { height: 46px; width: auto; object-fit: contain; pointer-events: none; }
.weapon span { font-weight: 900; font-size: 11px; letter-spacing: .03em; }
.weapon kbd { position: absolute; top: 6px; left: 8px; font-family: var(--ui); font-size: 10px; font-weight: 900; opacity: .5; }
.weapon:hover { transform: translateY(-3px); }
.weapon.is-on { border-color: var(--yolk); box-shadow: 0 0 0 2px var(--yolk), 0 6px 0 var(--pink); transform: translateY(-4px); }

/* ---------- nut meter (bottom-right) ---------- */
.meter {
  position: fixed;
  right: 22px; bottom: 18px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.meter-tube {
  width: 34px;
  height: 200px;
  border: 3px solid var(--goo);
  border-radius: 999px;
  background: rgba(11,11,15,.88);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 3px;
}
.meter-fill {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(0deg, #e9dcbc, var(--goo));
  transition: height .08s linear;
}
.meter.low .meter-fill { background: var(--pink); }
.meter-label { font-weight: 900; font-size: 11px; text-align: center; line-height: 1.1; letter-spacing: .04em; }

.refractory {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  z-index: 45;
  font-family: var(--drip);
  font-size: clamp(30px, 5vw, 64px);
  color: var(--pink);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke;
  text-shadow: 5px 5px 0 var(--ink);
  pointer-events: none;
  animation: blink .5s steps(2) infinite;
  text-align: center;
}
@keyframes blink { 50% { opacity: .35; } }

/* ---------- overlays ---------- */
.gate, .win, .drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11,11,15,.55);
  backdrop-filter: blur(14px);
}
.gate[hidden], .win[hidden], .drawer[hidden] { display: none; }
body.gated { cursor: auto; }
body.gated button { cursor: pointer; }
.gate-card, .win-card {
  text-align: center;
  background: var(--ink);
  border: 3px solid var(--goo);
  border-radius: 28px;
  padding: 28px 32px 32px;
  max-width: 520px;
  box-shadow: 10px 10px 0 var(--pink);
}
.gate-gif { width: 190px; height: 190px; object-fit: cover; border-radius: 20px; border: 3px solid var(--goo); transform: rotate(-4deg); }
.gate-18 { font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .6; margin: 16px 0 0; }
.gate-q { font-family: var(--drip); font-weight: 400; font-size: clamp(44px, 8vw, 76px); line-height: .95; margin: 8px 0 22px; color: var(--goo); text-shadow: 4px 4px 0 var(--pink); }
.gate-btns, .win-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.yes {
  font-family: var(--drip);
  font-size: 34px;
  padding: 10px 40px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--yolk);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--yolk), 5px 5px 0 2px var(--pink);
  transition: transform .08s;
}
.yes:hover { transform: rotate(-4deg) scale(1.06); }
.yes:nth-child(2) { background: var(--pink); color: var(--goo); box-shadow: 0 0 0 2px var(--pink), 5px 5px 0 2px var(--yolk); }

.win-title { font-family: var(--drip); font-weight: 400; font-size: clamp(40px, 7vw, 68px); line-height: .95; margin: 0 0 16px; color: var(--goo); text-shadow: 4px 4px 0 var(--pink); }
.win-line { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.win-line b { color: var(--yolk); }
.win-best { font-weight: 800; color: var(--pink); margin: 0 0 22px; min-height: 1em; }
.ghost { height: 46px; padding: 0 20px; border-radius: 999px; background: transparent; border: 2px solid var(--goo); font-weight: 900; font-size: 14px; }
.ghost:hover { background: var(--goo); color: var(--ink); }

.drawer { place-items: center end; padding: 0; }
.drawer-card {
  position: relative;
  height: 100%;
  width: min(440px, 100%);
  overflow-y: auto;
  background: var(--ink);
  border-left: 3px solid var(--goo);
  padding: 36px 28px;
  animation: slide .25s ease-out;
}
@keyframes slide { from { transform: translateX(100%); } }
.drawer-card h2 { font-family: var(--drip); font-weight: 400; font-size: 40px; margin: 0 0 12px; color: var(--yolk); line-height: 1; }
.drawer-card h3 { font-weight: 900; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--pink); margin: 24px 0 8px; }
.drawer-card p, .drawer-card li { font-weight: 500; line-height: 1.5; font-size: 15px; }
.drawer-card ol { padding-left: 20px; margin: 0; }
.tok { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tok li { border: 2px solid rgba(255,246,224,.3); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.tok li b { display: block; font-size: 20px; font-weight: 900; color: var(--goo); }
kbd { font-family: var(--ui); font-weight: 800; font-size: 12px; border: 2px solid rgba(255,246,224,.4); border-radius: 6px; padding: 1px 6px; margin-right: 2px; }
.disclaimer { font-size: 12px !important; opacity: .55; margin-top: 28px; }
.drawer-x { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border-radius: 999px; background: transparent; border: 2px solid var(--goo); font-size: 22px; line-height: 1; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .bar { flex-wrap: wrap; }
  .ca { order: 10; width: 100%; max-width: none; justify-content: space-between; }
  .links { display: none; }
  .stats { width: auto; left: 10px; right: auto; bottom: 120px; padding: 10px 12px; }
  .gooned b { font-size: 32px; }
  .stat-row { display: none; }
  .weapons { bottom: 10px; gap: 6px; }
  .weapon { width: 92px; }
  .weapon img { height: 34px; }
  .meter { right: 10px; bottom: 120px; }
  .meter-tube { height: 140px; width: 28px; }
}
@media (max-width: 480px) {
  .bar { padding: 8px 10px; gap: 8px; }
  .buy { height: 40px; padding: 0 14px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .col .col-inner, .ticker-track { animation: none !important; }
  .tile.hit, body.shake #wall { animation: none; }
}
body.gated #gun { display: none; }
.drawer-card { touch-action: auto; }
@media (max-width: 480px) {
  .logo-word { font-size: 24px; }
  .icon-btn { width: 36px; min-width: 36px; height: 36px; font-size: 14px; }
  .buy { padding: 0 12px; font-size: 12px; height: 38px; }
}
