/* ================================
   БАЗА + ФОН + SAFE AREA
==================================*/

:root{
  --safe: env(safe-area-inset-bottom, 0px);
  --nav-h: 72px;
  --dock-height: 90px;
}

button:focus,
a:focus,
input:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* ������� ����� ������� � ���� ��������� */
*:focus {
    outline: none !important;
}

/* ������� ��������� ��� ���� �� ��������� */
* {
    -webkit-tap-highlight-color: transparent !important;
}

* {
    user-select: none;
    -webkit-user-select: none;
}

*,
*::before,
*::after{
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  background-color: #8ec5fc;            /* запасной цвет неба */
  background-position: center bottom;
  background-size: cover;
  background-repeat: no-repeat;
  min-height: 100vh;
}

/* Фоны для сцен */
body.scene--mining {
  background-image: url('/static/assets/mining.jpg');
}

body.scene--kitchen {
  background-image: url('/static/assets/kitchen.jpg');
}

body.scene--hospital {
  background-image: url('/static/assets/hospital.jpg');
}

body.scene--leaderboard {
  background-image: url('/static/assets/top.jpg');
}

body.scene--games {
  background-image: url('/static/assets/games.jpg');
}

body.scene--profile {
  background-image: url('/static/assets/profile.jpg');
}

/* Корневой контейнер миниаппы */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Внутри #app весь контент ограничиваем по ширине */
#scenes{
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 8px 8px 140px;                 /* снизу запас под энергию + навбар */
  margin: 0 auto;
}


/* ================================
   TOPBAR (как в референсе)
==================================*/

.topbar{
  position: sticky;
  top: 0;
  z-index: 20;

  width: 100%;
  max-width: 480px;
  margin: 0 auto 8px;
  padding: 6px 8px;

  background: rgba(25, 46, 74, .95);      /* тёмный полупрозрачный */
  color: #fff;
  border-radius: 18px;
  backdrop-filter: blur(10px);
  box-shadow: none;
}

.topbar .row{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.topbar .item{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  padding: 6px 6px;
  font-size: 12px;
  font-weight: 800;

  color: #fff;
  background: rgba(255,255,255,.08);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}

.topbar .ico{
  opacity: .95;
}

.stat-ok       { color: #ffffff; }
.stat-mid      { color: #ffe27a; }
.stat-low      { color: #ffb347; }
.stat-very-low { color: #ff6b6b; }

/* Маленькие «пилюли» статов в топбаре */
.stat-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0,0,0,.20);
  color: #fff;
}

/* Цвета по состоянию */
.stat-ok{
  background: rgba(34, 197, 94, .9);   /* зелёный */
}
.stat-mid{
  background: rgba(234, 179, 8, .9);   /* жёлтый */
}
.stat-low{
  background: rgba(249, 115, 22, .9);  /* оранжевый */
}
.stat-very-low{
  background: rgba(239, 68, 68, .95);  /* красный */
}

/* ================================
   КНОПКА УРОВНЯ + TON
==================================*/

.actions{
  width: 100%;
  max-width: 480px;
  margin: 10px auto 4px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge-btn{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;

  background: #f5fff2;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  font-weight: 700;
}

.badge-btn span:first-child{
  font-size: 18px;
}

.ton-btn{
  flex: 1;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;

  background: #1d8af5;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(29,138,245,.35);
}

.ton-btn.connected{
  background: #23c38e;
}


/* ================================
   ИГРОВАЯ ЗОНА: ПИТОМЕЦ
==================================*/
/* Зона для кликов */
.scene[data-scene="mining"]{
  display: flex;
  flex-direction: column;
}

/* Игровая зона растягивается, чтобы центрировать мамонта */
.scene[data-scene="mining"] main{
  flex: 1;
  display: flex;
  flex-direction: column;
}

.play{
  flex: 1;
  display: flex;
  align-items: center;      /* по вертикали по центру */
  justify-content: center;  /* по горизонтали по центру */
  padding-top: 6vh;
}

#play {
  position: relative;
  width: 100%;
  height: 100%;
}

.pet{
  width: 220px;
  height: 220px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;       /* убрали большой верхний margin */
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  user-select: none;
  transition: transform .08s ease, filter .08s ease;
}

#pet {
  position: fixed;                 /* привязываем к экрану, а не к play */
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--dock-height) + 26px);  /* посадка на траву, можно подстроить */

  height: min(420px, 55vh);
  width: auto;         /* нормальный размер на мобиле и в вебе */

  pointer-events: auto;            /* снова кликабельный */
  cursor: pointer;
  user-select: none;
  transition: transform .08s ease, filter .08s ease;
}

.pet.tap{
  transform: scale(.96);
  filter: brightness(1.02);
}

.mining-secondary-row {
  display: flex;
  gap: 8px;
  margin: 8px 16px 0;
}

.mining-secondary-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 999px;
  border: 0;

  background: #f9fafb;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;

  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.15);
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    transform 0.08s ease,
    box-shadow 0.12s ease,
    opacity 0.12s ease;
}

.mining-secondary-btn:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.22);
}

.mining-secondary-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.mining-secondary-btn.has-quests {
  position: relative;
}

.mining-secondary-btn.has-quests::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  background: #fbbf24;
  border-radius: 50%;
  box-shadow: 0 0 6px #fbbf24;
}


/* ЕЖЕДНЕВНЫЙ ВХОД И ЗАДАНИЯ */
/* Заголовок и текст в модалках майнинга по центру */
.mining-card .modal-title {
  text-align: center;
}

.mining-card .modal-subtitle {
  text-align: center;
  margin-bottom: 10px;
}

.daily-info {
  background: #0c1b36;
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #e5e7eb;
  text-align: center;
}

.daily-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.daily-row:last-child {
  margin-bottom: 0;
}

.daily-status {
  font-size: 12px;
  text-align: center;
  margin-top: 6px;
  opacity: 0.8;
}

/* Лесенка наград ежедневного входа */
.daily-ladder {
  background: #0c1b36;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #e5e7eb;
}

.daily-ladder-title {
  font-weight: 600;
  margin-bottom: 6px;
  opacity: 0.95;
}

.daily-ladder-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.daily-ladder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.daily-ladder-item + .daily-ladder-item {
  margin-top: 2px;
}

/* Подсветка текущего/следующего дня (класс is-next вешаем из JS) */
.daily-ladder-item.is-next {
  background: rgba(248, 250, 252, 0.08);
  box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.18);
  transform: translateY(-1px);
}

.daily-ladder-day {
  opacity: 0.85;
}

.daily-ladder-prize {
  font-weight: 500;
  text-align: right;
}

.quests-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-item {
  background: #0c1b36;
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 10px;
}

.quest-item--clickable {
  cursor: pointer;
}

.quest-item--clickable:hover {
  background: #102347; /* немного светлее — подсветка при наведении */
}

.quest-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.quest-item-progress {
  font-size: 12px;
  opacity: 0.8;
}

.quest-item--clickable {
  cursor: pointer;
}

.quest-item--clickable:hover {
  background: #102347;
}

.quest-claim-btn {
  margin-top: 8px;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #27c3ff, #0077ff);
  color: #fff;
  align-self: center;
}

.quest-claim-btn:disabled {
  background: #9ca3af;
  cursor: default;
}

/* Разделы в модалке "Задания" */
.quests-section + .quests-section {
  margin-top: 12px;
}

.quest-section:last-child {
  margin-bottom: 12px;
}

.quests-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
  margin: 4px 2px 6px;
  margin-top: 14px;
}

.daily-ladder {
  background: #0c1b36;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #e5e7eb;
}

.daily-ladder-title {
  font-weight: 600;
  margin-bottom: 6px;
  opacity: 0.95;
}

.daily-ladder-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.daily-ladder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.daily-ladder-item + .daily-ladder-item {
  margin-top: 2px;
}

.daily-ladder-item.is-next {
  background: rgba(248, 250, 252, 0.08);
  box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.18);
  transform: translateY(-1px);
}

.daily-ladder-day {
  opacity: 0.85;
}

.daily-ladder-prize {
  font-weight: 500;
  text-align: right;
}

.daily-info {
  text-align: center;
}
.daily-row {
  display: flex;
  flex-direction: column;      /* метка и значение в столбик */
  align-items: center;
  gap: 2px;
}

.daily-row + .daily-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.daily-row span:first-child {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.8;
}

.daily-row span:last-child {
  font-size: 14px;
  font-weight: 600;
}


.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #27c3ff, #0077ff);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 119, 255, 0.4);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 119, 255, 0.55);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(0, 119, 255, 0.45);
}

#dailyClaimBtn {
  display: block;          /* 👈 было inline-block */
  margin: 16px auto 4px;   /* авто-отступы слева/справа → центр */
  width: auto;
  padding: 10px 24px;
}

#dailyClaimBtn:disabled {
  background: #d1d5db;
  color: #6b7280;
  box-shadow: none;
  cursor: default;
  transform: none;
}

/* Всплывающая монета */
.float{
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%,-50%);
  font-weight: 700;
  font-size: 16px;
  pointer-events: none;
  white-space: nowrap;
  animation: floatUp .8s ease-out forwards;
}

@keyframes floatUp{
  0%{ opacity:0; transform:translate(-50%,-20%) scale(.9); }
 10%{ opacity:1; }
100%{ opacity:0; transform:translate(-50%,-120%) scale(1.1); }
}

/* Лог под питомцем (если нужен) */
.log{
  width: 100%;
  max-width: 480px;
  margin: 8px auto 0;
  text-align: center;
  font-size: 13px;
  color: #555;
}


/* ================================
   СЦЕНЫ (КУХНЯ, БОЛЬНИЦА и т.д.)
==================================*/

.scene{
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 52vh;
  display: block;
}

.scene.hidden{
  display: none;
}

.scene-card{
  margin: 32px auto;
  padding: 16px;
  width: min(560px, 92%);

  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

.scene-card h2{
  margin: 0 0 8px;
}


/* ================================
   МОДАЛКА УРОВНЕЙ
==================================*/

.modal{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0006;
  z-index: 40;
}

.modal.hidden{
  display: none;
}

.modal-card{
  position: relative;
  width: min(440px,92%);
  background:#fff;
  border-radius:20px;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  padding:16px;
}

/* верх модалки уровней и бустов переиспользуем */
.modal-top{
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  margin-bottom:12px;
}

.modal-top .title{
  font-weight:800;
  font-size:20px;
  display:flex;
  align-items:center;
  gap:6px;
}

.modal-top .close-btn{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  border:none;
  background:none;
  font-size:22px;
  color:#777;
  cursor:pointer;
  transition:.2s;
}

.modal-top .close-btn:hover{
  color:#000;
  transform:translateY(-50%) scale(1.08);
}

/* шапка уровней */
.lvl-header{
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}

.lvl-emoji{ font-size:26px; line-height:1; }
.lvl-name{ font-weight:800; font-size:18px; }
.lvl-range{ font-size:13px; color:#666; }

.lvl-progress{
  height:12px;
  background:#00000014;
  border-radius:999px;
  overflow:hidden;
  margin:10px 0 6px;
}

.lvl-progress .fill{
  height:100%;
  width:0%;
  background:#7cd67c;
  transition:width .25s ease;
}

.lvl-meta{
  display:flex;
  justify-content:space-between;
  font-size:13px;
  color:#666;
}


/* ================================
   МОДАЛКА БУСТОВ
==================================*/
/* ===== ОТДЕЛЬНЫЙ СТИЛЬ ДЛЯ МОДАЛКИ БУСТОВ ===== */
.modal.modal--boost{
  align-items:flex-end;            /* прижать к низу */
  justify-content:center;
  padding:0 0 calc(8px + var(--safe));
}

/* «простыня» снизу, скролл внутрь */
.modal.modal--boost .modal-card.boosts{
  width:100%;
  max-width:480px;
  border-radius:20px 20px 0 0;     /* только верх скруглён */
  max-height:80vh;                 /* не выше 80% экрана */
  overflow-y:auto;
  box-shadow:0 -6px 24px rgba(0,0,0,.4);
}

.modal-card.boosts{
  width:min(480px,92%);
}

.boosts-section{
  margin-top:12px;
}

.boosts-section h4{
  margin:4px 0 8px;
  font-size:14px;
  color:#666;
}

.boost-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.boost-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;

  background:#f7f7f7;
  border-radius:14px;
  padding:10px 12px;
}

.b-left{
  display:flex;
  flex-direction:column;
}

.b-title{ font-weight:700; }
.b-note{ font-size:12px; color:#666; }

.b-meta{
  font-size:12px;
  color:#666;
  margin-top:4px;
}

.b-qty{ font-weight:700; }

.b-cost.bad{ color:#c33838; font-weight:700; }
.b-cost.good{ color:#1f7a1f; font-weight:700; }

.b-buy{
  background:#1f2937;
  color:#fff;
  border:0;
  border-radius:12px;
  padding:8px 12px;
  cursor:pointer;
  font-weight:700;
  white-space:nowrap;
}

.b-buy:disabled{
  opacity:.6;
  cursor:not-allowed;
}

.main-layout,
.scene-layout {
  flex: 1;
  padding: 16px 16px 100px;    /* запас под нижнюю навигацию */
  box-sizing: border-box;
}

/* ================================
   НИЖНИЙ ДОК: ЭНЕРГИЯ + НАВИГАЦИЯ
==================================*/

.dock{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: calc(var(--safe) + 4px);
  z-index: 40;

  display: flex;
  justify-content: center;
}

.dock-inner{
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

/* Панель энергии + бустов над навигацией */
.bottom-panel{
  position: relative;
  width: 100%;
  padding: 0 8px 6px;
  max-width: 560px;     /* расширяем */
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ЧИП ЭНЕРГИИ (чёрный, полупрозрачный) */
.chip-dark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  padding:10px 14px;
  min-width: 140px;

  background: rgba(0,0,0,.9);
  color:#fff;
  border-radius:18px;
  border:0;

  font-weight:800;
  font-size:14px;
  box-shadow:0 10px 24px rgba(0,0,0,.45);
}

/* Кнопка «Бусты» */
.boost-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  padding:10px 18px;
  border-radius:18px;
  border:0;
  cursor:pointer;

  background:#ff7f32;
  color:#fff;
  font-weight:800;
  box-shadow:0 10px 24px rgba(255,127,50,.5);
  transition: transform .12s ease, background .12s ease;
}

.boost-btn:hover{
  transform: translateY(-1px);
  background:#ff944f;
}

.boost-btn:active{
  transform: translateY(0);
}

.b-status {
  font-size: 13px;
  color: #ccc;
  margin-bottom: 4px;
}

/* ================================
   NAVBAR (как в образце)
==================================*/

.bottom-nav{
  position: sticky;
  height: 64px;
  bottom: 0;
  z-index: 20;

  margin: 0 8px;
  padding: 4px 8px;
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: 12px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;

  background: rgba(24,30,36,.96);             /* тёмный полупрозрачный */
  color:#cfd6de;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  box-shadow: none;
}

.bottom-nav button{
  flex:1;
  height: 100%;
  border:0;
  background:none;
  cursor:pointer;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;

  color:#cfd6de;
  font-size:11px;
  font-weight:600;
  border-radius:12px;
}

.bottom-nav .icon{
  font-size:20px;
  line-height:1;
}

.bottom-nav button.active{
  color:#ffd34d;
  text-shadow:0 0 8px rgba(255,211,77,.6);
}

/* ================================
   Кухня
==================================*/
.kitchen-wrap{
  padding: 16px 12px 24px;
}

.kitchen-title{
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
}

.kitchen-sub{
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
}

/* сетка 3 ряда по 2 карточки */
.kitchen-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

/* карточка еды */
.food-card{
  border: 0;
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(15,23,42,.92);
  color:#f9fafb;
  text-align:left;
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
  display:flex;
  flex-direction:column;
  gap:4px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.food-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.3);
}
.food-card:active{
  transform: translateY(0);
}

.food-top{
  display:flex;
  align-items:center;
  gap:6px;
  font-weight:800;
  font-size:14px;
}
.food-emoji{ font-size:18px; }

.food-restore{
  font-size:12px;
  color:#22c55e;
  font-weight:600;
}

.food-price{
  margin-top:2px;
  font-size:12px;
  color:#e5e7eb;
}
.food-price.is-free{ color:#4ade80; }
.food-price.is-legendary{ color:#f97316; font-weight:700; }

.food-left{
  margin-top:2px;
  font-size:11px;
  color:#cbd5f5;
  opacity:.85;
}

/* ===== модалка кухни ===== */
.food-modal{
  max-width: 420px;
  background:#fef6e8;
  border-radius:22px;
  padding:18px 16px 18px;
}

.food-modal-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:12px;
}
.food-modal-icon{
  font-size:28px;
}
.food-modal-title{
  flex:1;
  font-size:18px;
  font-weight:800;
}
.food-modal-cancel{
  border:0;
  border-radius:999px;
  padding:6px 14px;
  background:#e5e7eb;
  font-size:13px;
  cursor:pointer;
}

.food-modal-body{
  font-size:14px;
  color:#111827;
}
.food-modal-desc{
  margin:0 0 12px;
}

.food-modal-row{
  display:flex;
  gap:6px;
  margin-bottom:4px;
  font-size:13px;
}
.food-modal-row .label{
  min-width:104px;
  color:#6b7280;
}
.food-modal-row .value{
  font-weight:600;
}

.food-modal-btn{
  margin-top:14px;
  width:100%;
  border:0;
  border-radius:999px;
  padding:10px 14px;
  background:#f97316;
  color:#fff;
  font-weight:800;
  font-size:15px;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(248,113,34,.4);
}
.food-modal-btn:active{
  transform: translateY(1px);
}

/* ================================
   БОЛЬНИЦА
==================================*/
.hospital-wrap{
  padding: 16px 12px 24px;
}

.hospital-title{
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
}

.hospital-sub{
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
}

/* сетка 3 ряда по 2 карточки */
.hospital-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

/* карточка лечения */
.heal-card{
  border: 0;
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(15,23,42,.92);
  color:#f9fafb;
  text-align:left;
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
  display:flex;
  flex-direction:column;
  gap:4px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.heal-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.3);
}
.heal-card:active{
  transform: translateY(0);
}

.heal-top{
  display:flex;
  align-items:center;
  gap:6px;
  font-weight:800;
  font-size:14px;
}
.heal-emoji{ font-size:18px; }

.heal-effect{
  font-size:12px;
  color:#22c55e;
  font-weight:600;
}

.heal-price{
  margin-top:2px;
  font-size:12px;
  color:#e5e7eb;
}
.heal-limit{
  margin-top:2px;
  font-size:11px;
  color:#cbd5f5;
  opacity:.85;
}

/* ===== модалка больницы ===== */
.heal-modal{
  max-width: 420px;
  background:#ecfeff; /* нежный голубой / мед. тема */
  border-radius:22px;
  padding:18px 16px 18px;
}

.heal-modal-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:12px;
}
.heal-modal-icon{
  font-size:28px;
}
.heal-modal-title{
  flex:1;
  font-size:18px;
  font-weight:800;
}
.heal-modal-cancel{
  border:0;
  border-radius:999px;
  padding:6px 14px;
  background:#e5e7eb;
  font-size:13px;
  cursor:pointer;
}

.heal-modal-body{
  font-size:14px;
  color:#111827;
}
.heal-modal-desc{
  margin:0 0 12px;
}

.heal-modal-row{
  display:flex;
  gap:6px;
  margin-bottom:4px;
  font-size:13px;
}
.heal-modal-row .label{
  min-width:104px;
  color:#6b7280;
}
.heal-modal-row .value{
  font-weight:600;
}

.heal-modal-btn{
  margin-top:14px;
  width:100%;
  border:0;
  border-radius:999px;
  padding:10px 14px;
  background:#06b6d4;
  color:#fff;
  font-weight:800;
  font-size:15px;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(6,182,212,.4);
}
.heal-modal-btn:active{
  transform: translateY(1px);
}

/* ===== ТОП ===== */
.leader-wrap{
  padding:16px 12px 24px;
}

/* ��������� � ������� �� ������, ��� ������� ��������� */
.leader-title{
  margin:0 0 4px;
  font-size:20px;
  font-weight:800;
  text-align:center;
}

.leader-sub{
  margin:0 0 16px;
  font-size:13px;
  color:#64748b;
  text-align:center;
}

/* табы */
.leader-tabs{
  display:flex;
  gap:8px;
  margin-bottom:12px;
}

.leader-tab{
  flex:1;
  border:0;
  border-radius:999px;
  padding:8px 10px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  background:rgba(15,23,42,.16);
  color:#1f2933;
}

.leader-tab.is-active{
  background:#facc15;
  box-shadow:0 6px 14px rgba(250,204,21,.45);
}

/* список */
.leader-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.leader-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 10px;
  border-radius:14px;
  background:rgba(15,23,42,.94);
  color:#f9fafb;
  font-size:13px;
  box-shadow:0 6px 14px rgba(0,0,0,.25);
}

.leader-left{
  display:flex;
  align-items:center;
  gap:8px;
}

.leader-rank{
  width:24px;
  text-align:center;
  font-weight:800;
}

.leader-name{
  font-weight:700;
}

.leader-meta{
  font-size:11px;
  opacity:.75;
}

.leader-value{
  font-weight:700;
  font-size:13px;
}

/* =======================================================
   ИГРЫ: сцена, карточки, модалки, мини-игры
   (ЧИСТАЯ ВЕРСИЯ)
======================================================= */

/* ====== СЦЕНА "ИГРЫ" — компактно, как кухня, без скролла ====== */

.scene[data-scene="games"] {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 12px 118px; /* снизу ~высота энергии + навбар */
  box-sizing: border-box;
}

/* заголовок и подзаголовок */

.scene[data-scene="games"] .games-layout {
  margin: 0;
}

.scene[data-scene="games"] .games-header h2,
.scene[data-scene="games"] .games-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
}

.scene[data-scene="games"] .games-header p,
.scene[data-scene="games"] .games-subtitle {
  margin: 0 0 10px;
  font-size: 13px;
  opacity: 0.85;
}

/* список карточек */

.scene[data-scene="games"] .games-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;                /* маленький отступ между картами */
}

/* ====== КАРТОЧКИ ИГР (компактные) ====== */

.scene[data-scene="games"] .game-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 18px;
  padding: 10px 12px;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);

  display: flex;
  flex-direction: column;
  gap: 4px;

  /* без min-height — высота ровно по контенту */
}

/* шапка: иконка + название + описание */

.scene[data-scene="games"] .game-card-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 2px;
}

.scene[data-scene="games"] .game-card-icon {
  font-size: 20px;
  margin-top: 1px;
}

.scene[data-scene="games"] .game-card-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 2px;
}

.scene[data-scene="games"] .game-card-desc {
  font-size: 12px;
  opacity: 0.9;
}

/* цена / награда */

.scene[data-scene="games"] .game-card-footer {
  margin-top: 0;
  font-size: 11px;
  opacity: 0.9;
}

.scene[data-scene="games"] .game-card-meta-value {
  font-weight: 600;
}

/* кнопки "Играть" / "Правила" */

.scene[data-scene="games"] .game-card-buttons {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.scene[data-scene="games"] .game-card-buttons .btn {
  flex: 1;
  height: 30px;
  border-radius: 999px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

/* основная кнопка */

.scene[data-scene="games"] .game-card-buttons .btn.game-btn-primary {
  background: #ff9f1c;
  color: #1f2933;
  box-shadow: 0 3px 0 rgba(191, 73, 2, 0.85);
}

.scene[data-scene="games"] .game-card-buttons .btn.game-btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(191, 73, 2, 0.85);
}

/* вторичная */

.scene[data-scene="games"] .game-card-buttons .btn.game-btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e6e6e6;
}

/* ---------- ОБЩАЯ МОДАЛКА ИГР (ОКНО ИГРЫ) ---------- */

.game-play-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
}

.game-play-modal.hidden {
  display: none;
}

.game-play-window {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  background: #fff4dc;
  border-radius: 24px;
  padding: 16px 16px 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

/* сюда JS рисует саму игру */
.game-play-root {
  flex: 1;
  margin-top: 8px;
  border-radius: 18px;
  background: #fff7e6;
  overflow: hidden;
}

/* ---------- МОДАЛКА ПРАВИЛ ИГР ---------- */

.game-rules-modal {
  position: fixed;
  inset: 0;
  z-index: 41;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.game-rules-modal.hidden {
  display: none;
}

.game-rules-window {
  width: calc(100% - 32px);
  max-width: 460px;
  background: #fff7ea;
  border-radius: 24px;
  padding: 20px 20px 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.55);
  position: relative;
  text-align: center;
}

.game-rules-close {
  position: absolute;
  top: 12px;
  right: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  border: none;
  background: #e5ded2;
  font-size: 13px;
  cursor: pointer;
}

.game-rules-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
}

#gameRulesText {
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 18px;
}

#gameRulesPlay {
  display: inline-block;
  border-radius: 999px;
}

/* ---------- ОБЩИЕ ЭЛЕМЕНТЫ ВНУТРИ ИГР ---------- */

.game-play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-play-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 16px;
}

.game-play-timer {
  margin-left: auto;
  margin-right: 12px;
  font-size: 14px;
  color: #7b7267;
}

.game-play-exit.btn {
  padding: 6px 14px;
  border-radius: 999px;
  background: #e6e0d6;
  color: #5c5144;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.game-play-exit.btn:hover {
  background: #ddd2c1;
}

.game-play-body {
  padding: 16px 24px 24px;
}

/* ---------- "Мамонтёнок-спринт" ---------- */

.game-play-body.tap-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.game-play-help {
  margin: 0 0 8px;
  font-size: 14px;
  color: #4b433a;
}

.game-play-score {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.game-btn-primary.game-play-big {
  min-width: 220px;
  padding: 14px 28px;
  font-size: 18px;
}

/* ---------- "Лови еду" ---------- */

.game-play-body .catch-board {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.catch-board-inner {
  width: 100%;
  max-width: 380px;
  height: 260px;
  margin: 0 auto;
  background: #f9f0dd;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* корзинка */
.catch-basket {
  position: absolute;
  bottom: 16px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7ad4c 0%, #e48c32 100%);
  box-shadow: 0 4px 0 rgba(190, 115, 34, 0.7);
}

/* падающие фрукты */
.catch-fruit {
  position: absolute;
  font-size: 24px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* ------ Мини-игра "Поймай мамонтёнка" ------ */
.mammoth-catch-game .mammoth-cell .mammoth-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.mammoth-catch-game .mammoth-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  justify-items: center;
}

.mammoth-catch-game .mammoth-cell {
  border: 0;
  border-radius: 16px;
  width: 60px;
  height: 60px;
  background: #f9fafb;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.10);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background .12s ease,
    box-shadow .12s ease,
    transform .08s ease;
}

.mammoth-catch-game .mammoth-icon {
  font-size: 30px;
}

.mammoth-catch-game .mammoth-cell.is-active {
  background: #f97373;
  box-shadow: 0 6px 16px rgba(248,113,113,.8);
  transform: translateY(-1px);
}

.mammoth-catch-game .mammoth-cell:active {
  transform: translateY(1px);
}

/* ---------- ИТОГОВЫЙ ЭКРАН ---------- */

.game-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 16px;
  text-align: center;
}

.game-result-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.game-result-stat {
  font-size: 15px;
  margin-bottom: 4px;
}

/* ================================
   ПРОФИЛЬ / СКЛАД
==================================*/
.profile-wrap {
  max-width: 480px;
  margin: 24px auto 0;
  padding: 0 16px 140px; /* запас под док */
}

.profile-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
}

.profile-subtitle {
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
}

/* меню-карточки */

.profile-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-menu-btn {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(15,23,42,.96);
  color: #f9fafb;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}

.profile-menu-btn .icon {
  font-size: 20px;
}

.profile-menu-btn .text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.profile-menu-btn .title {
  font-size: 14px;
  font-weight: 700;
}

.profile-menu-btn .sub {
  font-size: 12px;
  opacity: .8;
}

.profile-menu-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,.4);
}

.profile-menu-btn:active {
  transform: translateY(0);
}

/* нижние ссылки */

.profile-footer-links {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.profile-footer-links .link-btn {
  border: 0;
  padding: 0;
  background: none;
  color: #0f172a;
  opacity: .7;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
}

/* ==== ПРОФИЛЬ: модалки ==== */

.profile-modal .profile-card {
  position: relative;
  max-width: 480px;
  background: #fefaf3;
  border-radius: 22px;
  padding: 16px 16px 18px;
}

.profile-modal .modal-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
}

.profile-modal .modal-subtitle {
  margin: 0 0 14px;
  font-size: 13px;
  color: #6b7280;
}

.profile-modal .modal-text {
  font-size: 13px;
  color: #4b5563;
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: #9ca3af;
}

/* статистика */

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

.profile-stats-grid .stat-item {
  padding: 10px 10px;
  border-radius: 14px;
  background: #111827;
  color: #e5e7eb;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}

.profile-stats-grid .label {
  font-size: 11px;
  opacity: .8;
  margin-bottom: 2px;
}

.profile-stats-grid .value {
  font-size: 15px;
  font-weight: 700;
}

/* рефералы */

.ref-summary {
  border-radius: 14px;
  background: #111827;
  color: #f9fafb;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}

.ref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.ref-row + .ref-row {
  margin-top: 4px;
}

.ref-link-block label {
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
  color: #4b5563;
}

.ref-link-row {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.ref-link-row input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 6px 10px;
  font-size: 12px;
}

.btn.small {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border: 0;
  background: #f97316;
  color: #fff;
  cursor: pointer;
}

.ref-note {
  font-size: 11px;
  color: #6b7280;
}

/* инвентарь */

.inv-tabs {
  display: none;
}

.inv-tab {
  flex: 1;
  border-radius: 999px;
  border: 0;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #e5e7eb;
}

.inv-tab.is-active {
  background: #facc15;
  box-shadow: 0 6px 14px rgba(250,204,21,.45);
}

.inv-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-item {
  border-radius: 14px;
  padding: 8px 10px;
  background: #111827;
  color: #f9fafb;
  font-size: 13px;
  margin-bottom: 10px;
}

/* Убираем последний отступ перед низом модалки */
.inv-item:last-child {
  margin-bottom: 0;
}

.inv-item.empty {
  background: #f9fafb;
  color: #6b7280;
  opacity: 0.7;
  text-align: center;
  padding: 12px;
}

.inv-storage {
  margin: 6px 0 10px;
  font-size: 12px;
  color: #4b5563; /* спокойный серый текст */
}

#invHealList {
  display: none !important;
}
/* настройки */

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 14px;
  background: #111827;
  color: #f9fafb;
  padding: 8px 10px;
}

.settings-text .title {
  font-size: 14px;
  font-weight: 700;
}

.settings-text .sub {
  font-size: 11px;
  opacity: .8;
}

/* тумблер */

.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: #4b5563;
  cursor: pointer;
  padding: 0;
}

.toggle .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #e5e7eb;
  transition: transform .15s ease;
}

.toggle.is-on {
  background: #22c55e;
}

.toggle.is-on .knob {
  transform: translateX(16px);
}

/* донат */

.donate-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donate-card {
  border-radius: 14px;
  background: #111827;
  color: #f9fafb;
  padding: 10px 12px;
}

.donate-card .title {
  font-weight: 700;
  margin-bottom: 2px;
}

.donate-card .sub {
  font-size: 12px;
  opacity: .8;
  margin-bottom: 6px;
}

/* донат — списки в разделах */

.donate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.donate-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 12px;
  background: #111827;
  color: #f9fafb;
  border: none;
  cursor: pointer;
  text-align: left;
}

.donate-row .d-left {
  max-width: 70%;
}

.donate-row .d-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.donate-row .d-sub {
  font-size: 12px;
  opacity: 0.8;
}

.donate-row .d-right {
  font-weight: 700;
  white-space: nowrap;
}

.donate-perks {
  margin: 8px 0 4px;
  padding-left: 18px;
  font-size: 13px;
  color: #e5e7eb;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  width: 85%;
  max-height: 80%;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
}

.modal-text {
  white-space: pre-wrap;
  font-size: 14px;
  color: #222;
}

/* ===== ОВЕРЛЕЙ СМЕРТИ МАМОНТЁНКА ===== */

.death-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7); /* затемнение ~70% */
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.death-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.death-modal {
  width: calc(100% - 32px);
  max-width: 360px;
  background: transparent; /* рамка сама будет светлой */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  color: #1f140e;
  font-family: inherit;
}

.death-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff7de;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  margin-bottom: 8px;
}

.death-subtitle {
  font-size: 14px;
  color: #fff7de;
  margin-bottom: 16px;
}

/* Золотая рамка с инфой */

.death-box {
  background: #fff8e2;
  border-radius: 24px;
  border: 3px solid #f4c65c;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.death-box-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #3a2617;
}

.death-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}

.death-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.05s ease, opacity 0.2s ease;
}

.death-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) inset;
}

.death-btn[disabled] {
  opacity: 0.4;
  cursor: default;
}

/* Цвета кнопок */

.death-btn-coins {
  background: linear-gradient(180deg, #ffb733, #ff8a1f);
  color: #1a1208;
  box-shadow: 0 4px 12px rgba(255, 138, 31, 0.6);
}

.death-btn-free {
  background: #ffffff;
  color: #1a1208;
  border: 1px solid #e2d3b0;
}

.death-btn-gems {
  background: #4f57ff;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 87, 255, 0.6);
}

.death-note {
  margin-top: 4px;
  font-size: 11px;
  color: #7c6a4c;
}

.restart-btn {
  background: #ff6666;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: bold;
  color: white;
  margin-top: 10px;
}
.restart-btn:hover {
  background: #ff4c4c;
}


/* ===== Жёсткий фикс для Телеграма: чтобы карточки игр не залезали под энергию и навбар ===== */

body.is-telegram [data-scene="games"] .games-grid {
  padding-bottom: 260px; /* можно потом подправить значение под свой вкус */
}

/* Отступ под табличку заголовка на сценах */
.kitchen-wrap,
.hospital-wrap,
.leader-wrap,
.games-layout,
.profile-wrap {
  position: relative;
  padding-top: 90px; /* можно 80–100, подгони по вкусу */
}

/* --- Заголовки сцен (по центру) --- */
.kitchen-title,
.hospital-title,
.leader-title,
.games-title,
.profile-title {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);

    font-size: 22px;
    font-weight: 700;

    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);

    z-index: 20;
    pointer-events: none;
}

.scene-title-box {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);

  background: #c58a3d;
  border: 3px solid #8b5a2b;
  border-radius: 12px;
  padding: 8px 24px;

  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 2px 3px rgba(0,0,0,0.5);

  box-shadow: 0 4px 10px rgba(0,0,0,0.4);

  z-index: 30;
  pointer-events: none;
}

/* ======== FULLSCREEN LOADING ======== */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: linear-gradient(180deg, #A9D4FF, #E9C3FF);
}

/* Белая полупрозрачная заливка */
.loading-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  z-index: 1;
}

/* Изображение по центру */
.loading-image {
  width: 80%;
  max-width: 430px;
  border-radius: 24px;
  z-index: 2;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Полоска загрузки */
.loading-bar-wrapper {
  width: 70%;
  max-width: 340px;
  height: 8px;
  background: rgba(255,255,255,0.5);
  border-radius: 5px;
  margin-top: 25px;
  overflow: hidden;
  z-index: 2;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 5px;
  animation: loadingAnim 3s ease-out forwards;
}

@keyframes loadingAnim {
  0%   { width: 0%; }
  50%  { width: 30%; }
  80%  { width: 70%; }
  100% { width: 100%; }
}

/* Текст загрузки */
.loading-text {
  margin-top: 16px;
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
  z-index: 2;
}
