/* Маленький фильм про котёнка с мечом и большого рыцаря: тёплые сцены сменяются грозовыми, сверху кадр с субтитрами. */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500 800; font-display: swap; src: url(/fonts/nunito-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500 800; font-display: swap; src: url(/fonts/nunito-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  color-scheme: light;
  --bg: #fff4dc; --text: #3d2a2a; --muted: #7a6161; --card: #ffffff; --card-text: #3d2a2a; --line: #f0dfd0;
  --accent: #e86a5a; --on-accent: #ffffff; --soft: #ffe6df; --shadow: rgba(90, 50, 30, .1);
  --night: #1b2230; --night-card: #2c3548; --night-line: #414c66; --night-text: #f3eef0; --amber: #f2b25c; --on-amber: #2a1e12;
  --ok: #ddf6e5; --on-ok: #1f7a47; --no: #ffe3df; --on-no: #b23a2e;
  --body: "Nunito", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
html.storm {
  --bg: #1b2230; --text: #f3eef0; --muted: #b7bccb; --card: #2c3548; --card-text: #f3eef0; --line: #414c66;
  --accent: #f2b25c; --on-accent: #2a1e12; --soft: #3a3a3a; --shadow: rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--bg); transition: background-color .5s; }
body { margin: 0; color: var(--text); font: 600 16px/1.42 var(--body); overflow-x: clip; }
.wrap {
  max-width: 460px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:focus-visible, textarea:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-weight: 800; text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 24px; line-height: 1.18; }
.small { font-size: 13px; line-height: 1.35; color: var(--muted); font-weight: 600; }
.small a { color: inherit; }
.center { text-align: center; }

#stage { display: flex; flex-direction: column; gap: 14px; }
#stage.enter { animation: rise .4s ease-out; }

.card, .tile, .tag, .pick, .opt2 { background: var(--card); color: var(--card-text); box-shadow: 0 2px 12px var(--shadow); transition: transform .15s, background-color .15s, color .15s; }
.cta { display: block; width: 100%; padding: 16px; border-radius: 16px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 18px; text-align: center; text-decoration: none; box-shadow: 0 6px 18px var(--shadow); transition: transform .12s; }
.cta:active, .tile:active, .pick:active, .opt2:active { transform: scale(.98); }
.cta[disabled] { opacity: .6; }
.ghost { display: block; width: 100%; padding: 13px; border-radius: 16px; font-weight: 700; text-align: center; background: var(--card); color: var(--card-text); text-decoration: none; }
.actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.actions.full { align-items: stretch; }
.linkbtn { font-size: 14px; color: var(--muted); text-decoration: underline; }
.foot { text-align: center; }

.top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.back { padding: 4px 2px; font-weight: 700; color: var(--muted); }
.count { font-size: 14px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.track { position: relative; height: 34px; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 16px; height: 3px; border-radius: 2px; background: var(--line); }
.ava { position: absolute; top: 0; width: 34px; height: 34px; border-radius: 50%; background-color: var(--card); box-shadow: 0 0 0 2.5px var(--card), 0 2px 8px var(--shadow); }
.ava.kitten { background: url(/img/kitten.jpg) 50% 30% / 150%; left: calc(var(--p, 0) * (100% - 58px)); transition: left .7s cubic-bezier(.3, 1.1, .4, 1); z-index: 1; }
.ava.knight { background: url(/img/knight.jpg) 50% 40% / 135%; right: 0; }

.film { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: var(--night); box-shadow: 0 6px 22px var(--shadow); }
.film.tall { aspect-ratio: 3 / 2; }
.film img { display: block; width: 100%; height: 100%; object-fit: cover; animation: drift 14s ease-in-out infinite alternate; }
.film video { display: block; width: 100%; height: 100%; object-fit: cover; }
.film figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; text-align: center; color: #fff; font-weight: 800; font-size: 17px; line-height: 1.25; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); background: linear-gradient(transparent, rgba(0, 0, 0, .62)); }
.film figcaption span { display: inline-block; animation: sub .35s ease-out; }
.film.rain::after { content: ""; position: absolute; inset: -40px; pointer-events: none; opacity: .3; background-image: repeating-linear-gradient(105deg, transparent 0 14px, rgba(255, 255, 255, .55) 14px 15px, transparent 15px 34px); animation: rain .7s linear infinite; }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 8; }
#flash.on { animation: thunder 1.1s ease-out; }

.head { display: flex; flex-direction: column; gap: 4px; }
.hint { color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.tile { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; text-align: left; padding: 11px 12px; border-radius: 16px; font-size: 15px; line-height: 1.24; }
.tile .e { font-size: 23px; line-height: 1; transition: transform .2s cubic-bezier(.2, 1.6, .4, 1); }
.tile[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.tile[aria-pressed="true"] .e { transform: scale(1.18); }
.tile.safe { grid-column: 1 / -1; }
.block { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.block h3 { font: 800 19px/1.2 var(--body); }
.calm { padding: 12px 14px; border-radius: 16px; background: var(--card); color: var(--card-text); }

.deck { position: relative; padding-bottom: 6px; }
.deck::before { content: ""; position: absolute; inset: 8px 6px 0 6px; background: var(--card); border-radius: 22px; transform: rotate(2deg); opacity: .55; }
.card { position: relative; min-height: 180px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 26px 18px; border-radius: 22px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; transition: transform .24s, opacity .24s; }
.card.in { animation: deal .3s cubic-bezier(.2, 1.1, .4, 1); }
.card .big { font: 800 22px/1.22 var(--body); }
.card .who { font-weight: 800; font-size: 14px; color: var(--accent); }
.card .cnt { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stamp { position: absolute; top: 12px; padding: 2px 10px; border: 2.5px solid currentColor; border-radius: 10px; font: 800 18px/1.25 var(--body); opacity: 0; pointer-events: none; }
.stamp.ok { left: 14px; color: var(--on-ok); transform: rotate(-9deg); }
.stamp.no { right: 14px; color: var(--on-no); transform: rotate(9deg); }
.card.fly-ok { transform: translateX(125%) rotate(12deg) !important; opacity: 0; }
.card.fly-no { transform: translateX(-125%) rotate(-12deg) !important; opacity: 0; }
.card.fly-ok .stamp.ok, .card.fly-no .stamp.no { opacity: 1; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.pick { padding: 14px 6px; border-radius: 14px; font-weight: 800; font-size: 17px; }
.pick.no { background: var(--no); color: var(--on-no); }
.pick.ok { background: var(--ok); color: var(--on-ok); }

.vs { display: grid; margin-top: 8px; }
.opt2 { display: flex; gap: 12px; align-items: center; text-align: left; padding: 20px 16px; border-radius: 18px; font: 800 18px/1.22 var(--body); transition: transform .18s, opacity .18s, background-color .12s, color .12s; }
.opt2 .e { font-size: 30px; line-height: 1; }
.opt2.win { background: var(--accent); color: var(--on-accent); transform: scale(1.02); }
.opt2.lose { opacity: .45; transform: scale(.97); }
.orb { justify-self: center; margin: -9px 0; z-index: 1; padding: 2px 12px; background: var(--text); color: var(--bg); border-radius: 999px; font: 800 13px/1.5 var(--body); }
.vshead { display: flex; justify-content: space-between; font-weight: 800; color: var(--muted); font-size: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 9px 13px; border-radius: 999px; font-size: 15px; }
.tag[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.panel { display: flex; flex-direction: column; gap: 11px; padding: 14px; border-radius: 18px; background: var(--card); color: var(--card-text); box-shadow: 0 2px 12px var(--shadow); }
.panel p { font-weight: 800; }
.panel blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 0 10px 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.panel .said { font-size: 13px; font-weight: 800; color: var(--muted); }

.seen { align-self: flex-start; padding: 4px 10px; background: var(--soft); color: var(--text); border-radius: 8px; font-size: 13px; font-weight: 700; }
.paper { display: flex; flex-direction: column; gap: 8px; }
textarea { width: 100%; min-height: 130px; padding: 14px; background: var(--card); color: var(--card-text); border: 1.5px solid var(--line); border-radius: 16px; font: 600 17px/1.4 var(--body); resize: vertical; }
textarea::placeholder, .field input::placeholder { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 800; }
.field input { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--card-text); font: inherit; font-weight: 600; }

.gauge { position: relative; width: 112px; height: 112px; margin: -62px auto 0; border-radius: 50%; background: var(--card); box-shadow: 0 6px 22px var(--shadow); z-index: 1; }
.gauge svg { position: absolute; inset: 6px; width: 100px; height: 100px; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 9; stroke: var(--line); }
.gauge circle.fillc { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 264; stroke-dashoffset: 264; transition: stroke-dashoffset 1.1s cubic-bezier(.3, .9, .4, 1); }
.gauge b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: var(--card-text); font-variant-numeric: tabular-nums; }
.title { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; }
.title .tagline { font-size: 17px; color: var(--muted); }
.slam { animation: slam .45s cubic-bezier(.2, 1.2, .4, 1) .2s backwards; }
.duel { display: flex; flex-direction: column; background: var(--card); color: var(--card-text); border-radius: 18px; box-shadow: 0 2px 12px var(--shadow); overflow: hidden; }
.duel > div { display: grid; grid-template-columns: minmax(0, 1fr) 34px 34px; gap: 6px; align-items: center; padding: 10px 13px; }
.duel > div + div { border-top: 1.5px solid var(--line); }
.duel .col { text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.duel .mark { text-align: center; font-size: 19px; line-height: 1; }
.duel .name { display: flex; flex-direction: column; min-width: 0; }
.duel .name b { font-weight: 800; }
.duel .name span { font-size: 14px; line-height: 1.25; color: var(--muted); }
.badges { display: grid; gap: 9px; }
.badge { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px 13px; border-radius: 16px; background: var(--card); color: var(--card-text); box-shadow: 0 2px 12px var(--shadow); animation: pop .45s cubic-bezier(.2, 1.3, .4, 1) calc(var(--i) * .3s + .5s) backwards; }
.badge .m { font-size: 30px; line-height: 1; text-align: center; }
.badge small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.badge b { display: block; font-weight: 800; font-size: 17px; line-height: 1.2; }
.badge span.d { display: block; font-size: 14px; line-height: 1.25; color: var(--muted); }
ul.seen-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.make-poster { display: block; width: 100%; padding: 14px; border-radius: 16px; background: var(--card); color: var(--card-text); font-weight: 800; text-align: center; box-shadow: 0 2px 12px var(--shadow); }

.vault { display: flex; flex-direction: column; gap: 11px; padding: 12px; background: var(--night); color: var(--night-text); border-radius: 24px; }
.vault h2 { font-size: 22px; }
.vault .head { padding: 2px 4px; }
.lockcard { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 12px 13px; border-radius: 15px; background: var(--night-card); overflow: hidden; }
.lockcard::after { content: "🔒"; position: absolute; top: 11px; right: 11px; font-size: 14px; animation: wiggle 3.6s ease-in-out infinite; animation-delay: calc(var(--i) * .4s); }
.lockcard h3 { font: 800 16.5px/1.22 var(--body); padding-right: 24px; }
.lockcard p { font-size: 14px; line-height: 1.3; font-weight: 600; color: #c4c8d4; }
.bars { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; filter: blur(3px); }
.bars i { display: block; height: 8px; border-radius: 4px; background: var(--night-line); }
.faces { display: flex; gap: 10px; padding-top: 2px; filter: blur(7px); }
.faces i { width: 44px; height: 44px; border-radius: 50%; }
.faces i:first-child { background: url(/img/kitten.jpg) center / cover; }
.faces i:last-child { background: url(/img/knight.jpg) center / cover; }
.meter { display: flex; flex-direction: column; gap: 5px; padding-top: 3px; }
.meter .line { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #63d68f, #f2c14e 50%, #ef6a5e); }
.meter .pin { position: absolute; top: -5px; left: 50%; width: 20px; height: 20px; border-radius: 50%; background: #fff; filter: blur(6px); }
.buy { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 2; display: block; width: 100%; padding: 16px; border-radius: 16px; background: var(--amber); color: var(--on-amber); font-weight: 800; font-size: 18px; text-align: center; text-decoration: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); animation: pulse 2.2s ease-in-out infinite; }
.vault .under { font-size: 13px; color: #c4c8d4; text-align: center; }

.rep { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 20px; background: var(--card); color: var(--card-text); box-shadow: 0 2px 12px var(--shadow); }
.rep h2 { font-size: 22px; }
.rep .kicker { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.rep p { font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.rep blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 0 10px 10px 0; font-weight: 700; overflow-wrap: anywhere; }
.rep .said { font-size: 13px; font-weight: 800; color: var(--muted); }
.rep.night { background: var(--night); color: var(--night-text); }
.rep .verdict { display: flex; align-items: center; gap: 12px; }
.rep .verdict i { flex: none; width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 0 0 3px #e5322d; }
.rep .verdict i.kitten { background: url(/img/kitten.jpg) 50% 30% / 150%; }
.rep .verdict i.knight { background: url(/img/knight.jpg) 50% 40% / 135%; }
.rep .level { display: flex; flex-direction: column; gap: 6px; }
.rep .level .line { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #63d68f, #f2c14e 50%, #ef6a5e); }
.rep .level .pin { position: absolute; top: -5px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.rep .level b { font-size: 20px; font-weight: 800; }
.quest { display: flex; flex-direction: column; gap: 4px; padding: 12px 13px; border-radius: 14px; background: var(--soft); }
.quest b { font-weight: 800; font-size: 17px; }
.quest span { font-size: 15px; line-height: 1.32; }
.quest .why { color: var(--muted); font-size: 14px; }
.rep ol, .rep ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

#poster { position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: rgba(14, 11, 16, .94); color: #fff; overflow-y: auto; }
#poster img { display: block; height: min(70vh, 640px); max-width: 100%; aspect-ratio: 9 / 16; border-radius: 16px; object-fit: contain; animation: pop .4s cubic-bezier(.2, 1.2, .4, 1); }
#poster .row { display: flex; flex-direction: column; gap: 8px; width: min(100%, 360px); }
#poster .ghost { background: #2c3548; color: #fff; }
#cut { position: fixed; inset: 0; z-index: 9; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 24px; background: #0e0b10; color: #fff; text-align: center; animation: cut 1.6s ease both; cursor: pointer; }
#cut small { font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #b9aebd; }
#cut b { font-size: 30px; line-height: 1.15; font-weight: 800; text-wrap: balance; }
#cut span { font-size: 18px; color: #d9d0dc; }
.burst { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.burst span { position: absolute; top: 18%; left: var(--x); font-size: 22px; animation: fall 1.8s ease-out var(--d) forwards; opacity: 0; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: max-content; max-width: 300px; padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 14px; text-align: center; z-index: 10; }

@keyframes rise { from { transform: translateY(10px); opacity: .4; } }
@keyframes pop { from { transform: scale(.75); opacity: 0; } }
@keyframes sub { from { transform: translateY(6px); opacity: 0; } }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.09) translateY(-1%); } }
@keyframes rain { to { transform: translate(-14px, 34px); } }
@keyframes thunder { 0% { opacity: 0; } 8% { opacity: .75; } 16% { opacity: .1; } 26% { opacity: .55; } 100% { opacity: 0; } }
@keyframes deal { from { transform: translateY(20px) scale(.96); opacity: 0; } }
@keyframes slam { from { transform: scale(1.5); opacity: 0; } }
@keyframes wiggle { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(-12deg); } 96% { transform: rotate(12deg); } }
@keyframes pulse { 50% { transform: scale(1.018); } }
@keyframes cut { 0% { opacity: 0; } 14%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fall { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), 70vh) rotate(var(--r)); } }
html.still *, html.still *::before, html.still *::after { animation: none !important; transition: none !important; }
