:root {
  --bg1: #1a0d3d;
  --bg2: #3a1260;
  --ink: #fff;
  --soft: #cbbdf5;
  --gold: #ffd84a;
  --pink: #ff3b6b;
  --green: #21d07a;
  --blue: #22b8ff;
  --card: rgba(255, 255, 255, .09);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  color: var(--ink);
  font-family: "PT Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; touch-action: manipulation; -webkit-appearance: none; appearance: none; margin: 0; }
input { font: inherit; }

#app {
  position: fixed; inset: 0;
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px);
  display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.scr { display: flex; flex-direction: column; flex: 1; min-height: 100%; animation: in .3s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.grow { flex: 1; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; flex: 1; }

.logo { font-weight: 900; font-size: 44px; letter-spacing: 1px; text-shadow: 0 3px 0 var(--pink), 0 6px 0 #8b1fff; line-height: 1; }
.logo span { color: var(--gold); }
h1 { font-size: 28px; font-weight: 900; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 800; margin: 18px 0 10px; }
.muted { color: var(--soft); font-size: 15px; line-height: 1.4; }
.big { font-size: 26px; font-weight: 900; line-height: 1.2; }
.huge { font-size: 54px; font-weight: 900; line-height: 1; }

/* ---------- аватар ---------- */
.ava { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 22px;
  color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25); box-shadow: inset 0 -4px 0 rgba(0,0,0,.2); flex-shrink: 0; }
.ava.xl { width: 110px; height: 110px; font-size: 52px; }
.ava.s { width: 34px; height: 34px; font-size: 16px; }

/* ---------- кнопки ---------- */
.btn { display: block; width: 100%; padding: 18px; border-radius: 18px; font-weight: 900; font-size: 20px; text-align: center;
  background: var(--gold); color: #3a2300; box-shadow: 0 5px 0 #b88b00; transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b88b00; }
.btn.pink { background: var(--pink); color: #fff; box-shadow: 0 5px 0 #a3123a; }
.btn.ghost { background: var(--card); color: #fff; box-shadow: none; font-size: 16px; padding: 14px; }
.btn[disabled] { opacity: .45; }
.link { color: var(--soft); text-decoration: underline; font-size: 14px; padding: 10px; }

/* ---------- вход ---------- */
.field { width: 100%; padding: 18px; border-radius: 16px; border: 2px solid rgba(255,255,255,.2); background: rgba(0,0,0,.25); color: #fff;
  font-size: 22px; font-weight: 800; text-align: center; outline: none; -webkit-user-select: text; user-select: text; }
.field:focus { border-color: var(--gold); }
.colors { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 18px 0 24px; }
.color { width: 46px; height: 46px; border-radius: 50%; border: 4px solid transparent; }
.color.sel { border-color: #fff; transform: scale(1.12); }
.err { background: rgba(255,59,107,.25); border-radius: 14px; padding: 12px; margin-top: 14px; font-size: 15px; font-weight: 700; }

/* ---------- лобби / настройки ---------- */
.me-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.me-head .nm { font-size: 22px; font-weight: 900; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 10px; background: var(--gold); color: #3a2300; font-size: 12px; font-weight: 900; }
.seg { display: flex; background: rgba(0,0,0,.25); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 11px 4px; border-radius: 11px; font-weight: 800; font-size: 14px; color: var(--soft); }
.seg button.on { background: #fff; color: #23104f; }
.seg button.on.adult { background: var(--pink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 12px; border-radius: 12px; background: rgba(0,0,0,.25); font-weight: 700; font-size: 14px; color: var(--soft); border: 2px solid transparent; }
.chip.on { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.5); }
.chip.adult.on { border-color: var(--pink); }
.chip small { opacity: .6; font-weight: 600; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: var(--card); border-radius: 14px; font-weight: 800; }
.prow.off { opacity: .45; }
.prow .x { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,59,107,.25); font-size: 18px; }
.sticky-bottom { position: sticky; bottom: 0; padding-top: 14px; margin-top: auto; background: linear-gradient(to bottom, transparent, var(--bg2) 30%); }

/* ---------- игра ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: 40px; }
.cat { padding: 6px 12px; border-radius: 12px; background: var(--card); font-weight: 800; font-size: 14px; }
.score { font-weight: 900; color: var(--gold); font-size: 18px; }
.gear { width: 40px; height: 40px; border-radius: 12px; background: var(--card); font-size: 20px; }
.tbar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; margin-bottom: 14px; }
.tbar i { display: block; height: 100%; background: var(--gold); width: 100%; }
.qtext { font-size: 20px; font-weight: 800; line-height: 1.3; margin-bottom: 16px; }
.pichint { margin: -8px 0 14px; padding: 8px 12px; border-radius: 12px; background: rgba(255,216,74,.14); color: #ffd84a; font-weight: 700; font-size: 15px; text-align: center; animation: pichint 1.6s ease-in-out infinite; }
@keyframes pichint { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.answers { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.ans { flex: 1; min-height: 64px; max-height: 120px; border-radius: 18px; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  font-weight: 800; font-size: 19px; text-align: left; line-height: 1.2; box-shadow: 0 5px 0 rgba(0,0,0,.28); transition: transform .08s, opacity .2s; }
.ans:active { transform: translateY(3px); }
.ans .L { width: 38px; height: 38px; border-radius: 10px; background: rgba(0,0,0,.22); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 900; }
.a0 { background: #ff3b6b; } .a1 { background: #f0a400; } .a2 { background: #13b866; } .a3 { background: #1597e0; }
.answers.done .ans { opacity: .3; }
.answers.done .ans.mine { opacity: 1; box-shadow: 0 0 0 4px #fff; }
.cards { display: flex; flex-direction: column; gap: 14px; }
.cardbtn { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; text-align: left; background: var(--card); box-shadow: 0 5px 0 rgba(0,0,0,.25); }
.cardbtn .ic { font-size: 44px; width: 60px; text-align: center; }
.cardbtn b { font-size: 21px; display: block; }
.cardbtn span { color: var(--soft); font-size: 14px; font-weight: 600; }
.cardbtn.freeze { background: rgba(34,184,255,.25); } .cardbtn.slime { background: rgba(110,220,60,.25); }
.cardbtn.mice { background: rgba(255,155,90,.25); } .cardbtn.doubler { background: rgba(255,216,74,.25); }
.catbtn { padding: 26px 16px; border-radius: 20px; font-weight: 900; font-size: 24px; box-shadow: 0 5px 0 rgba(0,0,0,.28); }
.catbtn.c0 { background: #ff3b6b; } .catbtn.c1 { background: #8b3dff; } .catbtn.c2 { background: #0fa3e8; }
.result { border-radius: 24px; padding: 30px 20px; text-align: center; }
.result.ok { background: rgba(33,208,122,.3); }
.result.bad { background: rgba(255,59,107,.3); }
.result.none { background: var(--card); }
.yes { flex: 1; min-height: 220px; border-radius: 30px; background: var(--green); font-size: 64px; font-weight: 900; box-shadow: 0 8px 0 #0b7a45; margin-top: 16px; }
.yes:active { transform: translateY(5px); box-shadow: 0 3px 0 #0b7a45; }
.yes[disabled] { background: rgba(255,255,255,.1); box-shadow: none; font-size: 30px; }
.yes.ok { background: var(--green); } .yes.bad { background: var(--pink); box-shadow: 0 8px 0 #a3123a; }
.item { background: #fff; color: #23104f; border-radius: 22px; padding: 22px; font-size: 30px; font-weight: 900; text-align: center; margin-top: 12px; animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.ladder { display: flex; gap: 4px; margin-top: 10px; }
.ladder i { flex: 1; height: 10px; border-radius: 5px; background: rgba(255,255,255,.15); }
.ladder i.on { background: var(--gold); }
.shake { animation: shake .5s; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }

/* ---------- меню капитана ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: #2a1458; border-radius: 24px 24px 0 0; padding: 22px 16px calc(var(--safe-bottom) + 22px); display: flex; flex-direction: column; gap: 12px; animation: in .2s; }

/* ---------- препятствия ---------- */
#obstacles { position: fixed; inset: 0; z-index: 40; display: none; touch-action: none; }
#obstacles.on { display: block; }
.ob-label { position: absolute; left: 0; right: 0; top: calc(var(--safe-top) + 24px); text-align: center; font-size: 26px; font-weight: 900;
  text-shadow: 0 2px 6px rgba(0,0,0,.6); pointer-events: none; z-index: 2; }
.ob-label small { display: block; font-size: 16px; font-weight: 700; margin-top: 6px; }
.ice { position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.55), transparent 40%),
    radial-gradient(circle at 75% 65%, rgba(255,255,255,.4), transparent 45%),
    linear-gradient(160deg, rgba(190,235,255,.94), rgba(120,190,240,.92));
  transition: opacity .15s; }
.ice svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ice .count { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 40px); text-align: center; font-size: 64px; font-weight: 900; color: #0a4f7a; }
.ice.hit { animation: icehit .12s; }
@keyframes icehit { 50% { transform: scale(1.02) rotate(.4deg); } }
#obstacles canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mice-layer { position: absolute; inset: 0; background: rgba(20,10,40,.35); }
.mouse { position: absolute; font-size: 64px; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center;
  transition: left 1.5s ease-in-out, top 1.5s ease-in-out; }
.mouse.dead { transition: transform .25s, opacity .25s; transform: scale(1.8) rotate(90deg); opacity: 0; }

/* ---------- служебное ---------- */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 20px); background: #fff; color: #23104f; border-radius: 16px; padding: 14px;
  font-weight: 800; text-align: center; z-index: 80; transform: translateY(calc(100% + 80px)); visibility: hidden; transition: transform .3s, visibility 0s .3s; }
.toast.show { transform: none; visibility: visible; transition: transform .3s; }
.conn { position: fixed; top: calc(var(--safe-top) + 8px); left: 16px; right: 16px; background: var(--pink); border-radius: 12px; padding: 10px; text-align: center; font-weight: 800; font-size: 14px; z-index: 90; }
.hidden { display: none !important; }
.screen-hint { font-size: 64px; margin-bottom: 14px; }
.mt { margin-top: 16px; } .mt2 { margin-top: 28px; }

/* ---------- аватары-фото ---------- */
.ava.photo { padding: 3px; overflow: hidden; }
.ava.photo img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
.ava-btn { display: flex; align-items: center; gap: 12px; width: 100%; margin: 10px 0 4px; padding: 12px 14px; border-radius: 16px;
  background: linear-gradient(90deg, rgba(255,59,107,.35), rgba(155,92,255,.35)); font-weight: 800; font-size: 16px; text-align: left; }
.ava-btn .ic { font-size: 28px; }

/* ---------- редактор аватара ---------- */
.av-root { position: fixed; inset: 0; z-index: 70; background: linear-gradient(160deg, #1a0d3d, #3a1260); display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 16px); overflow-y: auto; animation: in .25s; }
.av-head { display: flex; justify-content: space-between; align-items: center; font-size: 20px; }
.av-stage { position: relative; width: min(78vw, 300px); aspect-ratio: 1; margin: 8px auto 6px; flex-shrink: 0; }
.av-canvas { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 10px 30px rgba(0,0,0,.4); touch-action: none; background: #2a1458; }
.av-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; pointer-events: none; }
.av-hint { text-align: center; font-size: 13px; margin: 4px 0; }
.av-zoom { width: 100%; margin: 6px 0 2px; accent-color: #ffd84a; }
.av-label { font-weight: 800; font-size: 14px; color: var(--soft); margin: 10px 0 6px; }
.av-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.av-row .chip { flex-shrink: 0; }
.av-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 14px; }
.av-shoot { cursor: pointer; }

/* мини-игры */
.sort-item { font-size: 34px; padding: 34px 18px; margin: 14px 0 18px; }
.sort-btns { display: flex; gap: 12px; flex: 1; min-height: 160px; }
.sortbtn { flex: 1; border-radius: 26px; font-size: 40px; font-weight: 900; color: #fff; box-shadow: 0 7px 0 rgba(0,0,0,.3); }
.sortbtn:active { transform: translateY(4px); box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.sortbtn.no { background: var(--pink); }
.sortbtn.yes2 { background: var(--green); }
.lnk { display: flex; gap: 10px; }
.lnk-col { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.lnk-h { font-size: 12px; font-weight: 800; color: var(--soft); text-transform: uppercase; letter-spacing: 1px; }
.lnk-it { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 8px 10px; border-radius: 14px; background: var(--card); border: 3px solid transparent;
  font-weight: 800; font-size: 15px; text-align: left; line-height: 1.15; }
.lnk-it.sel { background: rgba(255,255,255,.2); }
.lnk-it i { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }

.scr.still, .scr.still .item { animation: none; }

/* бомбы */

.av-pick { margin-top: 6px; }
.av-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.av-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px 10px; border-radius: 18px; background: var(--card); border: 3px solid transparent; font-weight: 800; font-size: 13px; }
.av-tile canvas { width: 100%; max-width: 96px; aspect-ratio: 1; border-radius: 50%; }
.av-tile.on { border-color: var(--gold); background: rgba(255,216,74,.15); }

/* живая камера */
.av-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; transform: scaleX(-1); background: #000; }
.av-root.live .av-canvas { position: relative; background: transparent; }
.av-root.live .av-zoom, .av-root.live .av-hint, .av-root.live [data-row=warp], .av-root.live [data-row=tint],
.av-root.live .av-label.nolive { display: none; }
.av-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 120px; font-weight: 900; color: #fff;
  text-shadow: 0 6px 20px rgba(0,0,0,.6); animation: pop .3s ease-out; pointer-events: none; }
.av-status { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(0,0,0,.6); padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.av-root.live .nolive { display: none; }

/* результат: всплытие и конфетти */
.result { position: relative; overflow: visible; }
.result.pop { animation: pop .45s cubic-bezier(.2,1.6,.4,1); }
.confetti-box { position: absolute; left: 0; right: 0; top: 30%; height: 0; pointer-events: none; }
.confetti-box i { position: absolute; width: 10px; height: 6px; border-radius: 2px; animation: cfly 1.3s ease-out forwards; }
@keyframes cfly { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), -160px) rotate(540deg); opacity: 0; } }

/* ===== вёрстка подлянок (iPhone) ===== */
.top { flex-wrap: nowrap; }
.top .cat { min-width: 0; max-width: 60%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 6px; }
.top .gear { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.cardbtn { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 84px; text-align: left; animation: slideup .4s cubic-bezier(.2,1.3,.4,1) both; }
.cardbtn .ic { flex: 0 0 60px; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; font-size: 40px; line-height: 1; }
.cardbtn .ic.txt { font-size: 30px; font-weight: 900; color: var(--gold); background: rgba(0,0,0,.25); border-radius: 16px; }
.cardbtn .ct { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cardbtn .ct b { font-size: 20px; line-height: 1.15; }
.cardbtn .ct small { font-size: 14px; line-height: 1.3; color: var(--soft); font-weight: 600; overflow-wrap: anywhere; }
.cardbtn:active { transform: scale(.97); }
.prow.target { width: 100%; padding: 12px 14px; text-align: left; animation: slideup .35s ease-out both; }
.prow.target .tn { flex: 1; min-width: 0; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes slideup { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

/* ===== ещё анимации на телефоне ===== */
.answers .ans { animation: slideup .35s cubic-bezier(.2,1.3,.4,1) both; }
.answers .ans:nth-child(2) { animation-delay: .06s; } .answers .ans:nth-child(3) { animation-delay: .12s; } .answers .ans:nth-child(4) { animation-delay: .18s; }
.scr.still .answers .ans, .scr.still .cardbtn, .scr.still .prow.target { animation: none; }
.answers.done .ans.mine { animation: chosen .5s ease-out; }
@keyframes chosen { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
.catbtn { animation: slideup .4s cubic-bezier(.2,1.3,.4,1) both; }
.catbtn:nth-child(2) { animation-delay: .1s; } .catbtn:nth-child(3) { animation-delay: .2s; }
.catbtn:active, .btn:active, .sortbtn:active { transform: scale(.96); }
.screen-hint { animation: bobble 1.6s ease-in-out infinite; display: inline-block; }
@keyframes bobble { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
.me-head .ava { animation: bobble 2.4s ease-in-out infinite; }
.yes, .sortbtn { transition: transform .08s; }
.ladder i.on { animation: rungs .5s ease-out both; }
@keyframes rungs { from { transform: scaleX(0); } to { transform: none; } }

/* Заголовки и крупные кнопки — узкий PT Sans Narrow, как в мониторинге */
.logo, h1, h2, .big, .huge, .btn, .ans, .catbtn, .sortbtn, .yes, .item, .cardbtn b, .score, .nm, .me-head .nm, .av-head b, .av-count, .sort-item, .seg button, .badge {
  font-family: "PT Sans Narrow", "Arial Narrow", "PT Sans", sans-serif; font-weight: 700; }
.logo { letter-spacing: 2px; }

/* ===== альбомная ориентация телефона ===== */
#app { padding-left: calc(env(safe-area-inset-left, 0px) + 16px); padding-right: calc(env(safe-area-inset-right, 0px) + 16px); }
@media (orientation: landscape) and (max-height: 540px) {
  #app { padding-top: calc(var(--safe-top) + 8px); padding-bottom: calc(var(--safe-bottom) + 8px);
    padding-left: calc(env(safe-area-inset-left, 0px) + 14px); padding-right: calc(env(safe-area-inset-right, 0px) + 14px); }
  .top { margin-bottom: 6px; min-height: 34px; }
  .gear { width: 34px; height: 34px; font-size: 17px; }
  .tbar { height: 6px; margin-bottom: 8px; }
  .logo { font-size: 34px; }
  .big { font-size: 22px; }
  .huge { font-size: 42px; }
  .muted { font-size: 14px; }
  .screen-hint { font-size: 42px; margin-bottom: 6px; }
  .mt { margin-top: 10px; } .mt2 { margin-top: 14px; }
  .qtext { font-size: 17px; margin-bottom: 8px; }
  .pichint { margin: -4px 0 8px; padding: 5px 10px; font-size: 13px; }
  /* ответы — сеткой 2×2 */
  .answers { flex-direction: row; flex-wrap: wrap; gap: 10px; align-content: stretch; }
  .ans { flex: 1 1 calc(50% - 5px); min-height: 50px; max-height: none; padding: 8px 12px; font-size: 17px; }
  .ans .L { width: 32px; height: 32px; }
  /* карты подлянок и темы — в ряд */
  .cards { flex-direction: row; gap: 10px; }
  .cards > * { flex: 1 1 0; min-width: 0; }
  .cardbtn { min-height: 70px; padding: 12px; gap: 10px; }
  .cardbtn .ic { flex-basis: 46px; width: 46px; height: 46px; font-size: 32px; }
  .cardbtn .ct b { font-size: 18px; }
  .catbtn { padding: 18px 10px; font-size: 20px; min-height: 110px; }
  .plist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .prow.target { padding: 9px 12px; }
  .result { padding: 14px 24px; }
  .result .huge { font-size: 40px; }
  /* центрирование без вылезания вверх, если не помещается */
  .center { min-height: 0; justify-content: flex-start; }
  .center > :first-child { margin-top: auto; }
  .center > :last-child { margin-bottom: auto; }
  /* лобби: имя и цвета компактнее */
  .field { padding: 12px; font-size: 19px; }
  .colors { margin: 10px 0 12px; gap: 10px; }
  .color { width: 38px; height: 38px; }
  .btn { padding: 14px; font-size: 18px; }
  /* мини-игры */
  .item { padding: 12px; font-size: 24px; margin-top: 6px; }
  .yes { min-height: 110px; font-size: 44px; margin-top: 10px; }
  .sort-item { font-size: 24px; padding: 12px 14px; margin: 6px 0 10px; }
  .sort-btns { min-height: 90px; }
  .sortbtn { font-size: 30px; }
  .lnk-it { min-height: 40px; padding: 6px 9px; font-size: 14px; }
  .ladder { margin-top: 4px; }
  .ladder i { height: 7px; }
  /* редактор аватара */
  .av-root { padding: calc(var(--safe-top) + 8px) calc(env(safe-area-inset-right, 0px) + 14px) calc(var(--safe-bottom) + 10px) calc(env(safe-area-inset-left, 0px) + 14px); }
  .av-grid { grid-template-columns: repeat(7, 1fr); gap: 8px; }
  .av-tile { font-size: 11px; padding: 6px 2px 8px; }
  .av-stage { width: min(58vh, 230px); }
  .av-actions { flex-direction: row; }
  .av-actions > * { flex: 1; }
  .sheet { padding-left: calc(env(safe-area-inset-left, 0px) + 16px); padding-right: calc(env(safe-area-inset-right, 0px) + 16px); }
  .ob-label { top: calc(var(--safe-top) + 10px); font-size: 22px; }
}

/* ===== пакости на вариантах ответа ===== */
.answers { position: relative; }
.ans { position: relative; overflow: hidden; }
.ans .tx { position: relative; z-index: 1; }
.ans .eat { font-style: normal; color: rgba(255,255,255,.4); letter-spacing: 1px; }
.ob-hint { margin: -4px 0 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255,59,107,.22); font-weight: 800; font-size: 14px; text-align: center; animation: slideup .35s ease-out both; }
.cardbtn.bugs { background: rgba(160,120,60,.3); }

/* лёд: 2 тапа — сначала трещины, потом тает */
.ob-ice { position: absolute; inset: 0; z-index: 3; border-radius: inherit; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 25% 30%, rgba(255,255,255,.75), transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.5), transparent 40%),
    linear-gradient(135deg, rgba(200,240,255,.97), rgba(120,195,240,.95));
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.7); transition: opacity .25s; animation: icein .35s ease-out; }
.ob-ice b { font-size: 16px; color: #0a4f7a; background: rgba(255,255,255,.6); padding: 4px 10px; border-radius: 10px; }
.ob-ice.i2 { opacity: .88; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M100 30 L70 8 M100 30 L140 4 M100 30 L60 52 M100 30 L150 56' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E") center/100% 100% no-repeat, linear-gradient(135deg, rgba(200,240,255,.92), rgba(120,195,240,.88)); }
.ob-ice.i1 { opacity: .7; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M100 30 L70 8 M100 30 L140 4 M100 30 L60 52 M100 30 L150 56 M100 30 L20 30 M100 30 L185 26 M70 8 L52 2 M140 4 L160 14 M60 52 L40 44 M150 56 L170 46 M20 30 L6 18 M185 26 L196 40' stroke='white' stroke-width='2.5' fill='none'/%3E%3C/svg%3E") center/100% 100% no-repeat, linear-gradient(135deg, rgba(200,240,255,.75), rgba(120,195,240,.7)); }
.ob-ice.hit { animation: icehit2 .15s; }
@keyframes icehit2 { 50% { transform: scale(1.04) rotate(.6deg); } }
@keyframes icein { from { transform: scale(1.15); opacity: 0; } to { transform: none; opacity: 1; } }

/* слизь: 2 мазка пальцем */
.ans.slimy { touch-action: none; }
.ob-slime { position: absolute; inset: -4px; z-index: 2; display: flex; align-items: center; justify-content: center; border-radius: inherit;
  background:
    radial-gradient(circle at 15% 40%, #8ee04a 0 18%, transparent 19%),
    radial-gradient(circle at 45% 70%, #6fcf2c 0 22%, transparent 23%),
    radial-gradient(circle at 75% 35%, #93e655 0 20%, transparent 21%),
    radial-gradient(circle at 92% 80%, #5fbf22 0 16%, transparent 17%),
    rgba(96,200,40,.93);
  animation: slimein .4s cubic-bezier(.3,1.6,.5,1); }
.ob-slime.s2 { opacity: .78; filter: saturate(.85); }
.ob-slime.s1 { opacity: .48; filter: saturate(.7); }
.ob-slime b { font-size: 15px; color: #173d00; background: rgba(255,255,255,.55); padding: 4px 10px; border-radius: 10px; }
@keyframes slimein { from { transform: scaleY(0); transform-origin: top; } to { transform: none; } }

/* буквоеды ползают по кнопке */
.ob-bugs { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ob-bugs i { position: absolute; font-style: normal; font-size: 18px; animation: crawl 3.2s linear infinite; }
.ob-bugs i:nth-child(1) { top: 2px; animation-delay: 0s; }
.ob-bugs i:nth-child(2) { bottom: 2px; animation-delay: -1.1s; animation-direction: reverse; }
.ob-bugs i:nth-child(3) { top: 40%; animation-delay: -2.2s; animation-duration: 4s; }
@keyframes crawl { from { left: -24px; } to { left: 100%; } }

/* бомба и блокировка */
.ans.exploded { animation: boomshake .5s; }
.ans.exploded::after { content: ''; position: absolute; inset: 0; z-index: 4; background: radial-gradient(circle, #fff 0, #ffd84a 25%, #ff6a00 50%, rgba(80,20,0,.8) 75%); animation: boomflash .6s ease-out forwards; }
@keyframes boomflash { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: scale(1.6); } }
@keyframes boomshake { 0%,100% { transform: none; } 20% { transform: translate(-8px, 4px) rotate(-2deg); } 40% { transform: translate(8px, -4px) rotate(2deg); } 60% { transform: translate(-6px, 2px); } 80% { transform: translate(5px, -2px); } }
.ob-lock { position: absolute; inset: -6px; z-index: 6; border-radius: 20px; background: rgba(30,8,12,.82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; animation: in .15s; }
.ob-lock .boom { font-size: 54px; animation: pop .3s ease-out; }
.ob-lock b { font-size: 40px; font-weight: 900; color: #ffd84a; font-family: "PT Sans Narrow", sans-serif; }
.ob-lock small { font-size: 15px; color: #fff; font-weight: 700; }
.ans.nope { animation: shake .35s; }

/* ===== эффекты льда и слизи ===== */
.ob-ice.hit { animation: icehit2 .18s !important; }
.ob-slime b { opacity: 0; transition: opacity .2s; }
.ob-slime b.on { opacity: 1; }
.ice-chip { position: absolute; z-index: 5; width: 9px; height: 9px; margin: -4px 0 0 -4px; background: #eaf8ff; border-radius: 2px;
  box-shadow: 0 0 4px rgba(255,255,255,.9); pointer-events: none; animation: chipfly .6s ease-out forwards; }
@keyframes chipfly { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
.shards { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.shards i { position: absolute; inset: 0; border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.8), transparent 40%), linear-gradient(135deg, rgba(210,243,255,.97), rgba(120,195,240,.95));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.8); animation: shardfall .75s cubic-bezier(.4,0,.8,.6) forwards; }
@keyframes shardfall { 0% { transform: none; opacity: 1; } 15% { transform: translate(calc(var(--dx) * .15), -6px) rotate(calc(var(--rot) * .2)); }
  100% { transform: translate(var(--dx), 160px) rotate(var(--rot)); opacity: 0; } }
.smear { position: absolute; left: -10%; width: 120%; height: 32px; z-index: 3; pointer-events: none; border-radius: 16px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: smear .6s ease-out forwards; }
@keyframes smear { from { transform: scaleX(.2); opacity: 1; } to { transform: none; opacity: 0; } }
.slime-off { position: absolute; inset: -4px; z-index: 3; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at 30% 40%, #8ee04a 0 20%, transparent 21%), radial-gradient(circle at 70% 60%, #6fcf2c 0 22%, transparent 23%), rgba(96,200,40,.6);
  animation: slideoff .75s ease-in forwards; }
@keyframes slideoff { to { transform: translateY(120%) scaleY(1.4); opacity: 0; } }

.cardbtn.bet { background: rgba(255,216,74,.18); }
.betres { margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: var(--card); font-weight: 700; font-size: 16px; }
.betres.win { background: rgba(255,216,74,.22); color: #ffd84a; }

/* =====================================================================
   v3: живее и отзывчивее
   ===================================================================== */
/* Живой фон: медленно плывущие пятна света (только transform — дёшево для GPU) */
/* Пятна маленькие и растянуты transform'ом: размытому градиенту чёткость не нужна, а видеопамяти — в 6 раз меньше */
body::before, body::after { content: ''; position: fixed; z-index: 0; pointer-events: none; width: 48vmax; height: 48vmax; border-radius: 50%; will-change: transform; }
body::before { left: -24vmax; top: -14vmax; background: radial-gradient(circle, rgba(255,59,107,.28), rgba(255,59,107,0) 60%); transform: scale(2.5); animation: bgdrift1 22s ease-in-out infinite alternate; }
body::after { right: -24vmax; bottom: -24vmax; background: radial-gradient(circle, rgba(34,184,255,.22), rgba(34,184,255,0) 60%); transform: scale(2.5); animation: bgdrift2 27s ease-in-out infinite alternate; }
@keyframes bgdrift1 { from { transform: scale(2.5); } to { transform: translate(18vmax, 14vmax) scale(2.75); } }
@keyframes bgdrift2 { from { transform: scale(2.5); } to { transform: translate(-16vmax, -12vmax) scale(2.9); } }
#app { z-index: 1; }
.haptic { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; clip-path: inset(50%); }
#app { overflow-x: hidden; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }

/* Вход нового экрана — только при смене фазы */
.scr { animation: none; }
.scr.enter { animation: scrin .38s cubic-bezier(.2,1,.3,1) both; }
@keyframes scrin { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

/* Пружинящие кнопки */
.btn, .ans, .catbtn, .cardbtn, .prow.target, .sortbtn, .chip, .seg button, .lnk-it, .gear, .ava-btn, .color, .yes {
  transition: transform .22s cubic-bezier(.3,1.7,.5,1), box-shadow .2s, opacity .25s, filter .25s, background-color .2s;
}
.btn:active, .catbtn:active, .cardbtn:active, .prow.target:active, .sortbtn:active, .chip:active, .seg button:active, .lnk-it:active, .gear:active, .ava-btn:active, .yes:active {
  transform: scale(.95); transition-duration: .06s;
}
.pressed { animation: pressed .3s cubic-bezier(.3,1.7,.5,1); }
@keyframes pressed { 40% { transform: scale(.93); } }
.ans.down { transform: scale(.965); transition-duration: .06s; }
.btn.big-btn { font-size: 22px; padding: 20px; }

/* Таймер: плавный (transform), краснеет и пульсирует на последних секундах */
.tbar i { width: 100%; transform-origin: 0 50%; will-change: transform; background: linear-gradient(90deg, var(--gold), #ffe98a); transition: background .3s; }
.tbar.hot i { background: linear-gradient(90deg, #ff3b6b, #ff7a1a); }
.tbar.hot { animation: tbhot .5s ease-in-out infinite alternate; }
@keyframes tbhot { to { box-shadow: 0 0 14px rgba(255,59,107,.7); } }

/* Счёт подпрыгивает, когда растёт */
.score { display: inline-block; min-width: 2ch; text-align: right; }
.score.bump { animation: bump .6s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 30% { transform: scale(1.45); color: #fff; text-shadow: 0 0 12px var(--gold); } }

.big.ready { animation: ready 1s ease-in-out infinite alternate; }
@keyframes ready { to { transform: scale(1.06); color: var(--gold); } }
.done-note { text-align: center; animation: slideup .35s ease-out both; }

/* После ответа: выбранный вариант светится, остальные уходят на второй план */
.answers.done .ans { opacity: .22; transform: scale(.96); filter: saturate(.4); }
.answers.done .ans.mine { opacity: 1; transform: scale(1.02); filter: none; box-shadow: 0 0 0 4px #fff, 0 0 26px rgba(255,255,255,.45); animation: chosen .5s cubic-bezier(.3,1.7,.5,1); }
.answers .ans { touch-action: none; }

/* ---------- смена имени ---------- */
.me-head .gear.edit { width: 40px; height: 40px; font-size: 18px; flex-shrink: 0; }
.sheet .field { margin-top: 6px; }
.sheet .colors { margin: 6px 0 4px; }
.color.taken { opacity: .2; }
.sheet-bg { animation: fadein .2s ease-out; }
.sheet { animation: sheetup .3s cubic-bezier(.2,1,.3,1); }
@keyframes fadein { from { opacity: 0; } }
@keyframes sheetup { from { transform: translateY(100%); } }

/* ---------- лёд ---------- */
.ob-ice { z-index: 4; animation: icein .35s ease-out; overflow: hidden; }
.ob-ice .cracks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ob-ice .crk { fill: none; stroke: rgba(255,255,255,.95); stroke-width: 1.1; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 400; stroke-dashoffset: 400; animation: crkdraw .22s ease-out forwards; filter: drop-shadow(0 0 2px rgba(120,200,255,.9)); }
.ob-ice .crk-dot { fill: rgba(255,255,255,.9); }
@keyframes crkdraw { to { stroke-dashoffset: 0; } }
/* Лёд полупрозрачный: ответ сквозь него угадывается, но нажать нельзя, пока не разобьёшь */
.ob-ice.i3, .ob-ice.i2, .ob-ice.i1 { opacity: 1; -webkit-backdrop-filter: blur(1.6px); backdrop-filter: blur(1.6px); }
.ob-ice.i3 { background:
    radial-gradient(circle at 25% 30%, rgba(255,255,255,.55), transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.35), transparent 40%),
    linear-gradient(135deg, rgba(205,242,255,.8), rgba(130,200,240,.74)); }
.ob-ice.i2 { background:
    radial-gradient(circle at 25% 30%, rgba(255,255,255,.45), transparent 35%),
    linear-gradient(135deg, rgba(205,242,255,.66), rgba(130,200,240,.6)); }
.ob-ice.i1 { background:
    radial-gradient(circle at 25% 30%, rgba(255,255,255,.35), transparent 35%),
    linear-gradient(135deg, rgba(205,242,255,.5), rgba(130,200,240,.44)); }
.ob-ice.hit { animation: icehit3 .16s ease-out !important; }
@keyframes icehit3 { 0% { transform: none; } 30% { transform: scale(1.03) rotate(.8deg); } 60% { transform: scale(.99) rotate(-.5deg); } 100% { transform: none; } }
.ob-ice.regrow { animation: icein .4s ease-out !important; }
.ans.icy { touch-action: none; }
.ice-chip { width: 10px; height: 10px; z-index: 6; }

/* ---------- слизь: холст ---------- */
.slime-cv { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; border-radius: inherit; pointer-events: none;
  filter: drop-shadow(0 3px 0 rgba(30,80,0,.45)); animation: slimein .45s cubic-bezier(.3,1.6,.5,1); }
.slime-cv.splat { animation: slimein .45s cubic-bezier(.3,1.6,.5,1); }
.slime-hint { position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
  background: rgba(255,255,255,.88); color: #173d00; font-weight: 800; font-size: 15px; padding: 5px 12px; border-radius: 12px; white-space: nowrap; }
.slime-hint.pop { animation: hintpop 1.4s ease-out forwards; }
@keyframes hintpop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.slime-drop { position: absolute; z-index: 6; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50% 50% 50% 0; background: #7be03a; pointer-events: none;
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.15); animation: dropfly .6s cubic-bezier(.3,.6,.6,1) forwards; }
@keyframes dropfly { to { transform: translate(var(--dx), 70px) rotate(45deg) scale(.5); opacity: 0; } }
.ans.slimy { touch-action: none; }

/* ---------- буквоеды: буквы исчезают по одной ---------- */
.ans .eat { position: relative; font-style: normal; color: inherit; letter-spacing: 0; animation: chomp .25s steps(1) forwards; }
.ans .eat::after { content: '•'; position: absolute; left: 50%; top: 0; transform: translateX(-50%); color: rgba(255,255,255,.45); opacity: 0;
  animation: dotin .25s ease-out forwards; animation-delay: inherit; }
@keyframes chomp { to { color: transparent; } }
@keyframes dotin { to { opacity: 1; } }

/* ---------- бомба ---------- */
.ob-lock.out { animation: fadeout .2s forwards; }
@keyframes fadeout { to { opacity: 0; } }
body.quake #app { animation: quake .45s; }
@keyframes quake { 0%,100% { transform: none; } 15% { transform: translate(-7px, 4px); } 30% { transform: translate(6px, -5px); } 45% { transform: translate(-5px, -3px); } 60% { transform: translate(4px, 4px); } 75% { transform: translate(-2px, 1px); } }

/* Результаты появляются с пружинкой */
.result.pop .huge { animation: hugepop .6s cubic-bezier(.3,1.8,.5,1) both; animation-delay: .1s; }
@keyframes hugepop { from { transform: scale(.3); opacity: 0; } }
.huge.pop { animation: hugepop .6s cubic-bezier(.3,1.8,.5,1) both; }
.screen-hint { will-change: transform; }

/* Списки игроков и кнопки въезжают по очереди */
.plist .prow { animation: slideup .3s ease-out both; }
.catbtn:nth-child(1) { animation-delay: 0s; }
