/* ---- one theme: Persona 5 (blood red, black, white, halftone dots, stars, ransom-note letters) ---- */
:root {
  --bg-color: #0a0a0a;
  --bg-art: linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .5)), url("p5/halftone.jpg") center / cover no-repeat;
  --ink: #ffffff;
  --line: #ffffff;           /* white borders */
  --red: #e60012;
  --dred: #8a0008;
  --pink: #e60012;           /* kept as the name of the accent used in shadows */
  --frame: rgba(8, 8, 8, .84);
  --radius: 4px;
  --title-color: #ffffff;
  --title-shadow: 4px 4px 0 var(--red), -2px -2px 0 #000;
  --head-bg: #000;
  --head-kanji: #ffffff;
  --head-label: #ff3b47;
  --dots: radial-gradient(circle, rgba(0, 0, 0, .35) 1.8px, transparent 2.4px) 0 0 / 12px 12px;
  --cell: var(--dots), linear-gradient(160deg, #ff1a2a 0%, #d00010 55%, #7a0008 100%);
  --cell-text: #ffffff;
  --btn-bg: #000;
  --btn-text: #ffffff;
  --accent: #ffffff;
  --accent-text: #000000;
  --panel: linear-gradient(180deg, rgba(20, 20, 20, .94), rgba(0, 0, 0, .96));
  --panel-text: #ffffff;
  --answer-text: #ffffff;
  --stage: #ffffff;
  --good: #14a85a;
  --bad: #e60012;
  --display: "Anton", Impact, "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --body: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, Arial, sans-serif;
}
body.p-menu { --bg-art: linear-gradient(rgba(0, 0, 0, .15), rgba(0, 0, 0, .3)), url("p5/takeyourheart.jpg") center / cover no-repeat; }
body.p-question { --bg-art: linear-gradient(rgba(0, 0, 0, .3), rgba(0, 0, 0, .45)), url("p5/halftone.jpg") center / cover no-repeat; }
body.p-board { --bg-art: linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .5)), url("p5/halftone.jpg") center / cover no-repeat; }
body.p-cat { --bg-art: linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .5)), url("p5/halftone.jpg") center / cover no-repeat; }
@media (max-aspect-ratio: 3/4) {   /* tall screens: the red star wallpaper */
  body.p-menu, body.p-question, body.p-board, body.p-cat { --bg-art: linear-gradient(rgba(0, 0, 0, .12), rgba(0, 0, 0, .12)), url("p5/stars.jpg") center / cover no-repeat; }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--body); color: var(--ink); background: var(--bg-color); position: relative; overflow-x: hidden; cursor: url("theme/cursor.png") 3 3, auto; }
button, a.btn { font-family: var(--display); letter-spacing: .02em; }
a, button, .cat, .num, .choice { cursor: url("theme/cursor-hand.png") 12 4, pointer; }
html.tv, html.tv * { cursor: none !important; }

.frame {
  max-width: 1100px; margin: 14px auto; padding: 14px;
  background: var(--frame); border: 4px solid var(--line); border-radius: 6px;
  box-shadow: 0 0 0 4px var(--red), 10px 10px 0 4px #000, inset 0 0 40px rgba(230, 0, 18, .18);
  backdrop-filter: blur(2px);
}

/* top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bar h1 {
  margin: 0; font-family: var(--display); font-weight: 400; letter-spacing: .03em;
  font-size: clamp(26px, 4vw, 38px); text-transform: uppercase;
  color: var(--title-color); text-shadow: var(--title-shadow); transform: skewX(-6deg);
}
.bar nav { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block; background: var(--btn-bg); color: var(--btn-text);
  border: 3px solid var(--line); border-radius: var(--radius); padding: 10px 20px;
  font-size: 17px; text-transform: uppercase; text-decoration: none; line-height: 1.1;
  box-shadow: 4px 4px 0 var(--red); transform: skewX(-6deg);
}
.btn:hover { filter: brightness(1.2); background: var(--red); }
.btn:active { transform: skewX(-6deg) translateY(2px); }
.btn.on { outline: 3px solid var(--red); outline-offset: 2px; }
.btn.accent { background: var(--accent); color: var(--accent-text); border-color: #000; box-shadow: 4px 4px 0 var(--red); }
.btn.accent:hover { background: #ffd5d8; }
.btn:disabled { opacity: .45; cursor: default; filter: none; }

/* category board: just the categories, no numbers; each has its own Phantom Thief mask */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cats .cat:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cat {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; text-decoration: none;
  min-height: clamp(130px, 22vh, 220px); padding: 14px 8px 10px;
  background: var(--cell); color: var(--cell-text);
  border: 4px solid var(--line); border-radius: 4px;
  box-shadow: 6px 6px 0 #000, 0 0 0 3px var(--red);
  font-family: var(--display);
}
.cat .mask { height: clamp(58px, 11vh, 120px); max-width: 80%; object-fit: contain; filter: drop-shadow(3px 3px 0 #000); }
.cat .jp { position: absolute; top: -4px; left: -4px; padding: 2px 10px; font-size: clamp(22px, 3.4vw, 40px); line-height: 1.15; background: #000; color: #fff; border: 3px solid #fff; border-top: 0; border-left: 0; }
.cat .en { font-size: clamp(20px, 2.8vw, 32px); letter-spacing: .08em; text-transform: uppercase; text-shadow: 3px 3px 0 #000; }
.cat .left { font-size: clamp(12px, 1.5vw, 16px); letter-spacing: .06em; opacity: .95; font-family: var(--body); font-weight: 800; background: #000; padding: 1px 10px; transform: skewX(-8deg); }
.cat.done { filter: grayscale(.9) brightness(.55); }

/* number grid inside a category (1-60) */
.nums { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.num {
  display: block; text-align: center; text-decoration: none;
  background: var(--cell); color: var(--cell-text);
  border: 3px solid var(--line); border-radius: var(--radius);
  font-family: var(--display); font-size: clamp(22px, 3vw, 34px); padding: 14px 0 12px;
  text-shadow: 2px 2px 0 #000; box-shadow: 3px 3px 0 #000;
}
.num.used { background: rgba(0, 0, 0, .6); color: rgba(255, 255, 255, .35); border-style: dashed; border-color: #777; box-shadow: none; text-shadow: none; }
.q-tag.big { margin-bottom: 14px; }
.note { margin: 12px 2px 0; font-size: 13px; font-weight: 800; color: #000; background: #fff; display: inline-block; padding: 3px 10px; transform: skewX(-8deg); }

/* question page */
.q-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.q-tag { display: flex; align-items: center; gap: 12px; background: var(--head-bg); border: 3px solid var(--line); border-radius: var(--radius); padding: 4px 16px 4px 10px; font-family: var(--display); box-shadow: 4px 4px 0 var(--red); }
.q-tag .tag-mask { height: 46px; width: auto; filter: drop-shadow(2px 2px 0 var(--red)); }
.q-tag .jp { font-size: 40px; line-height: 1; color: var(--head-kanji); }
.q-tag .en { color: var(--head-label); text-transform: uppercase; font-size: 18px; letter-spacing: .06em; }
.q-tag .no { color: #fff; font-size: 30px; }
.spacer { flex: 1; }
.q-panel { background: var(--panel); color: var(--panel-text); border: 4px solid var(--line); border-radius: 6px; padding: 18px; text-align: center; box-shadow: inset 0 0 30px rgba(230, 0, 18, .3); }

/* the prompt is a Persona-style dialogue bubble with a Phantom Thief next to it */
.q-stage { margin: 0 0 16px; display: flex; align-items: flex-end; gap: 0; min-height: 150px; text-align: left; }
.q-who { position: relative; flex: none; width: clamp(110px, 17vw, 200px); z-index: 2; margin-right: -3%; animation: charIn .6s cubic-bezier(.2, 1.3, .4, 1) .3s backwards; }
.q-char { display: block; width: 100%; height: auto; filter: drop-shadow(4px 0 0 #000) drop-shadow(-3px 0 0 #000) drop-shadow(0 3px 0 #000); }
.q-name { position: absolute; right: -6%; bottom: 8%; background: #fff; color: #000; font-family: var(--display); font-size: clamp(13px, 1.7vw, 20px); letter-spacing: .04em; padding: 1px 12px; transform: skewX(-14deg) rotate(-5deg); border: 2px solid #000; box-shadow: 3px 3px 0 var(--red); }
.q-bubble { flex: 1; min-width: 0; align-self: center; filter: drop-shadow(0 0 0 #fff) drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(7px 7px 0 var(--red)); }
.q-bubble > div { background: #000; clip-path: polygon(0 50%, 6% 0, 100% 7%, 97% 100%, 7% 93%); padding: clamp(26px, 4.5vw, 52px) clamp(26px, 6vw, 70px) clamp(26px, 4.5vw, 52px) clamp(40px, 8vw, 90px); min-height: 120px; display: flex; align-items: center; }
.q-prompt { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 4vw, 40px); text-transform: uppercase; margin: 0; color: #fff; text-shadow: 3px 3px 0 var(--dred); }
.q-img { display: block; margin: 0 auto 16px; max-width: 100%; max-height: 46vh; background: #fff; border: 4px solid var(--line); border-radius: 4px; box-shadow: 6px 6px 0 var(--red); cursor: zoom-in; }
.q-img.cutout, .lightbox img.cutout, .hq-img.cutout { background: var(--stage); }
.q-emoji { margin: 0 auto 16px; max-width: 760px; padding: clamp(14px, 3vw, 30px); background: var(--dots), linear-gradient(135deg, #ff1a2a, #7a0008); border: 4px solid #fff; box-shadow: 6px 6px 0 #000; font-size: clamp(60px, 14vw, 150px); line-height: 1.1; letter-spacing: .08em; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; text-shadow: none; }
.q-audio { margin: 0 auto 16px; max-width: 560px; padding: 22px; border: 4px solid var(--line); border-radius: 4px; background: var(--dots), linear-gradient(135deg, #ff1a2a, #7a0008); box-shadow: 6px 6px 0 #000; }
.q-audio .big { font-size: 52px; line-height: 1; margin-bottom: 8px; color: #fff; text-shadow: 3px 3px 0 #000; }
.q-audio audio { width: 100%; }

.q-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.q-actions .btn { font-size: 22px; padding: 12px 30px; }
.btn.hintbtn { background: var(--accent); color: var(--accent-text); border-color: #000; }
.btn.correctbtn { background: var(--good); color: #fff; }

.choices { display: none; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px auto 6px; max-width: 880px; }
.choices.show { display: grid; }
.choice {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: #000; color: #fff; border: 4px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; font-family: var(--display); font-size: clamp(18px, 2.6vw, 28px); text-transform: uppercase; line-height: 1.1;
  box-shadow: 5px 5px 0 var(--red);
}
.choice .letter { flex: none; width: 1.7em; height: 1.7em; display: grid; place-items: center; background: var(--red); color: #fff; font-size: .95em; transform: rotate(-8deg); border: 2px solid #fff; }
.choice:hover:not(:disabled) { background: var(--red); transform: translateX(6px); }
.choice:disabled { cursor: default; }
.choice.right { background: var(--good); color: #fff; border-color: #fff; animation: blink .5s 3; }
.choice.wrong { background: var(--bad); color: #fff; border-color: #fff; animation: nope .5s; }
.choice.dim { opacity: .4; }

.answer { display: none; margin: 18px auto 0; max-width: 640px; background: #000; color: var(--answer-text); border: 4px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: 8px 8px 0 var(--red); }
.answer.show { display: block; animation: slam .5s cubic-bezier(.2, 1.2, .4, 1); }
.answer small { display: block; font-family: var(--display); letter-spacing: .14em; text-transform: uppercase; font-size: 14px; color: #5dff9a; }
.answer.lost small { color: #ff5a66; }
.answer b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(28px, 5vw, 46px); text-transform: uppercase; line-height: 1.05; text-shadow: 3px 3px 0 var(--dred); }
.answer span { display: block; margin-top: 6px; font-size: 18px; font-weight: 700; }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 92vh; background: #fff; border: 4px solid var(--line); }

/* TV mode: audience display, no controls */
html.tv .bar nav, html.tv .tvhide { display: none !important; }

@media (max-width: 700px) {
  .frame { margin: 8px; padding: 10px; border-radius: 6px; }
  .cats { gap: 10px; grid-template-columns: repeat(2, 1fr); }
  .nums { gap: 6px; grid-template-columns: repeat(5, 1fr); }
  .num { border-width: 2px; padding: 10px 0 8px; }
  .btn { padding: 8px 12px; font-size: 14px; }
  .choices { grid-template-columns: 1fr; }
  .q-actions .btn { font-size: 18px; padding: 10px 18px; }
  .q-who { width: 90px; }
}

/* tall screens (a vertical TV): fill the whole screen and scale everything with the screen width */
@media (max-aspect-ratio: 3/4) {
  html, body { height: 100%; }
  html.tv, html.tv body { overflow: hidden; }
  html.tv .frame { height: 100vh; min-height: 0; }
  .frame { max-width: none; width: 100%; min-height: 100vh; margin: 0; border-radius: 0; border-width: 0; padding: 2.4vw; display: flex; flex-direction: column; box-shadow: none; background: rgba(8, 8, 8, .78); }
  .bar { margin-bottom: 2vw; }
  .bar h1 { font-size: 8vw; }
  .bar h1 small { display: none; }
  .btn { font-size: 3vw; padding: 1.6vw 3.4vw; border-radius: .6vw; }
  .cats { flex: 1; gap: 3vw; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, minmax(0, 1fr)); min-height: 0; }
  .cat { min-height: 0; overflow: hidden; border-radius: .8vw; }
  .cat .mask { height: 11vh; }
  .cat .jp { font-size: 8vw; } .cat .en { font-size: 6vw; } .cat .left { font-size: 3vw; }
  .nums { flex: 1; gap: 1.6vw; grid-template-columns: repeat(5, 1fr); grid-auto-rows: minmax(0, 1fr); min-height: 0; }
  .num { display: flex; align-items: center; justify-content: center; padding: 0; font-size: 5vw; border-radius: .6vw; }
  .note { font-size: 2.6vw; margin-top: 1.6vw; }
  .q-top { margin-bottom: 2vw; gap: 2vw; }
  .q-tag { padding: .6vw 3vw .6vw 1.6vw; border-radius: .6vw; gap: 2vw; }
  .q-tag .tag-mask { height: 9vw; }
  .q-tag .jp { font-size: 9vw; } .q-tag .en { font-size: 3.6vw; } .q-tag .no { font-size: 7vw; }
  .q-panel { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 3vw; border-radius: 1vw; min-height: 0; overflow: hidden; }
  .q-stage { min-height: 0; margin-bottom: 2vw; flex: none; }
  .q-who { width: 27vw; }
  .q-name { font-size: 3.4vw; }
  .q-bubble > div { padding: 5vw 5vw 5vw 10vw; min-height: 0; }
  .q-prompt { font-size: 6vw; }
  .q-img { width: 100%; height: auto; flex: 1 1 0; min-height: 0; max-height: none; object-fit: contain; margin-bottom: 2vw; border-radius: .6vw; }
  #media { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
  .q-emoji { max-width: none; width: 100%; font-size: 21vw; padding: 3vw; margin-bottom: 3vw; }
  .q-audio { max-width: none; width: 100%; padding: 6vw; margin-bottom: 3vw; }
  .q-audio .big { font-size: 22vw; }
  .q-actions .btn { font-size: 5vw; padding: 2.4vw 7vw; }
  .choices { grid-template-columns: 1fr 1fr; gap: 1.6vw; max-width: none; margin: 1vw 0 0; flex: none; }
  .choice { font-size: 4vw; padding: 1.8vw 2vw; border-radius: .6vw; gap: 1.4vw; border-width: 3px; }
  .answer { max-width: none; width: 100%; padding: 3vw 4vw; border-radius: .6vw; margin-top: 3vw; }
  .answer small { font-size: 3.2vw; }
  .answer { flex: none; }
  .answer b { font-size: 8vw; }
  .answer span { font-size: 3.8vw; margin-top: 1vw; }
}

/* difficulty badge */
.diff {
  font-family: var(--display); font-size: 18px; letter-spacing: .08em; text-transform: uppercase; display: inline-block;
  padding: 7px 14px; background: #000; border: 3px solid var(--line); border-radius: var(--radius);
  color: #5dff8c; animation: dropIn .5s .2s backwards;
}
.diff[data-d="2"] { color: #ffd23f; }
.diff[data-d="3"] { color: #ff5a66; }
.diff[hidden] { display: none; }
@media (max-aspect-ratio: 3/4) { .diff { font-size: 3.6vw; padding: 1.2vw 2.6vw; border-radius: .6vw; } }

/* ================= animation ================= */
body::before {            /* moving artwork behind everything */
  content: ""; position: fixed; inset: -7%; z-index: -3; pointer-events: none;
  background: var(--bg-art); animation: drift 40s ease-in-out infinite alternate; will-change: transform;
}
body::after {             /* slow-turning red spiral and stars, blended onto the dark background */
  content: ""; position: fixed; z-index: -2; pointer-events: none;
  width: 150vmax; height: 150vmax; left: 50%; top: 50%; translate: -50% -50%;
  background: url("p5/ring.jpg") center / contain no-repeat; mix-blend-mode: screen; opacity: .22;
  animation: turn 140s linear infinite, glow 7s ease-in-out infinite alternate;
}

@keyframes drift { from { transform: scale(1.04) translate(-2.2%, -1.6%); } to { transform: scale(1.12) translate(2.2%, 1.6%); } }
@keyframes turn { to { rotate: 360deg; } }
@keyframes glow { from { opacity: .12; } to { opacity: .3; } }
@keyframes frameGlow { 0%, 100% { border-color: #fff; box-shadow: 0 0 0 4px #e60012, 10px 10px 0 4px #000, inset 0 0 40px rgba(230, 0, 18, .18); } 50% { border-color: #ff5a66; box-shadow: 0 0 0 4px #fff, 10px 10px 0 4px #e60012, inset 0 0 50px rgba(230, 0, 18, .32); } }
@keyframes dots { to { background-position: 24px 24px, 0 0; } }
@keyframes glitch { 0%, 92%, 100% { transform: skewX(-6deg); } 93% { transform: translate(-4px, 1px) skewX(-12deg); } 95% { transform: translate(5px, -2px) skewX(2deg); } 97% { transform: translate(-2px, 0) skewX(-6deg); } }
@keyframes cellIn { 0% { opacity: 0; transform: translateX(-60px) skewX(-12deg); } 70% { transform: translateX(6px) skewX(2deg); } 100% { opacity: 1; transform: none; } }
@keyframes dropIn { 0% { opacity: 0; transform: translateY(-40px) skewX(-6deg); } 100% { opacity: 1; transform: skewX(-6deg); } }
@keyframes dropInFlat { 0% { opacity: 0; transform: translateY(-40px) scale(.9); } 100% { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-60px) skewX(-6deg); } to { opacity: 1; transform: skewX(-6deg); } }
@keyframes panelIn { 0% { opacity: 0; transform: translateY(40px) scale(.94); } 100% { opacity: 1; transform: none; } }
@keyframes imgIn { 0% { opacity: 0; transform: scale(.85) rotate(-2deg); } 100% { opacity: 1; transform: none; } }
@keyframes charIn { 0% { opacity: 0; transform: translateX(-80px) scale(.9); } 100% { opacity: 1; transform: none; } }
@keyframes bubbleIn { 0% { opacity: 0; transform: scaleX(.2) translateX(-40%); } 100% { opacity: 1; transform: none; } }
@keyframes slam { 0% { opacity: 0; transform: scale(1.7) rotate(-5deg); } 55% { opacity: 1; transform: scale(.94) rotate(1deg); } 100% { opacity: 1; transform: none; } }
@keyframes titleIn { 0% { opacity: 0; transform: translateY(-70px) scale(1.4) rotate(-6deg); } 60% { opacity: 1; transform: translateY(8px) scale(.98); } 100% { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-12px) rotate(1.2deg); } }
@keyframes rock { 0%, 100% { transform: rotate(-5deg) scale(1); } 50% { transform: rotate(5deg) scale(1.04); } }
@keyframes pulse { 0%, 100% { transform: scale(1); box-shadow: 6px 6px 0 #000, 0 0 0 0 var(--red); } 50% { transform: scale(1.06); box-shadow: 6px 6px 0 #000, 0 0 26px 8px var(--red); } }
@keyframes riseSpark { 0% { transform: translateY(0) rotate(0) scale(.6); opacity: 0; } 12% { opacity: .95; } 100% { transform: translateY(-115vh) rotate(300deg) scale(1.15); opacity: 0; } }
@keyframes dimInOut { 0% { opacity: 0; } 15%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes blink { 50% { filter: brightness(1.6); } }
@keyframes nope { 0%, 100% { transform: none; } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-7px); } 80% { transform: translateX(7px); } }
@keyframes quake { 0%, 100% { transform: none; } 10% { transform: translate(-14px, 6px); } 30% { transform: translate(12px, -8px); } 50% { transform: translate(-10px, -6px); } 70% { transform: translate(8px, 8px); } 90% { transform: translate(-4px, 2px); } }
@keyframes fxLife { 0% { opacity: 0; } 8%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes wordIn { 0% { opacity: 0; transform: scale(.2) rotate(-18deg); } 45% { transform: scale(1.12) rotate(4deg); } 65% { transform: scale(.96) rotate(-2deg); } 100% { opacity: 1; transform: scale(1) rotate(-3deg); } }
@keyframes textIn { 0% { opacity: 0; transform: translateY(30px) scale(.6) rotate(-8deg); } 100% { opacity: 1; transform: rotate(-3deg); } }
@keyframes fall { 0% { transform: translate(0, -8vh) rotate(0); opacity: 1; } 100% { transform: translate(var(--sway), 110vh) rotate(720deg); opacity: 1; } }
@keyframes starDrift { from { transform: translate(-4vw, 0) rotate(0); } to { transform: translate(6vw, -4vh) rotate(25deg); } }
@keyframes wipe { 0% { clip-path: polygon(0 0, 0 0, -20% 100%, -20% 100%); } 100% { clip-path: polygon(0 0, 130% 0, 110% 100%, -20% 100%); } }

.frame { animation: frameGlow 6s ease-in-out infinite; }
.cat, .num, .choice, .q-audio { animation-name: cellIn; animation-duration: .5s; animation-timing-function: cubic-bezier(.2, 1.2, .4, 1); animation-fill-mode: backwards; }
.cat, .num { background-size: 12px 12px, auto; animation-name: cellIn, dots; animation-duration: .5s, 7s; animation-timing-function: cubic-bezier(.2, 1.2, .4, 1), linear; animation-iteration-count: 1, infinite; animation-fill-mode: backwards, none; }
.cats .cat:nth-child(2) { animation-delay: .07s, 0s; } .cats .cat:nth-child(3) { animation-delay: .14s, 0s; }
.cats .cat:nth-child(4) { animation-delay: .21s, 0s; } .cats .cat:nth-child(5) { animation-delay: .28s, 0s; } .cats .cat:nth-child(6) { animation-delay: .35s, 0s; } .cats .cat:nth-child(7) { animation-delay: .42s, 0s; }
.nums .num { animation-delay: calc(var(--i, 0) * 16ms), 0s; }
.num.used { animation-name: cellIn; animation-duration: .5s; animation-iteration-count: 1; }
.q-audio { animation-name: imgIn; animation-delay: .3s; animation-duration: .65s; }
.q-emoji { animation: imgIn .65s cubic-bezier(.2, 1.3, .4, 1) .3s backwards; }
.bar h1 { animation: slideIn .6s cubic-bezier(.2, 1.3, .4, 1) backwards, glitch 7s 2s infinite; }
.bar nav .btn { animation: dropIn .5s backwards; }
.bar nav .btn:nth-child(2) { animation-delay: .06s; } .bar nav .btn:nth-child(3) { animation-delay: .12s; }
.bar nav .btn:nth-child(4) { animation-delay: .18s; } .bar nav .btn:nth-child(5) { animation-delay: .24s; }
.btn, .cat, .num, .choice { transition: transform .15s cubic-bezier(.2, 1.5, .4, 1), box-shadow .15s, filter .15s, background .15s; }
.btn:hover { transform: skewX(-6deg) translateY(-2px); }
.cat:hover, .num:not(.used):hover { box-shadow: 0 0 0 3px #fff, 8px 8px 0 3px #000, 0 0 28px 8px rgba(230, 0, 18, .8); transform: translateY(-4px) scale(1.04) rotate(-1deg); position: relative; z-index: 2; }
.cat:hover .mask { animation: rock .6s ease-in-out infinite; }
.note { animation: dropInFlat .6s .9s backwards; }

.q-tag { animation: slideIn .5s cubic-bezier(.2, 1.3, .4, 1) backwards; }
.q-panel { animation: panelIn .6s cubic-bezier(.2, 1.2, .4, 1) .05s backwards; }
.q-bubble { animation: bubbleIn .5s cubic-bezier(.2, 1.2, .4, 1) .4s backwards; transform-origin: left center; }
.q-img { animation: imgIn .65s cubic-bezier(.2, 1.3, .4, 1) .3s backwards; }
.q-audio .big { animation: float 2.4s ease-in-out infinite; display: inline-block; }
.hintbtn:not(:disabled) { animation: pulse 2.2s ease-in-out infinite; }
.choices.show .choice:nth-child(2) { animation-delay: .08s; } .choices.show .choice:nth-child(3) { animation-delay: .16s; } .choices.show .choice:nth-child(4) { animation-delay: .24s; }

/* menu */
.kicker { animation: slideIn .6s backwards; }
.title { animation: titleIn .9s cubic-bezier(.2, 1.2, .3, 1) .1s backwards; }
.sub { animation: dropIn .6s .55s backwards; }
.clubs { animation: dropIn .6s .8s backwards; }
.start { animation: dropIn .6s 1s backwards, pulse 2s ease-in-out 1.8s infinite; }
.hero { animation: imgIn .8s .4s backwards, float 5s ease-in-out 1.3s infinite; }

/* background decor (made in JS): drifting star clusters and rising stars */
.decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.decor img { position: absolute; max-width: none; mix-blend-mode: screen; }
.decor .cloud { width: 46vmax; opacity: .42; animation: starDrift 22s ease-in-out infinite alternate; }
.decor .cloud.a { left: -14vmax; top: -12vmax; }
.decor .cloud.b { right: -16vmax; bottom: -14vmax; animation-direction: alternate-reverse; animation-duration: 28s; }
.sparks { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.spark { position: absolute; bottom: -8vh; color: #fff; opacity: 0; animation: riseSpark linear infinite; text-shadow: 2px 2px 0 #000; }
.spark:nth-child(3n) { color: #e60012; } .spark:nth-child(3n + 1) { color: #111; text-shadow: 0 0 0 #fff, 1px 1px 0 #fff, -1px -1px 0 #fff; }
.spark::before { content: "★"; }

/* flash when a question opens: Persona card-throw clip with a red wipe */
.flash-dim { position: fixed; inset: 0; z-index: 89; pointer-events: none; background: #000; animation: dimInOut 1.4s ease-out forwards; }
.flash-vid { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 90; pointer-events: none; animation: fxLife 1.4s ease-out forwards; }
.flash-wipe { position: fixed; inset: 0; z-index: 91; pointer-events: none; background: var(--red); animation: wipe .45s ease-in reverse forwards, fxLife 1.4s ease-out forwards; mix-blend-mode: multiply; }

/* win / lose effects */
.fx { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1vmin; pointer-events: none; overflow: hidden; animation: fxLife 3.2s ease-out forwards; background: #000; }
.fx .fx-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fx-win::after, .fx-lose::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .65) 100%); }
.fx-lose .fx-vid { filter: grayscale(.5) brightness(.8); }
.fx-text { position: relative; z-index: 2; font-family: var(--display); text-transform: uppercase; font-size: clamp(54px, 15vmin, 150px); letter-spacing: .04em; color: #000; background: #fff; padding: .05em .35em; border: .06em solid #000; box-shadow: .08em .08em 0 var(--red), .16em .16em 0 #000; animation: textIn .9s cubic-bezier(.2, 1.2, .3, 1) both; }
.fx-lose .fx-text { background: var(--red); color: #fff; box-shadow: .08em .08em 0 #000, .16em .16em 0 #fff; }
.confetti { position: absolute; top: 0; width: 12px; height: 20px; z-index: 3; animation: fall 2s linear both; }
html.shake .frame { animation: quake .7s; }

.choices.show .choice.right { animation: blink .5s 3; }
.choices.show .choice.wrong { animation: nope .5s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sparks, .fx, .flash-dim, .flash-vid, .flash-wipe { display: none; }
}
