@font-face { font-family: "Nunito"; src: url("fonts/Nunito.ttf"); font-weight: 200 1000; font-display: swap; }
:root {
  --ink: #183153; --sky: #140c10; --accent: #ff7a1a; --accent2: #ffb238; --ok: #2f9d57;
  --card: rgba(255, 255, 255, 0.94); --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #140c10; color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.screen { position: fixed; inset: 0; display: none; flex-direction: column; justify-content: space-between;
  padding: calc(12px + var(--safe-t)) 14px calc(16px + var(--safe-b)); pointer-events: none; }
.screen.on { display: flex; }
.screen button, .screen .card { pointer-events: auto; }
.screen.dim { background: rgba(10, 0, 0, 0.55); justify-content: center; align-items: center; pointer-events: auto; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pill { background: rgba(255, 255, 255, 0.9); border-radius: 999px; padding: 6px 14px; font-size: 20px; font-weight: 800;
  box-shadow: 0 3px 0 rgba(24, 49, 83, 0.18); white-space: nowrap; }
.pill span { margin-left: 6px; }
.score { font-size: 34px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 rgba(24, 49, 83, 0.45), 0 0 12px rgba(24, 49, 83, 0.3);
  margin-left: auto; font-variant-numeric: tabular-nums; }

button { font-family: inherit; color: var(--ink); border: 0; cursor: pointer; }
button:disabled { opacity: 0.45; cursor: default; }
.round { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); font-size: 22px;
  box-shadow: 0 3px 0 rgba(24, 49, 83, 0.18); flex: none; }
.big, .mid { display: block; width: 100%; max-width: 340px; margin: 10px auto 0; border-radius: 18px; font-weight: 900; }
.big { font-size: 28px; padding: 16px; color: #fff; background: linear-gradient(#ff9a3a, #ff6a12);
  box-shadow: 0 6px 0 #c24a00, 0 10px 20px rgba(194, 74, 0, 0.35); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 #c24a00; }
.mid { font-size: 20px; padding: 12px; background: #fff; box-shadow: 0 4px 0 rgba(24, 49, 83, 0.25); }
.mid:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(24, 49, 83, 0.25); }
.mid.gold { background: linear-gradient(#ffe27a, #ffc21a); box-shadow: 0 4px 0 #c48a00; }

.title { text-align: center; margin-top: -12vh; }
.title h1 { margin: 0; font-size: clamp(40px, 11vw, 84px); font-weight: 1000; letter-spacing: 2px; color: #ffd9a0; line-height: 1;
  text-shadow: 0 4px 0 #c2300a, 0 8px 0 #6a1404, 0 0 30px rgba(255, 80, 20, 0.6); transform: rotate(-3deg); }
.title p { margin: 18px 0 0; font-size: 22px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(24, 49, 83, 0.5); }
.bottom { text-align: center; }
.best { display: inline-block; background: rgba(255, 255, 255, 0.85); border-radius: 999px; padding: 4px 14px; font-size: 18px; font-weight: 800; }

#pows { position: absolute; left: 14px; top: calc(70px + var(--safe-t)); display: flex; flex-direction: column; gap: 6px; }
.pow { width: 120px; height: 30px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); position: relative; overflow: hidden;
  display: flex; align-items: center; }
.pow span { position: relative; z-index: 1; font-size: 18px; padding-left: 8px; }
.pow i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #ffd23a, #ff9a3a); }
#hint { align-self: center; margin-bottom: 18vh; background: rgba(24, 49, 83, 0.75); color: #fff; font-size: 22px; font-weight: 900;
  padding: 10px 18px; border-radius: 16px; opacity: 0; transition: opacity 0.2s; text-align: center; }

.card { background: var(--card); border-radius: 26px; padding: 22px 20px 20px; width: min(92vw, 380px); text-align: center;
  box-shadow: 0 12px 40px rgba(24, 49, 83, 0.35); max-height: calc(100% - 20px); overflow-y: auto; touch-action: pan-y; }
.card.wide { width: min(94vw, 460px); text-align: left; }
.card h2 { margin: 0 0 6px; font-size: 32px; font-weight: 1000; }
.card h3 { margin: 16px 0 8px; font-size: 18px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.6; }
.big-num { font-size: 56px; font-weight: 1000; line-height: 1.1; font-variant-numeric: tabular-nums; }
.row { font-size: 20px; margin-bottom: 8px; }
.record { display: inline-block; background: var(--ok); color: #fff; padding: 3px 12px; border-radius: 999px; font-weight: 900; }
.shop-head { display: flex; justify-content: space-between; align-items: center; }

.item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(24, 49, 83, 0.1); }
.item .ic { font-size: 30px; width: 40px; text-align: center; }
.item .tx { flex: 1; min-width: 0; }
.item b { display: block; font-size: 18px; }
.item small { display: block; font-size: 14px; opacity: 0.7; }
.pips { display: flex; gap: 4px; margin-top: 5px; }
.pips i { width: 18px; height: 7px; border-radius: 4px; background: rgba(24, 49, 83, 0.15); }
.pips i.on { background: var(--accent); }
.buy { flex: none; min-width: 86px; padding: 10px 10px; border-radius: 14px; font-weight: 900; font-size: 16px;
  background: linear-gradient(#ffe27a, #ffc21a); box-shadow: 0 3px 0 #c48a00; }
#shopSkins { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.skin { background: #fff; border-radius: 16px; padding: 10px 6px; box-shadow: 0 3px 0 rgba(24, 49, 83, 0.2); text-align: center; }
.skin.sel { outline: 3px solid var(--accent); }
.skin .sw { display: block; width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 6px; border: 2px solid rgba(24, 49, 83, 0.2); }
.skin b { display: block; font-size: 15px; }
.skin small { font-size: 13px; opacity: 0.75; }
.nw { white-space: nowrap; }

#vign { position: fixed; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(200,20,0,0.75) 100%); }

/* хоррор-карточки: тёмные, с жаром по краю */
.card { background: rgba(28, 14, 16, 0.95) !important; color: #ffe2c8; box-shadow: 0 0 0 2px #6a1a0a, 0 0 40px rgba(255, 60, 10, 0.35) !important; }
.card h2 { color: #ff8a4a; }
.card .mid { background: #3a2226; color: #ffe2c8; }
.skin { background: #3a2226; color: #ffe2c8; }
.item { border-bottom-color: rgba(255, 200, 160, 0.12); }
.pips i { background: rgba(255, 200, 160, 0.18); }
.card .pill { background: #3a2226; color: #ffe2c8; }
.skin.bump { animation: bump 0.25s ease-out; }
@keyframes bump { 50% { transform: scale(1.08); } }

#banner { position: fixed; left: 0; right: 0; top: 28%; text-align: center; pointer-events: none; z-index: 5;
  font-size: clamp(26px, 8vw, 48px); font-weight: 1000; color: #ffd9a0; opacity: 0; transform: scale(0.8);
  text-shadow: 0 3px 0 #6a1404, 0 0 24px rgba(255, 80, 20, 0.7); transition: opacity 0.25s, transform 0.25s; padding: 0 16px; }
#banner.on { opacity: 1; transform: scale(1); }
#banner.rage { color: #fff; animation: ragepulse 0.3s infinite alternate; }
@keyframes ragepulse { to { transform: scale(1.08); color: #ffb080; } }
.daily { background: rgba(28, 14, 16, 0.85); color: #ffe2c8; border-radius: 14px; padding: 8px 12px; margin: 0 auto 8px;
  max-width: 340px; font-weight: 800; font-size: 16px; text-align: center; box-shadow: 0 0 0 1px #6a1a0a; }
.daily small { display: block; opacity: 0.75; font-size: 13px; }

/* 4. магазин: карточка ограничена экраном, «Назад» прилипает к низу */
#shop .card.wide { max-height: calc(100vh - 32px); overflow-y: auto; }
#btnShopBack { position: sticky; bottom: 0; box-shadow: 0 -10px 16px rgba(28, 14, 16, 0.95); }

/* горошек — нарисованный кружок, как в забеге, вместо эмодзи */
.pea { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; vertical-align: -0.08em;
  background: radial-gradient(circle at 35% 30%, #d8ffb0 0 14%, #7fd34a 30%, #3f8a1c 100%); box-shadow: 0 1px 0 rgba(0,0,0,0.3); }
.round.txt { width: auto; padding: 0 14px; border-radius: 999px; font-size: 15px; font-weight: 900; }
.tag { font-size: 14px; font-weight: 900; color: #2f6fd8; margin-left: 8px; }
.pw { font-weight: 1000; font-size: 13px; color: #ff8a4a; white-space: nowrap; }
.item .ic.pw { font-size: 13px; width: 58px; }
.title h1 .sub { display: block; margin-top: 10px; font-size: 0.62em; letter-spacing: 0.35em; color: #ff3a1a;
  text-shadow: 0 3px 0 #4a0800, 0 0 26px rgba(255, 40, 10, 0.9); }
.big.dark { background: linear-gradient(#5a1a12, #2a0806); box-shadow: 0 6px 0 #140302, 0 10px 20px rgba(0,0,0,0.4); }

.lvl { position: relative; max-width: 340px; margin: 0 auto 6px; background: rgba(28,14,16,0.85); color: #ffd9a0; border-radius: 999px;
  padding: 4px 12px; font-weight: 1000; font-size: 14px; text-align: center; overflow: hidden; box-shadow: 0 0 0 1px #6a1a0a; }
.lvl i { position: absolute; left: 0; bottom: 0; height: 3px; background: #ff8a4a; }
.mis { max-width: 340px; margin: 0 auto 6px; background: rgba(28,14,16,0.85); color: #ffe2c8; border-radius: 14px; padding: 6px 12px;
  font-size: 13px; font-weight: 800; box-shadow: 0 0 0 1px #6a1a0a; }
.mis div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.mis small { opacity: 0.7; white-space: nowrap; }
.row.small { font-size: 15px; opacity: 0.85; min-height: 0; }

/* 7. плашки бонусов: тёмная подпись на светлом, шкала под ней */
.pow { background: rgba(28, 14, 16, 0.85) !important; box-shadow: 0 0 0 1px #6a1a0a; }
.pow span, .pow .pw { color: #fff !important; font-size: 14px !important; text-shadow: 0 1px 2px #000; }
.pow i { opacity: 0.85; }
/* 10. последний ряд скинов не прячется под прилипшей «Назад» */
#shopSkins { margin-bottom: 70px; }
/* 2. награда за вход — строкой в меню, не баннером поверх логотипа */
.loginline { color: #7fd34a; font-weight: 1000; }
