/* ANIMLE: manga-panel night, neon rarity */

:root {
  --bg: #0d0b1a;
  --panel: #17142d;
  --panel-2: #1f1b3d;
  --ink: #f4f1ff;
  --mute: #a39dcb;
  --line: #34305f;
  --pink: #ff4d94;
  --cyan: #2de2e6;
  --gold: #ffd166;
  --violet: #9d7bff;
  --orange: #ff9f43;
  --slate: #8d9bb5;
  --miss: #55506b;
  --f-display: "Dela Gothic One", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --f-pixel: "DotGothic16", "MS Gothic", ui-monospace, "Cascadia Mono", monospace;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 5px 5px 0 #000;
}

[data-tier="common"]   { --tc: #8d9bb5; --tcr: 141,155,181; }
[data-tier="trope"]    { --tc: #ff9f43; --tcr: 255,159,67; }
[data-tier="uncommon"] { --tc: #2de2e6; --tcr: 45,226,230; }
[data-tier="rare"]     { --tc: #9d7bff; --tcr: 157,123,255; }
[data-tier="super"]    { --tc: #ff4d94; --tcr: 255,77,148; }
[data-tier="ultra"]    { --tc: #ffd166; --tcr: 255,209,102; }
[data-tier="miss"]     { --tc: #6a6488; --tcr: 106,100,136; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--f-body);
  background:
    radial-gradient(1100px 640px at 50% -8%, #40196a 0%, transparent 62%),
    radial-gradient(900px 600px at 105% 105%, #0e3c5c 0%, transparent 58%),
    radial-gradient(700px 500px at -10% 90%, #3b1239 0%, transparent 60%),
    var(--bg);
  overflow-x: hidden;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: var(--cyan); }
::selection { background: var(--pink); color: #000; }

/* ---------- backdrop ---------- */
#ambient {
  position: fixed; left: 50%; top: 0; width: min(100vw, 1280px); height: auto; aspect-ratio: 16 / 9; transform: translateX(-50%);
  image-rendering: pixelated; pointer-events: none; z-index: 0; opacity: .5;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(#000 60%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(#000 60%, transparent);
}
@media (max-width: 700px), (max-aspect-ratio: 1/1) {
  #ambient { left: 0; transform: none; width: 100vw; height: 100vh; aspect-ratio: auto; object-fit: cover; opacity: .4; }
}
.bg-halftone {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.075) 1.3px, transparent 1.7px);
  background-size: 11px 11px;
  -webkit-mask-image: linear-gradient(#000, transparent 72%);
          mask-image: linear-gradient(#000, transparent 72%);
}
.bg-rays {
  position: fixed; inset: -30%; z-index: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 34%, rgba(255,77,148,.07) 0 3deg, transparent 3deg 11deg);
  -webkit-mask-image: radial-gradient(circle at 50% 34%, transparent 12%, #000 62%, transparent 100%);
          mask-image: radial-gradient(circle at 50% 34%, transparent 12%, #000 62%, transparent 100%);
  animation: spin 160s linear infinite;
}
.bg-vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(4,3,12,.75) 100%);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- top bar ---------- */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 14px clamp(16px, 4vw, 32px);
}
.mini-logo {
  font-family: var(--f-display); font-size: 24px; line-height: 1; text-decoration: none;
  transform: skewX(-6deg); display: inline-flex; letter-spacing: -.01em;
}
.mini-logo span:first-child { color: var(--pink); text-shadow: 2px 2px 0 #000; }
.mini-logo span:last-child  { color: var(--cyan); text-shadow: 2px 2px 0 #000; }
.chips { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  font-family: var(--f-pixel); font-size: 13px; letter-spacing: .08em;
  padding: 5px 10px; border: 2px solid var(--line); background: rgba(23,20,45,.8); border-radius: 4px;
  color: var(--mute); white-space: nowrap;
}
.chip-streak.on { color: var(--gold); border-color: #7a6228; }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  font-family: var(--f-pixel); font-size: 18px; line-height: 1;
  background: var(--panel); border: 2px solid var(--line); border-radius: 6px; box-shadow: 3px 3px 0 #000;
  transition: transform .08s, border-color .15s;
}
.icon-btn:hover { border-color: var(--cyan); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }

/* ---------- layout ---------- */
main { position: relative; z-index: 2; flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 28px) 24px; }
.screen { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  position: relative; cursor: pointer; border: 3px solid #000; border-radius: 6px;
  font-family: var(--f-display); letter-spacing: .02em; text-transform: uppercase;
  padding: 14px 26px; font-size: 18px; color: #170a1f;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.btn span { display: inline-block; transform: skewX(-4deg); }
.btn-primary {
  background: linear-gradient(180deg, #ff7cb0, var(--pink) 55%, #e02d78);
  box-shadow: 0 6px 0 #6b1440, 0 10px 24px rgba(255,77,148,.35);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(5px); box-shadow: 0 1px 0 #6b1440, 0 4px 12px rgba(255,77,148,.3); }
.btn-ghost {
  background: var(--panel-2); color: var(--ink); border-color: var(--line);
  box-shadow: 0 5px 0 #000;
}
.btn-ghost:hover { border-color: var(--cyan); }
.btn-ghost:active { transform: translateY(4px); box-shadow: 0 1px 0 #000; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

/* ---------- home ---------- */
.hero { text-align: center; padding: clamp(10px, 4vh, 40px) 0 20px; }
.kicker { font-family: var(--f-pixel); letter-spacing: .24em; font-size: 14px; color: var(--cyan); margin: 0 0 6px; text-transform: uppercase; }
.logo {
  font-family: var(--f-display); font-weight: 400; margin: 4px 0 18px;
  font-size: clamp(58px, 15.5vw, 152px); line-height: .95; letter-spacing: -.02em; white-space: nowrap;
  transform: skewX(-6deg); text-transform: uppercase;
}
.logo span { display: inline-block; position: relative; }
.logo-a {
  color: var(--pink);
  text-shadow: 4px 4px 0 #000, 8px 8px 0 rgba(255,77,148,.32), -2px -2px 0 rgba(45,226,230,.55);
}
.logo-b {
  color: var(--cyan);
  text-shadow: 4px 4px 0 #000, 8px 8px 0 rgba(45,226,230,.28), -2px -2px 0 rgba(255,77,148,.5);
}
.logo span::after {
  content: attr(data-t); position: absolute; inset: 0; color: var(--gold); mix-blend-mode: screen; opacity: 0;
  clip-path: inset(42% 0 38% 0); animation: glitch 5.5s steps(1) infinite;
}
.logo-b::after { animation-delay: 1.8s; }
@keyframes glitch {
  0%, 92%, 100% { opacity: 0; transform: none; }
  93% { opacity: .9; transform: translate(6px, 0); }
  95% { opacity: .9; transform: translate(-5px, 2px); }
  97% { opacity: .9; transform: translate(4px, -1px); }
}
.tagline { max-width: 520px; margin: 0 auto 26px; font-size: clamp(16px, 2.4vw, 19px); line-height: 1.5; color: #d9d3f5; }
.tagline b { color: var(--gold); font-weight: 700; }
.hero-cta { margin-bottom: 30px; }
.hero-cta .btn { font-size: clamp(22px, 4vw, 30px); padding: 18px clamp(34px, 8vw, 64px); }
.cta-sub { font-family: var(--f-pixel); font-size: 14px; letter-spacing: .06em; color: var(--mute); margin: 18px 0 0; }

.legend {
  list-style: none; margin: 0 auto 28px; padding: 0; max-width: 760px;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
}
.legend li {
  position: relative; padding: 14px 6px 12px; text-align: center;
  background: linear-gradient(170deg, rgba(var(--tcr), .22), rgba(23,20,45,.92) 70%);
  border: 2px solid var(--tc); border-radius: 8px; box-shadow: 4px 4px 0 #000;
  transition: transform .15s;
}
.legend li:hover { transform: translateY(-4px) rotate(-1deg); }
.legend .lg-stars { font-size: 12px; color: var(--tc); letter-spacing: .1em; min-height: 16px; }
.legend .lg-name { font-family: var(--f-display); font-size: 13px; line-height: 1.1; margin: 6px 0 8px; text-transform: uppercase; color: var(--tc); }
.legend .lg-pts { font-family: var(--f-pixel); font-size: 22px; color: var(--ink); }
.legend .lg-pts small { font-size: 11px; color: var(--mute); margin-left: 2px; }
.legend li[data-tier="ultra"] { box-shadow: 4px 4px 0 #000, 0 0 26px rgba(255,209,102,.35); }

.howto { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; max-width: 760px; margin: 0 auto; text-align: left; }
.howto-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  background: rgba(23,20,45,.7); border: 2px solid var(--line); border-radius: 8px; font-size: 15px; line-height: 1.4; color: #d9d3f5;
}
.howto-item b { font-family: var(--f-display); font-size: 20px; color: var(--pink); line-height: 1; }

/* ---------- play ---------- */
.hud { display: grid; grid-template-columns: 1fr minmax(180px, 280px); gap: 14px 22px; align-items: center; padding: 4px 0 14px; }
.pips { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.pips li {
  width: 34px; height: 34px; display: grid; place-items: center; position: relative;
  font-family: var(--f-pixel); font-size: 14px; color: var(--mute);
}
.pips li::before {
  content: ""; position: absolute; inset: 3px; transform: rotate(45deg);
  background: #14112a; border: 2px solid var(--line); transition: background .3s, border-color .3s, box-shadow .3s;
}
.pips li span { position: relative; }
.pips li.now::before { border-color: var(--cyan); box-shadow: 0 0 12px rgba(45,226,230,.55); animation: bob 1.2s ease-in-out infinite; }
.pips li.done::before { background: var(--tc); border-color: #000; box-shadow: 0 0 14px rgba(var(--tcr), .6); }
.pips li.done { color: #0d0b1a; }
@keyframes bob { 50% { transform: rotate(45deg) scale(1.12); } }

.meter-label { display: flex; align-items: baseline; gap: 6px; font-family: var(--f-pixel); font-size: 13px; letter-spacing: .12em; color: var(--mute); }
.meter-label b { margin-left: auto; font-size: 26px; color: var(--gold); letter-spacing: 0; font-weight: 400; }
.meter-label i { font-style: normal; color: var(--mute); font-size: 14px; }
.meter-bar { height: 12px; margin-top: 4px; background: #100d24; border: 2px solid #000; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.meter-fill {
  height: 100%; width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1);
  background: linear-gradient(90deg, #8d9bb5, #2de2e6 25%, #9d7bff 50%, #ff4d94 75%, #ffd166);
  background-size: 280px 100%;
}

.stage { position: relative; min-height: 330px; }
.prompt {
  position: relative; padding: clamp(18px, 4vw, 30px) clamp(18px, 4vw, 34px) clamp(20px, 4vw, 32px);
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 3px solid #000; border-radius: 10px;
  box-shadow: 0 0 0 2px var(--line), 8px 8px 0 #000; text-align: left;
  animation: slam .45s cubic-bezier(.2,1.3,.4,1) both;
}
.prompt::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 8px; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.08) 1.2px, transparent 1.6px); background-size: 9px 9px;
  -webkit-mask-image: linear-gradient(135deg, #000, transparent 55%); mask-image: linear-gradient(135deg, #000, transparent 55%);
}
@keyframes slam { from { opacity: 0; transform: translateY(-20px) scale(.97); } to { opacity: 1; transform: none; } }
.prompt-kicker { display: flex; align-items: center; gap: 12px; font-family: var(--f-pixel); font-size: 14px; letter-spacing: .16em; color: var(--mute); }
.badge {
  margin-left: auto; padding: 3px 10px; border-radius: 3px; border: 2px solid #000; letter-spacing: .12em;
  background: var(--cyan); color: #06222a; font-size: 12px;
}
.badge.take { background: var(--pink); color: #2a0618; }
.prompt-text {
  position: relative; font-family: var(--f-display); font-weight: 400; margin: 14px 0 8px;
  font-size: clamp(26px, 5.4vw, 46px); line-height: 1.12; letter-spacing: -.005em; text-wrap: balance;
}
.prompt-sub { position: relative; margin: 0; font-family: var(--f-pixel); font-size: clamp(14px, 2.2vw, 17px); color: var(--cyan); letter-spacing: .03em; }
.preview-pill {
  position: absolute; right: 16px; bottom: -16px; font-family: var(--f-pixel); font-size: 14px; letter-spacing: .08em;
  background: var(--gold); color: #2b1d00; border: 3px solid #000; padding: 6px 14px; border-radius: 4px; box-shadow: 3px 3px 0 #000;
  animation: bob2 .9s ease-in-out infinite;
}
.preview-pill b { font-size: 18px; }
@keyframes bob2 { 50% { transform: translateY(-4px); } }

body[data-phase="reveal"] .prompt { padding: 14px 20px; }
body[data-phase="reveal"] .prompt-text { font-size: clamp(18px, 3vw, 26px); margin: 8px 0 2px; }
body[data-phase="reveal"] .prompt-sub, body[data-phase="reveal"] .preview-pill { display: none; }
body[data-phase="reveal"] .dock { display: none; }
body[data-phase="preview"] .dock { opacity: .55; pointer-events: none; }

/* ---------- dock ---------- */
.dock { margin-top: 30px; transition: opacity .2s; }
.dock-msg { min-height: 24px; margin: 0 0 8px; font-family: var(--f-pixel); font-size: 15px; letter-spacing: .04em; color: var(--orange); text-align: center; }
.dock-msg.good { color: var(--cyan); }
.dock-row { display: flex; align-items: center; gap: 14px; }
.timer { position: relative; width: 64px; height: 64px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.t-track { fill: #100d24; stroke: var(--line); stroke-width: 6; }
.t-fill { fill: none; stroke: var(--cyan); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 163.36; stroke-dashoffset: 0; transition: stroke .2s; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-pixel); font-weight: 400; font-size: 24px; }
.dock.hot .t-fill { stroke: var(--pink); }
.dock.hot .timer b { color: var(--pink); animation: pulse .5s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }
.input-col { flex: 1; min-width: 0; }
#answer {
  width: 100%; padding: 15px 16px; font-family: var(--f-pixel); font-size: clamp(20px, 3.4vw, 26px); letter-spacing: .02em;
  background: #0e0b20; border: 3px solid #000; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--line), 4px 4px 0 #000;
  caret-color: var(--pink);
}
#answer::placeholder { color: #5f5a8c; }
#answer:focus { outline: none; box-shadow: inset 0 0 0 2px var(--cyan), 4px 4px 0 #000, 0 0 22px rgba(45,226,230,.25); }
#answer.shake { animation: shake .38s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
.fuse { height: 6px; margin-top: 8px; background: #100d24; border: 2px solid #000; border-radius: 3px; overflow: hidden; }
.fuse i { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); }
.btn-pull { padding: 16px 22px; font-size: 20px; }

/* ---------- reveal: booster pack ---------- */
@property --mx { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@property --my { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@property --rx { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
@property --ry { syntax: "<angle>"; inherits: true; initial-value: 0deg; }

[data-tier="common"]   { --holo: 0;   --glare: .22; }
[data-tier="trope"]    { --holo: .22; --glare: .3; }
[data-tier="uncommon"] { --holo: .42; --glare: .4; }
[data-tier="rare"]     { --holo: .62; --glare: .5; }
[data-tier="super"]    { --holo: .85; --glare: .6; }
[data-tier="ultra"]    { --holo: 1;   --glare: .75; }
[data-tier="miss"]     { --holo: 0;   --glare: .1; }

.reveal {
  --pw: min(70vw, clamp(170px, calc((100vh - 330px) / 1.6), 270px));
  position: relative; display: flex; flex-direction: column; align-items: center; padding: 12px 0 4px;
}
.reveal-dim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .8s;
  background: radial-gradient(circle at 50% 46%, rgba(2,1,8,.3), rgba(2,1,8,.88) 78%);
}
.reveal.dim-soft .reveal-dim { opacity: .45; }
.reveal.dim .reveal-dim { opacity: 1; }
.reveal-bg {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(circle at 50% 48%, rgba(var(--tcr), .55), rgba(var(--tcr), .14) 38%, transparent 68%);
}
.reveal.tearing .reveal-bg { opacity: .5; }
.reveal.rising .reveal-bg { opacity: .95; }
.reveal.boom .reveal-bg { animation: boomflash 1s ease-out; }
@keyframes boomflash { 0% { opacity: 1; filter: brightness(3); } 100% { opacity: .95; filter: none; } }

.godrays { position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 1s; }
.godrays i {
  position: absolute; left: 50%; top: 47%; width: 240vmax; height: 240vmax; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(var(--tcr), .34) 0 4deg, transparent 4deg 12deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 40%); mask-image: radial-gradient(circle, #000 0, transparent 40%);
  animation: spin 14s linear infinite;
}
.reveal.rising .godrays { opacity: .45; }
.reveal[data-level="3"].rising .godrays { opacity: .8; }
.reveal[data-level="4"].rising .godrays, .reveal[data-level="5"].rising .godrays { opacity: 1; }
.reveal[data-level="5"] .godrays i { animation-duration: 8s; }

.reveal-stage { position: relative; z-index: 3; width: var(--pw); height: calc(var(--pw) * 1.6); }
.reveal.impact .reveal-stage { animation: zoompunch .65s cubic-bezier(.2,.9,.3,1); }
@keyframes zoompunch { 0% { transform: scale(1); } 30% { transform: scale(1.1); } 100% { transform: scale(1); } }
.fx-canvas {
  position: absolute; left: 50%; top: 50%; width: min(960px, 160vw); aspect-ratio: 16 / 9; height: auto;
  transform: translate(-50%, -50%); image-rendering: pixelated; pointer-events: none; z-index: 1; mix-blend-mode: screen;
}

/* the pack: mouse-tilted wrapper, then the floating pack */
.pack-tilt {
  position: absolute; inset: 0; z-index: 3;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
}
.pack {
  position: absolute; inset: 0; cursor: grab; outline: none; touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none;
  filter: drop-shadow(3px 0 0 #000) drop-shadow(-3px 0 0 #000) drop-shadow(0 3px 0 #000) drop-shadow(0 -3px 0 #000) drop-shadow(10px 12px 0 rgba(0,0,0,.7));
  animation: packdrop .6s cubic-bezier(.2,1.25,.4,1) both, packfloat 3.2s .6s ease-in-out infinite;
}
.pack:active { cursor: grabbing; }
.pack:focus-visible { outline: 3px solid var(--cyan); outline-offset: 10px; }
.pack.impatient { animation: packwiggle .5s ease-in-out infinite; }
@keyframes packdrop { from { opacity: 0; transform: translateY(-140px) rotate(-10deg) scale(.88); } to { opacity: 1; transform: none; } }
@keyframes packfloat { 50% { transform: translateY(-9px) rotate(.6deg); } }
@keyframes packwiggle { 25% { transform: rotate(-2.2deg) translateX(-3px); } 75% { transform: rotate(2.2deg) translateX(3px); } }
.reveal.dragging .pack { animation: packshake .09s linear infinite; }
.reveal.tearing .pack { animation: packshake .09s linear infinite; }
.reveal.rising .pack { animation: none; }
@keyframes packshake { 25% { transform: translate(-3px, 2px) rotate(-1deg); } 50% { transform: translate(3px, -2px) rotate(1deg); } 75% { transform: translate(-2px, -2px) rotate(-.6deg); } }

.p-take { --pk1: #ff93c0; --pk2: #e2347f; --pk3: #4d1259; }
.p-role { --pk1: #86f5f7; --pk2: #1f9bbd; --pk3: #16296b; }
.dud    { --pk1: #8f8aac; --pk2: #5a557c; --pk3: #2b2745; }
.pack-part {
  position: absolute; inset: 0; overflow: hidden;
  background:
    radial-gradient(130% 55% at 50% 0%, rgba(255,255,255,.4), transparent 62%),
    repeating-linear-gradient(62deg, rgba(255,255,255,.07) 0 7px, transparent 7px 14px),
    linear-gradient(172deg, var(--pk1), var(--pk2) 52%, var(--pk3));
}
.pack-part::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.34) 0 2px, rgba(255,255,255,.2) 2px 3px, transparent 3px 7px);
  -webkit-mask-image: linear-gradient(#000 0 6%, transparent 6% 94%, #000 94%);
          mask-image: linear-gradient(#000 0 6%, transparent 6% 94%, #000 94%);
}
.pack-part::after {
  content: ""; position: absolute; inset: -10%; pointer-events: none; mix-blend-mode: overlay; z-index: 3;
  background: linear-gradient(105deg, transparent 36%, rgba(255,255,255,.7) 47%, rgba(255,255,255,.2) 53%, transparent 62%);
  transform: translateX(-130%); animation: packsheen 3.4s ease-in-out infinite;
}
.dud .pack-part::after { display: none; }
@keyframes packsheen { 0% { transform: translateX(-130%); } 55%, 100% { transform: translateX(130%); } }
/* rainbow holo foil and glare that follow the mouse */
.foil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: color-dodge; opacity: .5;
  background: repeating-linear-gradient(115deg, #ff2d95 0%, #ff9d00 7%, #f4ff3a 14%, #20ff9a 21%, #1fc6ff 28%, #8a5cff 35%, #ff2d95 42%) var(--mx) var(--my) / 300% 300%;
  filter: saturate(1.4) brightness(.8);
}
.dud .foil { opacity: .06; }
.gloss {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: overlay;
  background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255,255,255,.85), rgba(255,255,255,.12) 40%, transparent 70%);
}
.pack-main {
  clip-path: polygon(0 15%, 4% 17%, 12% 13%, 20% 17%, 28% 13%, 36% 17%, 44% 13%, 52% 17%, 60% 13%, 68% 17%, 76% 13%, 84% 17%, 92% 13%, 100% 15%, 100% 100%, 0 100%);
}
.pack-strip {
  clip-path: polygon(0 0, 100% 0, 100% 15%, 92% 13%, 84% 17%, 76% 13%, 68% 17%, 60% 13%, 52% 17%, 44% 13%, 36% 17%, 28% 13%, 20% 17%, 12% 13%, 4% 17%, 0 15%);
  transform-origin: 0 100%;
  transform: rotate(calc(var(--tear, 0) * -15deg)) translate(calc(var(--tear, 0) * 3%), calc(var(--tear, 0) * -4%));
}
.tear-hint { position: absolute; left: 50%; top: 7%; z-index: 6; transform: translateX(-50%); white-space: nowrap; font-family: var(--f-pixel); font-size: 11px; letter-spacing: .22em; color: rgba(0,0,0,.62); animation: hintslide 1.6s ease-in-out infinite; }
@keyframes hintslide { 50% { transform: translateX(-38%); } }
.perf { position: absolute; left: 0; right: 0; top: 11.5%; z-index: 2; border-top: 3px dashed rgba(0,0,0,.4); }
.pack-art { position: absolute; inset: 16% 0 6% 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 6px 12px 10px; text-align: center; }
.pack-logo { font-family: var(--f-display); font-size: clamp(26px, 6.6vw, 38px); line-height: 1; transform: skewX(-6deg); letter-spacing: -.02em; }
.pack-logo span:first-child { color: #fff; text-shadow: 3px 3px 0 #000; }
.pack-logo span:last-child { color: #170a1f; text-shadow: 2px 2px 0 rgba(255,255,255,.55); }
.pack-sub { margin-top: 2px; font-family: var(--f-pixel); font-size: 11px; letter-spacing: .3em; color: rgba(255,255,255,.9); text-shadow: 1px 1px 0 #000; }
.pack-emblem { position: relative; flex: 1; width: 100%; display: grid; place-items: center; min-height: 0; }
.pack-emblem::before {
  content: ""; position: absolute; width: 42%; aspect-ratio: 1; transform: rotate(45deg); background: linear-gradient(135deg, #fff, rgba(255,255,255,.25));
  border: 4px solid #000; box-shadow: inset 0 0 0 4px var(--pk1), 6px 6px 0 rgba(0,0,0,.5);
}
.pack-emblem canvas { position: relative; width: 88%; max-height: 100%; aspect-ratio: 1; image-rendering: pixelated; mix-blend-mode: screen; }
.pack-label { display: grid; gap: 1px; margin-bottom: 8px; }
.pack-label b { font-family: var(--f-display); font-weight: 400; font-size: 20px; color: #fff; text-shadow: 2px 2px 0 #000; }
.pack-label small { font-family: var(--f-pixel); font-size: 12px; letter-spacing: .18em; color: rgba(255,255,255,.85); text-shadow: 1px 1px 0 #000; }
.pack-sealed { width: 92%; padding: 5px 8px 6px; background: rgba(8,5,20,.55); border: 2px solid #000; border-radius: 4px; }
.pack-sealed small { display: block; font-family: var(--f-pixel); font-size: 10px; letter-spacing: .2em; color: var(--gold); }
.pack-sealed b { display: block; font-family: var(--f-pixel); font-weight: 400; font-size: 15px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }

/* the tear: the strip peels with the drag, then flies off */
.reveal.tearing .pack-strip { animation: tearaway .62s cubic-bezier(.35,0,.6,1) forwards; }
@keyframes tearaway {
  18% { transform: translate(2%, -9%) rotate(-19deg); opacity: 1; }
  100% { transform: translate(70%, -170%) rotate(52deg); opacity: 0; }
}
.reveal.rising .pack-main { animation: dropaway .7s .1s cubic-bezier(.55,0,.85,.4) forwards; }
@keyframes dropaway { to { transform: translateY(75%) rotate(-5deg); opacity: 0; } }

/* light leaking out of the tear: the rarity tell */
.beam {
  position: absolute; left: 50%; top: 13%; width: 190%; aspect-ratio: 1; z-index: 5; pointer-events: none; mix-blend-mode: screen;
  opacity: calc(var(--tear, 0) * .9); transform: translate(-50%, -50%) scale(calc(.2 + var(--tear, 0) * .55));
}
.beam-rays {
  position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(var(--tcr), .8) 0 3.5deg, transparent 3.5deg 11deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 66%); mask-image: radial-gradient(circle, #000 0, transparent 66%);
  animation: spin 7s linear infinite;
}
.beam-core { position: absolute; left: 50%; top: 50%; width: 44%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, #fff 0, rgba(var(--tcr), .95) 26%, transparent 70%); }
.reveal[data-tier="common"] .beam-rays, .reveal[data-tier="miss"] .beam-rays { opacity: .3; }
.reveal.tearing .beam { animation: beamup calc(var(--tease, 0ms) + 1.2s) ease-out forwards; }
@keyframes beamup {
  0%   { opacity: .5;  transform: translate(-50%, -50%) scale(.6); }
  22%  { opacity: .9;  transform: translate(-50%, -50%) scale(.8); }
  70%  { opacity: 1;   transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(1.6); }
}
main.shake { animation: screenshake .6s; }
@keyframes screenshake { 10% { transform: translate(-8px, 3px); } 30% { transform: translate(7px, -4px); } 50% { transform: translate(-6px, -2px); } 70% { transform: translate(4px, 4px); } 100% { transform: none; } }

/* the card inside */
.card-rise {
  position: absolute; left: 5%; top: 10.5%; width: 90%; aspect-ratio: 5 / 7; z-index: 2; perspective: 1100px;
  transform: translateY(14%) scale(.9); transition: transform .85s cubic-bezier(.2,1.25,.3,1);
}
.reveal.rising .card-rise { transform: none; }
.pull-card { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); }
.pull-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.2,.85,.25,1.05); transform: rotateY(0); }
.pull-card.flipped .pull-inner { transform: rotateY(180deg); }
.pull-back, .pull-face { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.pull-back {
  display: grid; place-items: center; border: 4px solid #000;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 10px, transparent 10px 20px), linear-gradient(160deg, #3b1d6e, #1a1238 60%, #0f2a49);
  box-shadow: 0 0 0 3px var(--violet), 8px 8px 0 #000;
}
.pull-back span { font-family: var(--f-display); font-size: 56px; color: var(--pink); text-shadow: 4px 4px 0 #000, -2px -2px 0 var(--cyan); transform: skewX(-6deg); }
.pull-face {
  transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 14px 14px; border: 4px solid #000;
  background: radial-gradient(circle at 50% 0%, rgba(var(--tcr), .55), transparent 62%), linear-gradient(165deg, rgba(var(--tcr), .28), rgba(13,11,26,.97) 58%), var(--panel);
  box-shadow: 0 0 0 3px var(--tc), 0 0 44px rgba(var(--tcr), .5), 8px 8px 0 #000;
}
.pull-face::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: radial-gradient(rgba(var(--tcr), .35) 1.2px, transparent 1.6px); background-size: 8px 8px;
  -webkit-mask-image: linear-gradient(200deg, #000, transparent 50%); mask-image: linear-gradient(200deg, #000, transparent 50%);
}
.holo {
  position: absolute; inset: 0; pointer-events: none; z-index: 1; border-radius: 12px; opacity: calc(var(--holo, 0) * .5); mix-blend-mode: color-dodge;
  background:
    repeating-linear-gradient(112deg, #ff2d95 0%, #ff9d00 7%, #f4ff3a 14%, #20ff9a 21%, #1fc6ff 28%, #8a5cff 35%, #ff2d95 42%) var(--mx) var(--my) / 320% 320%,
    radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.55), transparent 46%);
  filter: saturate(1.5) brightness(.85) contrast(1.15);
}
.stars, .tier-name, .card-rule, .card-answer, .card-sub, .card-pts, .card-quip { z-index: 3; }
.glare {
  position: absolute; inset: 0; pointer-events: none; z-index: 4; border-radius: 12px; opacity: var(--glare, .4); mix-blend-mode: overlay;
  background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255,255,255,.85) 0%, rgba(255,255,255,.14) 38%, transparent 68%);
}
.shine {
  position: absolute; inset: -40%; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.5) 50%, transparent 62%);
  transform: translateX(-60%); animation: sheen 3.4s ease-in-out 1.2s infinite;
}
@keyframes sheen { 0% { transform: translateX(-70%); } 55%, 100% { transform: translateX(70%); } }
.stars { position: relative; font-size: 23px; letter-spacing: .08em; color: var(--tc); min-height: 28px; }
.stars .star { position: relative; display: inline-block; opacity: .2; filter: grayscale(.7); }
.stars .star.lit { opacity: 1; filter: none; text-shadow: 0 0 14px rgba(var(--tcr), .9); }
.stars .star.land { opacity: 1; filter: none; text-shadow: 0 0 14px rgba(var(--tcr), .95), 0 0 34px rgba(var(--tcr), .6); animation: starland .55s cubic-bezier(.2,1.5,.35,1) both; }
.stars .star.land::after {
  content: ""; position: absolute; left: 50%; top: 52%; width: 100%; aspect-ratio: 1; border: 3px solid var(--tc); border-radius: 50%;
  transform: translate(-50%, -50%) scale(.3); opacity: .95; animation: starring .55s ease-out both;
}
@keyframes starland {
  0%   { opacity: 0; transform: translateY(calc(-34px - var(--k, 0) * 30px)) scale(calc(2.6 + var(--k, 0) * 2.4)) rotate(-50deg); }
  55%  { opacity: 1; transform: scale(.8) rotate(6deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes starring { to { transform: translate(-50%, -50%) scale(calc(2.8 + var(--k, 0) * 2.2)); opacity: 0; } }
.card-rise.hit { animation: cardhit .28s ease-out; }
@keyframes cardhit {
  0%   { transform: translate(calc((var(--k, 0) + .4) * -5px), calc((var(--k, 0) + .4) * 4px)) scale(1.03); }
  30%  { transform: translate(calc((var(--k, 0) + .4) * 5px), calc((var(--k, 0) + .4) * -4px)) scale(1.04); }
  60%  { transform: translate(calc((var(--k, 0) + .4) * -2px), calc((var(--k, 0) + .4) * 2px)); }
  100% { transform: none; }
}
.tier-name { position: relative; margin-top: 6px; font-family: var(--f-display); font-size: clamp(20px, 3.2vw, 27px); line-height: 1; color: var(--tc); text-shadow: 3px 3px 0 #000; letter-spacing: .01em; }
.card-rule { position: relative; width: 70%; height: 3px; margin: 12px 0; background: linear-gradient(90deg, transparent, var(--tc), transparent); }
.card-answer { position: relative; font-family: var(--f-display); font-size: clamp(18px, 4.6vw, 26px); line-height: 1.12; text-wrap: balance; overflow-wrap: anywhere; }
.card-sub { position: relative; margin-top: 6px; font-family: var(--f-pixel); font-size: 13px; letter-spacing: .04em; color: var(--mute); min-height: 16px; }
.card-pts { position: relative; margin-top: auto; display: flex; align-items: baseline; gap: 6px; }
.card-pts b { font-family: var(--f-pixel); font-weight: 400; font-size: clamp(38px, 8vw, 50px); line-height: 1; color: var(--ink); text-shadow: 3px 3px 0 #000, 0 0 18px rgba(var(--tcr), .7); }
.card-pts span { font-family: var(--f-pixel); font-size: 14px; color: var(--tc); letter-spacing: .12em; }
.card-quip { position: relative; margin: 6px 0 0; font-size: 12px; line-height: 1.35; color: #cfc8ee; min-height: 32px; }
.reveal[data-tier="ultra"] .pull-face { animation: goldpulse 1.6s ease-in-out infinite; }
@keyframes goldpulse { 50% { box-shadow: 0 0 0 3px var(--tc), 0 0 70px rgba(255,209,102,.75), 8px 8px 0 #000; } }
.reveal[data-tier="miss"] .pull-face { filter: saturate(.55); }

.reveal-foot { position: relative; z-index: 5; width: 100%; min-height: 64px; margin-top: 12px; display: grid; place-items: center; }
.reveal-foot > * { grid-area: 1 / 1; }
.pack-hint { margin: 0; font-family: var(--f-pixel); font-size: 15px; letter-spacing: .22em; color: var(--gold); text-align: center; animation: blink 1.1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.reveal.tearing .pack-hint, .reveal.shown .pack-hint, .reveal.dragging .pack-hint { visibility: hidden; }
.reveal-actions { opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .35s, transform .35s; }
.reveal.shown .reveal-actions { opacity: 1; pointer-events: auto; transform: none; }

/* page-level theatrics: sparks, flash and the rarity banner */
#sparks { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }
#flash {
  position: fixed; inset: 0; z-index: 31; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 46%, #fff 0 14%, rgba(var(--tcr, 255,255,255), .85) 48%, rgba(var(--tcr, 255,255,255), .25) 100%);
}
#flash.go { animation: flashgo var(--fd, .5s) ease-out; }
@keyframes flashgo { 0% { opacity: var(--fa, .9); } 100% { opacity: 0; } }
.rarity-banner { position: fixed; left: 0; right: 0; top: 24%; z-index: 29; pointer-events: none; display: grid; place-items: center; }
.rarity-banner span {
  display: block; opacity: 0; font-family: var(--f-display); font-size: clamp(34px, 11vw, 112px); line-height: 1; text-transform: uppercase; letter-spacing: -.01em; color: var(--tc);
  transform: skewX(-8deg); -webkit-text-stroke: 2px #000; text-shadow: 6px 6px 0 #000, 0 0 44px rgba(var(--tcr), .95);
}
.rarity-banner.show span { animation: bannerslam 1.6s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes bannerslam {
  0%   { opacity: 0; transform: skewX(-8deg) scale(3.4) rotate(-5deg); }
  14%  { opacity: 1; transform: skewX(-8deg) scale(.92) rotate(1deg); }
  22%  { transform: skewX(-8deg) scale(1.05); }
  30%  { transform: skewX(-8deg) scale(1); }
  78%  { opacity: 1; transform: skewX(-8deg) scale(1); }
  100% { opacity: 0; transform: skewX(-8deg) scale(1.14) translateY(-14px); }
}

/* ---------- results ---------- */
.results { text-align: center; padding: clamp(8px, 3vh, 28px) 0 20px; }
.res-score { margin: 0; font-weight: 400; font-family: var(--f-display); line-height: 1; }
.res-score b { font-size: clamp(88px, 22vw, 168px); color: var(--gold); text-shadow: 5px 5px 0 #000, 0 0 40px rgba(255,209,102,.4); letter-spacing: -.02em; }
.res-score i { font-style: normal; font-family: var(--f-pixel); font-size: clamp(20px, 4vw, 30px); color: var(--mute); margin-left: 6px; }
.res-band { margin: 6px auto 0; max-width: 520px; font-family: var(--f-display); font-size: clamp(18px, 3.4vw, 26px); color: var(--pink); text-shadow: 2px 2px 0 #000; }
.res-tally { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.res-tally span {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; font-family: var(--f-pixel); font-size: 14px;
  border: 2px solid var(--tc); border-radius: 4px; background: rgba(var(--tcr), .14); color: var(--tc); letter-spacing: .06em;
}
.res-tally span b { color: var(--ink); font-weight: 400; font-size: 16px; }
.res-best { margin: 10px 0 20px; font-family: var(--f-pixel); font-size: 15px; color: var(--mute); }
.res-best b { color: var(--tc, var(--gold)); font-weight: 400; }

.log { list-style: none; margin: 0 auto; padding: 0; max-width: 700px; display: grid; gap: 10px; text-align: left; counter-reset: r; }
.log li {
  position: relative; border: 3px solid #000; border-radius: 8px; overflow: hidden; background: var(--panel);
  box-shadow: 0 0 0 2px var(--line), 5px 5px 0 #000; animation: rise .4s both;
}
.log li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--tc); box-shadow: 0 0 18px rgba(var(--tcr), .8); }
.log summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 14px; align-items: center; padding: 12px 16px 12px 24px;
}
.log summary::-webkit-details-marker { display: none; }
.log .lg-n { grid-row: span 2; font-family: var(--f-display); font-size: 26px; color: var(--tc); text-shadow: 2px 2px 0 #000; }
.log .lg-q { font-family: var(--f-pixel); font-size: 13px; letter-spacing: .05em; color: var(--mute); }
.log .lg-a { font-family: var(--f-display); font-size: 19px; line-height: 1.15; }
.log .lg-t { grid-row: span 2; text-align: right; font-family: var(--f-pixel); color: var(--tc); font-size: 13px; letter-spacing: .1em; }
.log .lg-t b { display: block; font-weight: 400; font-size: 26px; color: var(--ink); letter-spacing: 0; }
.log details[open] summary { border-bottom: 2px dashed var(--line); }
.table { padding: 12px 16px 14px 24px; display: grid; gap: 8px; }
.table-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.4; }
.table-row .tr-t { font-family: var(--f-pixel); font-size: 12px; letter-spacing: .08em; color: var(--tc); }
.table-row .tr-t small { color: var(--mute); }
.table-row .tr-a { color: #d9d3f5; }
.table-hint { font-family: var(--f-pixel); font-size: 12px; color: var(--mute); letter-spacing: .05em; }

.res-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 28px 0 8px; }
.share-note { min-height: 22px; margin: 8px 0 0; font-family: var(--f-pixel); font-size: 14px; color: var(--cyan); }
.next-dive { margin-top: 16px; font-family: var(--f-pixel); font-size: 14px; letter-spacing: .14em; color: var(--mute); }
.next-dive b { display: block; margin-top: 4px; font-weight: 400; font-size: 30px; color: var(--ink); letter-spacing: .08em; }

/* ---------- footer, modals ---------- */
.foot { position: relative; z-index: 2; padding: 14px clamp(14px, 4vw, 32px) 22px; text-align: center; }
.foot p { max-width: 640px; margin: 0 auto; font-size: 12px; line-height: 1.55; color: #7f79a8; }
.foot b { color: var(--mute); }

.modal { border: 3px solid #000; border-radius: 10px; padding: 0; background: var(--panel-2); color: var(--ink); box-shadow: 0 0 0 2px var(--line), 8px 8px 0 #000; width: min(460px, 92vw); }
.modal::backdrop { background: rgba(6,4,16,.72); backdrop-filter: blur(3px); }
.modal form { padding: 24px 24px 22px; }
.modal h3 { margin: 0 0 14px; font-family: var(--f-display); font-weight: 400; font-size: 26px; color: var(--pink); text-shadow: 2px 2px 0 #000; transform: skewX(-4deg); }
.modal .btn { margin-top: 18px; width: 100%; }
.how-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 15px; line-height: 1.45; color: #d9d3f5; }
.how-list b { color: var(--gold); }
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 2px dashed var(--line); cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; margin: 2px 0 0; border-radius: 4px; background: #0e0b20; border: 3px solid #000; box-shadow: inset 0 0 0 2px var(--line); position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 2px; background: var(--mute); transition: transform .15s, background .15s; }
.switch input:checked { background: #14455a; }
.switch input:checked::after { transform: translateX(20px); background: var(--cyan); }
.switch span { font-size: 16px; line-height: 1.3; }
.switch small { display: block; margin-top: 3px; font-size: 13px; color: var(--mute); }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .legend { grid-template-columns: repeat(3, 1fr); }
  .howto { grid-template-columns: 1fr; }
  .hud { grid-template-columns: 1fr; }
  .pips { justify-content: center; }
  .chip-streak { display: none; }
  .dock-row { gap: 10px; }
  .timer { width: 54px; height: 54px; }
  .timer b { font-size: 20px; }
  .btn-pull { padding: 14px 16px; font-size: 17px; }
  .log summary { grid-template-columns: 26px 1fr auto; padding-left: 20px; }
  .table-row { grid-template-columns: 1fr; gap: 2px; }
}

/* low-power / reduced motion */
body.low #ambient, body.low .bg-rays, body.low .fx-canvas, body.low .pack-tilt, body.low .beam, body.low .reveal-bg, body.low .reveal-dim, body.low .godrays, body.low #sparks { display: none; }
body.low .card-rise { transition: none; transform: none; }
body.low .shine, body.low .logo span::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #ambient, .bg-rays { display: none; }
}

/* anime impact frames (5-star pulls): flickering flat frames with speed lines */
#impact { position: fixed; inset: 0; z-index: 40; pointer-events: none; display: none; --rot: 0deg; --bgc: #fff; --lnc: #000; background: var(--bgc); overflow: hidden; }
#impact.on { display: block; }
#impact.f1 { --bgc: #fff; --lnc: #000; }
#impact.f2 { --bgc: #000; --lnc: #fff; }
#impact.f3 { --bgc: #ffd166; --lnc: #1a0a00; }
#impact i {
  position: absolute; inset: -40%;
  background: repeating-conic-gradient(from var(--rot) at 50% 50%, var(--lnc) 0 1.1deg, var(--bgc) 1.1deg 3.3deg, var(--lnc) 3.3deg 4.2deg, var(--bgc) 4.2deg 9deg);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 0 14%, #000 34%); mask-image: radial-gradient(circle at 50% 50%, transparent 0 14%, #000 34%);
}
#impact b {
  position: absolute; left: 50%; top: 46%; width: min(70vmin, 520px); aspect-ratio: 1; transform: translate(-50%, -50%) rotate(var(--rot)); background: var(--lnc);
  clip-path: polygon(50% 0, 56% 36%, 100% 28%, 64% 54%, 86% 100%, 50% 66%, 14% 100%, 36% 54%, 0 28%, 44% 36%);
}
#impact::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--lnc) 1.6px, transparent 2px); background-size: 9px 9px; opacity: .28; }
body.low #impact { display: none !important; }

/* the address: ANIMLE with ".xyz" in small print at the bottom right */
.mini-logo { position: relative; padding-right: 2px; }
.tld { position: absolute; right: -26px; bottom: -7px; font-family: var(--f-pixel); font-size: 11px; font-weight: 400; letter-spacing: .06em; color: var(--mute); transform: skewX(6deg); pointer-events: none; }
.logo { position: relative; display: inline-block; }
.logo .tld { right: -.6em; bottom: .12em; font-size: clamp(14px, 2.6vw, 28px); transform: skewX(6deg); text-shadow: 2px 2px 0 #000; color: var(--ink); opacity: .85; }
.foot-url { margin: 0 auto 8px; font-family: var(--f-display); font-size: 20px; color: var(--ink); letter-spacing: -.01em; }
.foot-url span { font-family: var(--f-pixel); font-size: 12px; color: var(--mute); margin-left: 2px; }

/* halftone integration */
.ht-field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; opacity: .6; mix-blend-mode: screen; }
.prompt.ht-host::before { display: none; }
.pull-face { isolation: isolate; }
.pull-face::before { display: none; }
.pull-face > .ht { z-index: 0; }
.legend li { overflow: hidden; }
body.low .ht-field, body.low .ht-fixed { display: none; }
