@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; color: #fff; background: #000033;
  height: 100dvh; display: grid; grid-template-rows: auto 1fr auto;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive;
  cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><text y='24' font-size='24'>🏛️</text></svg>") 4 4, auto;
}
#stars {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 140px 70px, #ff0, transparent),
    radial-gradient(1px 1px at 90px 140px, #0ff, transparent),
    radial-gradient(2px 2px at 200px 190px, #f0f, transparent),
    #000033;
  background-size: 300px 220px; animation: drift 40s linear infinite;
}
@keyframes drift { to { background-position: 300px 220px; } }
a { color: #0ff; }
.pix { image-rendering: pixelated; }
.tiny { font-size: 11px; font-family: Verdana, sans-serif; opacity: .85; }
.hot { color: #ff0; background: #f00; padding: 0 4px; }

/* ---------- bars ---------- */
.topbar {
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); background-size: 200% 100%;
  animation: slide-bg 3s linear infinite; color: #000;
  font-family: "Press Start 2P", monospace; font-size: 11px; padding: 5px 0;
}
@keyframes slide-bg { to { background-position: 200% 0; } }
.footbar {
  display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap;
  background: #000; border-top: 3px double #0f0; padding: 4px 10px;
  font-family: "VT323", monospace; font-size: 18px; color: #0f0;
}
.counter { letter-spacing: 2px; text-shadow: 0 0 6px #0f0; }

/* ---------- layout ---------- */
.stage {
  display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  min-height: 0; overflow: hidden;
}
.face-zone { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; }
.right { display: flex; flex-direction: column; min-height: 0; padding: 1.2vh 2vw 1.2vh 1vw; gap: 1vh; }

/* ---------- THE FACE ---------- */
.face {
  position: relative; width: min(92%, 78vh); aspect-ratio: 1; cursor: pointer;
  padding: 14px; border-radius: 6px;
  background: conic-gradient(from var(--a, 0deg), #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  animation: spin-border 2s linear infinite, bob 3s ease-in-out infinite;
  box-shadow: 0 0 40px #f0f, 0 0 90px #0ff, 18px 18px 0 #000;
  transform: rotate(-5deg);
}
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin-border { to { --a: 360deg; } }
@keyframes bob { 50% { transform: rotate(4deg) scale(1.04); } }
.face img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.face:active { filter: saturate(3) contrast(1.3); }
#wreath { position: absolute; left: 35%; top: 7%; width: 35%; pointer-events: none; }
#shades {
  position: absolute; left: 34%; top: 29.5%; width: 28%; pointer-events: none;
  transform: translateY(-140vh); transition: transform .9s cubic-bezier(.3, 1.4, .6, 1);
}
.face.cool #shades { transform: translateY(0); }
.deal {
  position: absolute; left: 0; right: 0; bottom: 6%; text-align: center;
  font-family: "Press Start 2P"; font-size: clamp(14px, 3.4vh, 30px); color: #fff;
  text-shadow: 3px 3px 0 #000, -2px -2px 0 #000; opacity: 0; transition: opacity .3s .8s;
}
.face.cool .deal { opacity: 1; }

.burst {
  position: absolute; right: 2%; top: 4%; width: clamp(90px, 17vh, 160px); aspect-ratio: 1;
  background: #ff0; color: #f00; display: grid; place-items: center; text-align: center;
  font-family: Impact, sans-serif; font-size: clamp(11px, 2vh, 18px); line-height: 1;
  clip-path: polygon(50% 0, 61% 18%, 82% 7%, 79% 30%, 100% 33%, 85% 50%, 100% 67%, 79% 70%, 82% 93%, 61% 82%, 50% 100%, 39% 82%, 18% 93%, 21% 70%, 0 67%, 15% 50%, 0 33%, 21% 30%, 18% 7%, 39% 18%);
  animation: rot 6s linear infinite; z-index: 3;
}
.burst span { animation: rot 6s linear infinite reverse; }
@keyframes rot { to { transform: rotate(360deg); } }
.speech {
  position: absolute; left: 4%; bottom: 3%; max-width: 60%; z-index: 3;
  background: #fff; color: #000; border: 3px solid #000; border-radius: 14px;
  padding: 6px 10px; font-weight: bold; font-size: clamp(12px, 1.9vh, 16px);
  transform: rotate(-3deg);
}

/* ---------- title ---------- */
.wordart {
  font-family: Impact, "Arial Black", sans-serif; font-size: clamp(34px, 9vh, 92px);
  margin: 0; text-align: center; line-height: 1; letter-spacing: 2px; white-space: nowrap;
  filter: drop-shadow(4px 4px 0 #00ffff) drop-shadow(-3px -3px 0 #ff00ff);
  transform: perspective(400px) rotateX(16deg);
}
.wordart span {
  display: inline-block; animation: bounce 1s ease-in-out infinite;
  background: linear-gradient(180deg, #fff200 0%, #ff7a00 45%, #ff0080 55%, #8000ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 2px #000;
}
@keyframes bounce { 50% { transform: translateY(-10px); } }
.subtitle { text-align: center; font-size: clamp(16px, 3vh, 28px); font-weight: bold; }
.rainbow {
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #f0f, #f00); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: slide-bg 2s linear infinite;
}
.bio { margin: 0; text-align: center; font-size: clamp(12px, 1.9vh, 16px); line-height: 1.45; }

/* ---------- tabs + panels ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.tab {
  font-family: "Press Start 2P", monospace; font-size: clamp(8px, 1.2vh, 11px);
  background: #c0c0c0; color: #000; border: 3px outset #fff; padding: 7px 8px; cursor: pointer;
}
.tab:hover { background: #ff0; }
.tab.on { background: #f0f; color: #fff; border-style: inset; }
.panel-wrap { flex: 1; min-height: 0; position: relative; border: 5px ridge #0ff; background: rgba(0,0,0,.6); }
.panel { position: absolute; inset: 0; padding: 1.2vh 1.2vw; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 1vh; }
.panel.on { display: flex; animation: zoom-in .35s cubic-bezier(.3,1.6,.6,1); }
@keyframes zoom-in { from { transform: scale(.7) rotate(-3deg); opacity: 0; } }
.row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }

.btn98 {
  font-family: "Press Start 2P", monospace; font-size: clamp(8px, 1.2vh, 10px);
  background: #c0c0c0; color: #000; padding: 7px 9px; border: 3px outset #fff; cursor: pointer;
}
.btn98:hover { background: #ff0; }
.btn98:active { border-style: inset; }
.btn98.mini { padding: 3px 6px; }

/* oracle */
.cards { container-type: size; flex: 1; min-height: 0; width: 100%; display: flex; gap: 2%; justify-content: center; align-items: center; }
.card { height: min(100cqh, 330px, calc(31cqw / .68)); aspect-ratio: .68; perspective: 800px; cursor: pointer; }
.card-inner { position: relative; width: 100%; height: 100%; transition: transform .8s; transform-style: preserve-3d; }
.card.flipped .card-inner { transform: rotateY(180deg); }
.card-back, .card-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 4px solid gold; border-radius: 10px; }
.card-back {
  background: repeating-conic-gradient(#4b0082 0 15deg, #8a2be2 15deg 30deg);
  display: grid; place-items: center; box-shadow: 0 0 18px #f0f; animation: pulse 1.5s infinite alternate;
}
.card-back::after { content: "👁️"; font-size: clamp(28px, 6vh, 56px); }
@keyframes pulse { to { box-shadow: 0 0 34px #0ff; } }
.card-front {
  transform: rotateY(180deg); background: #fff8dc; color: #300; padding: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-around; text-align: center;
}
.c-name { font-family: "Press Start 2P"; font-size: clamp(6px, 1vh, 9px); color: #800080; line-height: 1.5; }
.c-icon { font-size: clamp(24px, 5vh, 48px); }
.c-text { font-size: clamp(10px, 1.5vh, 13px); font-weight: bold; }

/* cul-de-sac */
#culdesac-canvas { flex: 1; min-height: 0; max-width: 100%; height: 100%; width: auto; image-rendering: pixelated; border: 5px ridge #0f0; }
.dunbar { font-family: "VT323"; font-size: 22px; }

/* lucid */
#philo-in { flex: 1; min-width: 0; padding: 7px; font-family: "Times New Roman", serif; font-size: 15px; border: 3px inset #888; }
.slide {
  flex: 1; min-height: 0; aspect-ratio: 16/9; max-width: 100%; position: relative;
  background: #fff; color: #111; font-family: "Helvetica Neue", Arial, sans-serif;
  padding: 4% 5%; box-shadow: 10px 10px 0 #ff00ff; overflow: hidden;
}
.slide.pop { animation: pop .5s; }
@keyframes pop { 0% { transform: scale(.6) rotate(-8deg); } 70% { transform: scale(1.05) rotate(1deg); } }
.slide-num { position: absolute; top: 6px; right: 12px; font-size: 10px; color: #888; }
.slide-title { font-size: clamp(14px, 3vh, 30px); font-weight: 800; letter-spacing: -1px; }
.slide ul { font-size: clamp(11px, 2vh, 18px); line-height: 1.45; padding-left: 1.2em; }
.slide-foot { position: absolute; bottom: 6px; left: 5%; font-size: 9px; color: #aaa; letter-spacing: 2px; }

/* busts */
.busts { flex: 1; min-height: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 1vh; }
.bust { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #222; border: 3px solid #555; min-height: 0; overflow: hidden; }
.bust:hover { border-color: #ff0; }
.bust canvas { height: 62%; width: auto; image-rendering: pixelated; }
.bust .name { font-family: "Press Start 2P"; font-size: clamp(6px, 1vh, 9px); margin-top: 4px; }
.bust .stamp {
  position: absolute; top: 34%; left: 50%; transform: translateX(-50%) rotate(-16deg);
  border: 3px solid #f00; color: #f00; font-family: Impact; font-size: clamp(11px, 2vh, 18px);
  padding: 1px 5px; background: rgba(255,255,255,.88); white-space: nowrap;
}
.bust.ok .stamp { border-color: #0a0; color: #0a0; }
.why { min-height: 2.6em; text-align: center; color: #ff0; opacity: 1; }

/* recovery */
.meter { width: 100%; max-width: 480px; height: 26px; background: #000; border: 3px inset #888; overflow: hidden; }
#meter-fill { height: 100%; width: 97%; background: repeating-linear-gradient(90deg, #f00 0 12px, #f60 12px 24px); transition: width .6s cubic-bezier(.5,1.8,.5,.8); }
.meter-label { font-family: "VT323"; font-size: clamp(16px, 2.6vh, 22px); color: #f66; text-align: center; }
.step { background: #ffffcc; color: #600; border: 4px dashed #f0f; padding: 10px 14px; font-size: clamp(13px, 2.2vh, 19px); text-align: center; max-width: 520px; }

/* fx */
.sparkle { position: fixed; pointer-events: none; z-index: 9999; font-size: 16px; animation: fall 1s forwards; }
@keyframes fall { to { transform: translateY(40px) rotate(180deg); opacity: 0; } }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translate(-8px, 4px); } 50% { transform: translate(8px, -4px); } 75% { transform: translate(-4px, -2px); } }
body.toga { animation: hue 3s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* ---------- phones: stack, still no scroll ---------- */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: 34% 66%; }
  .face { width: auto; height: 90%; }
  .burst { width: 76px; right: 3%; font-size: 9px; }
  .speech { display: none; }
  .wordart { font-size: clamp(24px, 9vw, 60px); letter-spacing: 0; }
  .subtitle { font-size: 4.2vw; }
  .tab { font-size: 7px; padding: 6px 5px; }
  .footbar { font-size: 15px; gap: 8px; }
  .footbar span:nth-child(2) { display: none; }
  .bio { display: none; }
  .right { padding: 1vh 3vw; }
  .footbar .tiny { display: none; }
}

/* deck nav */
.slide { cursor: pointer; user-select: none; }
.slide-body { font-size: clamp(11px, 2vh, 18px); line-height: 1.45; }
.slide-body ul { margin: .4em 0; padding-left: 1.2em; }
.slide-body .big { font-size: clamp(20px, 4.6vh, 44px); font-weight: 900; letter-spacing: -1px; color: #7b2cff; margin-top: .3em; }
.slide-body .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-size: .85em; margin-top: .4em; }
.slide-body .grid2 div { border: 2px solid #eee; padding: 4px 6px; }
.slide-body .grid2 .us { border-color: #ff00ff; background: #fff0ff; font-weight: bold; }
.slide.next-in { animation: in-r .35s cubic-bezier(.3,1.4,.6,1); }
.slide.prev-in { animation: in-l .35s cubic-bezier(.3,1.4,.6,1); }
@keyframes in-r { from { transform: translateX(40%) rotate(6deg); opacity: 0; } }
@keyframes in-l { from { transform: translateX(-40%) rotate(-6deg); opacity: 0; } }
.deck-nav { flex-wrap: nowrap; }
.dots { display: flex; gap: 4px; }
.dots button { width: 12px; height: 12px; padding: 0; border: 2px solid #fff; background: transparent; cursor: pointer; }
.dots button.on { background: #ff00ff; }
.stamp-funded {
  position: absolute; right: 8%; bottom: 18%; transform: rotate(-14deg) scale(3); opacity: 0;
  border: 5px solid #0a0; color: #0a0; font-family: Impact; font-size: clamp(16px, 3.4vh, 30px);
  padding: 4px 10px; text-align: center; line-height: 1; background: rgba(255,255,255,.9); pointer-events: none;
  transition: transform .35s cubic-bezier(.3,1.6,.6,1) .25s, opacity .2s .25s;
}
.stamp-funded.on { transform: rotate(-14deg) scale(1); opacity: 1; }
@media (max-width: 760px), (max-aspect-ratio: 4/5) { .dots button { width: 9px; height: 9px; } .deck-nav .btn98 { padding: 6px 5px; } }
