/* Хуевомёт — стили. Вайб «веб 2010–2015 / Windows 7»: глянцевые градиенты, тонкие обводки,
   Tahoma как во ВК, окна с красной кнопкой закрытия. Фирменные цвета huEVO: графит + красный. */

@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ptsans-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ptsans-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/ptsans-700-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/ptsans-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #bfe57e;
  --bg-hi: #ddf5a8;
  --bg-lo: #a2cf58;
  --txt: #222;
  --muted: #6b6b6b;
  --link: #2b587a; /* синий ссылок ВК */
  --line: #c4c4c4;
  --line-2: #9d9d9d;
  --hu-hi: #8c8c8c;
  --hu: #555;
  --hu-lo: #2e2e2e;
  --hu-red: #d40000;
  --tip: #ffffe1; /* жёлтая всплывашка Windows */
  --cw: 40px;
  --ch: 57px;
  --sw: 180px;
  --hud-h: 170px;
  --tabs-h: 80px;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --font: Tahoma, 'PT Sans', Verdana, Geneva, sans-serif;
  --font-head: 'Trebuchet MS', 'PT Sans', Tahoma, sans-serif;
  --outline: 0 1px 0 #1d1d1d, 1px 0 0 #1d1d1d, -1px 0 0 #1d1d1d, 0 -1px 0 #1d1d1d,
    1px 1px 0 #1d1d1d, -1px 1px 0 #1d1d1d, 1px -1px 0 #1d1d1d, -1px -1px 0 #1d1d1d;
  /* глянцевые кнопки: светлая верхняя половина с резким переходом посередине */
  --g-green: linear-gradient(#a6e683 0%, #75cd4f 48%, #55b52d 52%, #3f9a1d 100%);
  --g-gray: linear-gradient(#ffffff 0%, #f0f0f0 48%, #dedede 52%, #cfcfcf 100%);
  --g-red: linear-gradient(#f39a8c 0%, #e05a45 48%, #c8331f 52%, #a82312 100%);
  --g-gold: linear-gradient(#fff1a6 0%, #ffd84d 48%, #f5b800 52%, #dc9a00 100%);
  --g-dark: linear-gradient(#7a7a7a 0%, #575757 48%, #3d3d3d 52%, #2a2a2a 100%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 12px, rgba(255, 255, 255, 0) 12px 24px),
    radial-gradient(120% 90% at 50% 38%, var(--bg-hi) 0%, var(--bg) 60%, var(--bg-lo) 100%);
  color: var(--txt);
  font-family: var(--font);
  font-size: 13px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
img { -webkit-user-drag: none; }
img.px { image-rendering: pixelated; image-rendering: crisp-edges; display: inline-block; vertical-align: middle; }
img.ei { vertical-align: -3px; margin-right: 3px; }

/* знак валюты: мини-плашка huEVO с белой «Х» и красным бруском */
.cur {
  position: relative; display: inline-block; width: 1.3em; height: 1.3em; margin-right: 0.3em; vertical-align: -0.2em;
  border-radius: 0.24em; background: linear-gradient(#8c8c8c, #3a3a3a); border: 1px solid #222;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 1px rgba(0, 0, 0, 0.3);
  color: #fff; font: normal bold 0.8em/1.3em Arial, Helvetica, sans-serif; text-align: center;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); overflow: hidden;
}
.cur::after { content: ''; position: absolute; right: 0.16em; bottom: 0.1em; width: 0.38em; height: 0.2em; background: var(--hu-red); }

#rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#app { position: relative; z-index: 1; height: 100%; display: flex; justify-content: center; }
#play { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 520px; height: 100%; }

/* ---------- верх ---------- */
#hud { position: relative; z-index: 5; display: flex; flex-direction: column; align-items: center; padding: calc(8px + var(--st)) 10px 0; }
#topbar { width: 100%; display: flex; align-items: center; gap: 6px; min-height: 36px; }
.spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 3px; min-width: 0; max-width: 58%;
  border-radius: 4px; background: linear-gradient(#ffffff, #e8e8e8); border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.25); font-weight: bold; font-size: 12px; color: var(--link);
}
.ava { flex: none; width: 26px; height: 26px; border-radius: 2px; overflow: hidden; display: grid; place-items: center; background: #f2f2f2; border: 1px solid #b5b5b5; }
.ava img { width: 100%; height: 100%; object-fit: cover; }
#pname { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { flex: none; font-size: 9px; letter-spacing: 0.5px; background: var(--g-red); color: #fff; padding: 2px 5px; border-radius: 3px; border: 1px solid #8e1b0d; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3); }
#bribes { padding: 0 10px 0 6px; color: var(--txt); font-size: 13px; }
.envi { width: 26px; height: 21px; display: inline-block; }
.envi svg { width: 100%; height: 100%; display: block; }
.iconbtn {
  flex: none; width: 34px; height: 32px; border-radius: 4px; display: grid; place-items: center;
  background: var(--g-gray); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.25);
}
.iconbtn svg { width: 22px; height: 22px; display: block; }
.chip:active, .iconbtn:active { background: linear-gradient(#d9d9d9, #efefef); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3); }

/* ---------- счётчик: тёмные перекидные карточки, как часы HTC Sense ---------- */
.counter { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; min-height: calc(var(--ch) + 6px); }
.fc-box { display: flex; gap: 3px; }
.fc {
  position: relative; width: var(--cw); height: var(--ch); perspective: calc(var(--ch) * 4);
  font-family: Tahoma, 'PT Sans', Verdana, sans-serif; font-weight: bold; font-size: calc(var(--ch) * 0.74); color: #fff;
  border-radius: 6px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), 0 0 0 1px #111;
}
.fc.gap { margin-left: calc(var(--cw) * 0.24); }
.fc.dot { width: calc(var(--cw) * 0.42); }
.fc > div { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; }
.fc span { position: absolute; left: 0; right: 0; height: var(--ch); line-height: var(--ch); text-align: center; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.7); }
.fc-t, .fc-ft { top: 0; border-radius: 6px 6px 0 0; background: linear-gradient(#6a6a6a, #3c3c3c); }
.fc-b, .fc-fb { bottom: 0; border-radius: 0 0 6px 6px; background: linear-gradient(#2e2e2e, #1a1a1a); }
.fc-t span, .fc-ft span { top: 0; }
.fc-b span, .fc-fb span { top: calc(var(--ch) * -0.5); }
.fc-ft { z-index: 2; transform-origin: 50% 100%; backface-visibility: hidden; }
.fc-fb { z-index: 2; transform-origin: 50% 0; transform: rotateX(90deg); backface-visibility: hidden; }
.fc::before { content: ''; position: absolute; z-index: 4; left: 0; right: 0; top: 0; height: 30%; border-radius: 6px 6px 0 0; background: linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0)); pointer-events: none; }
.fc::after { content: ''; position: absolute; z-index: 3; left: 0; right: 0; top: calc(50% - 1px); height: 2px; background: #000; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12); }
.fc.flip .fc-ft { animation: fcTop 0.12s ease-in forwards; }
.fc.flip .fc-fb { animation: fcBot 0.12s ease-out 0.12s forwards; }
@keyframes fcTop { to { transform: rotateX(-90deg); } }
@keyframes fcBot { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }
.fc-unit {
  font-weight: bold; font-size: calc(var(--ch) * 0.36); line-height: 1; padding: 6px 7px; border-radius: 5px; color: #fff;
  background: linear-gradient(#6a6a6a, #3c3c3c 50%, #2a2a2a 51%, #1a1a1a); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), 0 0 0 1px #111;
}
.fc-sign { width: var(--ch); height: var(--ch); margin-left: 3px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4)); }
.fc-sign svg { width: 100%; height: 100%; display: block; }

#rate {
  margin-top: 6px; color: #fff; font-family: Tahoma, 'PT Sans', Verdana, sans-serif; font-weight: bold;
  font-size: clamp(15px, 4.4vw, 19px); white-space: nowrap; text-shadow: var(--outline), 0 3px 3px rgba(0, 0, 0, 0.35);
}
#rate.boosted { color: #ffe36b; }
#boosts { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 6px; min-height: 22px; }
.boost {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 4px; border-radius: 3px; font-size: 11px; font-weight: bold; color: #fff;
  background: var(--g-dark); border: 1px solid #111; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); text-shadow: 0 -1px 0 #000;
}
.boost img.ei { margin: 0; }

/* ---------- пачка ---------- */
#stage { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; touch-action: none; cursor: grab; }
#stage:active { cursor: grabbing; }
#stack { position: relative; width: var(--sw); height: calc(var(--sw) * 2); margin-bottom: 10px; transform-origin: 50% 85%; }
#stack .deck {
  position: absolute; inset: 0; border-radius: 9px; background: var(--edge, #ddd);
  box-shadow: 2px 3px 0 #fff, 4px 6px 0 var(--edge, #ddd), 6px 9px 0 #fff, 8px 12px 0 var(--edge, #ddd),
    10px 15px 0 #f4f4f4, 12px 19px 6px rgba(0, 0, 0, 0.25);
}
#billTop { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 9px; pointer-events: none; }
#band {
  position: absolute; left: -7%; right: -7%; top: 60%; height: 12.5%; display: grid; place-items: center; pointer-events: none;
  background: linear-gradient(#5cd6c7 0%, #2fbcab 48%, #20a596 52%, #188c80 100%); border-top: 1px solid #8ff0e4; border-bottom: 1px solid #0d6359;
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.25); color: #fff; font-family: Tahoma, 'PT Sans', Verdana, sans-serif; font-weight: bold;
  font-size: calc(var(--sw) * 0.14); white-space: nowrap; text-shadow: var(--outline);
}
#band::before, #band::after { content: ''; position: absolute; top: 0; bottom: 0; width: 6.5%; background: rgba(0, 0, 0, 0.18); }
#band::before { left: 0; }
#band::after { right: 0; }
#band .cur { font-size: 0.7em; vertical-align: 0.05em; }
#stack.pop { animation: squash 0.14s ease-out; }
@keyframes squash { 50% { transform: scale(0.97, 0.95); } }
#stack.golden .deck { box-shadow: 2px 3px 0 #fff, 4px 6px 0 #e9c45a, 6px 9px 0 #fff, 8px 12px 0 #e9c45a, 10px 15px 0 #fff6d8, 0 0 34px 10px rgba(255, 213, 74, 0.75); }
#stack.golden #billTop { animation: goldglow 0.9s ease-in-out infinite alternate; }
@keyframes goldglow { to { filter: brightness(1.12) drop-shadow(0 0 10px #ffe27a); } }

#safe, #trophy { position: absolute; bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 2; }
#safe { left: 6px; width: min(27%, 124px); }
#trophy { right: 8px; width: min(19%, 88px); }
#safeArt, #trophyArt { display: block; width: 100%; }
#safeArt svg, #trophyArt svg { display: block; width: 100%; height: auto; }
.safelbl, .tcount {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; margin-top: -4px; padding: 2px 7px 3px; border-radius: 3px;
  background: linear-gradient(#ffffff, #e6e6e6); border: 1px solid var(--line-2); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-weight: bold; font-size: 11px; white-space: nowrap;
}
/* прогресс-бар как в Windows 7 */
.safebar { display: block; height: 6px; border-radius: 2px; background: linear-gradient(#d6d6d6, #f5f5f5); border: 1px solid #a5a5a5; overflow: hidden; }
.safebar i { display: block; height: 100%; width: 0; background: linear-gradient(#b9f29b 0%, #6fd243 50%, #3fae1c 51%, #5cc93a 100%); }
#safe.full .safelbl { background: linear-gradient(#ffe9e5, #ffd0c8); border-color: #c9533f; }
#safe.full .safebar i { background: linear-gradient(#ffb0a3 0%, #ee5a43 50%, #c8331f 51%, #e04a33 100%); }
#safe.ready #safeArt { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-4deg); } 90% { transform: rotate(4deg); } 95% { transform: rotate(-2deg); } }
#safe:active, #trophy:active { transform: scale(0.96); }

/* ---------- нижние вкладки: тёмная глянцевая «панель задач» ---------- */
#tabs {
  position: relative; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 5px 6px calc(5px + var(--sb)); background: linear-gradient(#6e6e6e 0%, #4c4c4c 48%, #333 52%, #222 100%);
  border-top: 1px solid #9a9a9a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 -2px 6px rgba(0, 0, 0, 0.25);
}
#tabs::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--hu-red); opacity: 0.85; }
#tabs button {
  position: relative; height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 5px; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s;
}
#tabs button svg { width: 46px; height: 46px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
#tabs .tl { font-size: 11px; font-weight: bold; color: #fff; text-shadow: 0 1px 1px #000; }
@media (hover: hover) {
  #tabs button:hover { background: linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04) 50%, rgba(255, 255, 255, 0) 51%, rgba(255, 255, 255, 0.08)); border-color: rgba(255, 255, 255, 0.25); }
}
#tabs button.on {
  background: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.04) 51%, rgba(170, 215, 255, 0.25));
  border-color: rgba(255, 255, 255, 0.55); box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.35), 0 0 10px rgba(120, 190, 255, 0.45);
}
#tabs button:active svg { transform: translateY(1px); }
#tabs .dot {
  position: absolute; top: 3px; right: 14%; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, #ff8a7a, #d40000 70%); border: 1.5px solid #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  color: #fff; font: normal bold 11px/1 Tahoma, sans-serif;
}
#tabs .dot::after { content: '!'; }

/* ---------- панель с предметами ---------- */
#panel {
  position: fixed; z-index: 20; left: 50%; width: 100%; max-width: 520px; top: calc(var(--hud-h) - 6px); bottom: var(--tabs-h);
  display: flex; flex-direction: column; overflow: hidden; background: #f2f2f2;
  border: 1px solid #1e1e1e; border-bottom: 0; border-radius: 6px 6px 0 0; box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, calc(100% + var(--tabs-h) + 30px)); visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.28s;
}
#panel.open { transform: translate(-50%, 0); visibility: visible; transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.phead {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 8px 9px 12px; color: #fff;
  background: linear-gradient(#7c7c7c 0%, #5a5a5a 48%, #424242 52%, #333 100%); border-bottom: 2px solid var(--hu-red);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.ptxt { flex: 1; min-width: 0; }
#ptitle { font-family: var(--font-head); font-weight: bold; font-size: 18px; text-shadow: 0 -1px 0 #000, 0 1px 2px rgba(0, 0, 0, 0.5); }
#psub { margin-top: 1px; font-size: 11.5px; color: #e4e4e4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 -1px 0 #000; }
#psub .cur { font-size: 0.85em; }
/* красная кнопка закрытия как в Windows 7 */
.pclose, .mclose {
  flex: none; width: 42px; height: 22px; border-radius: 4px; display: grid; place-items: center; color: #fff;
  background: var(--g-red); border: 1px solid #5e1208; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
  font: normal bold 14px/1 Arial, sans-serif; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
}
.pclose:hover, .mclose:hover { background: linear-gradient(#f8b2a6 0%, #ea6c58 48%, #d63f2a 52%, #b72a17 100%); }
.pbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: linear-gradient(#fbfbfb, #e9e9e9); border-bottom: 1px solid var(--line); }
#phint { flex: 1; min-width: 0; font-size: 11px; color: #555; }
/* сегментный переключатель */
.pmult { flex: none; display: flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12); }
.pmult button { padding: 4px 9px; font-weight: bold; font-size: 11px; color: #333; background: var(--g-gray); border-left: 1px solid var(--line-2); text-shadow: 0 1px 0 #fff; }
.pmult button:first-child { border-left: 0; }
.pmult button.on { background: linear-gradient(#cfe4f9, #b7d6f4 50%, #a5cbf1 51%, #c3dcf6); color: #123a5f; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25); }
.plist { flex: 1; overflow-y: auto; padding: 8px 8px calc(12px + var(--sb)); touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: #f2f2f2; }

.item {
  display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px 8px; margin-bottom: 6px;
  background: linear-gradient(#ffffff, #f3f3f3); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.1);
}
@media (hover: hover) {
  .item:hover { border-color: #a9c7e8; background: linear-gradient(#f7fbff, #e6f1fc); }
}
.item .ic {
  position: relative; width: 50px; height: 50px; border-radius: 5px; display: grid; place-items: center;
  background: linear-gradient(#ffffff, #e2e2e2); border: 1px solid #b3b3b3; box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.15);
}
.item .ic span { font-size: 28px; }
.lvl {
  position: absolute; right: -7px; bottom: -7px; min-width: 22px; padding: 1px 4px; border-radius: 3px; text-align: center;
  background: var(--g-dark); color: #fff; border: 1px solid #111; font-size: 10px; font-weight: bold; text-shadow: 0 -1px 0 #000;
}
.lvl:empty { display: none; }
.nm { font-weight: bold; font-size: 12.5px; line-height: 1.2; color: var(--link); }
.ds { margin-top: 1px; font-size: 11px; line-height: 1.3; color: #777; }
.ef { margin-top: 2px; font-size: 11px; font-weight: bold; color: #3a8a1c; }
.ef .cur { font-size: 0.85em; }
.ef:empty { display: none; }
.ms { height: 8px; margin-top: 4px; border-radius: 2px; background: linear-gradient(#d9d9d9, #f7f7f7); border: 1px solid #a5a5a5; overflow: hidden; }
.ms i { display: block; height: 100%; width: 0; background: linear-gradient(#b9f29b 0%, #6fd243 50%, #3fae1c 51%, #5cc93a 100%); transition: width 0.3s; }
.msl { margin-top: 1px; font-size: 10px; color: #8a6a00; }
.buy {
  min-width: 96px; padding: 5px 8px 6px; border-radius: 4px; text-align: center; color: #fff;
  background: var(--g-green); border: 1px solid #2c6f14; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 2px rgba(0, 0, 0, 0.3);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35);
}
.buy .bt { display: block; font-weight: bold; font-size: 11px; }
.buy .bp { display: block; font-weight: bold; font-size: 12px; white-space: nowrap; margin-top: 1px; }
.buy:active { background: linear-gradient(#3f9a1d, #55b52d 48%, #75cd4f 52%, #8ed96a); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.35); }
.buy.off { background: var(--g-gray); border-color: #9a9a9a; color: #7b7b7b; text-shadow: 0 1px 0 #fff; }
.buy.gold { background: var(--g-gold); border-color: #a87400; color: #4a3000; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.item.locked { opacity: 0.75; border-style: dashed; }
.item.locked .ic img { filter: grayscale(1) opacity(0.7); }
.item.ach { grid-template-columns: 50px minmax(0, 1fr); }
.item.ach:not(.got) .ic img { filter: grayscale(1) opacity(0.6); }
.item.ach.got { background: linear-gradient(#fffdf0, #fff6cc); border-color: #e0c66a; }
.achhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 2px 10px; font-size: 12px; }
.stats { margin-top: 4px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.stats h3 { margin: 2px 0 6px; font-family: var(--font-head); font-size: 14px; color: var(--link); }
.stats div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12px; border-bottom: 1px dotted #ccc; }
.stats div:last-child { border-bottom: 0; }
.pnote { padding: 6px 12px 12px; text-align: center; font-size: 11px; color: var(--muted); }

/* ---------- кнопки ---------- */
.btn {
  width: 100%; min-height: 38px; padding: 7px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 4px; background: var(--g-green); border: 1px solid #2c6f14; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 3px rgba(0, 0, 0, 0.3);
  color: #fff; font-family: var(--font); font-weight: bold; font-size: 14px; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35);
}
.btn:active:not(:disabled) { box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35); }
.btn.big { min-height: 44px; font-size: 15px; }
.btn.red { background: var(--g-red); border-color: #7d1a0c; }
.btn.gray { background: var(--g-gray); border-color: #8f8f8f; color: #333; text-shadow: 0 1px 0 #fff; }
.btn.gold { background: var(--g-gold); border-color: #a87400; color: #4a3000; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn.small { width: auto; min-height: 28px; padding: 4px 10px; font-size: 12px; }
.btn:disabled { filter: grayscale(0.9); opacity: 0.6; }

/* ---------- окна: стекло Aero ---------- */
#modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 14px; background: rgba(0, 0, 0, 0.5); }
.mcard {
  width: min(100%, 370px); max-height: calc(100% - 12px); overflow: auto; padding: 0 6px 6px; border-radius: 7px;
  background: linear-gradient(rgba(214, 228, 243, 0.97), rgba(178, 202, 228, 0.97)); border: 1px solid #3b4d61;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 10px 30px rgba(0, 0, 0, 0.55); animation: mpop 0.2s ease-out;
}
@keyframes mpop { from { transform: scale(0.92); opacity: 0; } }
.mhead {
  position: relative; padding: 7px 50px 7px 4px; text-align: left; font-family: var(--font-head); font-weight: bold; font-size: 15px;
  color: #13304f; text-shadow: 0 0 6px #fff, 0 0 2px #fff;
}
.mhead.bad { color: #6b0f05; }
.mclose { position: absolute; right: 0; top: 0; border-radius: 0 0 4px 4px; border-top: 0; }
.mbody { padding: 12px 14px 4px; text-align: center; font-size: 13px; line-height: 1.45; background: #fff; border: 1px solid #8ea2b8; border-bottom: 0; border-radius: 3px 3px 0 0; }
.mbody p { margin: 6px 0 10px; }
.mbtns { display: flex; flex-direction: column; gap: 8px; padding: 6px 14px 12px; background: #f0f0f0; border: 1px solid #8ea2b8; border-top: 1px solid #dfdfdf; border-radius: 0 0 3px 3px; }
.mbtns:empty { display: none; }
.mbody:last-child { border-bottom: 1px solid #8ea2b8; border-radius: 3px; padding-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.warn { color: #8a3000; background: var(--tip); border: 1px solid #d9b45c; border-radius: 3px; padding: 6px 8px; }
.safe-big svg { width: 140px; height: auto; }
.giftbig { margin: 4px 0; font-size: 40px; line-height: 1.1; font-weight: bold; }

.wheel { position: relative; width: min(72vw, 280px); aspect-ratio: 1; margin: 6px auto 4px; }
.wheel-rot { width: 100%; height: 100%; will-change: transform; }
.wheel-rot svg { width: 100%; height: 100%; display: block; }
.wheel-ptr { position: absolute; left: 50%; top: -12px; width: 38px; height: 44px; transform: translateX(-50%); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4)); }

.visitor { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vava {
  width: 116px; height: 116px; border-radius: 6px; display: grid; place-items: center;
  background: linear-gradient(#ffffff, var(--c)); border: 1px solid #555; box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(0, 0, 0, 0.35);
  animation: vin 0.4s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes vin { from { transform: scale(0.3); opacity: 0; } }
.bubble { position: relative; padding: 8px 12px; background: var(--tip); border: 1px solid #767676; border-radius: 4px; font-size: 13px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.bubble::before { content: ''; position: absolute; top: -7px; left: 50%; width: 12px; height: 12px; margin-left: -6px; background: var(--tip); border-left: 1px solid #767676; border-top: 1px solid #767676; transform: rotate(45deg); }
.veffect { padding: 6px 10px; border-radius: 3px; font-size: 13px; }
.veffect.bad { background: #ffe4df; color: #8e1a0c; border: 1px solid #e4a093; }
.veffect.good { background: #e6f7dd; color: #2a6e18; border: 1px solid #9fd38a; }

.settings { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.srow {
  display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 4px; font-weight: bold; font-size: 13px;
  background: linear-gradient(#ffffff, #efefef); border: 1px solid var(--line); box-shadow: inset 0 1px 0 #fff;
}
.srow span { display: inline-flex; align-items: center; gap: 6px; }
.srow b { font-size: 16px; color: #888; }
.srow.danger { color: #a3200f; }
/* переключатель «ВКЛ/ВЫКЛ» в духе iOS 6 */
.tgl {
  position: relative; width: 62px; height: 24px; border-radius: 12px; overflow: hidden; border: 1px solid #8a8a8a;
  background: linear-gradient(#d4d4d4, #f6f6f6); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.25);
}
.tgl::before { content: 'ВЫКЛ'; position: absolute; right: 7px; top: 5px; font: normal bold 10px/1 Tahoma, sans-serif; color: #777; }
.tgl::after { content: ''; position: absolute; top: 0; left: 0; width: 24px; height: 22px; border-radius: 11px; background: linear-gradient(#ffffff, #d9d9d9); border: 1px solid #8a8a8a; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.tgl.on { background: linear-gradient(#2b7fd6, #5aa6ef); border-color: #1d5ea3; }
.tgl.on::before { content: 'ВКЛ'; left: 9px; right: auto; color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35); }
.tgl.on::after { transform: translateX(37px); }
.settings .muted { text-align: center; margin: 6px 0 0; }

/* ---------- уведомления (как всплывашки ВК) ---------- */
#toasts { position: fixed; z-index: 60; top: calc(6px + var(--st)); left: 50%; width: min(94vw, 400px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
.toast {
  padding: 8px 11px; border-radius: 4px; background: rgba(28, 28, 28, 0.9); color: #fff; border: 1px solid #000;
  font-size: 12px; line-height: 1.35; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: tin 0.25s ease-out; transition: opacity 0.35s, transform 0.35s;
}
.toast .cur { font-size: 0.85em; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- эффекты ---------- */
#fx { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.flybill { position: fixed; border-radius: 8px; pointer-events: none; will-change: transform; }
.flybill.small { width: 30px; height: 60px; }
.floattext {
  position: fixed; z-index: 16; transform: translate(-50%, 0); white-space: nowrap; font-family: Tahoma, 'PT Sans', Verdana, sans-serif;
  font-weight: bold; font-size: 20px; color: #fff; text-shadow: var(--outline), 0 2px 3px rgba(0, 0, 0, 0.4); animation: floatUp 0.9s ease-out forwards;
}
.floattext .cur { font-size: 0.75em; }
.floattext.gold, .floattext.big { color: #ffe36b; font-size: 26px; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.7); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -90px) scale(1); }
}
.spark { position: fixed; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: #ffd54a; box-shadow: 0 0 8px #ffe27a; animation: spark 0.7s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--x), var(--y)) scale(0.2); opacity: 0; } }
.bump { animation: bump 0.3s ease-out; }
@keyframes bump { 40% { transform: scale(1.08); } }
.pop { animation: squash 0.25s ease-out; }
.shake { animation: shake 0.45s ease-in-out; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- обучение: жёлтая всплывашка Windows ---------- */
.hint {
  position: fixed; z-index: 45; max-width: 220px; padding: 7px 10px; text-align: center; pointer-events: none;
  background: var(--tip); color: #000; border: 1px solid #767676; border-radius: 4px; box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.3);
  font-size: 12px; font-weight: bold; animation: hintbob 0.9s ease-in-out infinite alternate;
}
.hint::after { content: ''; position: absolute; left: var(--ax, 50%); bottom: -7px; width: 12px; height: 12px; margin-left: -6px; background: var(--tip); border-right: 1px solid #767676; border-bottom: 1px solid #767676; transform: rotate(45deg); }
@keyframes hintbob { to { transform: translateY(-4px); } }
.hand { position: fixed; z-index: 44; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); animation: hand 1.5s ease-in-out infinite; }
@keyframes hand { 0% { transform: translateY(30px); opacity: 0; } 20% { opacity: 1; } 70% { transform: translateY(-70px); opacity: 1; } 100% { transform: translateY(-90px); opacity: 0; } }
.pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

.fatal { position: fixed; z-index: 99; left: 12px; right: 12px; bottom: 12px; padding: 12px; background: #fff; border: 1px solid var(--hu-red); border-radius: 4px; font-weight: bold; }
#errbox { position: fixed; z-index: 99; left: 0; right: 0; bottom: 0; max-height: 30%; overflow: auto; margin: 0; padding: 6px; font-size: 11px; white-space: pre-wrap; background: rgba(160, 0, 0, 0.85); color: #fff; }

/* ---------- низкие экраны ---------- */
@media (max-height: 680px) {
  #tabs button { height: 56px; }
  #tabs button svg { width: 36px; height: 36px; }
  #tabs .tl { font-size: 10px; }
  #rate { font-size: 15px; margin-top: 4px; }
  #boosts { margin-top: 4px; }
  .counter { margin-top: 4px; }
}

/* ---------- широкий режим: рамка huEVO на десктопе ---------- */
body.wide #app { gap: 14px; padding: 0 14px; }
body.wide #play { flex: none; width: min(44vw, 470px); }
body.wide #panel {
  position: relative; left: auto; top: auto; bottom: auto; flex: 1 1 auto; max-width: 640px; height: calc(100% - 24px); margin: 12px 0;
  border-bottom: 1px solid #1e1e1e; border-radius: 6px; transform: none; visibility: visible; transition: none;
}
body.wide .pclose { display: none; }
body.wide #tabs { border-radius: 6px 6px 0 0; }
body.wide #toasts { top: auto; bottom: 18px; left: auto; right: 18px; width: 330px; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hint, .hand, .pulse, #safe.ready #safeArt, #stack.golden #billTop { animation: none; }
}
