/* Fun layer: speech bubbles, the "something's here" marker, big comic words, speed lines, the Met counter. */

/* ---------- speech bubbles ---------- */
#bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.bub { position: absolute; left: 0; top: 0; will-change: transform; }
.bub-in { position: absolute; left: 0; bottom: 26px; width: max-content; max-width: 230px; transform: translateX(-50%) scale(.3); transform-origin: 50% 100%; opacity: 0;
  transition: transform .38s cubic-bezier(.3, 1.7, .5, 1), opacity .22s; padding: 7px 12px 8px; border-radius: 16px; text-align: center;
  background: #fff4e6; color: #2a0c04; font: 600 14.5px/1.25 'Inter Tight', system-ui, sans-serif; box-shadow: 0 8px 26px rgba(0, 0, 0, .4); }
.bub-in::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 0 0 3px 0; z-index: -1; }
.bub.on .bub-in { opacity: 1; transform: translateX(-50%) scale(1); }
.bub-in i { display: block; font: 500 9px 'JetBrains Mono', monospace; font-style: normal; letter-spacing: .18em; text-transform: uppercase; color: #a8622e; margin-bottom: 1px; }
/* screams: hot red, shaking */
.bub-scream .bub-in { background: #ff4f3e; color: #fff; font: italic 900 18px/1.1 'Inter Tight', system-ui, sans-serif; letter-spacing: .01em; }
.bub-scream .bub-in i { color: rgba(255, 255, 255, .75); }
.bub-scream.on .bub-in { animation: bubShake .11s linear infinite; }
@keyframes bubShake { 0% { transform: translateX(-50%) translate(1.5px, -1px) rotate(-2deg); } 50% { transform: translateX(-50%) translate(-1.5px, 1px) rotate(2deg); } 100% { transform: translateX(-50%) translate(1.5px, -1px) rotate(-2deg); } }
/* guests: dark glass, their name in their colour */
.bub-cameo .bub-in { background: rgba(24, 10, 28, .86); color: #fff6ee; border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.bub-cameo .bub-in::after { background: rgba(24, 10, 28, .86); border-right: 1px solid rgba(255, 255, 255, .18); border-bottom: 1px solid rgba(255, 255, 255, .18); }
.bub-cameo .bub-in i { color: #ffcf80; }
/* you */
.bub-hero .bub-in { background: linear-gradient(180deg, #ffe2a8, #f3c06a); }

/* ---------- "something's here" marker ---------- */
#marker { position: fixed; left: 0; top: 0; z-index: 8; pointer-events: none; opacity: 0; transition: opacity .4s; will-change: transform; }
#marker.on { opacity: 1; }
#marker i { position: absolute; left: -19px; top: -19px; width: 38px; height: 38px; border-radius: 50%; border: 2px dashed rgba(243, 192, 106, .85); animation: mkSpin 6s linear infinite; }
#marker b { position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; display: grid; place-items: center; font: 800 13px 'Inter Tight', sans-serif; color: #2a0c04; background: #f3c06a; border-radius: 50%; box-shadow: 0 0 18px rgba(243, 192, 106, .8); animation: mkBob 1.6s ease-in-out infinite; }
#marker.near i { border-style: solid; border-color: #ffe0a0; animation-duration: 2s; }
@keyframes mkSpin { to { transform: rotate(360deg); } }
@keyframes mkBob { 50% { transform: scale(1.18); } }

/* ---------- big comic words ---------- */
#pop { position: fixed; left: 50%; top: 30%; z-index: 13; pointer-events: none; opacity: 0; white-space: nowrap; transform: translate(-50%, -50%);
  font: italic 900 clamp(56px, 13vw, 150px)/1 'Inter Tight', system-ui, sans-serif; letter-spacing: -.02em;
  -webkit-text-stroke: 3px #2a0c04; paint-order: stroke fill; text-shadow: 0 8px 0 #2a0c04, 0 14px 40px rgba(0, 0, 0, .5); }
#pop.pop-warm { color: #ffe0a0; }
#pop.pop-hot { color: #ffb347; }
#pop.pop-cool { color: #9fe0ff; }
#pop.go { animation: popGo 1.5s cubic-bezier(.2, .9, .3, 1) forwards; }
@keyframes popGo {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(-12deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(-6deg); }
  30% { transform: translate(-50%, -50%) scale(.96) rotate(-5deg); }
  75% { opacity: 1; transform: translate(-50%, -54%) scale(1) rotate(-5deg); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1.05) rotate(-5deg); }
}

/* ---------- speed lines during surges ---------- */
#speed { position: fixed; left: 50%; top: 50%; width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax; z-index: 2; pointer-events: none; opacity: 0;
  background: center / 100% 100% no-repeat; animation: speedJit .18s steps(2) infinite; will-change: transform, opacity; }
@keyframes speedJit { 0% { transform: rotate(0deg) scale(1); } 100% { transform: rotate(2.4deg) scale(1.03); } }

/* ---------- the Met counter ---------- */
.hud-found { display: none; align-items: baseline; gap: 6px; padding: 5px 10px 5px 11px; border-radius: 999px; background: rgba(20, 4, 6, .45); border: 1px solid rgba(160, 200, 255, .3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: border-color .5s; }
.hud-found.on { display: flex; }
.hud-found b { font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1; color: #bfe0ff; font-variant-numeric: tabular-nums; }
.hud-found.new { border-color: #bfe0ff; animation: painBump .9s ease; }
.hud-found.new .hud-k { color: #bfe0ff; }

/* recap: who you met */
.rc-met { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px auto 16px; font-size: 12px; color: var(--dim); }
.rc-met b { font-weight: 500; color: var(--ink); margin-right: 4px; }
.rc-met span { padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(160, 200, 255, .3); color: #bfe0ff; }
.rc-met span.miss { border-style: dashed; color: rgba(246, 239, 230, .3); border-color: rgba(246, 239, 230, .15); }

body.cine #bubbles, body.cine #marker, body.cine #speed { opacity: 0 !important; transition: opacity .3s; }
@media (max-width: 560px) {
  .bub-in { font-size: 13px; max-width: 190px; }
  .bub-scream .bub-in { font-size: 16px; }
  #pop { -webkit-text-stroke: 2px #2a0c04; }
}

/* ---------- choose your ride ---------- */
#picker { position: fixed; inset: 0; z-index: 21; pointer-events: none; opacity: 0; transition: opacity .35s; }
#picker.hidden { display: none; }
#picker.on { opacity: 1; }
#picker::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 1, 2, .7) 0%, rgba(8, 1, 2, 0) 26%, rgba(8, 1, 2, 0) 58%, rgba(8, 1, 2, .82) 100%); }
.pk-head { position: absolute; top: calc(var(--safe-t) + 22px); left: 16px; right: 16px; text-align: center; }
.pk-k { font: 500 11px 'JetBrains Mono', monospace; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.pk-t { font-family: var(--serif); font-size: clamp(40px, 7vw, 76px); line-height: 1; margin-top: 6px; text-shadow: 0 4px 30px rgba(0, 0, 0, .6); }
.pk-s { font-size: 14px; color: var(--dim); margin-top: 6px; }
.pk-bottom { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 18px); display: flex; flex-direction: column; align-items: center; gap: 14px; pointer-events: auto; }
.pk-cards { display: flex; gap: 10px; overflow-x: auto; max-width: 100vw; padding: 8px 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.pk-cards::-webkit-scrollbar { display: none; }
.pk-card { flex: 0 0 152px; scroll-snap-align: center; text-align: left; padding: 12px 12px 13px; border-radius: 14px; border: 1px solid rgba(246, 239, 230, .16); background: rgba(20, 6, 6, .6);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink); cursor: pointer; font: inherit; transition: transform .25s, border-color .25s, background .25s, box-shadow .25s; }
.pk-card:hover { border-color: rgba(243, 192, 106, .5); }
.pk-card.on { border-color: var(--gold); background: rgba(58, 24, 8, .78); transform: translateY(-5px); box-shadow: 0 12px 30px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--gold); }
.pk-ic { display: block; color: rgba(246, 239, 230, .7); }
.pk-card.on .pk-ic { color: var(--gold); }
.pk-ic svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pk-card b { display: block; font-weight: 600; font-size: 15px; margin-top: 7px; }
.pk-tag { display: block; font-size: 12px; line-height: 1.3; color: var(--dim); margin-top: 3px; }
.pk-go-row { display: flex; align-items: center; gap: 14px; }
#pkGo { font: 600 15px 'Inter Tight', sans-serif; padding: 12px 26px; border-radius: 999px; border: 0; background: var(--gold); color: #2a0c04; cursor: pointer; box-shadow: 0 8px 24px rgba(243, 192, 106, .3); }
.pk-hint { font: 500 10px 'JetBrains Mono', monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
body.touch .pk-hint { display: none; }
@media (max-width: 560px) { .pk-card { flex-basis: 134px; padding: 10px; } .pk-tag { font-size: 11px; } .pk-t { font-size: 40px; } }

/* ---------- the prescription prompt ---------- */
#ingest { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-b) + 34px); z-index: 22; display: flex; justify-content: center; padding: 0 16px; opacity: 0; transform: translateY(14px); transition: opacity .45s, transform .45s; }
#ingest.hidden { display: none; }
#ingest.on { opacity: 1; transform: none; }
.ig-card { width: min(440px, 100%); padding: 18px 18px 18px; border-radius: 18px; background: rgba(16, 6, 6, .66); border: 1px solid rgba(246, 239, 230, .14); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.ig-k { font: 500 10.5px 'JetBrains Mono', monospace; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.ig-line { font-family: var(--serif); font-size: 22px; line-height: 1.25; margin: 8px 0 14px; }
#btnIngest { display: inline-flex; align-items: center; gap: 10px; font: 600 16px 'Inter Tight', sans-serif; padding: 14px 26px; border-radius: 999px; border: 0; background: var(--gold); color: #2a0c04; cursor: pointer; box-shadow: 0 10px 30px rgba(243, 192, 106, .35); animation: igPulse 2.2s ease-in-out infinite; }
#btnIngest:hover { transform: translateY(-1px); }
@keyframes igPulse { 50% { box-shadow: 0 10px 40px rgba(243, 192, 106, .6), 0 0 0 6px rgba(243, 192, 106, .12); } }
