/* «Загрузка-тайкун» (assets/tycoon.js): кнопка ⬇️ в шапке, экран игры, рейтинг группы.
   Всё — поверх кабинета и урока (уроки используют z-index до ~10000). Классы — с префиксом ty-.
   Элементы, которые двигает GSAP (.ty-big, .ty-fly, .ty-float, .ty-ev, .ty-poke, .ty-mon, .ty-folder, .ty-ask-box, тосты), —
   без transition/animation по transform; ховеры и «тряска» — через translate/scale/rotate на элементах, которых GSAP не касается. */

/* ── кнопка ⬇️ в шапке: .top-btn { display: flex } сильнее атрибута hidden ── */
.ty-btn[hidden] { display: none !important; }
.ty-btn { padding-inline: 12px; }
.ty-btn .ico { filter: drop-shadow(0 0 8px rgba(62, 224, 255, .7)); }

/* ── экран игры ── */
.ty-game { --ty-rank: clamp(252px, 22vw, 360px); position: fixed; inset: 0; z-index: 20030; overflow: auto; color: #fff; user-select: none;
  font-family: Nunito, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  background: radial-gradient(1100px 640px at 38% 14%, #3a3fa8 0%, transparent 70%), radial-gradient(760px 520px at 100% 100%, rgba(155, 123, 255, .3), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .075) 1.2px, transparent 1.4px) 0 0 / 30px 30px, linear-gradient(180deg, #1b1f4b, #0d1030); }
.ty-game [hidden] { display: none !important; }
.ty-game button { font-family: inherit; touch-action: manipulation; }
.ty-game .spark { position: absolute; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; z-index: 50;
  background: radial-gradient(circle, #fff, var(--c) 45%, transparent 70%); }
.ty-wrap { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) var(--ty-rank); height: 100%; min-height: 560px; }
.ty-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: clamp(8px, 1.8vh, 20px); min-width: 0; min-height: 0;
  padding: clamp(10px, 2vh, 22px) clamp(12px, 1.6vw, 28px) clamp(12px, 2vh, 24px); }

/* шапка: ✕ и три счётчика */
.ty-top { display: flex; align-items: center; gap: clamp(8px, 1vw, 16px); }
.ty-x { position: relative; z-index: 40; flex: none; width: 56px; height: 56px; border-radius: 18px; border: 2px solid var(--line); cursor: pointer;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 26px; font-weight: 900; transition: background-color .15s, border-color .15s; }
.ty-x:hover { background: #ff5d7a; }
.ty-title { font-size: clamp(20px, 2.3vw, 30px); font-weight: 900; white-space: nowrap; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.ty-stats { display: flex; flex: 1 1 auto; justify-content: flex-end; gap: clamp(8px, 1vw, 14px); min-width: 0; }
.ty-stat { position: relative; display: flex; align-items: center; gap: 10px; flex: 1 1 0; min-width: 0; max-width: 280px; padding: 8px 14px 8px 12px;
  border-radius: 20px; background: rgba(0, 0, 0, .38); border: 2px solid rgba(255, 255, 255, .14); box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }
.ty-stat > i { font-style: normal; font-size: clamp(26px, 4vh, 38px); line-height: 1; }
.ty-stat > span { display: block; min-width: 0; }
.ty-stat small { display: block; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ty-stat b { display: block; font-size: clamp(24px, 3.8vh, 40px); font-weight: 900; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; }
.ty-stat-mb { border-color: var(--cyan); box-shadow: 0 6px 0 rgba(0, 0, 0, .25), 0 0 26px rgba(62, 224, 255, .28); }
.ty-stat-mb b { color: var(--cyan); }
.ty-pen { position: absolute; top: 6px; right: 12px; font-style: normal; font-size: 15px; font-weight: 900; color: var(--orange); }

/* сцена: слева кнопка, справа окно «Загрузки» */
.ty-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(10px, 1.6vw, 26px); min-height: 0; }
.ty-left { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 2.6vh, 28px); min-width: 0; min-height: 0; }
.ty-pure { position: absolute; top: 0; left: 0; padding: 6px 16px; border-radius: 99px; font-size: clamp(16px, 2.3vh, 22px); font-weight: 900;
  background: rgba(182, 242, 58, .16); border: 2px solid var(--lime); color: var(--lime); font-variant-numeric: tabular-nums; }
.ty-bigbox { position: relative; display: grid; place-items: center; }

/* большая кнопка: внешняя — для GSAP («проминание»), внутренняя — ховер и нажатие через translate */
.ty-big { position: relative; width: clamp(160px, 33vh, 380px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
.ty-big::before { content: ""; position: absolute; inset: -4%; border-radius: 50%; border: 4px solid var(--cyan); opacity: 0; pointer-events: none; animation: tyHalo 2.6s ease-out infinite; }
@keyframes tyHalo { from { scale: .94; opacity: .65; } to { scale: 1.28; opacity: 0; } }
.ty-big-face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 26%, #c6f9ff 0, #3ee0ff 34%, #1a9fd8 70%, #1470b4 100%);
  box-shadow: inset 0 -16px 0 rgba(0, 50, 110, .32), inset 0 10px 0 rgba(255, 255, 255, .4), 0 14px 0 #0b4a80, 0 30px 52px rgba(0, 0, 0, .5), 0 0 70px rgba(62, 224, 255, .38);
  transition: translate .08s, box-shadow .08s, filter .15s; }
.ty-big:hover .ty-big-face { filter: brightness(1.08); }
.ty-big:active .ty-big-face { translate: 0 9px;
  box-shadow: inset 0 -16px 0 rgba(0, 50, 110, .32), inset 0 10px 0 rgba(255, 255, 255, .4), 0 5px 0 #0b4a80, 0 14px 28px rgba(0, 0, 0, .5), 0 0 50px rgba(62, 224, 255, .3); }
.ty-big:focus-visible { outline: 5px solid var(--lime); outline-offset: 12px; }
.ty-arrow { width: 52%; height: 52%; filter: drop-shadow(0 6px 0 rgba(0, 60, 120, .5)); animation: tyBob 1.8s ease-in-out infinite; }
@keyframes tyBob { 50% { translate: 0 6%; } }

/* подсказка при первом открытии: рука и одна строка */
.ty-hint { position: absolute; inset: 0; pointer-events: none; }
.ty-say { position: absolute; left: 50%; bottom: calc(100% - 4px); translate: -50% 0; white-space: nowrap; padding: 9px 20px; border-radius: 18px; background: #fff; color: #17203f;
  font-size: clamp(18px, 2.6vh, 26px); font-weight: 900; box-shadow: 0 8px 0 rgba(0, 0, 0, .25), 0 14px 30px rgba(0, 0, 0, .35); animation: tySay 1.6s ease-in-out infinite; }
.ty-say::after { content: ""; position: absolute; left: 50%; top: 100%; translate: -50% 0; border: 11px solid transparent; border-top-color: #fff; }
@keyframes tySay { 50% { translate: -50% -5px; } }
.ty-hand { position: absolute; right: 6%; bottom: 4%; font-size: clamp(54px, 9vh, 92px); line-height: 1; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); animation: tyHand 1s ease-in-out infinite; }
@keyframes tyHand { 50% { translate: -8px -22px; } }

/* перерождение: полоска «скачано / 1 000», а когда можно — золотая кнопка */
.ty-rebirth { position: relative; overflow: hidden; display: grid; place-content: center; width: min(100%, 380px); height: clamp(56px, 8.4vh, 80px); padding: 0 14px;
  border-radius: 22px; border: 3px solid rgba(255, 255, 255, .2); background: rgba(0, 0, 0, .38); color: #fff; cursor: pointer; text-align: center;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .3); transition: border-color .2s, box-shadow .2s, background-color .2s, color .2s; }
.ty-rb-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, rgba(182, 242, 58, .42), rgba(62, 224, 255, .42)); transition: width .25s; }
.ty-rebirth b { position: relative; font-size: clamp(18px, 2.7vh, 25px); font-weight: 900; }
.ty-rebirth small { position: relative; font-size: clamp(13px, 1.8vh, 16px); font-weight: 900; color: var(--muted); font-variant-numeric: tabular-nums; }
.ty-rebirth.ready { border-color: var(--gold); background: linear-gradient(180deg, #ffe680, #ffb81f); color: #3a2600; box-shadow: 0 6px 0 #b47900, 0 0 36px rgba(255, 210, 62, .6);
  animation: tyReady 1.4s ease-in-out infinite; }
.ty-rebirth.ready small { color: #7a4b00; }
.ty-rebirth.ready .ty-rb-fill { display: none; }
@keyframes tyReady { 50% { box-shadow: 0 6px 0 #b47900, 0 0 64px rgba(255, 210, 62, .95); } }

/* окно «Загрузки»: куча, Свалкозавр, торчащие файлы */
.ty-win { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; border-radius: 28px; background: #161a49;
  border: 3px solid rgba(255, 255, 255, .18); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); transition: border-color .3s, box-shadow .3s; }
.ty-win[data-tier="1"] { border-color: rgba(255, 154, 46, .85); }
.ty-win[data-tier="2"] { border-color: rgba(255, 77, 112, .95); box-shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 0 50px rgba(255, 77, 112, .35); }
.ty-win-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(0, 0, 0, .34); font-size: clamp(17px, 2.4vh, 22px); white-space: nowrap; }
.ty-dots { display: flex; gap: 6px; }
.ty-dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5d7a; }
.ty-dots i:nth-child(2) { background: var(--gold); }
.ty-dots i:nth-child(3) { background: var(--lime); }
.ty-slow { margin-left: auto; padding: 4px 12px; white-space: nowrap; border-radius: 99px; font-style: normal; font-size: clamp(13px, 1.9vh, 16px); font-weight: 900;
  background: var(--orange); color: #3a1d00; animation: tyBlink 1.1s ease-in-out infinite; }
.ty-win[data-tier="2"] .ty-slow { background: #ff4d70; color: #fff; }
@keyframes tyBlink { 50% { opacity: .62; } }
.ty-win-body { position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 46px), radial-gradient(70% 60% at 50% 72%, rgba(155, 123, 255, .24), transparent 70%), #1b1f55; }
.ty-folder { position: absolute; overflow: visible; right: 14px; top: 12px; z-index: 2; width: clamp(44px, 7vh, 72px); height: clamp(44px, 7vh, 72px); display: grid; place-items: center;
  font-size: clamp(32px, 5.4vh, 54px); line-height: 1; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .4)); }
.ty-folder-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: grid; place-items: center; font-size: inherit; line-height: 1; }
.ty-clean { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: clamp(26px, 4.4vh, 42px); font-weight: 900;
  color: var(--lime); text-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 24px rgba(182, 242, 58, .5); }
.ty-mon-box { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 5%; pointer-events: none; }
.ty-mon-in { animation: tyWobble 3s ease-in-out infinite; }
@keyframes tyWobble { 50% { rotate: -2.5deg; translate: 0 -1.5%; } }
.ty-mon { position: relative; width: clamp(120px, 26vh, 250px); aspect-ratio: 1; transform-origin: 50% 100%; font-size: clamp(100px, 22vh, 210px); line-height: 1;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .45)); transition: filter .4s; }
.ty-heap-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: grid; place-items: center; font-size: inherit; line-height: 1; }
.ty-win[data-tier="1"] .ty-mon { filter: drop-shadow(0 0 16px rgba(255, 154, 46, .75)); }
.ty-win[data-tier="2"] .ty-mon { filter: drop-shadow(0 0 22px rgba(255, 77, 112, .95)); }
.ty-mon-name { position: absolute; top: 12px; left: 0; right: 0; width: max-content; margin: 0 auto; padding: 3px 16px; border-radius: 99px; font-size: clamp(16px, 2.4vh, 22px); font-weight: 900;
  background: #ff4d70; box-shadow: 0 6px 0 rgba(0, 0, 0, .3); }
.ty-pokes { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ty-poke { --w: clamp(40px, 6.4vh, 60px); position: absolute; width: var(--w); height: calc(var(--w) * 1.3); margin: calc(var(--w) * -.65) 0 0 calc(var(--w) * -.5);
  padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .45)); transition: filter .15s; }
.ty-poke::before { content: ""; position: absolute; inset: -8px; }
.ty-poke:hover { filter: drop-shadow(0 0 12px var(--lime)) brightness(1.1); }
/* когда Загрузки тормозят, торчащие файлы подсвечены: «щёлкни — улетит в папку» (мигает только прозрачность подсветки) */
.ty-poke::after { content: ""; position: absolute; inset: -12px; z-index: -1; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 154, 46, .6), transparent); }
.ty-win:not([data-tier="0"]) .ty-poke::after { animation: tyGlow 1.2s ease-in-out infinite; }
@keyframes tyGlow { 50% { opacity: 1; } }
.ty-poke svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.ty-hbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px 14px; background: rgba(0, 0, 0, .3); }
.ty-hnum { min-width: 4.4ch; font-size: clamp(18px, 2.6vh, 25px); font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ty-track { position: relative; flex: 1; height: clamp(18px, 2.8vh, 26px); border-radius: 14px; overflow: hidden; background: rgba(0, 0, 0, .5); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .5); }
.ty-track i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 14px; background: linear-gradient(90deg, #8fd12a, var(--lime)); transition: width .2s; }
.ty-track[data-tier="1"] i { background: linear-gradient(90deg, #ff9a2e, #ffc04d); }
.ty-track[data-tier="2"] i { background: linear-gradient(90deg, #ff4d70, #ff8a5c); }
.ty-track u { position: absolute; top: 0; bottom: 0; width: 3px; background: rgba(255, 255, 255, .55); }
.ty-track u:first-of-type { left: 33.33%; }
.ty-track u:last-of-type { left: 66.66%; }

/* улучшения: крупные карточки */
.ty-ups { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1vw, 16px); }
.ty-up { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: clamp(8px, 1.2vh, 14px) 8px clamp(10px, 1.4vh, 14px);
  border-radius: 22px; border: 3px solid rgba(255, 255, 255, .16); cursor: pointer; color: #fff; text-align: center;
  background: linear-gradient(180deg, #4a4fc4, #2a2d7a); box-shadow: 0 6px 0 #171a48, 0 12px 24px rgba(0, 0, 0, .3);
  transition: translate .12s, filter .15s, border-color .15s, box-shadow .15s, background-color .15s; }
.ty-up-ico { position: relative; flex: none; width: clamp(44px, 7.8vh, 80px); height: clamp(44px, 7.8vh, 80px); margin-bottom: 4px; }
.ty-up-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: grid; place-items: center; font-size: clamp(34px, 6vh, 60px); line-height: 1; }
.ty-up-name { display: grid; place-items: center; min-height: 2.25em; font-size: clamp(14px, 2vh, 21px); font-weight: 900; line-height: 1.1; }
.ty-up-hint { min-height: 1.2em; font-size: clamp(12px, 1.6vh, 16px); font-weight: 800; color: var(--muted); line-height: 1.15; }
.ty-price { margin-top: 2px; padding: 3px 14px; border-radius: 99px; font-size: clamp(15px, 2.2vh, 22px); font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--gold); color: #3a2600; }
.ty-price-own { background: var(--lime); color: #17300a; }
.ty-up-lvl { position: absolute; top: 6px; right: 8px; padding: 1px 7px; border-radius: 99px; font-size: clamp(11px, 1.6vh, 14px); font-weight: 900; background: rgba(0, 0, 0, .45); }
.ty-up.can { border-color: var(--lime); box-shadow: 0 6px 0 #171a48, 0 0 28px rgba(182, 242, 58, .5), 0 12px 24px rgba(0, 0, 0, .3); }
.ty-up.can:hover { translate: 0 -4px; }
.ty-up.can:active { translate: 0 4px; box-shadow: 0 2px 0 #171a48, 0 0 24px rgba(182, 242, 58, .5); }
.ty-up.no { filter: grayscale(.55) brightness(.6); cursor: default; }
.ty-up.no .ty-price { background: #8f96d6; }
.ty-up.own { border-color: var(--lime); background: linear-gradient(180deg, #5d9a1d, #2f5a0b); cursor: default; }
.ty-pop { animation: tyPop .45s; }
@keyframes tyPop { 40% { scale: 1.1; } }
.ty-shake { animation: tyShake .4s; }
@keyframes tyShake { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }

/* рейтинг группы */
.ty-rank { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: clamp(12px, 2vh, 22px) 14px; border-left: 2px solid rgba(255, 255, 255, .14);
  background: linear-gradient(180deg, rgba(14, 16, 48, .74), rgba(10, 12, 40, .9)); }
.ty-rank h2 { margin: 4px 0 12px; text-align: center; font-size: clamp(20px, 2.8vh, 27px); font-weight: 900; }
.ty-rows { display: grid; align-content: start; gap: 6px; min-height: 0; margin: 0; padding: 0; list-style: none; overflow: auto; }
.ty-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: clamp(6px, 1vh, 10px) 10px; border-radius: 14px;
  border: 2px solid transparent; background: rgba(255, 255, 255, .06); font-size: clamp(15px, 2.1vh, 19px); font-weight: 800; }
.ty-row.me { border-color: var(--lime); background: rgba(182, 242, 58, .15); box-shadow: 0 0 22px rgba(182, 242, 58, .22); }
.ty-rk { text-align: center; font-size: 1.1em; font-weight: 900; color: var(--muted); }
.ty-nm { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.ty-nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.ty-nm em { flex: none; font-style: normal; font-size: .8em; font-weight: 900; color: var(--lime); white-space: nowrap; }
.ty-sc { font-weight: 900; color: var(--cyan); font-variant-numeric: tabular-nums; }
.ty-gap { line-height: .5; text-align: center; font-weight: 900; color: var(--muted); }

/* слой полётов: значки файлов, «+N», золотой файл, ловушка */
.ty-air { position: absolute; inset: 0 var(--ty-rank) 0 0; z-index: 8; overflow: hidden; pointer-events: none; }
.ty-fly { position: absolute; left: 0; top: 0; width: 44px; height: 58px; filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .4)); }
.ty-fly svg { display: block; width: 100%; height: 100%; }
.ty-float { position: absolute; left: 0; top: 0; z-index: 9; width: 0; display: flex; justify-content: center; }
.ty-float span { white-space: nowrap; font-size: clamp(22px, 3.2vh, 32px); font-weight: 900; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .55), 0 0 14px rgba(62, 224, 255, .8); }
.ty-float-gold span { font-size: clamp(30px, 5vh, 50px); color: var(--gold); text-shadow: 0 4px 0 #7a4b00, 0 0 22px rgba(255, 210, 62, .9); }
.ty-float-bad span { color: #ff7a93; }
.ty-float-ok span { color: var(--lime); }
.ty-ev { position: absolute; left: 0; top: 0; z-index: 10; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; transition: filter .15s; }
.ty-ev:hover { filter: brightness(1.2); }
.ty-ev-img { display: block; width: clamp(80px, 13vh, 130px); height: clamp(80px, 13vh, 130px); object-fit: contain; font-size: 70px; }
.ty-gold { width: clamp(56px, 9vh, 92px); height: clamp(72px, 11.6vh, 120px); filter: drop-shadow(0 0 18px rgba(255, 210, 62, .95)); }
.ty-gold:hover { filter: drop-shadow(0 0 26px rgba(255, 210, 62, 1)) brightness(1.1); }
.ty-ev-svg { display: block; width: 100%; height: 100%; }
.ty-ev-svg svg { display: block; width: 100%; height: 100%; }
.ty-trap-plate { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 16px; white-space: nowrap; border: 3px solid #ff4d70; background: #fff; color: #1b1f4b;
  font-size: clamp(18px, 2.6vh, 24px); font-weight: 900; box-shadow: 0 6px 0 rgba(0, 0, 0, .3), 0 0 24px rgba(255, 77, 112, .75); }
.ty-trap-box { display: flex; flex-direction: column; align-items: center; gap: 0; }
.ty-trap-box .ty-ev-img { width: clamp(70px, 11vh, 110px); height: clamp(70px, 11vh, 110px); margin-bottom: -10px; position: relative; z-index: 1; }
.ty-trap-box .ty-trap-plate { font-size: clamp(15px, 2.1vh, 20px); padding: 5px 12px; }
.ty-trap-plate i { font-style: normal; }
.ty-trap-plate em { padding: 0 9px; border-radius: 10px; font-style: normal; background: #ff4d70; color: #fff; }

/* сообщения, загрузка, «Очистить Загрузки?» */
.ty-toast-box { position: fixed; left: 0; right: 0; bottom: clamp(16px, 4vh, 40px); z-index: 20; display: flex; justify-content: center; pointer-events: none; }
.ty-toast { display: flex; align-items: center; gap: 12px; max-width: min(92vw, 780px); padding: 14px 24px; border-radius: 20px; background: #262a72; border: 3px solid var(--cyan);
  font-size: clamp(18px, 2.6vh, 26px); font-weight: 900; box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
.ty-toast i { font-style: normal; font-size: 1.5em; }
.ty-load { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(13, 16, 48, .94); font-size: 28px; font-weight: 900; }
.ty-load span { font-size: 64px; animation: tySpin 1.4s linear infinite; }
@keyframes tySpin { to { rotate: 360deg; } }
.ty-net { position: fixed; top: 12px; right: 12px; z-index: 31; display: none; padding: 6px 12px; border-radius: 99px; font-size: 22px; background: var(--orange); }
.ty-net.on { display: block; }
.ty-ask { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(6, 8, 30, .7); }
.ty-ask-box { padding: 24px 40px 30px; border-radius: 28px; text-align: center; background: linear-gradient(180deg, #2b2f80, #171a48); border: 2px solid rgba(255, 255, 255, .2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.ty-ask-ico { font-size: 72px; line-height: 1.1; }
.ty-ask-box h2 { margin: 4px 0 6px; font-size: 34px; font-weight: 900; text-wrap: balance; }
.ty-ask-box p { margin: 0 0 8px; font-size: 22px; font-weight: 800; color: var(--muted); }
.ty-ask-mult { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 6px 0 4px; font-size: 38px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ty-ask-mult span { color: var(--muted); }
.ty-ask-mult b { color: var(--lime); text-shadow: 0 0 22px rgba(182, 242, 58, .6); }
.ty-ask-mult i { font-style: normal; color: var(--gold); }
.ty-btns { display: flex; justify-content: center; gap: 14px; margin-top: 16px; }
.ty-ask-box .btn-game { font-size: 26px; padding: 16px 38px; }
.ty-game.ty-hurt::after { content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; box-shadow: inset 0 0 140px 30px rgba(255, 77, 112, .75); animation: tyHurt .7s ease-out forwards; }
@keyframes tyHurt { from { opacity: 1; } to { opacity: 0; } }

/* награда поверх игры */
body.ty-loot-top .loot { z-index: 20050; }

/* узкий экран: рейтинг — под игрой, страница прокручивается */
@media (max-width: 920px) {
  .ty-wrap { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100%; }
  .ty-air { inset: 0; }
  .ty-top { flex-wrap: wrap; }
  .ty-stage { grid-template-columns: minmax(0, 1fr); }
  .ty-left { padding: 28px 0 8px; }
  .ty-win { min-height: 440px; }
  .ty-ups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ty-rank { border-left: 0; border-top: 2px solid rgba(255, 255, 255, .14); }
}
@media (max-width: 1250px) { .ty-title { display: none; } }
@media (max-width: 1180px) { .ty-dots { display: none; } .ty-win-bar { gap: 8px; padding: 10px 12px; } .ty-slow { padding: 4px 9px; font-size: 13px; } }
@media (max-height: 700px) {
  .ty-say { padding: 6px 14px; }
}
@media (prefers-reduced-motion: reduce) { .ty-game *, .ty-game *::before, .ty-game *::after { animation: none !important; } }

/* ── урок 11: перерыв по минуте — кольцо на кнопке ⬇️, окно «Перерыв на минуту ▶», таймер в игре ── */
.ty-btn .ty-ring { display: none; position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; rotate: -90deg; pointer-events: none; fill: none; }
.ty-btn .ty-ring circle { stroke: rgba(255, 255, 255, .16); stroke-width: 3; }
.ty-btn .ty-ring .ty-ring-fg { stroke: var(--cyan, #3ee0ff); stroke-linecap: round; }
.ty-btn.ty-m-break .ty-ring, .ty-btn.ty-m-ready .ty-ring { display: block; }
.ty-btn.ty-m-ready { border-color: var(--lime, #b6f23a); animation: tyReady 1.6s ease-in-out infinite; }
.ty-btn.ty-m-ready .ty-ring-fg { stroke: var(--lime, #b6f23a); }
@keyframes tyReady { 50% { box-shadow: 0 0 22px rgba(182, 242, 58, .75); } }
.ty-btn .ty-lock { display: none; position: absolute; right: -7px; bottom: -7px; font-size: 16px; line-height: 1; pointer-events: none; }
.ty-btn.ty-m-locked, .ty-btn.ty-m-paused, .ty-btn.ty-m-learning { filter: grayscale(1); opacity: .62; }
.ty-btn.ty-m-locked .ty-lock, .ty-btn.ty-m-paused .ty-lock, .ty-btn.ty-m-learning .ty-lock { display: block; }
/* урок 12: во время объяснения шла минута — кольцо показывает замороженный остаток */
.ty-btn.ty-frozen .ty-ring { display: block; }
.ty-gate { position: fixed; inset: 0; z-index: 20040; display: grid; place-items: center; padding: 16px; background: rgba(6, 8, 30, .72);
  color: #fff; font-family: Nunito, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
.ty-gate .ty-ask-box { width: min(600px, 100%); }
.ty-gate .ty-ask-box p, .ty-over .ty-ask-box p { color: var(--muted, #b9bde8); }
.ty-gate .btn-game { font-family: inherit; white-space: nowrap; }
.ty-gate .ty-ask-box .btn-game { font-size: 22px; padding: 14px 26px; }
.ty-quiz-ico .ty-chest-svg { width: 56px; }
.ty-timer { position: relative; flex: none; width: 60px; height: 60px; display: grid; place-items: center; }
.ty-timer svg { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; fill: none; }
.ty-timer circle { stroke: rgba(255, 255, 255, .16); stroke-width: 3.2; }
.ty-timer .ty-ring-fg { stroke: var(--lime, #b6f23a); stroke-linecap: round; }
.ty-timer b { position: relative; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ty-timer.ty-timer-end .ty-ring-fg { stroke: var(--orange, #ff9a2e); }
.ty-timer.ty-timer-end b { color: var(--orange, #ff9a2e); }
.ty-boost { position: absolute; top: -10px; right: 10px; padding: 2px 10px; border-radius: 99px; font-style: normal; font-size: 14px; font-weight: 900; white-space: nowrap;
  color: #1b1f4b; background: var(--gold, #ffd23e); box-shadow: 0 0 16px rgba(255, 210, 62, .8); }

/* «Золотой сундук» и вопрос */
.ty-chest { display: flex; flex-direction: column; align-items: center; gap: 2px; animation: tyChest 1.3s ease-in-out infinite; }
@keyframes tyChest { 50% { filter: drop-shadow(0 0 22px rgba(255, 210, 62, 1)) brightness(1.08); } }
.ty-chest-svg { display: block; width: clamp(76px, 12vh, 116px); }
.ty-chest-svg svg { display: block; width: 100%; height: auto; }
.ty-chest b { padding: 3px 10px; border-radius: 99px; white-space: nowrap; font-size: 15px; font-weight: 900; color: #fff; background: rgba(0, 0, 0, .5); }
.ty-quiz-box { width: min(780px, 94vw); padding: 22px 28px 24px; text-align: left; }
.ty-quiz-hd { display: flex; align-items: center; gap: 14px; }
.ty-quiz-ico { font-size: 50px; line-height: 1; }
.ty-quiz-hd small { display: block; font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--gold, #ffd23e); }
.ty-quiz-hd b { display: block; font-size: 18px; font-weight: 800; color: var(--muted, #b9bde8); }
.ty-ask-box .ty-quiz-q { margin: 14px 0; font-size: clamp(24px, 3.6vh, 32px); text-align: left; }
.ty-quiz-a { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ty-qa { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 12px 16px; border-radius: 18px; border: 3px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 20px; font-weight: 800; text-align: left; cursor: pointer;
  transition: background-color .15s, border-color .15s, translate .1s; }
.ty-qa:hover:not(:disabled) { background: rgba(255, 255, 255, .17); translate: 0 -2px; }
.ty-qa:disabled { cursor: default; }
.ty-qa i { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-style: normal; font-weight: 900; color: var(--cyan, #3ee0ff); background: rgba(0, 0, 0, .35); }
.ty-qa.ok { border-color: var(--lime, #b6f23a); background: rgba(182, 242, 58, .22); }
.ty-qa.almost { border-color: var(--orange, #ff9a2e); background: rgba(255, 154, 46, .2); }
.ty-ask-box .ty-quiz-why { margin: 14px 0 0; padding: 10px 14px; border-radius: 14px; font-size: 19px; color: #fff; background: rgba(255, 154, 46, .16); }
.ty-quiz-why b { color: var(--orange, #ff9a2e); }
.ty-quiz .ty-btns { justify-content: flex-end; }
@media (max-width: 700px) { .ty-quiz-a { grid-template-columns: minmax(0, 1fr); } .ty-qa { font-size: 18px; min-height: 56px; } }
@media (max-height: 700px) { .ty-ask-box .ty-quiz-q { margin: 8px 0; } .ty-qa { min-height: 54px; padding: 8px 14px; } }
