:root {
  --bg: #14122a;
  --bg2: #1d1a3a;
  --card: #26224b;
  --card2: #2f2a5c;
  --line: #3a3470;
  --ink: #f6f3ff;
  --muted: #a7a1cf;
  --yellow: #ffd23f;
  --yellow-d: #e0a800;
  --red: #ff4545;
  --green: #3ddc78;
  --green-d: #1f9e50;
  --orange: #ff8a1f;
  --purple: #43206a;
  --paper: #fffaf0;
  --paper-ink: #2b2240;
  --r: 16px;
  --shadow: 0 4px 0 rgba(0,0,0,.35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.35 Rubik, system-ui, sans-serif; }
body { max-width: 520px; margin: 0 auto; padding-bottom: calc(28px + env(safe-area-inset-bottom)); overflow-x: hidden; user-select: none; -webkit-user-select: none; }
button { font: inherit; cursor: pointer; color: inherit; }
b, h2, h3, h4 { font-weight: 700; }

/* ---------- HUD ---------- */
.hud { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 1fr 1fr 1.35fr 34px; gap: 6px; padding: 8px 10px 6px; background: linear-gradient(#0e0c1f, #0e0c1fee); backdrop-filter: blur(6px); }
.pill { position: relative; display: flex; align-items: center; gap: 6px; background: #000; border: 2px solid #2b2752; border-radius: 12px; padding: 5px 8px; overflow: hidden; min-width: 0; }
.pill .ico { font-size: 16px; }
.pill small { display: block; font-size: 9px; letter-spacing: .08em; color: var(--muted); }
.pill b { display: block; font: 18px/1.05 'Russo One', sans-serif; color: var(--yellow); white-space: nowrap; }
.pill b.danger { color: var(--red); animation: pulse 1s infinite; }
.pill-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #1a1733; }
.pill-bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .6s; }
.pill.bump b { animation: bump .5s; }
.sound { border: 0; background: #000; border-radius: 12px; font-size: 16px; border: 2px solid #2b2752; padding: 0; }
@media (max-width: 430px) {
  .hud { grid-template-columns: .8fr .85fr 1.35fr 30px; gap: 5px; padding: 6px 8px 5px; }
  .pill { padding: 5px 7px; }
  .pill .ico { display: none; }
  .pill b { font-size: 16px; }
  .act { padding: 7px 6px; gap: 4px; }
  .act-ico { font-size: 20px; }
  .act b { font-size: 14px; }
}
.dayline { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.daybar { flex: 1; height: 5px; background: #2a2650; border-radius: 3px; overflow: hidden; }
.daybar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--yellow)); border-radius: 3px; }
@keyframes bump { 40% { transform: scale(1.2); color: #fff; } }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Scene ---------- */
.scene { position: relative; margin: 4px 10px 0; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 2px #000, var(--shadow); }
#house { display: block; width: 100%; height: auto; }
.win { cursor: pointer; }
.win:active { filter: brightness(1.4); }
.cloud { animation: drift linear infinite; }
@keyframes drift { from { transform: translateX(-120px); } to { transform: translateX(480px); } }
.drip { animation: drip 1.3s infinite ease-in; }
@keyframes drip { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }
.rain line { animation: rain .55s linear infinite; }
@keyframes rain { from { transform: translateY(-40px); } to { transform: translateY(420px); } }
.twinkle { animation: twinkle 2.4s infinite alternate; }
@keyframes twinkle { to { opacity: .2; } }
.bob { animation: bob 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.pop { animation: popin .6s cubic-bezier(.2,1.6,.4,1); transform-box: fill-box; transform-origin: center; }
@keyframes popin { from { transform: scale(.2); } to { transform: scale(1); } }
.walker { animation: walk 2.6s linear forwards; }
@keyframes walk { 0% { transform: translateX(0); opacity: 0; } 10% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(var(--dx)); opacity: 0; } }
.legs { animation: legs .3s steps(2) infinite; }
@keyframes legs { 50% { transform: translateY(-1.5px); } }
.spark { animation: spark .25s steps(2) infinite; }
@keyframes spark { 50% { opacity: 0; } }
.lamp-glow { animation: glow 3s ease-in-out infinite alternate; }
@keyframes glow { to { opacity: .5; } }

.nina-say { display: flex; align-items: center; gap: 8px; padding: 8px; background: #0e0c1f; border-top: 2px solid #000; min-height: 68px; }
.nina-say .bubble { max-width: none; flex: 1; }
.nina-ava { pointer-events: auto; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #000; background: #ffe7c2; padding: 0; overflow: hidden; box-shadow: var(--shadow); }
.nina-ava svg { width: 100%; height: 100%; display: block; }
.bubble { pointer-events: auto; position: relative; background: var(--paper); color: var(--paper-ink); border: 2px solid #000; border-radius: 14px 14px 14px 4px; padding: 7px 10px; font-size: 13px; line-height: 1.25; max-width: 78%; box-shadow: var(--shadow); animation: say .35s ease-out; }
.bubble b { color: #c0182a; }
@keyframes say { from { transform: translateY(8px) scale(.95); opacity: 0; } }

/* ---------- Actions ---------- */
.actions { display: flex; gap: 8px; padding: 10px 10px 4px; }
.act { flex: 1; display: flex; align-items: center; gap: 6px; border: 2px solid #000; border-radius: 14px; padding: 8px 8px; text-align: left; box-shadow: var(--shadow); transition: transform .08s; min-width: 0; }
.act:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.act:disabled { filter: grayscale(.8) brightness(.6); }
.act-ico { font-size: 24px; }
.act b { display: block; font-size: 15px; white-space: nowrap; }
.act small { display: block; font-size: 10.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act span:last-child { min-width: 0; }
.act-green { background: var(--green); color: #062a14; }
.act-green.ready { animation: wiggle 2.2s infinite; }
.act-yellow { background: var(--yellow); color: #2a1f00; }
.act-pie { flex: 0 0 auto; background: linear-gradient(135deg, #ffb36b, #ff7a3d); color: #3a1300; animation: wiggle 1.8s infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-3deg); } 90% { transform: rotate(3deg); } 95% { transform: rotate(-2deg); } }
.flatstat { display: flex; gap: 6px; padding: 4px 10px 10px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.flatstat span { background: var(--bg2); border-radius: 8px; padding: 3px 7px; }
.flatstat i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; border: 1px solid #000; }

/* ---------- Tabs ---------- */
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 0 10px; }
.tabs button { position: relative; border: 0; background: var(--bg2); color: var(--muted); padding: 7px 2px 6px; border-radius: 12px 12px 0 0; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tabs button span { font-size: 18px; filter: grayscale(.6); }
.tabs button.active { background: var(--card); color: var(--ink); font-weight: 500; }
.tabs button.active span { filter: none; }
.badge { position: absolute; top: 3px; right: 6px; min-width: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font: 700 10.5px/17px Rubik; font-style: normal; }
.badge-gold { background: var(--yellow); color: #000; }
main { margin: 0 10px; background: var(--card); border-radius: 0 0 var(--r) var(--r); padding: 12px; min-height: 260px; }
.tab { display: none; }
.tab.active { display: block; animation: fadein .25s; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.section-title { font: 15px 'Russo One', sans-serif; margin: 14px 0 8px; color: var(--ink); }
.section-title:first-child { margin-top: 0; }

/* ---------- Notebook ---------- */
.notebook { background: var(--paper); color: var(--paper-ink); border-radius: 12px; padding: 12px 12px 6px 38px; position: relative; box-shadow: var(--shadow);
  background-image: repeating-linear-gradient(transparent 0 29px, #d7e0f5 29px 30px); }
.notebook::before { content: ''; position: absolute; left: 27px; top: 0; bottom: 0; width: 2px; background: #f19a9a; }
.notebook::after { content: ''; position: absolute; left: 8px; top: 14px; bottom: 14px; width: 8px; background: radial-gradient(circle, #14122a 3px, transparent 3.5px) 0 0 / 8px 26px repeat-y; }
.nb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.nb-title { font: 700 24px/1 'Caveat', 'Russo One', sans-serif; margin: 0; color: #2a3a8a; }
.nb-head small { color: #8a8299; font-size: 11px; }
.nb-item { display: flex; align-items: center; gap: 8px; min-height: 60px; border-bottom: 1px dashed #d9cfb0; padding: 7px 0; }
.nb-item:last-child { border-bottom: 0; }
.nb-num { width: 26px; text-align: center; font: 20px 'Russo One', sans-serif; color: #7b6fa0; }
.nb-item.done .nb-num { color: var(--green-d); font-size: 24px; }
.nb-main { flex: 1; min-width: 0; }
.nb-main b { display: block; font-size: 15px; }
.nb-main small { display: block; color: #6b6385; font-size: 12px; }
.nb-item.done b { text-decoration: line-through; text-decoration-color: var(--green-d); text-decoration-thickness: 2px; }
.nb-item .btn { padding: 8px 10px; font-size: 13px; }
.price { color: #c0182a; font-weight: 700; }
.progress { height: 7px; background: #ece3c6; border-radius: 4px; overflow: hidden; margin-top: 5px; }
.progress i { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--orange) 0 6px, #ffa64d 6px 12px); background-size: 17px 17px; animation: stripes .6s linear infinite; }
@keyframes stripes { to { background-position: 17px 0; } }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: #ece3c6; color: #6b5a1a; margin-top: 3px; }

.btn { border: 2px solid #000; border-radius: 12px; padding: 10px 14px; font-weight: 700; color: #1a1530; background: var(--ink); white-space: nowrap; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: .45; }
.btn-yellow { background: var(--yellow); }
.btn-green { background: var(--green); }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: #5a5490; box-shadow: none; }
.btn-star { background: linear-gradient(135deg, #ffe066, #ff9a2f); }
.btn-blue { background: #59b7ff; }

.fork { margin-top: 12px; background: radial-gradient(circle at 50% 0, #6a35a8, var(--purple)); border: 2px solid #000; border-radius: 14px; padding: 14px 12px; color: #fff; box-shadow: var(--shadow); }
.fork h3 { margin: 0 0 4px; font: 22px 'Russo One', sans-serif; text-align: center; letter-spacing: .02em; }
.fork p { margin: 0 0 12px; text-align: center; font-size: 13px; color: #e1d2fa; }
.fork-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fork-card { background: #fff; color: var(--paper-ink); border: 2px solid #000; border-radius: 12px; padding: 10px 8px; text-align: center; box-shadow: var(--shadow); }
.fork-card:active { transform: translateY(2px); }
.fork-card .num { font: 30px 'Russo One', sans-serif; color: var(--purple); line-height: 1; }
.fork-card .big { font-size: 30px; }
.fork-card b { display: block; margin-top: 2px; }
.fork-card small { display: block; color: #6b6385; margin: 4px 0; min-height: 44px; font-size: 11.5px; }

.shop { margin-top: 14px; display: grid; gap: 8px; }
.shop-row { display: flex; align-items: center; gap: 10px; background: var(--bg2); border-radius: 12px; padding: 10px; border: 1px solid var(--line); }
.shop-row .ico { font-size: 24px; }
.shop-row div { flex: 1; font-size: 12px; color: var(--muted); }
.shop-row b { display: block; font-size: 14px; color: var(--ink); }
.stats { margin-top: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.stat { background: var(--bg2); border-radius: 10px; padding: 7px 9px; font-size: 11px; color: var(--muted); }
.stat b { display: block; font-size: 15px; color: var(--ink); }
.comfort { height: 6px; border-radius: 3px; background: #14122a; margin-top: 4px; overflow: hidden; }
.comfort i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--yellow), var(--green)); }

/* ---------- Events ---------- */
.ev { position: relative; background: var(--bg2); border: 2px solid #000; border-radius: 14px; padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow); overflow: hidden; }
.ev::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--red); }
.ev-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.ev-ico { font-size: 30px; width: 44px; height: 44px; display: grid; place-items: center; background: #000; border-radius: 12px; }
.ev h4 { margin: 0; font: 16px 'Russo One', sans-serif; }
.ev p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.ev .row { display: grid; gap: 7px; }
.ev .row .btn { width: 100%; font-size: 13px; text-align: left; white-space: normal; }
.ev .timer { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: #ffb0b0; font-size: 11.5px; }
.ev .timer i { flex: 1; height: 4px; background: #14122a; border-radius: 2px; overflow: hidden; }
.ev .timer i i { display: block; height: 100%; background: var(--red); }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; }
.empty .big { font-size: 44px; display: block; margin-bottom: 6px; }

/* ---------- Goals ---------- */
.goals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.goal { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 9px; font-size: 12px; color: var(--muted); position: relative; }
.goal b { display: block; color: var(--ink); font-size: 13px; }
.goal .rw { display: inline-block; margin-top: 5px; font-weight: 700; color: var(--yellow); }
.goal.done { background: linear-gradient(135deg, #2f5a3c, #1f3f2a); border-color: var(--green-d); }
.goal.done::after { content: '✔'; position: absolute; right: 8px; top: 6px; color: var(--green); font-weight: 800; }
.goal .medal { font-size: 22px; filter: grayscale(1) opacity(.5); }
.goal.done .medal { filter: none; }
.pie-card { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #5a2f14, #3a1e10); border: 2px solid #000; border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
.pie-card .ico { font-size: 34px; }
.pie-card div { flex: 1; font-size: 12px; color: #f3d6bd; }
.pie-card b { display: block; font-size: 15px; color: #fff; }
.streak { display: flex; gap: 4px; margin-top: 5px; }
.streak i { width: 16px; height: 16px; border-radius: 50%; background: #2a160b; border: 1px solid #000; font-size: 9px; display: grid; place-items: center; font-style: normal; }
.streak i.on { background: #ffb36b; }

/* ---------- Log / Top ---------- */
.log-item { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; gap: 8px; }
.log-item span { color: var(--muted); min-width: 46px; font-size: 11px; padding-top: 2px; }
.log-item.good { color: #b5f5cb; }
.log-item.bad { color: #ffc0c0; }
.top-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.top-row .pos { width: 28px; text-align: center; font: 16px 'Russo One', sans-serif; color: var(--muted); }
.top-row:nth-child(1) .pos { color: #ffd23f; } .top-row:nth-child(2) .pos { color: #d8d8e8; } .top-row:nth-child(3) .pos { color: #e09a5a; }
.top-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-row .days { color: var(--green); font-weight: 700; }
.hint { margin-top: 10px; font-size: 11px; color: var(--muted); text-align: center; }

/* ---------- FX / stamp / toast ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 25; overflow: hidden; }
.fly { position: absolute; font-size: 22px; transition: transform .75s cubic-bezier(.5,-0.3,.7,1), opacity .75s; }
.float-num { position: absolute; font: 22px 'Russo One', sans-serif; color: var(--yellow); text-shadow: 0 2px 0 #000; animation: floatup 1.2s ease-out forwards; }
@keyframes floatup { to { transform: translateY(-60px); opacity: 0; } }
.confetti { position: absolute; top: -12px; width: 9px; height: 14px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.stamp { position: fixed; left: 50%; top: 36%; z-index: 30; pointer-events: none; font: 42px/1 'Russo One', sans-serif; padding: 10px 18px; border: 6px solid currentColor; border-radius: 12px; color: var(--red);
  background: rgba(0,0,0,.2); text-align: center; white-space: nowrap; animation: stamp 1.1s ease-out forwards; mix-blend-mode: normal; }
.stamp.green { color: var(--green); } .stamp.yellow { color: var(--yellow); }
@keyframes stamp { 0% { transform: translate(-50%,-50%) rotate(-12deg) scale(3); opacity: 0; } 22% { transform: translate(-50%,-50%) rotate(-12deg) scale(.92); opacity: 1; } 32% { transform: translate(-50%,-50%) rotate(-12deg) scale(1); } 85% { opacity: 1; } 100% { transform: translate(-50%,-50%) rotate(-12deg) scale(1); opacity: 0; } }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40; max-width: 496px; margin: 0 auto; background: #000; color: #fff; border: 2px solid #3a3470; border-left: 6px solid var(--red); border-radius: 12px; padding: 12px 14px; font-size: 14px; animation: say .25s; }
.toast.good { border-left-color: var(--green); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(10,8,25,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; gap: 12px; animation: fadein .3s; }
.overlay h2 { font: 34px/1.05 'Russo One', sans-serif; margin: 0; }
.overlay p { color: var(--muted); margin: 0; max-width: 330px; }
.overlay .btn { min-width: 240px; font-size: 15px; }
.intro-art { width: 220px; height: 220px; }
.intro-text { font: 24px/1.2 'Russo One', sans-serif; max-width: 320px; min-height: 90px; }
.intro-text em { font-style: normal; color: var(--yellow); }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #3a3470; }
.dots i.on { background: var(--yellow); }

/* mini-game */
.mini { width: 100%; max-width: 360px; }
.mini h3 { margin: 0 0 4px; font: 22px 'Russo One', sans-serif; }
.mini-field { position: relative; width: 100%; aspect-ratio: 1 / 1.1; border: 3px solid #000; border-radius: 16px; overflow: hidden; margin: 10px 0; touch-action: manipulation;
  background: repeating-linear-gradient(0deg, #8e5a3e 0 14px, #7a4a31 14px 15px), #8e5a3e; }
.mini-field.roof { background: repeating-linear-gradient(90deg, #4b4560 0 22px, #3d3850 22px 24px); }
.mini-field.cable { background: #2b2b38; }
.target { position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px; border: 0; background: none; font-size: 38px; padding: 0; animation: popin .3s cubic-bezier(.2,1.6,.4,1), wob 1s infinite .3s; }
@keyframes wob { 50% { transform: scale(1.1); } }
.target.fixed { animation: none; transform: scale(.9); filter: grayscale(1); opacity: .5; pointer-events: none; }
.mini-bar { height: 10px; background: #000; border-radius: 5px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--yellow)); width: 100%; }
.mini-count { font: 18px 'Russo One', sans-serif; color: var(--yellow); }

/* ---------- Итог решения / пока тебя не было ---------- */
.result-card { position: relative; width: 100%; max-width: 360px; background: var(--paper); color: var(--paper-ink); border: 3px solid #000; border-radius: 18px; padding: 22px 16px 16px; box-shadow: 0 6px 0 rgba(0,0,0,.4); animation: popin .35s cubic-bezier(.2,1.5,.4,1); text-align: center; }
.result-card.good { border-top: 8px solid var(--green); }
.result-card.bad { border-top: 8px solid var(--red); }
.result-card h3 { margin: 4px 0 6px; font: 22px 'Russo One', sans-serif; }
.result-card p { color: #4a4060; margin: 8px auto 12px; }
.result-card .btn { width: 100%; min-width: 0; }
.res-ico { font-size: 44px; line-height: 1; }
.res-kicker { display: block; font-weight: 800; letter-spacing: .2em; color: #8a8299; font-size: 11px; margin-top: 6px; }
.res-choice { display: inline-block; background: #ece3c6; border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 500; }
.res-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.res-rows > div { background: #fff; border: 2px solid #000; border-radius: 12px; padding: 8px; }
.res-rows small { display: block; font-size: 11px; color: #8a8299; }
.res-rows b { font: 20px 'Russo One', sans-serif; }
.pos { color: var(--green-d); }
.neg { color: #d02030; }
.nina-ava.big { width: 76px; height: 76px; margin: -52px auto 4px; border-radius: 50%; border: 3px solid #000; overflow: hidden; background: #ffe7c2; }
.nina-ava.big svg { width: 100%; height: 100%; display: block; }
.away-list { display: grid; gap: 6px; text-align: left; margin-bottom: 14px; max-height: 40vh; overflow: auto; }
.away-list > div { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #d9cfb0; border-radius: 10px; padding: 7px 10px; font-size: 13px; }
.away-list span { flex: 1; }
.away-list b { font: 16px 'Russo One', sans-serif; }
.away-ev { background: #fff4f0 !important; }

/* ---------- Голосование в тетрадке ---------- */
.vote { margin-top: 12px; background: radial-gradient(circle at 50% 0, #6a35a8, var(--purple)); border: 2px solid #000; border-radius: 14px; padding: 14px 12px; color: #fff; text-align: center; box-shadow: var(--shadow); }
.vote h3 { margin: 0 0 4px; font: 22px 'Russo One', sans-serif; }
.vote p { margin: 0 0 12px; font-size: 13px; color: #e1d2fa; }
.vote .fork-card { opacity: .95; }
.vote .live { display: inline-block; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; border-radius: 6px; padding: 2px 8px; margin-bottom: 8px; animation: pulse 1.4s infinite; }
.lock { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; color: #7b3fbf; background: #efe4ff; border-radius: 6px; padding: 2px 7px; }
.winner { display: inline-block; font-size: 10px; font-weight: 800; color: #fff; background: #7b3fbf; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }

.pill.paused { border-color: var(--yellow); }
.pill.paused b { color: #fff; }
.pause-note { background: #00000055; border-radius: 10px; padding: 8px; color: var(--yellow) !important; font-weight: 500; }

/* ---------- мини-игры ---------- */
.games-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.games-head b { display: block; color: var(--ink); font: 16px 'Russo One', sans-serif; margin-bottom: 2px; }
.tix-box { text-align: center; flex: none; }
.tix-box small { display: block; font-size: 10.5px; margin-top: 3px; }
.tix { display: inline-flex; gap: 4px; }
.tix i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #000; background: #3a3470; }
.tix i.on { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.game-card { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.game-card .ico { font-size: 34px; flex: none; }
.game-card > div { flex: 1; min-width: 0; }
.game-card b { display: block; color: var(--ink); font-size: 14.5px; }
.game-card small { display: block; color: var(--yellow); margin-top: 2px; }
.mini-field.game-pies { background: linear-gradient(#2d2a58, #4a3a2a); }
.mini-field.game-lamps, .mini-field.game-keys { background: #8a4b35; display: flex; align-items: center; justify-content: center; padding: 12px; }
.lamps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; height: 100%; }
.lamp { border: 3px solid #000; border-radius: 6px; background: #1b1838; box-shadow: inset 0 0 0 4px #5a3a2a; transition: background .1s, box-shadow .1s; }
.lamp.on { background: #ffe680; box-shadow: inset 0 0 0 4px #5a3a2a, 0 0 22px #ffd23f; }
.lamp.bad { background: var(--red); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; height: 100%; }
.card { border: 2px solid #000; border-radius: 10px; background: var(--yellow) repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.08) 6px 12px); font-size: 30px; padding: 0; }
.card span { opacity: 0; transition: opacity .15s; }
.card.up { background: var(--paper); }
.card.up span { opacity: 1; }
.card.ok { background: #c8f5d8; pointer-events: none; }

/* ---------- рейтинг ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 4px 0 12px; }
.pod { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.pod-medal { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.pod-1 .pod-medal { font-size: 38px; animation: bob 2.2s ease-in-out infinite; }
.pod-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.pod small { font-size: 11px; color: var(--muted); }
.pod-step { width: 100%; border: 2px solid #000; border-bottom: 0; border-radius: 10px 10px 0 0; font: 22px 'Russo One', sans-serif; padding-top: 6px; color: #1a1530; }
.pod-1 .pod-step { height: 74px; background: linear-gradient(#ffe27a, var(--yellow)); }
.pod-2 .pod-step { height: 54px; background: linear-gradient(#e4e8f2, #b4bbd0); }
.pod-3 .pod-step { height: 40px; background: linear-gradient(#f0b27a, #c9803f); }
.pod.me .pod-name { color: var(--yellow); }
.pod.me .pod-step { box-shadow: 0 0 0 3px var(--green) inset; }
.top-list { display: grid; gap: 5px; }
.top-row.me { background: #1e3a2c; border-color: var(--green); }
.top-me { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--green); background: #14281f; }
.top-me span { color: var(--muted); font-size: 12px; }
.top-me b { font: 20px 'Russo One', sans-serif; color: var(--green); }
.top-me small { margin-left: auto; color: var(--ink); }

/* =====================================================================
   Полировка дизайна (v2): единый «мультяшный» стиль — чёрный контур,
   жёсткая тень, мягкие градиенты, больше воздуха и отклика на касание
   ===================================================================== */
:root {
  --glow-y: 0 0 14px rgba(255, 210, 63, .45);
  --card-grad: linear-gradient(180deg, #2c2858, #25214a);
  --ring: 0 0 0 3px rgba(255, 210, 63, .55);
}
html { background: var(--bg); }
body {
  background:
    radial-gradient(120% 60% at 50% -10%, #2b2563 0%, rgba(43, 37, 99, 0) 60%),
    radial-gradient(80% 40% at 90% 30%, rgba(255, 138, 31, .07), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button:focus-visible { outline: none; box-shadow: var(--ring); }
button { touch-action: manipulation; }

/* --- загрузка --- */
.splash { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 50% 35%, #2b2563, #0e0c1f 70%); transition: opacity .45s, visibility .45s; }
.splash.off { opacity: 0; visibility: hidden; pointer-events: none; }
.splash .logo { font-size: 84px; line-height: 1; animation: bob 1.4s ease-in-out infinite; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .4)); }
.splash b { font: 26px 'Russo One', sans-serif; letter-spacing: .02em; }
.splash b em { font-style: normal; color: var(--yellow); }
.splash small { color: var(--muted); }
.splash .bar { width: 160px; height: 6px; border-radius: 3px; background: #1d1a3a; overflow: hidden; }
.splash .bar i { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, var(--orange), var(--yellow)); border-radius: 3px; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(300%); } }

/* --- HUD --- */
.hud { background: linear-gradient(#0b0a1d, rgba(11, 10, 29, .92)); border-bottom: 1px solid #1d1a3a; }
.pill { background: linear-gradient(180deg, #05040f, #0d0b22); box-shadow: 0 2px 0 rgba(0, 0, 0, .5); font-variant-numeric: tabular-nums; }
.pill::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--orange); }
#pill-res::before { background: var(--green); }
#pill-budget::before { background: var(--yellow); }
.pill-money { border-color: #4a3d12; }
.pill b { text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
.pill.paused::before { background: #fff; }
.pill small { padding-left: 2px; }
.sound { transition: transform .1s; }
.sound:active { transform: scale(.92); }
.dayline { padding: 0 2px; }
.daybar { height: 6px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }

/* --- сцена --- */
.scene { box-shadow: 0 0 0 2px #000, 0 6px 0 rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35); }
.win { transition: filter .15s; }
@media (hover: hover) { .win:hover { filter: brightness(1.25); } }
.nina-say { background: linear-gradient(#14112b, #0e0c1f); }
.bubble { box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }

/* --- кнопки действий --- */
.actions { gap: 8px; }
.act { position: relative; overflow: hidden; background-image: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%); }
.act::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .28) 50%, transparent 60%); transform: translateX(-120%); }
.act.ready::after, .act-pie::after { animation: shine 2.8s infinite; }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.act small { white-space: normal; line-height: 1.15; }
.act-ico { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
.flatstat { gap: 5px; }
.flatstat span { border: 1px solid var(--line); }

/* --- вкладки --- */
.tabs { gap: 3px; }
.tabs button { background: linear-gradient(#1d1a3a, #17142f); border-top: 2px solid transparent; transition: background .15s, color .15s; }
.tabs button:active { background: var(--card2); }
.tabs button.active { background: var(--card-grad); border-top-color: var(--yellow); box-shadow: 0 -4px 14px rgba(255, 210, 63, .12); }
.tabs button.active span { transform: translateY(-1px) scale(1.08); }
.tabs button span { transition: transform .15s; }
main { background: var(--card-grad); box-shadow: 0 6px 0 rgba(0, 0, 0, .35); }

/* --- единые карточки --- */
.ev, .game-card, .shop-row, .games-head, .goal, .stat, .pie-card, .top-row {
  border: 2px solid #000;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}
.shop-row, .game-card, .games-head, .goal, .stat, .top-row { background: linear-gradient(180deg, #221e48, #1b183a); }
.stat { border-radius: 12px; padding: 8px 10px; }
.goal.done { background: linear-gradient(135deg, #2f5a3c, #1f3f2a); border-color: #000; box-shadow: 0 3px 0 rgba(0, 0, 0, .35), inset 0 0 0 1px var(--green-d); }
.goals { gap: 9px; }
.game-card { transition: transform .1s; }
.game-card:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.game-card .ico { width: 52px; height: 52px; display: grid; place-items: center; background: #000; border-radius: 14px; font-size: 30px; }
.shop-row .ico { width: 42px; height: 42px; display: grid; place-items: center; background: #000; border-radius: 12px; }
.ev { background: linear-gradient(180deg, #2a2554, #211d44); }
.ev .row .btn { transition: transform .08s; }
.section-title { display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, var(--line), transparent); border-radius: 1px; }

/* --- кнопки --- */
.btn { background-image: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 60%); box-shadow: 0 3px 0 rgba(0, 0, 0, .45); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
.btn:disabled { filter: grayscale(.6); }
.btn-ghost { background-image: none; }
.btn-yellow { box-shadow: 0 3px 0 #a07800, 0 5px 0 rgba(0, 0, 0, .35); }
.btn-star { box-shadow: 0 3px 0 #b3560f, 0 5px 0 rgba(0, 0, 0, .35); }

/* --- тетрадка --- */
.notebook { box-shadow: 0 4px 0 rgba(0, 0, 0, .4), inset 0 0 30px rgba(120, 90, 30, .08); }
.nb-item { transition: background .2s; }
.nb-item.done { background: linear-gradient(90deg, rgba(61, 220, 120, .1), transparent 70%); }
.progress { border: 1px solid #d9cfb0; }

/* --- рейтинг --- */
.top-list { gap: 6px; }
.top-row { border-radius: 12px; padding: 9px 10px; }
.top-row:nth-child(1) .pos, .top-row:nth-child(2) .pos, .top-row:nth-child(3) .pos { color: var(--muted); }
.top-row.me { background: linear-gradient(180deg, #24523a, #1b3f2c); }
.pod-step { box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }

/* --- модальные окна и штамп --- */
.overlay { background: radial-gradient(circle at 50% 30%, rgba(40, 33, 90, .96), rgba(10, 8, 25, .97) 75%); backdrop-filter: blur(3px); }
.result-card { background-image: repeating-linear-gradient(transparent 0 27px, rgba(130, 150, 210, .16) 27px 28px); }
.toast { box-shadow: 0 6px 18px rgba(0, 0, 0, .5); backdrop-filter: blur(4px); }
.stamp { text-shadow: 0 3px 0 rgba(0, 0, 0, .35); box-shadow: 0 0 0 3px rgba(0, 0, 0, .25), inset 0 0 0 2px rgba(0, 0, 0, .15); }

/* --- мини-игры --- */
.mini-field { box-shadow: 0 5px 0 rgba(0, 0, 0, .4), inset 0 0 30px rgba(0, 0, 0, .35); }
.mini-bar { border: 2px solid #000; height: 12px; }
.mini h3 { text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.mini p { color: var(--muted); font-size: 13px; margin: 2px 0; }

/* --- доступность: без анимаций, если пользователь так просит --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* очень узкие экраны */
@media (max-width: 360px) {
  .tabs button { font-size: 10px; }
  .tabs button span { font-size: 16px; }
  .pill b { font-size: 15px; }
  .pod-name { font-size: 11px; }
}

/* кнопка пирожков: градиент не должен затираться общим блеском .act */
.act-pie { background-image: linear-gradient(180deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0) 55%), linear-gradient(135deg, #ffb36b, #ff7a3d); }
.act-pie small { opacity: .85; }

/* ---------- чердак (квартира 51) ---------- */
.attic-room { width: 100%; max-width: 380px; text-align: left; }
.attic-room h3 { margin: 0 0 8px; font: 20px 'Russo One', sans-serif; text-align: center; }
.attic-svg { width: 100%; height: auto; display: block; border: 3px solid #000; border-radius: 16px; box-shadow: 0 5px 0 rgba(0, 0, 0, .4); background: #1c1411; }
.attic-room .btn { width: 100%; min-width: 0; }
.att-item { cursor: pointer; transform-box: fill-box; transform-origin: center bottom; }
@media (hover: hover) { .att-item:hover { filter: brightness(1.25); } }
.att-item.hit { animation: attHit .4s; }
@keyframes attHit { 35% { transform: scale(1.14) rotate(-3deg); } 70% { transform: scale(.97) rotate(2deg); } }
.attic-say { margin: 10px 0; min-height: 76px; background: var(--paper); color: var(--paper-ink); border: 2px solid #000; border-radius: 14px 14px 14px 4px; padding: 9px 12px; font-size: 14px; line-height: 1.3; box-shadow: var(--shadow); animation: say .3s ease-out; }
.attic-say b { display: block; color: #c0182a; font: 15px 'Russo One', sans-serif; margin-bottom: 2px; }
.tear { animation: tear 2.4s ease-in infinite; }
@keyframes tear { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(18px); opacity: 0; } }
.dust { animation: dust 6s ease-in-out infinite alternate; opacity: .6; }
@keyframes dust { to { transform: translate(10px, -14px); opacity: .15; } }
.heart { fill: #ff5a7a; opacity: 0; animation: heart 3.6s ease-out infinite; }
@keyframes heart { 0% { transform: translateY(20px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-70px) scale(1.3); opacity: 0; } }
.note { fill: #ffd23f; animation: note 2.2s ease-out infinite; opacity: 0; }
@keyframes note { 0% { transform: translate(0, 10px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(8px, -22px); opacity: 0; } }
.wrench { animation: wrench 1.3s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 0 100%; }
@keyframes wrench { to { transform: rotate(-14deg); } }
.clock-min { animation: spin 12s linear infinite; transform-box: view-box; transform-origin: 296px 106px; }
.clock-hour { animation: spin 144s linear infinite; transform-box: view-box; transform-origin: 296px 106px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- низ экрана: инструктаж и «Сдаться» ---------- */
.foot { display: flex; gap: 8px; margin: 14px 10px 0; }
.foot-btn { flex: 1; padding: 10px 8px; border: 2px solid #3a3470; border-radius: 12px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.foot-btn:active { background: #1d1a3a; }
.foot-btn.danger { color: #ff9a9a; border-color: #5a2a3a; }
.foot-btn[hidden] { display: none; }

/* ---------- инструктаж ---------- */
.coach { position: fixed; inset: 0; z-index: 35; }
.coach-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(8, 6, 22, .82), 0 0 0 3px var(--yellow), 0 0 22px 4px rgba(255, 210, 63, .55); pointer-events: none; transition: left .25s, top .25s, width .25s, height .25s, opacity .2s; }
.coach-card { position: fixed; left: 12px; right: 12px; max-width: 420px; margin: 0 auto; background: var(--paper); color: var(--paper-ink); border: 3px solid #000; border-radius: 16px; padding: 12px 14px; box-shadow: 0 6px 0 rgba(0, 0, 0, .4); animation: say .25s ease-out; }
.coach-step { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: #8a8299; margin-bottom: 4px; }
.coach-text { font-size: 14.5px; line-height: 1.35; margin-bottom: 10px; }
.coach-text b { color: #c0182a; }
.coach-btns { display: flex; gap: 8px; justify-content: flex-end; }
.coach-btns .btn { padding: 8px 12px; font-size: 13px; }
.coach-btns .btn-ghost { color: #4a4060; border-color: #b9b0cf; }
.coach-btns .btn-yellow { margin-left: auto; }

/* =====================================================================
   Уровни, рейтинги по уровням, «Круглосуточный магазин»
   ===================================================================== */
.level-chip { flex: none; border: 2px solid #3a3470; border-radius: 10px; background: #14122a; color: var(--ink); font-size: 11.5px; font-weight: 700; padding: 3px 8px; white-space: nowrap; }
.level-chip:active { background: var(--card2); }
.dayline #day-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daybar { flex: 0 0 70px; }
.ov-choose { font-weight: 800; letter-spacing: .08em; color: var(--yellow) !important; margin-top: 4px !important; }

/* выбор уровня */
.levels-box { width: 100%; max-width: 400px; text-align: left; }
.levels-box h3 { margin: 0 0 6px; font: 22px 'Russo One', sans-serif; text-align: center; }
.lv-hint { text-align: center; font-size: 12.5px; margin-bottom: 10px !important; }
.levels { display: grid; gap: 9px; margin-bottom: 12px; }
.level-card { display: flex; align-items: center; gap: 10px; background: linear-gradient(180deg, #2c2858, #25214a); border: 2px solid #000; border-radius: 14px; padding: 10px; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.level-card.cur { border-color: var(--yellow); box-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 0 14px rgba(255, 210, 63, .25); }
.level-card.locked { opacity: .6; }
.lv-ico { font-size: 28px; width: 52px; height: 52px; flex: none; display: grid; place-items: center; background: #000; border-radius: 14px; }
.lv-body { flex: 1; min-width: 0; }
.lv-body b { display: block; font-size: 14px; }
.lv-body p { margin: 2px 0; font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.lv-body small { font-size: 11px; color: var(--yellow); }
.level-card .btn { padding: 8px 10px; font-size: 12.5px; }

/* рейтинг: переключатель уровней */
.top-chips { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.chip { flex: none; border: 2px solid #3a3470; background: #14122a; color: var(--muted); border-radius: 999px; padding: 6px 11px; font-size: 12.5px; font-weight: 700; }
.chip.on { background: var(--yellow); color: #2a1f00; border-color: #000; }

/* магазин */
body.mode-shop .foot { margin-top: 14px; }
.shop-front { display: block; width: calc(100% - 20px); margin: 4px 10px 0; height: auto; border: 2px solid #000; border-radius: var(--r) var(--r) 0 0; box-shadow: var(--shadow); }
.neon { filter: drop-shadow(0 0 5px #ff5aa8); animation: neon 2.2s ease-in-out infinite alternate; }
@keyframes neon { 0%, 60% { opacity: 1; } 70% { opacity: .55; } 100% { opacity: 1; } }
.shop-say { display: flex; align-items: center; gap: 8px; margin: 0 10px; padding: 8px; background: #0e0c1f; border: 2px solid #000; border-top: 0; border-radius: 0 0 var(--r) var(--r); }
.shop-say .bubble { flex: 1; max-width: none; }
.sh-ava { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 3px solid #000; background: #ffe7c2; display: grid; place-items: center; font-size: 26px; }
.shop-tabs { margin-top: 12px; }
.shop-main { margin: 0 10px; background: linear-gradient(180deg, #2c2858, #25214a); border-radius: 0 0 var(--r) var(--r); padding: 12px; min-height: 220px; box-shadow: 0 6px 0 rgba(0, 0, 0, .35); display: block; }
.sh-note { background: #1b183a; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.sh-note b { color: var(--ink); }
.wide { width: 100%; margin: 6px 0; }
.rr-ico { font-size: 26px; width: 42px; height: 42px; flex: none; display: grid; place-items: center; background: #000; border-radius: 12px; }
.sr-main { flex: 1; min-width: 0; }
.sr-main b { display: block; font-size: 14px; }
.sr-main small { display: block; font-size: 11.5px; color: var(--muted); }
.sr-main small.warn { color: #ffb066; font-weight: 700; }
.recv-row { background: linear-gradient(180deg, #221e48, #1b183a); border: 2px solid #000; border-radius: 12px; padding: 9px; margin-bottom: 8px; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.rr-head { display: flex; align-items: center; gap: 8px; }
.rr-head b { flex: 1; }
.rr-head small { color: var(--muted); font-size: 11.5px; }
.rr-facts { display: flex; gap: 6px; flex-wrap: wrap; margin: 7px 0; }
.fact { background: #14122a; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 12px; }
.fact.bad { background: #3a1620; border-color: #8a2a3a; color: #ffb0b0; font-weight: 700; }
.rr-act { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.refund { color: var(--muted); margin-left: auto; font-size: 11.5px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: #14122a; border: 2px solid #000; border-radius: 10px; }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--yellow); font: 22px 'Russo One', sans-serif; padding: 0; }
.stepper button:active { background: #2a2650; }
.stepper b { min-width: 28px; text-align: center; font-size: 15px; }
.shelf-row, .order-row, .upg-row { display: flex; align-items: center; gap: 9px; background: linear-gradient(180deg, #221e48, #1b183a); border: 2px solid #000; border-radius: 12px; padding: 8px; margin-bottom: 7px; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.shelf-row .btn, .upg-row .btn { padding: 8px 10px; font-size: 12.5px; }
.plus5 { border: 2px solid #000; background: #2a2650; color: var(--yellow); border-radius: 8px; padding: 6px 7px; font-weight: 800; font-size: 12px; }
.order-total { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 2px; padding: 8px 10px; background: #14122a; border-radius: 10px; }
.order-total b { font: 20px 'Russo One', sans-serif; color: var(--yellow); }
.order-total small { margin-left: auto; color: var(--muted); }
.pips { display: inline-flex; gap: 4px; margin-top: 3px; }
.pips i { width: 12px; height: 12px; border-radius: 50%; background: #3a3470; border: 2px solid #000; }
.pips i.on { background: var(--green); }
.maxed { font-size: 12px; color: var(--green); font-weight: 800; }
.shift-start { margin: 12px 10px 0; text-align: center; }
.shift-start small { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.btn.big { width: 100%; font-size: 17px; padding: 14px; }
.shift-resume { margin: 12px 10px; padding: 14px; background: #1b183a; border: 2px solid #000; border-radius: 14px; text-align: center; }
.shift-resume p { margin: 0 0 10px; color: var(--muted); }
.away-ev.bad-row { background: #fff4f0 !important; }

/* смена */
body.in-shift { overflow: hidden; }
.shift { position: fixed; inset: 0; z-index: 18; display: flex; flex-direction: column; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)); background: radial-gradient(120% 70% at 50% 0, #2b2563, #0e0c1f 70%); overflow: hidden; max-width: 520px; margin: 0 auto; }
.sh-head { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); background: #05040f; border: 2px solid #2b2752; border-radius: 12px; padding: 6px 10px; }
.sh-head b { color: var(--yellow); font-family: 'Russo One', sans-serif; }
.sh-exit { margin-left: auto; border: 2px solid #5a2a3a; background: transparent; color: #ff9a9a; border-radius: 9px; padding: 4px 8px; font-size: 11.5px; font-weight: 700; }
.sh-queue { display: flex; gap: 6px; min-height: 76px; align-items: stretch; }
.cust { position: relative; flex: 1 1 0; min-width: 0; max-width: 25%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 3px 9px; border: 2px solid #000; border-radius: 12px; background: linear-gradient(180deg, #2c2858, #221e48); color: var(--ink); animation: popin .3s cubic-bezier(.2, 1.5, .4, 1); box-shadow: 0 3px 0 rgba(0, 0, 0, .4); overflow: hidden; }
.cust.sel { border-color: var(--yellow); box-shadow: 0 3px 0 rgba(0, 0, 0, .4), 0 0 12px rgba(255, 210, 63, .5); }
.cust.thief { background: linear-gradient(180deg, #4a1c2a, #2c1020); border-color: #ff5a7a; }
.cust.late .c-bar i { background: var(--red); }
.cust.leave { animation: leave .45s ease-in forwards; pointer-events: none; }
@keyframes leave { to { transform: translateY(-14px) scale(.8); opacity: 0; } }
.c-face { font-size: 26px; line-height: 1; }
.c-want { font-size: 11px; line-height: 1.15; text-align: center; min-height: 26px; }
.c-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: #000; }
.c-bar i { display: block; height: 100%; width: 100%; background: var(--green); transition: width .1s linear; }
.sh-order { background: var(--paper); color: var(--paper-ink); border: 2px solid #000; border-radius: 14px; padding: 8px 10px; box-shadow: var(--shadow); min-height: 118px; display: flex; flex-direction: column; gap: 6px; }
.sh-idle { margin: auto; color: #8a8299; font-size: 13px; text-align: center; }
.sh-say { font-size: 11.5px; font-weight: 800; color: #8a8299; margin-right: 6px; }
.sh-wants, .sh-basket { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.want { background: #fff; border: 2px solid #000; border-radius: 8px; padding: 2px 7px; font-size: 12.5px; font-weight: 600; }
.want.ok { background: #c8f5d8; }
.sh-empty { font-size: 12px; color: #a39ab5; }
.bchip { border: 2px solid #000; background: #ffe9a8; color: #2a1f00; border-radius: 8px; padding: 2px 8px; font-size: 13px; font-weight: 700; }
.bchip.extra { background: #ffb0b0; }
.sell { margin-top: auto; padding: 9px; font-size: 15px; }
.sh-shelves { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 6px; padding: 8px; background: linear-gradient(#3b2a1f, #2a1d16); border: 3px solid #000; border-radius: 14px; overflow: hidden; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 2px solid #000; border-radius: 10px; background: linear-gradient(180deg, #f4f1e8, #d9d2bd); color: #2b2240; padding: 2px; min-height: 0; box-shadow: 0 3px 0 rgba(0, 0, 0, .45); }
.tile:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.tile .t-ico { font-size: 30px; line-height: 1; }
.tile b { font-size: 11px; line-height: 1.1; text-align: center; }
.tile .t-cnt { position: absolute; top: 2px; right: 3px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: #000; color: #fff; font: 700 10.5px/17px Rubik; font-style: normal; text-align: center; }
.tile.in { background: linear-gradient(180deg, #ffe9a8, #ffd23f); }
.tile.empty { filter: grayscale(.8) brightness(.7); }
.tile.empty .t-cnt { background: var(--red); }
.sh-sending { position: absolute; inset: 0; background: rgba(8, 6, 22, .85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font: 20px 'Russo One', sans-serif; text-align: center; padding: 20px; }
.sh-sending p { margin: 0; font-size: 15px; font-family: Rubik, sans-serif; }
.howto { display: grid; gap: 7px; text-align: left; margin: 10px 0 12px; }
.ht-row { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid #d9cfb0; border-radius: 10px; padding: 7px 10px; font-size: 13px; }
.ht-row > span { font-size: 22px; flex: none; }
.ht-row b { display: block; color: #c0182a; font-size: 13.5px; }
@media (max-width: 360px) { .tile .t-ico { font-size: 26px; } .tile b { font-size: 10px; } .c-want { font-size: 10px; } }

/* исправление: карточки уровней не должны шире экрана */
.levels { grid-template-columns: minmax(0, 1fr); }
.level-card .btn { flex: none; }
.levels-box { min-width: 0; }

.want.out { background: #ffd0d0; }
.sh-head span { white-space: nowrap; }
.sh-head { flex-wrap: nowrap; font-size: 12px; gap: 8px; }

/* магазин: акция, серия, цели */
.promo-card { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px; border: 2px solid #000; border-radius: 12px; background: linear-gradient(135deg, #ffe066, #ff9a2f); color: #2a1f00; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.promo-card b { display: block; font-size: 14px; }
.promo-card small { font-size: 12px; }
.order-row.promo { border-color: #ff9a2f; box-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 0 10px rgba(255, 154, 47, .35); }
.promo-tag { display: inline-block; margin-left: 6px; background: #ff9a2f; color: #2a1f00; border-radius: 6px; padding: 0 5px; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.sh-streak { font-weight: 800; color: #ffb066; }
.sh-streak.hot { color: #ff5a5a; animation: pulse .8s infinite; }

/* ЭКСТРА: свой облик */
body.mode-extra .scene { box-shadow: 0 0 0 3px #ff5a5a, 0 6px 0 rgba(0, 0, 0, .4), 0 0 26px rgba(255, 90, 90, .35); }
body.mode-extra .scene::before { content: '⭐ ЭКСТРА'; position: absolute; z-index: 2; top: 8px; left: 8px; padding: 3px 9px; border: 2px solid #000; border-radius: 8px; background: linear-gradient(135deg, #ff5a5a, #ffb03a); color: #fff; font: 12px 'Russo One', sans-serif; letter-spacing: .06em; box-shadow: 0 2px 0 rgba(0, 0, 0, .4); pointer-events: none; }
body.mode-extra .level-chip { border-color: #ff5a5a; background: #2a0f18; color: #ffd0d0; }
body.mode-extra #pill-days::before { background: #ff5a5a; }
.stat.infl { border-color: #8a2a3a; background: linear-gradient(180deg, #3a1620, #2a0f18); }
.stat.infl b { color: #ffb0b0; }
.extra-card { border-top: 8px solid #ff5a5a; }

/* меню уровней v2 */
.lv2 { border: 2px solid #000; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, #2c2858, #221e48); box-shadow: 0 4px 0 rgba(0, 0, 0, .4); }
.lv2.cur { box-shadow: 0 4px 0 rgba(0, 0, 0, .4), 0 0 0 3px var(--yellow); }
.lv2.locked { filter: saturate(.4); }
.lv2-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.lv2-banner small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.lv2-banner b { display: block; font: 17px 'Russo One', sans-serif; line-height: 1.1; }
.lv2-ico { font-size: 34px; width: 54px; height: 54px; flex: none; display: grid; place-items: center; background: rgba(0, 0, 0, .35); border: 2px solid rgba(0, 0, 0, .5); border-radius: 14px; }
.lv2-house .lv2-banner { background: linear-gradient(135deg, #b8704f, #5a2f8a); }
.lv2-extra .lv2-banner { background: linear-gradient(135deg, #ff5a5a, #ffb03a); }
.lv2-shop .lv2-banner { background: linear-gradient(135deg, #1fb6a0, #ff5aa8); }
.lv2-body { padding: 10px 12px 12px; }
.lv2-body p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.35; color: var(--muted); text-align: left; max-width: none; }
.lv2-prog small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink); }
.lv2-bar { height: 8px; background: #14122a; border-radius: 4px; overflow: hidden; border: 1px solid #000; }
.lv2-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.lv2-extra .lv2-bar i { background: linear-gradient(90deg, #ff5a5a, #ffb03a); }
.lv2-shop .lv2-bar i { background: linear-gradient(90deg, #1fb6a0, #3ddc78); }
.lv-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.lv-chip, .lv-st { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 9px; background: #14122a; border: 1px solid var(--line); }
.lv-st.won { background: #1e3a2c; border-color: var(--green); color: var(--green); }
.lv-st.lost { background: #3a1620; border-color: #8a2a3a; color: #ffb0b0; }
.lv-st.play { background: #2a2650; border-color: var(--yellow); color: var(--yellow); }
.lv-st.lock { color: var(--muted); }
.lv-actions { display: flex; gap: 8px; }
.lv-actions .btn { flex: 1; min-width: 0; font-size: 13px; padding: 9px 10px; }
.levels-box .levels { max-height: 64vh; overflow-y: auto; padding: 2px 2px 6px; }

/* бонус за подписку */
.sub-card { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #1f4f8a, #2a8ad8); border: 2px solid #000; border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); font-size: 12.5px; color: #dfefff; }
.sub-card .ico { font-size: 32px; flex: none; }
.sub-card > div { flex: 1; min-width: 0; }
.sub-card b { display: block; font-size: 14.5px; color: #fff; margin-bottom: 2px; }
.sub-card.done { background: linear-gradient(135deg, #2f5a3c, #1f3f2a); color: #c8f5d8; }
.sub-btns { display: flex; gap: 8px; margin-top: 8px; }
.sub-btns .btn { flex: 1; padding: 8px 10px; font-size: 13px; }

/* интерактивное обучение: подсветка не мешает нажимать */
.coach.live { pointer-events: none; }
.coach.live .coach-card { pointer-events: auto; }
.coach.live .coach-spot { box-shadow: 0 0 0 9999px rgba(8, 6, 22, .62), 0 0 0 3px var(--yellow), 0 0 22px 4px rgba(255, 210, 63, .55); animation: spotPulse 1.4s ease-in-out infinite; }
@keyframes spotPulse { 50% { box-shadow: 0 0 0 9999px rgba(8, 6, 22, .62), 0 0 0 5px var(--yellow), 0 0 30px 8px rgba(255, 210, 63, .7); } }
.coach-wait { margin-left: auto; align-self: center; font-weight: 800; color: #c0182a; font-size: 13px; animation: pulse 1.2s infinite; }
/* обучение во время смены — компактная карточка поверх очереди */
body.in-shift .coach-card { padding: 7px 10px; }
body.in-shift .coach-text { font-size: 13px; margin-bottom: 6px; }
body.in-shift .coach-btns .btn { padding: 5px 10px; font-size: 12px; }

/* =================== Дизайн v3: шапка, магазин, смена, итоги =================== */
/* шапка: плашки с мягким градиентом и цветной кромкой */
.pill { background: linear-gradient(180deg, #0b0a1c, #000); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
#pill-days { border-color: #3b3470; }
#pill-res { border-color: #1f5a3a; }
.pill-money { border-color: #6a5418; background: linear-gradient(180deg, #1a1405, #000); }
.pill.paused { border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(255, 210, 63, .25); animation: pulse 2s infinite; }
.dayline { padding-top: 2px; }
.daybar { height: 7px; border: 1px solid #000; }
.level-chip { border-color: var(--yellow); background: linear-gradient(180deg, #2c2858, #1d1a3a); color: var(--yellow); box-shadow: 0 2px 0 rgba(0, 0, 0, .4); padding: 4px 9px; }
body.mode-shop .daybar i { background: linear-gradient(90deg, #1fb6a0, var(--green)); }
body.mode-shop #day-label { color: var(--ink); font-weight: 600; }

/* магазин: витрина и подсказка одним блоком */
.shop-say { background: linear-gradient(180deg, #120f28, #0b0a1c); }
.sh-ava { background: radial-gradient(circle at 40% 35%, #fff3d6, #ffd9a0); box-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.shop-tabs button.active { color: var(--yellow); }
.shop-tabs button .badge { animation: pulse 1.2s infinite; }
.sh-note { border-left: 4px solid #5a4fb0; }

/* приёмка: компактная строка — название сверху, факты слева, «принять» справа */
.recv-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'head head' 'facts act'; align-items: center; gap: 6px 8px; padding: 8px 9px; }
.recv-row .rr-head { grid-area: head; }
.recv-row .rr-ico { width: 34px; height: 34px; font-size: 21px; border-radius: 10px; }
.recv-row .rr-facts { grid-area: facts; margin: 0; gap: 4px; }
.recv-row .fact { font-size: 11.5px; padding: 2px 7px; }
.recv-row .rr-act { grid-area: act; flex-direction: column; align-items: flex-end; gap: 2px; }
.recv-row .rr-act > span:first-child { display: none; }
.recv-row .refund { margin: 0; font-size: 10.5px; }
.recv-row:has(.fact.bad) { border-color: #8a2a3a; }
.stepper button { width: 32px; height: 32px; }

/* ряды товара, заказа, развития */
.shelf-row, .order-row, .upg-row, .paid-row { transition: transform .08s; }
.order-row .stepper { margin-left: auto; }
.order-total { border: 2px solid #000; }

/* бонусы за звёзды */
.paid-row { display: flex; align-items: center; gap: 9px; padding: 9px; margin-bottom: 7px; border: 2px solid #6a5418; border-radius: 12px; background: linear-gradient(135deg, #3a2a08, #1d1a3a 70%); box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.paid-row .rr-ico { background: linear-gradient(135deg, #ffe066, #ff9a2f); }
.paid-row.off { filter: saturate(.5); opacity: .8; }
.paid-row .btn, .paid-mini .btn { padding: 8px 11px; font-size: 13px; flex: none; }
.paid-row small.muted { color: #c9b98a; }
.paid-mini { display: flex; align-items: center; gap: 9px; margin: 8px 0; padding: 8px 10px; border: 2px dashed #b88a1f; border-radius: 12px; background: rgba(255, 210, 63, .07); text-align: left; }
.paid-mini .pm-ico { font-size: 24px; flex: none; }
.paid-mini > div { flex: 1; min-width: 0; }
.paid-mini b { display: block; font-size: 13.5px; }
.paid-mini small { display: block; font-size: 11px; color: var(--muted); line-height: 1.25; }
.shift-start .paid-mini { margin-top: 0; }
.insured-on { margin: 0 0 8px; padding: 8px 10px; border: 2px solid var(--green); border-radius: 12px; background: #14281f; color: #c8f5d8; font-size: 12.5px; font-weight: 600; }
.credits { margin: 12px 10px 0; padding: 10px 12px; border: 2px solid var(--green); border-radius: 14px; background: linear-gradient(135deg, #1e3a2c, #14281f); display: grid; gap: 8px; }
.credit-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.credit-row span { flex: 1; }
.credit-row .btn { padding: 7px 12px; font-size: 13px; }

/* пауза */
.pause-banner { display: flex; gap: 10px; align-items: center; margin: 12px 10px 0; padding: 10px 12px; border: 2px solid var(--yellow); border-radius: 14px; background: repeating-linear-gradient(-45deg, #2a2405 0 12px, #1d1a3a 12px 24px); font-size: 12.5px; color: var(--ink); }
.pause-banner b { flex: none; font: 16px 'Russo One', sans-serif; color: var(--yellow); }

/* смена: полки не растягиваются на весь экран и стоят внизу — под большой палец */
.sh-shelves { flex: 0 1 auto; margin-top: auto; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(60px, 112px); align-content: end; padding: 8px 8px 10px; background: linear-gradient(180deg, #4a3424, #2a1d16); }
.tile { border-radius: 10px 10px 6px 6px; box-shadow: 0 4px 0 #6b4a2f, 0 6px 0 rgba(0, 0, 0, .45); }
.tile:active { box-shadow: 0 2px 0 #6b4a2f; }
.tile .t-ico { font-size: 28px; }
.sh-order { min-height: 112px; }
.sh-head { background: linear-gradient(180deg, #0b0a1c, #05040f); }
.cust .c-face { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }

/* итог смены: крупная сумма и три лица */
.res-net { margin: 2px 0 10px; font: 34px/1 'Russo One', sans-serif; }
.res-net small { display: block; font: 700 10.5px Rubik, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #8a8299; margin-bottom: 4px; }
.res-net.pos { color: var(--green-d); }
.res-net.neg { color: #d22a3a; }
.res-people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.res-people > div { background: #fff; border: 2px solid #e6dcc0; border-radius: 12px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; }
.res-people span { font-size: 20px; line-height: 1; }
.res-people b { font: 20px 'Russo One', sans-serif; }
.res-people small { font-size: 10.5px; color: #8a8299; line-height: 1.1; text-align: center; }
.res-people .bad { border-color: #ffb0b0; background: #fff4f0; }
.res-people .bad b { color: #d22a3a; }
.shift-card .away-list { max-height: 34vh; overflow-y: auto; }

/* итоги игры: карточка вместо голого текста */
.ov-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 16px 14px; border: 3px solid #000; border-radius: 20px; background: linear-gradient(180deg, #2c2858, #1b183a); box-shadow: 0 8px 0 rgba(0, 0, 0, .45), 0 0 40px rgba(0, 0, 0, .5); animation: popin .45s cubic-bezier(.2, 1.4, .4, 1); }
.ov-card.won { border-top: 8px solid var(--green); }
.ov-card.lost { border-top: 8px solid var(--red); }
.ov-card h2 { font-size: 28px; }
.ov-card > div:first-child { line-height: 1; }
.ov-stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ov-stats.three { grid-template-columns: repeat(3, 1fr); }
.ov-stats > div { background: #14122a; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; text-align: left; }
.ov-stats small { display: block; font-size: 10.5px; color: var(--muted); }
.ov-stats b { font: 15px 'Russo One', sans-serif; color: var(--yellow); }
.ov-goal { width: 100%; text-align: left; }
.ov-goal small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.ov-btns { width: 100%; display: grid; gap: 8px; }
.ov-btns .btn { min-width: 0; width: 100%; }
.ov-btns .ov-choose { margin: 2px 0 0 !important; }

/* меню уровней */
.levels-box h3 { font-size: 24px; }
.lv2 { transition: transform .1s; }
.lv2:not(.locked):active { transform: scale(.99); }
.lv2-bar { height: 10px; }
.lv2-prog small { font-weight: 600; }
.lv2.cur .lv2-banner small { color: var(--yellow); }
.lv2.locked .lv2-body p { opacity: .7; }
.levels-box > .btn-ghost { width: 100%; }
/* кошелёк */
#btn-wallet { flex-basis: 100%; order: -1; color: var(--yellow); border-color: #6a5418; }
.foot { flex-wrap: wrap; }
.wallet-box { width: 100%; max-width: 400px; max-height: 92vh; overflow-y: auto; text-align: left; padding: 2px 2px 8px; }
.wallet-box h3 { margin: 0 0 8px; font: 22px 'Russo One', sans-serif; text-align: center; }
.wallet-box .paid-row .btn { padding: 8px 10px; }
.w-hist { display: grid; gap: 4px; margin-bottom: 10px; }
.w-hist > div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 10px; background: #1b183a; font-size: 12.5px; color: var(--muted); }
.w-hist .pos { color: var(--green); } .w-hist .neg { color: #ff9a9a; }
.wallet-box > .btn-ghost { width: 100%; margin-top: 4px; }
/* новые страницы тетрадки (Пётр, серии 4–8) */
.nb-petr { margin-top: 14px; }
.nb-ep { margin: 10px 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .5px; color: #8a6d3b; text-transform: uppercase; }
.nb-perk { display: inline-block; margin: 3px 0 2px; padding: 2px 8px; border-radius: 8px; background: #f1e6c4; color: #6a4a00; font-size: 11.5px; font-weight: 700; }
.nb-perk.on { background: rgba(61, 220, 120, .18); color: #1f6b3a; }
.nb-perks { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(61, 220, 120, .12); color: #1f6b3a; font-size: 13px; }
/* событие «Telegram не открывается» */
.ev-err { border-color: #ff6b6b; }
.ev-err .ev-ico { background: #3a1620; }
.ev-note { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; font-size: 13px; line-height: 1.35; }
.ev-note.bad { background: #3a1620; border: 1px solid #8a2a3a; color: #ffb0b0; }
.ev-note.good { background: #14281f; border: 1px solid var(--green); color: #c8f5d8; }
.ev-contest { border-color: var(--yellow, #ffd23f); }
.ev-done::before { background: var(--green); }
/* онлайн и реферальная карточка */
.top-online { margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.top-online b { color: var(--green); }
.online { flex: none; font-size: 11px; font-weight: 700; color: var(--green); background: #14281f; border: 1px solid #1f5a3a; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.ref-card { display: flex; align-items: flex-start; gap: 10px; background: linear-gradient(135deg, #2f5a3c, #1b3f4a); border: 2px solid #000; border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); font-size: 12.5px; color: #d6f2e0; }
.ref-card .ico { font-size: 32px; flex: none; }
.ref-card > div { flex: 1; min-width: 0; }
.ref-card b { display: block; font-size: 14.5px; color: #fff; margin-bottom: 2px; }
/* подсказка «как получить» в целях */
.goal .how { margin-top: 5px; font-size: 11.5px; line-height: 1.3; color: #ffd98a; font-weight: 500; }
.goal.done .how { color: var(--green); font-weight: 700; }
/* кнопки за звёзды: блик поверх золотого фона (раньше блик затирал фон, и кнопка была тёмной) */
.btn-star { background: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 60%), linear-gradient(135deg, #ffe066, #ff9a2f); color: #2a1600; }
/* кошелёк: общие кнопки оверлея слишком широкие (min-width 240px), в этом окне они обычные */
/* кошелёк: баланс, тарифы плиткой, заглушка оплаты */
.w-hero { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 6px; border-radius: 16px; border: 2px solid #6a5418;
  background: radial-gradient(120% 140% at 0% 0%, #3a2d0a 0%, #1d1838 55%, #14122a 100%); box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.w-hero-ico { font-size: 34px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(255, 210, 63, .12); border: 1px solid rgba(255, 210, 63, .35); flex-shrink: 0; }
.w-hero small { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.w-hero b { font: 30px 'Russo One', sans-serif; color: var(--yellow); line-height: 1.1; }
.w-hero-tag { position: absolute; top: 10px; right: 12px; font-size: 11px; font-weight: 700; color: #ffb35c; }
.w-hero-tag.on { color: var(--green); }
.w-tariffs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 8px; }
.w-tariff { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 10px; border-radius: 16px; border: 2px solid #2f3a86;
  background: linear-gradient(180deg, #1c2464 0%, #141a4c 100%); box-shadow: 0 4px 0 #080b26; min-width: 0; }
.w-tariff.hit { border-color: var(--yellow); background: linear-gradient(180deg, #3a2a8a 0%, #241a66 100%); }
.w-hit { position: absolute; top: -10px; right: 10px; font-size: 11px; font-weight: 800; color: #fff; background: #ff4d6d; border: 2px solid #000; border-radius: 8px; padding: 2px 8px; transform: rotate(4deg); }
.w-t-name { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; color: #fff; }
.w-t-name i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 2px solid #000; flex-shrink: 0; }
.w-t-price { font: 26px 'Russo One', sans-serif; color: var(--yellow); line-height: 1.1; white-space: nowrap; }
.w-t-gets { font-size: 11.5px; color: #aab3f0; margin-bottom: 6px; }
.wallet-box .w-tariff .btn { width: 100%; padding: 9px 6px; font-size: 14px; margin-top: auto; }
.w-stub { display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; background: #3a1620; border: 1px solid #8a2a3a; }
.w-stub[hidden] { display: none; }
.w-stub-ico { font-size: 24px; }
.w-stub b { display: block; color: #ffd0d0; font-size: 14px; }
.w-stub small { color: #ffb0b0; font-size: 12px; }
.w-stub.shake { animation: wshake .35s; }
@keyframes wshake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.w-trust { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.w-trust span { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: #1b183a; border: 1px solid var(--line); color: var(--ink); }
.w-fine { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; line-height: 1.35; }
.w-docs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 10px; font-size: 12.5px; }
.w-docs a { color: #7fc4ff; text-decoration: underline; }
.wallet-box { min-width: 0; box-sizing: border-box; }
.wallet-box .btn { min-width: 0; }
.wallet-box .paid-row .btn { min-width: 74px; }
.wallet-box .paid-row { align-items: center; }
.wallet-box .sr-main small { white-space: normal; }
.wallet-box > .btn-ghost { min-width: 0; }

/* ===== выбор способа оплаты бонуса: звёзды или СБП/карта ===== */
.pay-pick { width: 100%; max-width: 380px; box-sizing: border-box; text-align: center; padding: 4px 2px 6px; }
.pay-pick .pp-ico { font-size: 44px; line-height: 1; margin-bottom: 6px; }
.pay-pick h3 { margin: 0 0 4px; }
.pay-pick .pp-desc { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.pay-pick .pp-q { margin: 6px 0 8px; font: 13px 'Russo One', sans-serif; letter-spacing: .05em; color: var(--yellow); text-transform: uppercase; }
.pp-opt { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--card2); color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: transform .1s; }
.pp-opt:active { transform: scale(.98); }
.pp-opt .pp-big { font-size: 28px; width: 34px; text-align: center; flex: none; }
.pp-opt .pp-txt { flex: 1; min-width: 0; }
.pp-opt .pp-txt b { display: block; font-size: 15px; }
.pp-opt .pp-txt small { color: var(--muted); font-size: 12px; }
.pp-opt .pp-price { flex: none; padding: 6px 10px; border-radius: 10px; font: 14px 'Russo One', sans-serif; white-space: nowrap; }
.pp-stars { border-color: #b98a1d; }
.pp-stars .pp-price { background: var(--yellow); color: #2a1d00; }
.pp-sbp { border-color: #1f9e50; }
.pp-sbp .pp-price { background: var(--green); color: #062612; }
.pay-pick .pp-sum { display: flex; justify-content: space-between; padding: 8px 12px; margin-bottom: 6px; border-radius: 10px; background: var(--card2); font-size: 14px; }
.pay-pick .pp-sum span { color: var(--muted); }
.pay-pick .pp-wait { margin: 10px 0; padding: 12px; border-radius: 12px; background: var(--card2); font-size: 14px; }
.pay-pick .btn { width: 100%; margin-top: 6px; }
.pay-pick .w-stub { text-align: left; }

/* голосование: итог */
.vote.done { background: radial-gradient(circle at 50% 0, #2f8a55, #1d5e3a); }
.fork-card.win { outline: 3px solid var(--yellow); transform: scale(1.03); }
.fork-card.lose { opacity: .55; }

/* ===== Время: кнопка в шапке и окно (пауза, скорость, перемотка) ===== */
#btn-time { min-width: 0; }
#btn-time.t-fast { border-color: var(--orange); color: #ffb35c; }
#btn-time.t-paused { background: var(--yellow); color: #2a1600; border-color: #000; animation: tpulse 1.6s ease-in-out infinite; }
@keyframes tpulse { 50% { box-shadow: 0 2px 0 rgba(0,0,0,.4), 0 0 0 4px rgba(255,210,63,.35); } }

.tm-card { position: relative; width: 100%; max-width: 360px; text-align: left; color: var(--ink);
  background: radial-gradient(circle at 50% -20%, #3d3480, #221e48 60%, #1a1738); border: 3px solid #000; border-radius: 20px;
  padding: 16px 14px 14px; box-shadow: 0 6px 0 rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,210,63,.18); animation: popin .35s cubic-bezier(.2,1.5,.4,1); }
#modal:has(.tm-card) { justify-content: flex-start; overflow-y: auto; } /* на низком экране окно прокручивается, а не обрезается сверху */
.tm-card { margin: auto 0; flex: none; }
.tm-card .btn { min-width: 0; } /* у кнопок оверлея по умолчанию min-width 240px */
.tm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tm-clock { flex: none; width: 50px; height: 50px; display: grid; place-items: center; font-size: 28px; border-radius: 15px;
  background: linear-gradient(180deg, #ffe066, #ffb020); border: 2px solid #000; box-shadow: 0 3px 0 #a07800; }
.tm-head h3 { margin: 0; font: 20px/1.1 'Russo One', sans-serif; }
.tm-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.tm-state { font-weight: 700; color: var(--green); }
.tm-state.fast { color: #ffb35c; }
.tm-state.paused { color: var(--yellow); }
.tm-body { display: flex; flex-direction: column; gap: 10px; }
.tm-sec { background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.tm-label { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 2px 8px; }
.tm-hint { margin: 7px 2px 0; font-size: 12px; line-height: 1.3; color: var(--muted); }
.tm-big { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; font-size: 16px; white-space: normal; }
.tm-big small { font-size: 13px; opacity: .85; }
.tm-resume { animation: tpulse 1.6s ease-in-out infinite; box-shadow: 0 3px 0 var(--green-d), 0 5px 0 rgba(0,0,0,.35); }

.tm-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.tm-opt { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 2px 8px; border-radius: 12px;
  border: 2px solid #000; background: #15132b; color: var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,.45); transition: transform .08s; }
.tm-opt:active { transform: translateY(2px); box-shadow: none; }
.tm-opt b { font: 18px/1 'Russo One', sans-serif; }
.tm-opt small { font-size: 10px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tm-opt.own { border-color: #5a5490; }
.tm-opt.own small { color: var(--green); }
.tm-opt.buy { background: linear-gradient(180deg, #3a2a10, #22180a); border-color: #6a5418; }
.tm-opt.buy small { color: #ffc14d; }
.tm-opt.cur { background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 60%), var(--yellow); color: #2a1600;
  box-shadow: 0 3px 0 #a07800, 0 0 0 3px rgba(255,210,63,.3); cursor: default; }
.tm-opt.cur small { color: #5a3d00; }

.tm-skip { display: flex; align-items: center; gap: 10px; }
.tm-skip-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px; background: #000; border-radius: 12px; }
.tm-skip div { flex: 1; min-width: 0; }
.tm-skip b { display: block; font-size: 15px; }
.tm-skip small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.tm-skip .btn { flex: none; padding: 9px 12px; }

.tm-note { margin: 12px 4px 10px; font-size: 11.5px; text-align: center; color: var(--muted); }
.tm-close { width: 100%; background: var(--card2); color: var(--ink); border-color: #000; }

/* ===== Главный экран (20.11.2026) ===== */
/* на телефоне полоска дня уходит отдельной строкой во всю ширину — «День 140 · новый через …» больше не обрезается */
@media (max-width: 480px) {
  .dayline { flex-wrap: wrap; row-gap: 6px; }
  .dayline .daybar { flex: 1 0 100% !important; order: 9; height: 5px; }
}

/* ===== Сайт: форма входа ===== */
.login-box { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; margin-top: 4px; }
.login-in { width: 100%; padding: 13px 14px; border-radius: 12px; border: 2px solid #3a3470; background: #14122a; color: var(--ink); font: 600 16px 'Rubik', sans-serif; outline: none; }
.login-in:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 210, 63, .25); }
.login-in::placeholder { color: var(--muted); font-weight: 400; }
.login-err { min-height: 18px; color: #ff8a8a; font-size: 13px; font-weight: 600; }
.login-box .btn { width: 100%; min-width: 0; }
