/* ============ RUG THE GHOST ============ */
:root {
  --night: #1d1433;
  --night-2: #2b1e4c;
  --night-3: #3a2a63;
  --ink: #140e1f;
  --paper: #fff6e2;
  --cream: #f1e2c0;
  --slime: #b4ff39;
  --pink: #ff5ea8;
  --yellow: #ffd23f;
  --red: #ff4d4d;
  --rug-red: #b8453a;
  --rug-blue: #4f6d8a;
  --display: 'Bangers', Impact, 'Arial Black', sans-serif;
  --hand: 'Patrick Hand', 'Comic Sans MS', 'Chalkboard SE', cursive;
  --marker: 'Permanent Marker', 'Comic Sans MS', cursive;
  --ticker: 'Lilita One', 'Arial Black', Impact, sans-serif;
  --radius: 22px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.locked { overflow: hidden; }
body {
  margin: 0;
  background-color: var(--night);
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 9%, #fff9 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 42% 64%, #fff6 50%, transparent 51%),
    radial-gradient(2px 2px at 88% 52%, #fff7 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 23% 83%, #fff6 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 63% 33%, #fff5 50%, transparent 51%),
    radial-gradient(ellipse at 50% -10%, #4a2f86 0%, transparent 55%);
  background-size: 420px 420px, 380px 380px, 460px 460px, 520px 520px, 340px 340px, 300px 300px, 100% 100%;
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--hand);
  font-size: 1.2rem;
  line-height: 1.45;
  overflow-x: hidden;
}
/* paint the phone's status-bar band so content doesn't scroll up under it */
body::before { content: ''; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 45; background: var(--night); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 4px dashed var(--slime); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Bangers has no lowercase, so the $Rug ticker gets a face that does wherever it sits in display type */
.tkr { font-family: var(--ticker); font-weight: 400; letter-spacing: 0; text-transform: none; font-size: .9em; }
mark { background: var(--yellow); color: var(--ink); padding: 0 .25em; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

#page { position: relative; transform-origin: 50% 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font-family: var(--display); font-size: 1.5rem; letter-spacing: 1.5px;
  padding: .55em 1.1em .45em;
  color: var(--ink); background: var(--paper);
  border: 4px solid var(--ink); border-radius: 16px;
  box-shadow: 5px 5px 0 var(--ink);
  text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-2px, -2px) rotate(-1.5deg); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-slime { background: var(--slime); }
.btn-paper { background: var(--paper); }
.btn-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: 5px 5px 0 var(--pink); }
.btn-ink:hover { box-shadow: 7px 7px 0 var(--pink); }
.btn-sm { font-size: 1.15rem; padding: .45em .9em .35em; border-width: 3px; box-shadow: 4px 4px 0 var(--ink); }

/* ---------- ticker ---------- */
.ticker {
  background: var(--yellow); color: var(--ink);
  border-block: 4px solid var(--ink);
  overflow: hidden; white-space: nowrap;
  font-family: var(--display); font-size: 1.25rem; letter-spacing: 2px;
  padding: .3em 0 .2em;
}
.ticker-track { display: inline-flex; animation: marquee 38s linear infinite; }
.ticker-track span { padding: 0 1.2em; }
.ticker-track span::after { content: '\2605'; margin-left: 2.4em; color: var(--rug-red); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px var(--gutter);
  background: rgba(29, 20, 51, .86);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 3px solid #0006;
}
.nav-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--display); font-size: 1.9rem; letter-spacing: 2px; color: var(--yellow); text-shadow: 3px 3px 0 var(--ink); }
.nav-logo img { width: 40px; height: auto; filter: drop-shadow(2px 3px 0 var(--ink)); transition: transform .2s; }
.nav-logo:hover img { transform: rotate(-12deg) scale(1.1); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-x { width: 42px; height: 42px; display: grid; place-items: center; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.nav-x svg { width: 20px; height: 20px; fill: currentColor; }
.nav-x:hover { transform: translate(-2px, -2px) rotate(-4deg); box-shadow: 6px 6px 0 var(--ink); }
.nav-links { display: flex; gap: clamp(10px, 2vw, 26px); }
.nav-links a { text-decoration: none; font-size: 1.15rem; color: var(--cream); position: relative; }
.nav-links a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -2px; height: 3px; background: var(--slime); border-radius: 3px; transition: right .2s; }
.nav-links a:hover::after { right: 0; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(16px, 4vw, 48px);
  max-width: 1240px; margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) var(--gutter) clamp(40px, 6vw, 80px);
}
.kicker { font-family: var(--marker); color: var(--pink); font-size: 1.15rem; margin: 0 0 .3em; transform: rotate(-2deg); display: inline-block; }
.title { margin: 0; line-height: .85; }
.title-big {
  display: block; font-family: var(--display); font-weight: 400;
  font-size: clamp(6rem, 17vw, 12.5rem); letter-spacing: 6px;
  color: var(--cream);
  -webkit-text-stroke: 4px var(--ink);
  text-shadow: 6px 6px 0 var(--ink), 12px 12px 0 var(--rug-red);
  animation: wobble 3.2s ease-in-out infinite;
  transform-origin: 30% 80%;
}
.title-tape {
  display: inline-block; margin-top: .2em;
  font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 4.2vw, 2.7rem); letter-spacing: 2px;
  color: var(--ink); background: var(--yellow);
  padding: .15em .5em .05em; border: 4px solid var(--ink); border-radius: 6px;
  box-shadow: 5px 5px 0 var(--pink);
  transform: rotate(-3deg);
}
@keyframes wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(1.5deg) scale(1.02); } }
.lede { font-size: clamp(1.2rem, 1.9vw, 1.45rem); max-width: 34em; margin: 1.1em 0 1.2em; color: var(--cream); }
.lede b { color: #fff; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }

.ca-box {
  display: flex; align-items: center; gap: 10px; margin-top: 20px; max-width: 520px;
  background: #0007; border: 3px dashed var(--cream); border-radius: 14px; padding: 8px 8px 8px 12px;
}
.ca-label { font-family: var(--display); font-size: 1.3rem; color: var(--slime); letter-spacing: 1px; }
.ca-box code { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92rem; overflow-wrap: anywhere; line-height: 1.3; color: var(--cream); user-select: all; }
.ca-copy { font-family: var(--display); letter-spacing: 1px; font-size: 1.05rem; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 10px; padding: .25em .7em .15em; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.ca-copy:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.hero-x { margin: 14px 0 0; color: var(--cream); font-size: 1.15rem; }
.hero-x a { font-family: var(--ticker); color: var(--slime); text-decoration: none; border-bottom: 3px solid var(--slime); }
.hero-x a:hover { color: var(--yellow); border-color: var(--yellow); }
.hero-x span { color: #a99bbf; }
.hero-stats { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats li { background: var(--night-2); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 14px; box-shadow: 4px 4px 0 #0008; min-width: 128px; }
.hero-stats b { display: block; font-family: var(--display); font-size: 1.9rem; color: var(--yellow); letter-spacing: 1px; line-height: 1; }
.hero-stats span { font-size: .95rem; color: var(--cream); }

.hero-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-top: 168px; }
.moon { position: absolute; top: 150px; left: 50%; width: min(78%, 440px); aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 40% 38%, #fff5d6 0%, #f7dfa0 38%, #e8b85c 70%, #b9853a 100%); box-shadow: 0 0 80px 20px #ffd23f33, inset -18px -14px 0 #0002; opacity: .9; }
.moon::before, .moon::after { content: ''; position: absolute; border-radius: 50%; background: #c9964a55; }
.moon::before { width: 18%; height: 18%; top: 22%; left: 58%; }
.moon::after { width: 11%; height: 11%; top: 60%; left: 24%; }

.rug-3d { position: relative; z-index: 2; background: none; border: 0; padding: 0; cursor: pointer; perspective: 900px; width: min(100%, 450px); -webkit-tap-highlight-color: transparent; }
.rug-tilt { display: block; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out; transform-style: preserve-3d; }
.rug-tilt img { width: 100%; animation: float 4.2s ease-in-out infinite; filter: drop-shadow(0 18px 24px #000a) drop-shadow(0 0 40px #ffd23f22); }
.rug-3d.poked .rug-tilt img { animation: squish .5s cubic-bezier(.3, 1.6, .5, 1), float 4.2s ease-in-out .5s infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-22px) rotate(1.5deg); } }
@keyframes squish { 0% { transform: scale(1, 1); } 30% { transform: scale(1.18, .78) translateY(30px); } 60% { transform: scale(.9, 1.12) translateY(-16px); } 100% { transform: scale(1, 1); } }
.rug-shadow { width: 46%; height: 26px; margin-top: -10px; border-radius: 50%; background: radial-gradient(#000c, transparent 70%); animation: shadow 4.2s ease-in-out infinite; }
@keyframes shadow { 0%, 100% { transform: scaleX(1); opacity: .85; } 50% { transform: scaleX(.75); opacity: .5; } }
.poke-hint { font-family: var(--marker); color: var(--slime); margin: 8px 0 0; font-size: 1rem; transform: rotate(-3deg); }

.bubble {
  position: relative; background: #fff; color: var(--ink);
  border: 4px solid var(--ink); border-radius: 26px;
  box-shadow: 6px 6px 0 var(--ink);
}
.hero-bubble { position: absolute; z-index: 3; top: 0; left: 2%; width: min(360px, 78%); padding: 14px 16px 12px; transform: rotate(-2deg); }
.hero-bubble::after { content: ''; position: absolute; bottom: -26px; right: 22%; width: 34px; height: 30px; background: #fff; border-right: 4px solid var(--ink); border-bottom: 4px solid var(--ink); transform: skewX(30deg); border-bottom-right-radius: 10px; }
.hero-bubble p { margin: 0 0 10px; min-height: 3.75em; font-size: 1.22rem; line-height: 1.25; }
.bubble-btn { font-family: var(--display); letter-spacing: 1px; font-size: 1rem; background: var(--red); color: #fff; border: 3px solid var(--ink); border-radius: 10px; padding: .2em .7em .1em; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.bubble-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-stage { padding-top: 160px; }
  .moon { top: 140px; }
  .hero-bubble { left: 0; width: min(360px, 100%); }
  .rug-3d { width: min(88%, 420px); }
}

/* ---------- rug band divider (woven border + fringe) ---------- */
.rug-band {
  position: relative; height: 34px; margin: 0;
  background:
    linear-gradient(var(--cream) 0 4px, transparent 4px calc(100% - 4px), var(--cream) calc(100% - 4px)),
    repeating-linear-gradient(45deg, var(--rug-red) 0 9px, var(--cream) 9px 12px, var(--rug-blue) 12px 21px, var(--cream) 21px 24px);
  border-block: 3px solid var(--ink);
}
.rug-band::before, .rug-band::after { content: ''; position: absolute; left: 0; right: 0; height: 16px; background: repeating-linear-gradient(90deg, var(--cream) 0 5px, transparent 5px 12px); }
.rug-band::before { top: -19px; }
.rug-band::after { bottom: -19px; }

/* ---------- sections ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: clamp(56px, 8vw, 104px) var(--gutter) 0; scroll-margin-top: 70px; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto clamp(24px, 4vw, 40px); }
.eyebrow { font-family: var(--marker); color: var(--pink); margin: 0; font-size: 1.05rem; }
.section h2, .rugged h2, .dialog h2 {
  font-family: var(--display); font-weight: 400; letter-spacing: 2px; line-height: 1;
  font-size: clamp(2.6rem, 7vw, 4.4rem); margin: .1em 0 .25em;
  color: var(--yellow);
  -webkit-text-stroke: 2.5px var(--ink);
  text-shadow: 4px 4px 0 var(--ink), 8px 8px 0 var(--pink);
}
.section-sub { color: var(--cream); font-size: 1.25rem; margin: 0; }

.panel { background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: var(--radius); box-shadow: 10px 10px 0 var(--pink); }

/* ---------- story ---------- */
.story { padding: clamp(14px, 2.4vw, 24px); }
.story-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.chapter-pill { font-family: var(--display); letter-spacing: 1.5px; font-size: 1.3rem; background: var(--ink); color: var(--yellow); padding: .2em .8em .1em; border-radius: 999px; }
.meter { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; max-width: 460px; }
.meter-label { font-family: var(--display); letter-spacing: 1px; font-size: 1.05rem; white-space: nowrap; }
.meter-bar { flex: 1; height: 20px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--red) 0 10px, #ff8080 10px 20px); background-size: 28px 28px; animation: stripes 1s linear infinite; transition: width .6s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes stripes { to { background-position: 28px 0; } }
.meter b { font-family: var(--display); font-size: 1.3rem; min-width: 3ch; }

.scene { position: relative; margin: 0; border: 4px solid var(--ink); border-radius: 16px; overflow: hidden; background: var(--night-2); aspect-ratio: 16 / 9; }
.scene img { width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease, transform 6s ease-out; }
.scene img.loading { opacity: 0; }
.scene:hover img { transform: scale(1.04); }
.scene.shake { animation: shake .45s; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translate(-8px, 2px) rotate(-1deg); } 40% { transform: translate(7px, -3px) rotate(1deg); } 60% { transform: translate(-5px, 2px); } 80% { transform: translate(4px, -1px); } }
.scene-title { position: absolute; left: 14px; bottom: 14px; max-width: calc(100% - 28px); font-family: var(--display); letter-spacing: 1.5px; font-size: clamp(1.3rem, 3.4vw, 2.2rem); line-height: 1.05; background: var(--yellow); color: var(--ink); border: 4px solid var(--ink); border-radius: 10px; padding: .15em .5em .05em; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-1.5deg); }

.story-body { display: grid; gap: 16px; margin-top: 18px; }
.narration p { margin: 0 0 .55em; font-size: 1.28rem; }
.narration p:last-child { font-family: var(--display); letter-spacing: 1px; font-size: 1.55rem; margin-bottom: 0; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.choice { text-align: left; font-family: var(--hand); font-size: 1.25rem; line-height: 1.2; background: #fff; color: var(--ink); border: 4px solid var(--ink); border-radius: 14px; padding: 12px 14px; box-shadow: 4px 4px 0 var(--ink); cursor: pointer; display: flex; gap: 10px; align-items: center; transition: transform .12s, box-shadow .12s, background .12s; }
.choice b { flex: none; font-family: var(--display); font-weight: 400; font-size: 1.4rem; width: 36px; height: 36px; display: grid; place-items: center; background: var(--slime); border: 3px solid var(--ink); border-radius: 50%; }
.choice:hover:not(:disabled) { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 6px 6px 0 var(--ink); background: #fffbe0; }
.choice:disabled { cursor: default; opacity: .4; }
.choice.picked { opacity: 1; background: var(--yellow); }
.choice.picked b { background: var(--pink); }
.outcome { background: var(--ink); color: var(--paper); border-radius: 16px; padding: 16px 18px; position: relative; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.outcome::before { content: 'RUG:'; font-family: var(--display); letter-spacing: 1px; color: var(--slime); font-size: 1.3rem; display: block; }
.outcome-text { margin: 0; font-size: 1.32rem; min-height: 1.4em; }
.outcome-after { margin: .6em 0 0; color: var(--yellow); font-size: 1.15rem; opacity: 0; transition: opacity .4s; }
.outcome-after.show { opacity: 1; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.story-nav { display: flex; justify-content: flex-end; }
.smart-count { margin: 14px 0 0; font-size: 1rem; color: #6b5a7d; text-align: right; }

/* ---------- newspaper ---------- */
.newspaper {
  max-width: 820px; margin: 0 auto; color: #1b1712;
  background: #f3ecd9 repeating-linear-gradient(0deg, transparent 0 22px, #0000000a 22px 23px);
  border: 2px solid #1b1712; padding: clamp(16px, 3vw, 28px);
  box-shadow: 10px 10px 0 var(--slime);
  transform: rotate(-1deg);
  font-family: Georgia, 'Times New Roman', serif;
}
.np-masthead { font-family: 'Old English Text MT', 'UnifrakturMaguntia', Georgia, serif; font-size: clamp(2.2rem, 7vw, 3.6rem); text-align: center; border-bottom: 3px double #1b1712; line-height: 1.1; padding-bottom: 4px; font-weight: 700; }
.np-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #1b1712; padding: 4px 0; margin-bottom: 14px; }
.np-headline { font-family: var(--display); font-weight: 400; letter-spacing: 1px; font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1; margin: 0 0 14px; text-align: center; min-height: 2em; }
.np-body { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: start; margin-bottom: 18px; }
.np-photo { margin: 0; background: #ddd5bf; border: 2px solid #1b1712; padding: 6px; }
.np-photo img { filter: grayscale(1) contrast(1.25) brightness(1.05); }
.np-photo figcaption { font-size: .8rem; font-style: italic; margin-top: 4px; }
.np-byline { margin: 0 0 8px; font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #1b171244; padding-bottom: 6px; }
.np-text { margin: 0; font-size: clamp(1.15rem, 2.2vw, 1.45rem); line-height: 1.45; min-height: 4.4em; }
.np-cont { margin: 12px 0 0; font-size: .85rem; font-style: italic; }
.newspaper .btn { font-size: 1.25rem; }
.np-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 3px double #1b1712; padding-top: 14px; }
.np-ad { font-size: .85rem; max-width: 26em; margin: 0; border: 1px dashed #1b1712; padding: 6px 10px; }
@media (max-width: 560px) { .np-body { grid-template-columns: 110px 1fr; gap: 12px; } }

/* ---------- chat ---------- */
.chat { max-width: 760px; margin: 0 auto; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--ink); color: var(--paper); }
.chat-head img { width: 44px; height: 58px; object-fit: contain; }
.chat-head b { display: block; font-family: var(--display); letter-spacing: 1px; font-size: 1.5rem; line-height: 1; }
.chat-head span { font-size: .95rem; color: var(--slime); }
.chat-log { height: 320px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fff9ea repeating-linear-gradient(45deg, transparent 0 30px, #f3e6c855 30px 60px); overscroll-behavior: contain; }
.msg { max-width: 82%; padding: 10px 14px; border: 3px solid var(--ink); border-radius: 18px; font-size: 1.2rem; line-height: 1.3; animation: pop .25s ease-out; }
.msg.rug { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 3px 3px 0 var(--ink); }
.msg.you { align-self: flex-end; background: var(--slime); border-bottom-right-radius: 4px; box-shadow: -3px 3px 0 var(--ink); }
.msg.typing { color: #6b5a7d; letter-spacing: 3px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px 0; background: var(--paper); }
.chips button { font-size: 1.02rem; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 3px 12px; cursor: pointer; color: var(--ink); }
.chips button:hover { background: var(--yellow); }
.chat-form { display: flex; gap: 10px; padding: 12px 16px 16px; background: var(--paper); }
.chat-form input { flex: 1; min-width: 0; font-family: var(--hand); font-size: 1.25rem; padding: 8px 14px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); }
.chat-form input:focus { outline: none; box-shadow: 0 0 0 4px var(--slime); }

/* ---------- rugonomics ---------- */
.rug-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 44px 26px; padding: 18px 0; }
.rug-card {
  position: relative; text-align: center; color: var(--ink);
  background:
    radial-gradient(circle at 50% 50%, transparent 0 46px, transparent 47px),
    var(--cream);
  border: 4px solid var(--ink); border-radius: 8px;
  padding: 22px 18px 18px;
  box-shadow: inset 0 0 0 8px var(--cream), inset 0 0 0 12px var(--rug-red), inset 0 0 0 15px var(--cream), inset 0 0 0 18px var(--rug-blue), 7px 7px 0 #000a;
  transition: transform .2s;
}
.rug-card:nth-child(odd) { transform: rotate(-1.5deg); }
.rug-card:nth-child(even) { transform: rotate(1.2deg); }
.rug-card:hover { transform: rotate(0) scale(1.03); }
.rug-card::before, .rug-card::after { content: ''; position: absolute; left: 10px; right: 10px; height: 18px; background: repeating-linear-gradient(90deg, var(--cream) 0 5px, transparent 5px 11px); }
.rug-card::before { top: -22px; }
.rug-card::after { bottom: -22px; }
.rug-card h3 { font-family: var(--display); font-weight: 400; letter-spacing: 2px; margin: 8px 0 0; font-size: 1.35rem; color: var(--rug-red); }
.rug-card .big { font-family: var(--display); font-size: 2rem; line-height: 1; margin: 6px 0 8px; letter-spacing: 1px; }
.rug-card p { margin: 0 0 6px; padding: 0 8px; }

/* ---------- roadmap ---------- */
.roadmap { list-style: none; padding: 0; margin: 0 auto; max-width: 780px; position: relative; }
.roadmap::before { content: ''; position: absolute; left: 30px; top: 10px; bottom: 10px; border-left: 6px dashed var(--cream); opacity: .5; }
.roadmap li { position: relative; margin: 0 0 22px 76px; background: var(--night-2); border: 4px solid var(--ink); border-radius: 18px; padding: 14px 18px; box-shadow: 6px 6px 0 #000a; }
.roadmap li::before { content: ''; position: absolute; left: -62px; top: 16px; width: 40px; height: 40px; border-radius: 50%; background: var(--night-3); border: 4px solid var(--ink); }
.roadmap li.done::before { content: '\2714'; display: grid; place-items: center; background: var(--slime); color: var(--ink); font-size: 1.4rem; font-weight: 700; }
.roadmap li.danger { background: var(--red); color: #fff; animation: alarm 1.4s ease-in-out infinite; }
.roadmap li.danger::before { content: '!'; display: grid; place-items: center; background: var(--yellow); color: var(--ink); font-family: var(--display); font-size: 1.6rem; }
@keyframes alarm { 50% { box-shadow: 6px 6px 0 #000a, 0 0 0 8px #ff4d4d44; } }
.roadmap .phase { font-family: var(--marker); font-size: .95rem; color: var(--pink); }
.roadmap li.danger .phase { color: var(--yellow); }
.roadmap h3 { font-family: var(--display); font-weight: 400; letter-spacing: 1.5px; font-size: 1.9rem; margin: 0; line-height: 1.05; color: var(--yellow); }
.roadmap li.danger h3 { color: #fff; }
.roadmap p { margin: .3em 0 0; color: var(--cream); }
.roadmap li.danger p { color: #fff; }

/* ---------- reviews ---------- */
.reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 26px; }
.review { margin: 0; background: #fff; color: var(--ink); border: 4px solid var(--ink); border-radius: 24px; padding: 18px 20px 16px; position: relative; box-shadow: 6px 6px 0 var(--slime); }
.review:nth-child(3n+2) { box-shadow: 6px 6px 0 var(--yellow); transform: rotate(1deg); }
.review:nth-child(3n) { box-shadow: 6px 6px 0 var(--pink); transform: rotate(-1deg); }
.review::before { content: '\2605\2605\2605\2605\2606'; display: block; color: var(--rug-red); letter-spacing: 3px; margin-bottom: 4px; }
.review p { margin: 0 0 10px; font-size: 1.3rem; line-height: 1.3; }
.review cite { font-style: normal; font-family: var(--marker); font-size: .95rem; color: #6b5a7d; }

/* ---------- how to buy ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 58px 1fr; gap: 0 14px; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 18px; padding: 14px; box-shadow: 6px 6px 0 #000a; }
.steps li::before { content: counter(step); grid-row: span 2; width: 58px; height: 58px; display: grid; place-items: center; font-family: var(--display); font-size: 2.2rem; background: var(--yellow); border: 4px solid var(--ink); border-radius: 50%; }
.steps li.danger { background: var(--red); color: #fff; }
.steps li.danger::before { background: var(--ink); color: var(--red); }
.steps h3 { font-family: var(--display); font-weight: 400; letter-spacing: 1.5px; font-size: 1.55rem; margin: 0; line-height: 1.1; align-self: end; }
.steps p { margin: 2px 0 0; font-size: 1.12rem; line-height: 1.3; }
.how-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ---------- pull the rug ---------- */
.pull { text-align: center; padding-bottom: clamp(40px, 6vw, 80px); }
.pull-sign { display: inline-flex; flex-direction: column; font-family: var(--display); letter-spacing: 2px; line-height: .95; font-size: clamp(2.4rem, 7vw, 4rem); background: var(--red); color: #fff; border: 5px solid var(--ink); border-radius: 18px; padding: .2em .6em .1em; box-shadow: 8px 8px 0 var(--ink); transform: rotate(-2deg); margin-bottom: 18px; text-shadow: 3px 3px 0 var(--ink); }
.pull-sign span:first-child { font-size: .6em; color: var(--yellow); }
.pull-stage { position: relative; max-width: 760px; margin: 26px auto 0; padding: 20px 0 30px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.pull-floor { position: absolute; left: -4%; right: -4%; bottom: 0; height: 58%; border-radius: 50% 50% 18px 18px / 30% 30% 18px 18px; background: repeating-linear-gradient(90deg, #8a5a33 0 70px, #7a4e2c 70px 74px, #93633a 74px 140px, #7a4e2c 140px 144px); border: 4px solid var(--ink); box-shadow: inset 0 14px 30px #0006; }
.pull-rug { position: relative; width: 100%; transform: translateX(var(--dx, 0px)) rotate(calc(var(--dx, 0px) / 40)); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); filter: drop-shadow(0 12px 10px #0008); pointer-events: none; }
.pull-stage.dragging .pull-rug { transition: none; }
.pull-handle { position: absolute; right: -6px; bottom: 26%; z-index: 2; font-family: var(--display); letter-spacing: 1.5px; font-size: 1.3rem; background: var(--slime); color: var(--ink); border: 4px solid var(--ink); border-radius: 14px; padding: .4em .8em .3em; box-shadow: 4px 4px 0 var(--ink); cursor: grab; touch-action: none; transform: translateX(var(--dx, 0px)); animation: nudge 1.6s ease-in-out infinite; }
.pull-stage.dragging .pull-handle { cursor: grabbing; animation: none; }
@keyframes nudge { 0%, 100% { margin-right: 0; } 50% { margin-right: -10px; } }
.pull-count { color: var(--cream); margin-top: 18px; font-size: 1.1rem; }

/* ---------- footer ---------- */
.footer { margin-top: 24px; background: #120c21; }
.footer-inner { max-width: 900px; margin: 0 auto; padding: 50px var(--gutter) 120px; text-align: center; }
.footer-rug { width: 110px; margin: 0 auto 6px; animation: float 4s ease-in-out infinite; }
.footer-big { font-family: var(--display); font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: 2px; color: var(--yellow); margin: 0; text-shadow: 4px 4px 0 var(--pink); }
.socials { color: var(--cream); }
.socials a { font-family: var(--ticker); letter-spacing: .5px; font-size: 1.4rem; color: var(--slime); margin: 0 10px; }
.disclaimer { text-align: left; margin: 30px auto 20px; background: #0006; border: 3px solid #ffffff22; border-radius: 16px; padding: 18px 20px; }
.disclaimer h3 { font-family: var(--display); font-weight: 400; letter-spacing: 1px; color: var(--slime); margin: 0 0 8px; font-size: 1.4rem; }
.disclaimer p { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .95rem; line-height: 1.55; color: #e6dcc8; }
.tiny { font-size: .95rem; color: #a99bbf; }

/* ---------- heckler (corner Rug who won't shut up) ---------- */
.heckler { position: fixed; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; }
.heckler > * { pointer-events: auto; }
.heckler.gone { transform: translateY(160%); transition: transform .4s ease-in; }
.heckler.back { transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.heckler-rug { width: 92px; background: none; border: 0; padding: 0; cursor: pointer; animation: bob 3s ease-in-out infinite; -webkit-tap-highlight-color: transparent; }
.heckler-rug img { filter: drop-shadow(0 8px 10px #000a); }
.heckler-rug.poked { animation: squish .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(4deg); } 50% { transform: translateY(-10px) rotate(-3deg); } }
.heckler-bubble { position: relative; max-width: 270px; margin-bottom: 70px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 18px 18px 4px 18px; padding: 10px 30px 10px 14px; box-shadow: 4px 4px 0 var(--ink); font-size: 1.1rem; line-height: 1.25; animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.heckler-bubble p { margin: 0; }
.heckler-x { position: absolute; top: 2px; right: 4px; width: 24px; height: 24px; border: 0; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink); }
@media (max-width: 600px) {
  .heckler-rug { width: 64px; }
  .heckler-bubble { max-width: 200px; font-size: 1rem; margin-bottom: 50px; }
}

/* ---------- the rug pull ---------- */
#page.falling { animation: fall 1.1s cubic-bezier(.55, 0, .9, .4) forwards; }
#page.rising { animation: rise .8s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes fall {
  0% { transform: none; }
  18% { transform: translateX(-36px) rotate(-1.5deg); }
  30% { transform: translateX(-30px) rotate(-1deg); }
  100% { transform: translate(40px, 120vh) rotate(9deg); }
}
@keyframes rise { from { transform: translateY(-100vh); } to { transform: none; } }
body.shake #page { animation: shake .45s; }

.rugged { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 40%, #3a2a63ee, #0d0818f5); }
.rugged[hidden] { display: none; }
.rugged-card { max-width: 620px; text-align: center; animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.rugged-card img { width: min(100%, 520px); margin: 0 auto -10px; filter: drop-shadow(0 16px 20px #000c); }
.rugged h2 { font-size: clamp(3rem, 11vw, 5.6rem); color: var(--red); text-shadow: 4px 4px 0 var(--ink), 8px 8px 0 var(--yellow); margin: 0; }
.rugged p { font-size: 1.4rem; color: var(--cream); margin: .4em auto 1em; max-width: 30em; }

/* ---------- dialog ---------- */
.dialog { max-width: min(460px, calc(100vw - 32px)); padding: 24px 22px 22px; text-align: center; background: var(--paper); color: var(--ink); border: 5px solid var(--ink); border-radius: 24px; box-shadow: 10px 10px 0 var(--pink); }
.dialog::backdrop { background: #0d0818cc; }
.dialog[open] { animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.dialog img { width: 110px; margin: -6px auto 0; }
.dialog h2 { font-size: 2.6rem; margin: .1em 0 .2em; }
.dialog p { font-size: 1.25rem; margin: 0 0 18px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.dialog .btn { font-size: 1.2rem; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; top: calc(18px + env(safe-area-inset-top, 0px)); z-index: 120; visibility: hidden; transform: translate(-50%, -220%); background: var(--slime); color: var(--ink); font-family: var(--display); letter-spacing: 1px; font-size: 1.25rem; border: 3px solid var(--ink); border-radius: 999px; padding: .35em 1.1em .25em; box-shadow: 4px 4px 0 var(--ink); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); max-width: calc(100vw - 32px); text-align: center; }
.toast.show { visibility: visible; transform: translate(-50%, 0); }

/* ---------- calm down, for people who asked ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
