/* Атомна лаборатория — нощна лаборатория на квадратчета; плочките са като клетки от периодичната таблица.
   Метали = кехлибар, неметали = тюркоаз, маркерът на Никола (жълто) = точки и награди. */
:root {
    --bg: #0d1530;
    --bg-2: #141f42;
    --panel: #18244c;
    --panel-2: #1f2d5c;
    --line: rgba(255, 255, 255, .09);
    --text: #eef2ff;
    --soft: #9aa6c9;
    --marker: #ffd84d;
    --metal: #ffb547;
    --non: #3fd0c9;
    --ok: #5be38c;
    --bad: #ff5d6c;
    --display: 'Unbounded', sans-serif;
    --body: 'Manrope', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--body);
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(63, 208, 201, .14), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(255, 181, 71, .12), transparent 60%),
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 26px 26px,
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 26px 26px,
        var(--bg);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.45;
    overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
.mono { font-family: var(--mono); }
.ic { flex-shrink: 0; vertical-align: -4px; }
.icon-btn, .codex-btn, .node button span { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.streak { color: #ff8a5b; font-weight: 800; margin-left: 6px; }

.game { max-width: 760px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 40px; }

.kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); font-weight: 800; }
.back { color: var(--soft); text-decoration: none; font-weight: 700; font-size: .95rem; padding: 6px 0; }
.back:hover { color: var(--text); }

.go {
    background: var(--marker); color: #1b1d2b; font-weight: 800; font-size: 1.02rem;
    padding: .9rem 1.6rem; border-radius: 14px;
    box-shadow: 0 5px 0 #b8941a, 0 12px 30px -10px rgba(255, 216, 77, .6);
    transition: transform .1s, box-shadow .1s;
}
.go:active { transform: translateY(4px); box-shadow: 0 1px 0 #b8941a; }
.ghost {
    border: 2px solid var(--line); border-radius: 14px; padding: .8rem 1.3rem; font-weight: 800; color: var(--text);
    background: rgba(255, 255, 255, .04);
}
.ghost:hover { border-color: var(--soft); }

/* ---------- Плочка-елемент ---------- */
.tile {
    --c: var(--non);
    position: relative; display: inline-grid; place-items: center;
    width: 64px; height: 64px; border-radius: 12px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, var(--panel-2)), color-mix(in srgb, var(--c) 10%, var(--panel)));
    border: 2px solid color-mix(in srgb, var(--c) 70%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 6px 18px -8px color-mix(in srgb, var(--c) 70%, transparent);
    color: var(--text); user-select: none; -webkit-user-select: none;
}
.tile.metal { --c: var(--metal); }
.tile small { position: absolute; top: 4px; left: 7px; font-size: .62rem; font-weight: 800; color: color-mix(in srgb, var(--c) 80%, white); }
.tile b { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1; }
.tile em { font-style: normal; font-size: .62rem; font-weight: 700; color: var(--soft); position: absolute; bottom: 5px; }
.tile.mini { width: 36px; height: 36px; border-radius: 8px; border-width: 1.5px; }
.tile.mini b { font-size: .9rem; }
.tile.mini small { display: none; }
.tile.big { width: 84px; height: 84px; }
.tile.big b { font-size: 1.9rem; margin-top: -8px; }
.tile.xl { width: 128px; height: 128px; border-radius: 20px; border-width: 3px; }
.tile.xl b { font-size: 3.4rem; }
.tile.xl small { font-size: .9rem; top: 8px; left: 12px; }

/* ---------- Карта ---------- */
.map-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.icon-btn { font-size: 1.2rem; width: 42px; height: 42px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.title-block { margin-bottom: 18px; animation: rise .5s both; }
.title-block h1 { font-family: var(--display); font-weight: 900; font-size: clamp(2.1rem, 8vw, 3.4rem); line-height: 1.02; margin: 6px 0 10px; letter-spacing: -.02em; }
.title-block h1 span { color: var(--marker); display: block; }
.title-block.small h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.title-block.small h1 span { display: inline; }
.lead { color: var(--soft); max-width: 46ch; }

.rank { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; animation: rise .5s .08s both; }
.rank > div { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.rank small { display: block; color: var(--soft); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.rank b { font-family: var(--display); font-size: 1.15rem; }
.rank b i { font-style: normal; color: var(--soft); font-size: .8rem; }
.rank > div:first-child b { color: var(--marker); }

.weak { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: rgba(255, 93, 108, .08); border: 1px dashed rgba(255, 93, 108, .4); border-radius: 16px; padding: 10px 14px; margin-bottom: 14px; }
.weak small { color: #ffb3ba; font-weight: 700; }
.weak div { display: flex; gap: 6px; flex-wrap: wrap; }

.path { list-style: none; position: relative; padding: 14px 0 8px; }
.path::before { content: ''; position: absolute; left: 35px; top: 30px; bottom: 30px; border-left: 3px dotted rgba(255, 255, 255, .15); }
.node { position: relative; display: flex; align-items: center; gap: 16px; padding: 9px 0; animation: rise .45s calc(.12s + var(--i) * .06s) both; }
.node:nth-child(even) { margin-left: 26px; }
.node button {
    flex-shrink: 0; width: 72px; height: 72px; border-radius: 22px; transform: rotate(-4deg);
    background: linear-gradient(160deg, #2b3c78, #1c2a58); border: 2px solid rgba(255, 255, 255, .14);
    font-family: var(--display); font-weight: 900; font-size: 1.6rem;
    box-shadow: 0 6px 0 #0a1028, 0 14px 24px -12px rgba(0, 0, 0, .7);
    transition: transform .15s;
}
.node:nth-child(even) button { transform: rotate(4deg); }
.node button:not(:disabled):hover { transform: rotate(0) scale(1.06); }
.node.done button { background: linear-gradient(160deg, #ffe680, #f1b91e); color: #2a2205; border-color: #fff2b0; box-shadow: 0 6px 0 #9c7a10, 0 14px 30px -10px rgba(255, 216, 77, .6); }
.node.locked button { opacity: .45; cursor: not-allowed; font-size: 1.2rem; }
.node.locked .node-info { opacity: .5; }
.node.boss button { width: 84px; height: 84px; background: linear-gradient(160deg, #7a2cff, #3b0f8c); border-color: #c4a8ff; box-shadow: 0 6px 0 #22075a, 0 0 40px -6px rgba(170, 120, 255, .7); }
.node.boss:not(.locked) button { animation: pulse 2.2s infinite; }
.node.boss.done button { background: linear-gradient(160deg, #ffe680, #f1b91e); }
.node-info b { font-family: var(--display); font-weight: 700; font-size: 1.02rem; display: block; }
.node-info small { color: var(--soft); display: block; font-size: .85rem; }
.node-stars i { font-style: normal; color: rgba(255, 255, 255, .18); font-size: 1rem; }
.node-stars i.on { color: var(--marker); text-shadow: 0 0 10px rgba(255, 216, 77, .6); }

.codex-btn { width: 100%; margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; }
.codex-btn:hover { border-color: var(--soft); }

/* ---------- Справочник ---------- */
.codex-fact { background: var(--panel); border-left: 4px solid var(--marker); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; min-height: 52px; position: sticky; top: 8px; z-index: 2; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.codex-h { font-family: var(--display); font-size: .95rem; margin: 18px 0 10px; color: var(--soft); }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.codex-tile { display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border-radius: 14px; transition: background .15s; }
.codex-tile:hover { background: rgba(255, 255, 255, .05); }
.codex-tile .lat { font-size: .75rem; color: var(--soft); font-style: italic; }
.rules { margin-top: 24px; background: var(--panel); border-radius: 18px; padding: 18px 20px; border: 1px solid var(--line); }
.rules h3 { font-family: var(--display); color: var(--marker); margin-bottom: 10px; }
.rules ul { padding-left: 18px; display: grid; gap: 8px; }
.rules code { font-family: var(--mono); background: rgba(255, 255, 255, .08); padding: 1px 6px; border-radius: 6px; }

/* ---------- Въведение ---------- */
.intro { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 22px; margin-top: 6vh; animation: rise .4s both; }
.intro h2 { font-family: var(--display); font-weight: 900; font-size: 2rem; margin: 6px 0 14px; }
.intro ul { list-style: none; display: grid; gap: 10px; margin-bottom: 20px; }
.intro li { padding-left: 30px; position: relative; color: #d5dbf2; }
.intro li::before { content: ''; position: absolute; left: 4px; top: .45em; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--non); box-shadow: 0 0 0 3px rgba(63, 208, 201, .2); }
.intro .rec { color: var(--soft); margin-bottom: 14px; }
.intro .rec b { color: var(--marker); }
.intro .back { display: inline-block; margin-bottom: 10px; }
.intro.boss { background: radial-gradient(circle at 50% 0, rgba(122, 44, 255, .35), var(--panel) 60%); border-color: rgba(196, 168, 255, .4); }

/* ---------- HUD ---------- */
.hud { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hud-x { width: 38px; height: 38px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--soft); font-weight: 800; }
.hud-name { flex: 1; font-family: var(--display); font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-combo { font-family: var(--display); font-weight: 900; padding: 6px 10px; border-radius: 10px; background: var(--panel); color: var(--soft); }
.hud-combo.on { background: linear-gradient(135deg, #ff8a5b, #ff3d77); color: white; box-shadow: 0 0 24px -4px #ff5d6c; }
.hud-score { text-align: right; line-height: 1; }
.hud-score b { font-family: var(--display); font-size: 1.35rem; color: var(--marker); display: block; }
.hud-score small { color: var(--soft); font-size: .68rem; font-weight: 800; text-transform: uppercase; }

.progress { height: 8px; background: rgba(255, 255, 255, .08); border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--non), var(--marker)); border-radius: 99px; transition: width .4s; }

/* ---------- Въпрос ---------- */
.qcard { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 22px 18px; text-align: center; animation: pop-in .3s both; }
.q-prompt { color: var(--soft); font-weight: 700; font-size: 1.02rem; }
.q-big { font-family: var(--display); font-weight: 900; font-size: clamp(1.7rem, 7vw, 2.6rem); margin: 6px 0 4px; line-height: 1.15; }
.q-big.long { font-family: var(--body); font-weight: 800; font-size: clamp(1.25rem, 5vw, 1.6rem); margin: 10px 0; }
.q-big.mono { font-family: var(--mono); font-size: clamp(2.4rem, 11vw, 3.6rem); color: var(--marker); }
.q-tile { margin: 14px 0 6px; }
.q-hint { color: var(--soft); margin-top: 4px; }
.q-hint b { color: var(--non); font-style: italic; letter-spacing: .02em; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.opts-tiles { grid-template-columns: repeat(4, 1fr); }
.opt {
    position: relative; display: grid; place-items: center; min-height: 64px; padding: 12px 12px 12px 30px;
    background: var(--panel-2); border: 2px solid var(--line); border-radius: 16px; font-weight: 700; font-size: .98rem;
    transition: transform .1s, border-color .15s, background .15s;
}
.opt.mono span { font-family: var(--mono); font-size: 1.35rem; }
.opts-tiles .opt { padding: 12px 6px; background: transparent; border-color: transparent; }
.opts-tiles .opt .tile { width: 100%; max-width: 86px; height: auto; aspect-ratio: 1; }
.opts-tiles .opt .tile b { font-size: 1.9rem; }
.opt:hover:not(:disabled) { border-color: var(--soft); transform: translateY(-2px); }
.opt kbd { position: absolute; top: 6px; left: 8px; font-family: var(--mono); font-size: .65rem; color: var(--soft); opacity: .7; }
.opts-tiles .opt kbd { display: none; }
.opt.ok { border-color: var(--ok); background: rgba(91, 227, 140, .15); }
.opt.bad { border-color: var(--bad); background: rgba(255, 93, 108, .15); }
.opts-tiles .opt.ok .tile { border-color: var(--ok); box-shadow: 0 0 0 4px rgba(91, 227, 140, .35); }
.opts-tiles .opt.bad .tile { border-color: var(--bad); opacity: .6; }
.opt:disabled { cursor: default; }
.opt:disabled:not(.ok):not(.bad) { opacity: .45; }

.typer { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.typer input {
    width: 150px; text-align: center; font-family: var(--display); font-weight: 900; font-size: 2.4rem;
    background: var(--bg-2); border: 3px solid var(--line); border-radius: 18px; padding: 6px; outline: none;
}
.typer input:focus { border-color: var(--non); box-shadow: 0 0 0 5px rgba(63, 208, 201, .2); }
.typer input.ok { border-color: var(--ok); color: var(--ok); }
.typer input.bad { border-color: var(--bad); color: var(--bad); }

.feedback { min-height: 30px; margin-top: 16px; }
.feedback.ok b { color: var(--ok); font-family: var(--display); font-size: 1.15rem; }
.feedback.bad { background: rgba(255, 93, 108, .1); border-radius: 14px; padding: 12px 14px; text-align: left; }
.feedback.bad b { color: #ffb3ba; }
.feedback.bad b .mono, .feedback.bad b.mono { color: var(--marker); font-size: 1.1em; }
.feedback small { display: block; color: #d5dbf2; margin-top: 4px; font-size: .9rem; }
.feedback .next { display: block; margin: 12px auto 0; }

/* ---------- Бос ---------- */
.boss-zone { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.boss-bars { flex: 1; }
.bar-label { display: flex; justify-content: space-between; font-weight: 800; font-size: .8rem; color: #c4a8ff; margin-bottom: 4px; }
.hp { height: 14px; background: rgba(255, 255, 255, .08); border-radius: 99px; overflow: hidden; border: 1px solid rgba(196, 168, 255, .3); }
.hp div { height: 100%; background: linear-gradient(90deg, #ff3d77, #a855f7); transition: width .5s; }
.hearts { margin-top: 6px; letter-spacing: 2px; }
.hearts b { color: var(--bad); font-size: 1.15rem; text-shadow: 0 0 10px rgba(255, 93, 108, .6); }
.hearts b.lost { color: rgba(255, 255, 255, .12); text-shadow: none; }

/* Хаосът: объркан атом с ядро, орбити и сърдити очи */
.chaos { position: relative; width: 74px; height: 74px; flex-shrink: 0; }
.chaos.big { width: 120px; height: 120px; margin: 4px auto 18px; }
.chaos::before {
    content: ''; position: absolute; inset: 26%; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ff9ad5, #a020f0 55%, #4a0a8a);
    box-shadow: 0 0 30px #a855f7, inset 0 -6px 12px rgba(0, 0, 0, .35);
}
.chaos i { position: absolute; inset: 0; border: 2px solid rgba(196, 168, 255, .7); border-radius: 50%; transform: rotateX(70deg) rotateZ(0deg); animation: orbit 3s linear infinite; }
.chaos i:nth-child(2) { border-color: rgba(255, 61, 119, .7); animation-duration: 4.4s; animation-direction: reverse; transform: rotateY(70deg); }
.chaos i::after { content: ''; position: absolute; top: -5px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; }
.chaos .eyes { position: absolute; left: 36%; right: 36%; top: 44%; height: 10%; z-index: 1; }
.chaos .eyes::before, .chaos .eyes::after { content: ''; position: absolute; top: 0; width: 34%; height: 100%; background: #fff; border-radius: 0 0 50% 50%; }
.chaos .eyes::before { left: 0; transform: skewY(18deg); }
.chaos .eyes::after { right: 0; transform: skewY(-18deg); }
.chaos.hurt { animation: hurt .45s; }

/* ---------- Атомен дъжд ---------- */
.rain-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 10px; }
.rain-target { text-align: center; background: var(--marker); color: #1b1d2b; border-radius: 14px; padding: 6px 18px; box-shadow: 0 0 30px -6px rgba(255, 216, 77, .7); }
.rain-target small { display: block; font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.rain-target b { font-family: var(--display); font-weight: 900; font-size: 1.3rem; display: inline-block; }
.rain-count { text-align: right; color: var(--soft); font-weight: 800; }
.rain-count b { font-family: var(--display); color: var(--text); font-size: 1.3rem; }
.arena {
    position: relative; height: min(62vh, 560px); border-radius: 22px; overflow: hidden; touch-action: manipulation;
    background: linear-gradient(180deg, rgba(63, 208, 201, .06), rgba(255, 255, 255, .02)), var(--bg-2);
    border: 1px solid var(--line);
}
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: linear-gradient(90deg, var(--bad), #ff8a5b, var(--bad)); opacity: .7; }
.drop { position: absolute; top: 0; width: 70px; height: 70px; will-change: transform; transition: opacity .3s, scale .3s; }
.drop b { font-size: 1.7rem; }
.drop.caught { scale: 1.5; opacity: 0; border-color: var(--ok); }
.drop.wrong { border-color: var(--bad); opacity: 0; scale: .6; }
.drop.gone { opacity: 0; }

/* ---------- Памет ---------- */
.mem-top { display: flex; justify-content: space-between; color: var(--soft); font-weight: 700; margin-bottom: 12px; }
.mem-top b { color: var(--text); font-family: var(--display); }
.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; perspective: 900px; }
.card { aspect-ratio: 1; }
.card-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .4s; }
.card.flip .card-in { transform: rotateY(180deg); }
.card-back, .card-face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card-back {
    font-family: var(--display); font-weight: 900; font-size: 1.8rem; color: rgba(255, 255, 255, .35);
    background: repeating-linear-gradient(45deg, #22316a 0 10px, #1d2a5c 10px 20px); border: 2px solid var(--line);
}
.card-face { --c: var(--non); transform: rotateY(180deg); border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 18%, var(--panel)); }
.card-face.metal { --c: var(--metal); }
.card-face b { font-family: var(--display); font-weight: 900; font-size: clamp(1.4rem, 6vw, 2.2rem); }
.card-face small { position: absolute; top: 6px; left: 9px; font-size: .7rem; font-weight: 800; color: var(--c); }
.card-face em { font-style: normal; font-weight: 800; font-size: clamp(.8rem, 3.4vw, 1.05rem); padding: 4px; text-align: center; }
.card.match .card-face { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(91, 227, 140, .3); animation: glow .6s; }
.card.nope .card-face { border-color: var(--bad); }

/* ---------- Резултат ---------- */
.result { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 26px; padding: 26px 20px; margin-top: 3vh; animation: pop-in .4s both; }
.result h2 { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 8vw, 2.8rem); margin: 6px 0; }
.result.win h2 { color: var(--marker); }
.result .sub { color: var(--soft); margin: 6px 0; }
.stars { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.star { font-size: 3.2rem; color: rgba(255, 255, 255, .12); line-height: 1; }
.star.on { color: var(--marker); text-shadow: 0 0 22px rgba(255, 216, 77, .8); animation: star-in .5s var(--d) both; }
.star:nth-child(2) { font-size: 4rem; margin-top: -10px; }
.res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 10px; }
.res-stats div { background: var(--bg-2); border-radius: 14px; padding: 12px 6px; }
.res-stats b { display: block; font-family: var(--display); font-size: 1.35rem; }
.res-stats small { color: var(--soft); font-size: .72rem; font-weight: 700; }
.record { color: var(--marker); font-weight: 800; animation: pulse 1.6s infinite; display: inline-flex; gap: 8px; align-items: center; }
.review { text-align: left; margin-top: 18px; display: grid; gap: 8px; }
.review h3 { font-family: var(--display); font-size: 1rem; }
.rv { background: var(--bg-2); border-left: 4px solid var(--bad); border-radius: 10px; padding: 10px 12px; }
.rv b { color: var(--marker); font-size: 1.1rem; }
.rv small { display: block; color: var(--soft); margin-top: 2px; }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.diploma { margin: 18px 0 6px; padding: 18px; border-radius: 18px; border: 2px solid var(--marker); background: radial-gradient(circle at 50% 0, rgba(255, 216, 77, .18), transparent 70%); }
.diploma h3 { font-family: var(--display); font-size: 1.15rem; margin: 6px 0 12px; }
.diploma-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; justify-items: center; }
.diploma-grid .tile { width: 100%; max-width: 40px; height: auto; aspect-ratio: 1; }

/* ---------- Ефекти ---------- */
.float {
    position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -50%);
    font-family: var(--display); font-weight: 900; font-size: 1.3rem; color: var(--marker);
    text-shadow: 0 2px 10px rgba(0, 0, 0, .6); animation: float-up 1.1s ease-out forwards; white-space: nowrap;
}
.float.bad { color: #ffb3ba; font-size: 1rem; }
.float.dmg { color: #ff3d77; font-size: 1.6rem; }
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; z-index: 60; pointer-events: none; border-radius: 2px; animation: fall linear forwards; }
.shake { animation: shake .4s; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.94); } }
@keyframes float-up { to { opacity: 0; transform: translate(-50%, -160%); } }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(720deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes star-in { from { opacity: 0; transform: scale(2.4) rotate(-40deg); } }
@keyframes orbit { to { transform: rotateX(70deg) rotateZ(360deg); } }
@keyframes hurt { 30% { transform: scale(.82) rotate(-12deg); filter: brightness(2.2) hue-rotate(-60deg); } 60% { transform: scale(1.06) rotate(8deg); } }
@keyframes glow { 50% { transform: scale(1.06); } }

@media (max-width: 520px) {
    .game { padding-left: 12px; padding-right: 12px; }
    .rank b { font-size: 1rem; }
    .opts { grid-template-columns: 1fr; }
    .opts-tiles { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .opt { min-height: 54px; }
    .tile.xl { width: 108px; height: 108px; }
    .mem { gap: 7px; }
    .diploma-grid { grid-template-columns: repeat(5, 1fr); }
    .node:nth-child(even) { margin-left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
