/* Crazy Rare */
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; }
.screen { animation: screen-in 0.3s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- start ---------- */
.intro { padding: 10px 0 4px; }
.title { font-size: clamp(2.6rem, 9vw, 3.6rem); line-height: 1; margin: 8px 0 12px; color: var(--r5); text-shadow: 0 3px 0 #5a1a5a, 0 0 28px rgba(255, 85, 255, 0.35); }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 32em; }
.rules { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 8px; }
.rules li { position: relative; padding-left: 18px; color: var(--muted); }
.rules li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; background: var(--gold); }
.rules b { color: var(--text); font-weight: 600; }
.ladder-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; }
.ladder-row span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 600; font-size: 0.95rem; }
.ladder-row span i { width: 9px; height: 9px; background: currentColor; flex: none; }
.ladder-row span small { color: var(--faint); font-family: var(--font); font-size: 0.78rem; }
.ladder-row .hid { border-style: dashed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mini-stats { display: flex; gap: 22px; margin-top: 26px; color: var(--muted); font-size: 0.92rem; }
.mini-stats b { display: block; font-weight: 700; font-size: 1.5rem; color: var(--text); line-height: 1.1; }
#homeNote { margin-top: 12px; }

/* ---------- HUD ---------- */
.hud { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.dots { display: flex; gap: 5px; }
.dots i { width: 14px; height: 14px; border-radius: 3px; background: var(--bg-3); border: 1px solid var(--line-2); transition: background 0.3s, border-color 0.3s; }
.dots i.now { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.dots i.miss { background: #2a2e38; border-color: #2a2e38; }
.hud-score { margin-left: auto; font-size: 1.25rem; }
.hud-score::after { content: ' pts'; font-family: var(--font); font-size: 0.8rem; color: var(--faint); }
.hud-time { min-width: 2.2em; text-align: right; font-size: 1.25rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hud.low .hud-time { color: var(--bad); animation: tick 1s steps(1) infinite; }
@keyframes tick { 50% { opacity: 0.55; } }
.timer { height: 4px; border-radius: 2px; background: var(--bg-3); overflow: hidden; margin-bottom: 18px; }
.timer i { display: block; height: 100%; background: var(--gold); transform-origin: left; }
.hud.low + .timer i { background: var(--bad); }
.bump { animation: bump 0.4s ease; }
@keyframes bump { 40% { transform: scale(1.25); color: #55ffff; } }

/* ---------- prompt ---------- */
.prompt { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 22px; }
.p-tag { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.86rem; font-weight: 600; letter-spacing: 0.02em; }
.p-tag .ic { --s: 24px; }
.prompt h2 { font-size: clamp(1.35rem, 4.6vw, 1.75rem); margin: 10px 0 0; text-wrap: balance; }
.p-hint { color: var(--faint); font-size: 0.92rem; margin-top: 8px; }
.p-hint:empty { display: none; }
.shake { animation: shake 0.35s ease; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.answer { display: flex; gap: 10px; margin-top: 14px; }
.answer .field { flex: 1; min-width: 0; }
.dym { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.dym-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 6px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-3); cursor: pointer; font-weight: 500; }
.opt:hover, .opt.first { border-color: var(--gold); }
.opt .ic { --s: 28px; }
.feedback { min-height: 1.5em; margin-top: 10px; color: var(--muted); font-size: 0.94rem; }
.feedback.bad { color: var(--bad); }
.skip-row { display: flex; justify-content: flex-end; }

/* ---------- reveal: tooltip + RNG Meter ---------- */
.reveal { margin-top: 16px; display: grid; justify-items: center; gap: 16px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.reveal.done { cursor: default; }
.tip-wrap { position: relative; display: grid; justify-items: center; width: 100%; }
.mc-tip.big { font-size: 1.2rem; min-width: min(100%, 330px); max-width: 100%; padding: 14px 18px 15px; transition: box-shadow 0.25s; }
.mc-tip.big .t-name { display: flex; align-items: center; gap: 10px; font-size: 1.42rem; line-height: 1.2; margin-bottom: 4px; transition: color 0.15s; }
.mc-tip.big .t-name .ic { --s: 36px; }
.mc-tip.big .t-rar { font-size: 1.22rem; transition: color 0.12s; }
.mc-tip .t-why { color: var(--r7); }
.mc-tip.lit { box-shadow: 0 0 0 2px rgba(16, 1, 16, 0.96), inset 0 0 0 2px var(--edge), 0 0 34px -4px var(--glow), 0 18px 40px rgba(0, 0, 0, 0.45); }
.mc-tip.step { animation: recomb 0.22s ease-out; }
@keyframes recomb { 0% { filter: brightness(2.2); transform: scale(1.035); } 100% { filter: none; transform: none; } }
.mc-tip.land { animation: land 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes land { 0% { transform: scale(1.12); filter: brightness(2.6); } 100% { transform: none; filter: none; } }
.mc-tip.glitch { animation: glitch 0.6s steps(2) 1; }
@keyframes glitch {
  0% { transform: translate(0); filter: hue-rotate(0); } 20% { transform: translate(-5px, 2px) skewX(-6deg); filter: hue-rotate(90deg) saturate(3); }
  40% { transform: translate(5px, -2px); } 60% { transform: translate(-3px, -1px) skewX(4deg); filter: hue-rotate(-60deg); }
  80% { transform: translate(3px, 1px); } 100% { transform: none; filter: none; }
}
/* a light sweep across Divine and up */
.mc-tip.shine::after {
  content: ''; position: absolute; inset: 0; border-radius: 4px; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.22) 45%, transparent 60%);
  background-size: 250% 100%; animation: shine 1.6s ease-out 1;
}
@keyframes shine { from { background-position: 130% 0; } to { background-position: -60% 0; } }
.mc-tip .t-rar.pulse { animation: rarpulse 1.4s ease-in-out infinite; }
@keyframes rarpulse { 50% { text-shadow: 0 0 12px currentColor; } }
.pts { position: absolute; right: max(4px, calc(50% - 200px)); top: -34px; font-size: 1.5rem; opacity: 0; pointer-events: none; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }
.pts.show { animation: pts 1.1s ease-out forwards; }
@keyframes pts { 0% { opacity: 0; transform: translateY(14px) scale(0.8); } 25% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 1; transform: translateY(-4px) scale(1); } }

.drop { min-height: 1.9rem; font-size: clamp(1.35rem, 5vw, 1.8rem); font-weight: 700; letter-spacing: 0.03em; text-align: center; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.55); }
.drop.show { animation: drop-in 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes drop-in { 0% { opacity: 0; transform: scale(0.4) rotate(-4deg); } 100% { opacity: 1; transform: none; } }
.drop.pulse { animation: drop-in 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both, drop-glow 1.2s ease-in-out 0.55s infinite; }
@keyframes drop-glow { 50% { text-shadow: 0 3px 0 rgba(0, 0, 0, 0.55), 0 0 18px currentColor; } }

.meter { width: min(100%, 420px); }
.meter-head { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--faint); margin-bottom: 6px; }
.meter-head .pixel { font-size: 0.95rem; color: var(--muted); }
#meterLabel { font-weight: 600; font-size: 0.95rem; }
.meter-bar { display: grid; grid-template-columns: repeat(7, 1fr) 0.6fr; gap: 3px; padding: 3px; border-radius: 6px; background: #07080b; border: 1px solid var(--line); }
.seg { height: 14px; border-radius: 2px; background: #1a1d25; transition: background 0.12s, box-shadow 0.2s; }
.seg.on { background: var(--c); box-shadow: 0 0 10px -2px var(--c); }
.seg.hidden-seg { background: repeating-linear-gradient(45deg, #1a1d25 0 4px, #14161c 4px 8px); }
.seg.hidden-seg.on { background: repeating-linear-gradient(45deg, var(--c) 0 4px, #5a0e0e 4px 8px); }
.seg.pop { animation: seg 0.25s ease-out; }
@keyframes seg { 0% { transform: scaleY(1.8); filter: brightness(2); } }
.meter.crack .meter-bar { animation: glitch 0.5s steps(2) 1; border-color: var(--r7); }
.skip-hint { font-size: 0.82rem; color: var(--faint); margin-top: -6px; }
.next { width: 100%; max-width: 420px; }

/* ---------- results ---------- */
.res-top { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 6px 0 22px; }
.res-score { font-size: 3.4rem; line-height: 1; margin: 4px 0; }
.res-score small { font-family: var(--font); font-size: 1rem; color: var(--faint); }
.res-tiles { display: flex; gap: 6px; }
.res-tiles i { width: 30px; height: 30px; border-radius: 5px; background: var(--c, #2a2e38); box-shadow: 0 0 12px -3px var(--c, transparent); opacity: 0; transform: scale(0.4); transition: opacity 0.25s, transform 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
.res-tiles i.in { opacity: 1; transform: none; }
.res-tiles i.miss { background: #2a2e38; box-shadow: none; }
.res-tiles i.hid { background: repeating-linear-gradient(45deg, var(--c) 0 5px, #5a0e0e 5px 10px); }
#results .card { margin-top: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 1.12rem; }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.res-list li { display: grid; grid-template-columns: 36px 1fr auto; gap: 1px 12px; align-items: center; padding: 10px 12px; border-radius: 11px; background: var(--bg-3); }
.res-list .ic { --s: 34px; grid-row: 1 / 5; align-self: start; margin-top: 2px; }
.res-list .q { grid-column: 2 / 4; font-size: 0.84rem; color: var(--muted); line-height: 1.35; }
.res-list .a { grid-column: 2; font-weight: 600; font-size: 1.12rem; line-height: 1.25; }
.res-list .p { grid-column: 3; grid-row: 2; text-align: right; font-weight: 600; font-size: 0.98rem; white-space: nowrap; }
.res-list .s { grid-column: 2 / 4; font-size: 0.78rem; color: var(--faint); }
.xp-card { display: grid; gap: 12px; }
.xp-card .row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.xp-card .gain { font-weight: 600; font-size: 1.6rem; color: #55ffff; }
.xp-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.92rem; color: var(--muted); }
.xp-card li { display: flex; justify-content: space-between; gap: 12px; }
.xp-card li b { color: var(--text); font-weight: 600; }
.xp-card li span:last-child { font-weight: 600; color: #55ffff; }
.xp-card .lvlup { font-weight: 600; font-size: 1.15rem; animation: drop-in 0.5s both; }

.sound { position: fixed; right: 14px; bottom: 14px; z-index: 30; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.sound[aria-pressed="false"] { text-decoration: line-through; opacity: 0.6; }

@media (max-width: 480px) {
  .answer { flex-direction: column; }
  .mc-tip.big { font-size: 1.08rem; }
  .mc-tip.big .t-name { font-size: 1.25rem; }
  .res-score { font-size: 2.8rem; }
}
