@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Bungee+Shade&family=Fredoka:wght@400;500;600;700&family=Fraunces:ital,opsz,wght@1,9..144,500;1,9..144,700&display=swap');

:root {
  --ink: #160b27;
  --ink2: #24113f;
  --plum: #3b1663;
  --cream: #fff6e5;
  --coral: #ff5d73;
  --mustard: #ffb703;
  --mint: #3ddc97;
  --sky: #4cc9f0;
  --lilac: #b388ff;
  --muted: rgba(255, 246, 229, .68);
  --card: rgba(255, 246, 229, .07);
  --line: rgba(255, 246, 229, .16);
  --shadow: 0 10px 0 rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--cream);
  background: radial-gradient(1200px 800px at 20% 0%, #4a1c7a 0%, transparent 60%),
              radial-gradient(1000px 700px at 100% 100%, #6b1d4f 0%, transparent 55%),
              var(--ink);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }

/* ---------- scrolling background words ---------- */
.bg { position: fixed; inset: -20vh -20vw; z-index: 0; pointer-events: none;
  transform: rotate(-12deg); display: flex; flex-direction: column; justify-content: space-around; opacity: .09; }
.bg .row { white-space: nowrap; font-family: 'Bungee', sans-serif; font-size: 7vh; line-height: 1;
  animation: drift 60s linear infinite; }
.bg .row:nth-child(even) { animation-direction: reverse; animation-duration: 75s; color: var(--mustard); }
.bg .row:nth-child(3n) { color: var(--coral); animation-duration: 90s; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.bg-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: conic-gradient(from 0deg at 50% 50%, transparent, rgba(255, 93, 115, .08), transparent, rgba(76, 201, 240, .08), transparent);
  animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { position: relative; z-index: 2; height: 100%; }

/* ---------- logo ---------- */
.logo { font-family: 'Bungee Shade', 'Bungee', sans-serif; letter-spacing: .02em; line-height: 1; display: inline-flex; }
.logo span { display: inline-block; animation: drop .7s cubic-bezier(.2, 1.6, .4, 1) both, wobble 4s ease-in-out infinite; }
.logo span:nth-child(odd) { color: var(--mustard); }
.logo span:nth-child(even) { color: var(--coral); }
.logo span:nth-child(3n) { color: var(--mint); }
@keyframes drop { from { transform: translateY(-120vh) rotate(-30deg); } }
@keyframes wobble { 0%, 100% { rotate: 0deg; } 50% { rotate: 3deg; } }

/* ---------- swipe transition ---------- */
.swipe { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: flex; flex-direction: column; }
.swipe i { flex: 1; transform: translateX(-110%) skewX(-12deg); }
.swipe i:nth-child(1) { background: var(--coral); }
.swipe i:nth-child(2) { background: var(--mustard); }
.swipe i:nth-child(3) { background: var(--mint); }
.swipe i:nth-child(4) { background: var(--sky); }
.swipe.go i { animation: swipe .9s cubic-bezier(.7, 0, .3, 1) both; }
.swipe.go i:nth-child(2) { animation-delay: .05s; }
.swipe.go i:nth-child(3) { animation-delay: .1s; }
.swipe.go i:nth-child(4) { animation-delay: .15s; }
@keyframes swipe { 0% { transform: translateX(-120%) skewX(-12deg); } 45%, 55% { transform: translateX(0) skewX(-12deg); } 100% { transform: translateX(120%) skewX(-12deg); } }

/* ---------- shared bits ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4vh 4vw; }
.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.rise { animation: rise .6s ease-out both; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.btn { font-family: 'Bungee', sans-serif; font-size: 1.3rem; padding: .9em 1.6em; border: 0; border-radius: 18px;
  background: var(--mustard); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; transition: transform .1s; }
.btn:active { transform: translateY(6px); box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.btn.coral { background: var(--coral); color: var(--cream); }
.btn.mint { background: var(--mint); }
.btn[disabled] { opacity: .45; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: .4em; padding: .35em .8em .35em .35em; border-radius: 999px;
  background: var(--card); border: 2px solid var(--line); font-weight: 600; }
.dot { width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; font-family: 'Bungee'; font-size: .8em; color: var(--ink); }
.word { font-family: 'Bungee', sans-serif; color: var(--mustard); text-shadow: 0 6px 0 rgba(0, 0, 0, .35); line-height: 1; word-break: break-word; text-align: center; }
.pos { font-family: 'Fraunces', serif; font-style: italic; color: var(--muted); }
.defn { font-family: 'Fraunces', serif; font-style: italic; font-weight: 500; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- timer ring ---------- */
.timer { position: relative; display: grid; place-items: center; }
.timer svg { transform: rotate(-90deg); }
.timer .track { stroke: rgba(255, 255, 255, .12); }
.timer .bar { stroke: var(--mint); stroke-linecap: round; transition: stroke .3s; }
.timer.low .bar { stroke: var(--coral); }
.timer.low { animation: throb 1s ease-in-out infinite; }
@keyframes throb { 50% { transform: scale(1.08); } }
.timer b { position: absolute; font-family: 'Bungee'; }
.tbar { height: 10px; border-radius: 10px; background: rgba(255, 255, 255, .12); overflow: hidden; width: 100%; }
.tbar i { display: block; height: 100%; background: var(--mint); width: 100%; transition: background .3s; }
.tbar.low i { background: var(--coral); }

/* ---------- Gerard caption ---------- */
.gerard { position: fixed; left: 3vw; right: 3vw; bottom: 3vh; z-index: 40; display: flex; align-items: center; gap: 2vw;
  padding: 1.6vh 2vw; border-radius: 28px; background: rgba(22, 11, 39, .92); border: 3px solid var(--mustard);
  box-shadow: 0 14px 0 rgba(0, 0, 0, .4); transform: translateY(150%); transition: transform .5s cubic-bezier(.2, 1.4, .4, 1); }
.gerard.show { transform: none; }
.face { flex: none; width: 9vh; height: 9vh; border-radius: 50%; background: var(--cream); position: relative; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .15); }
.face::before { content: ''; position: absolute; left: 24%; top: 36%; width: 14%; height: 8%; background: var(--ink); border-radius: 4px; }
.face::after { content: ''; position: absolute; right: 18%; top: 28%; width: 26%; height: 26%; border: .55vh solid var(--mustard); border-radius: 50%; }
.face .tash { position: absolute; left: 26%; right: 26%; bottom: 24%; height: 12%; background: var(--ink); border-radius: 0 0 50% 50%; }
.face.talk .tash { animation: talk .18s ease-in-out infinite alternate; }
@keyframes talk { to { transform: scaleY(1.9) translateY(10%); } }
.gerard .who { font-family: 'Bungee'; color: var(--mustard); font-size: 2vh; letter-spacing: .1em; }
.gerard .cap { font-size: 3.6vh; font-weight: 600; line-height: 1.25; }
.gerard .cap span { opacity: .15; transition: opacity .15s; }
.gerard .cap span.on { opacity: 1; }

/* ---------- confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i { position: absolute; top: -5vh; width: 1.2vh; height: 2.2vh; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(115vh) rotate(720deg); } }

a.btn { text-decoration: none; display: inline-block; }
.dots::after { content: ''; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
