/* ===== I Need Exit — стили ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0a0e14;
  color: #e8edf2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

#game {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
}
#game > canvas:first-child { display: block; width: 100% !important; height: 100% !important; }
#game canvas#minimap { width: 150px !important; height: 120px !important; }

/* === Vignette-эффекты поверх canvas === */
/* Красная вспышка при уроне */
.damage-vignette {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(180,0,0,0.55) 100%);
  opacity: 0; pointer-events: none; z-index: 40;
  transition: opacity 0.12s ease-out;
}
.damage-vignette.flash { opacity: 1; transition: none; }

/* Постоянный тёмно-красный vignette при низком HP */
.lowhp-vignette {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(120,0,0,0.45) 100%);
  pointer-events: none; z-index: 39;
  animation: lowhpPulse 1.4s ease-in-out infinite;
}
@keyframes lowhpPulse { 0%,100%{opacity:0.5} 50%{opacity:0.85} }

/* Hitmarker */
.hitmarker {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  opacity: 0; z-index: 45; pointer-events: none;
}
.hitmarker::before, .hitmarker::after {
  content: ""; position: absolute; background: #ff5050;
  box-shadow: 0 0 4px rgba(0,0,0,0.8);
}
.hitmarker::before { width: 24px; height: 3px; top: 10px; left: 0; }
.hitmarker::after  { width: 3px; height: 24px; top: 0; left: 10px; }
.hitmarker.show { animation: hmFlash 0.3s ease-out; }
.hitmarker.kill::before, .hitmarker.kill::after { background: #ffeb3b; }   /* добивание — жёлтый */
@keyframes hmFlash { 0%{opacity:1; transform:translate(-50%,-50%) scale(1.5)} 100%{opacity:0; transform:translate(-50%,-50%) scale(0.8)} }

/* Всплывающие цифры урона */
.dmg-numbers { position: fixed; inset: 0; z-index: 44; pointer-events: none; }
.dmg-float {
  position: absolute; font: bold 18px sans-serif; color: #ffeb3b;
  text-shadow: 0 1px 3px #000, 0 0 6px rgba(255,80,0,0.6);
  animation: dmgFloat 0.8s ease-out forwards;
}
.dmg-float.crit { color: #ff5050; font-size: 22px; }
@keyframes dmgFloat {
  0% { opacity: 1; transform: translateY(0) scale(1.3); }
  100% { opacity: 0; transform: translateY(-50px) scale(1); }
}

/* Индикатор направления урона */
.dmg-indicator {
  position: fixed; top: 50%; left: 50%;
  width: 0; height: 0; z-index: 43; pointer-events: none;
  transform-origin: center;
}
.dmg-indicator svg {
  position: absolute;
  margin: -200px 0 0 -30px;   /* выносим к краю экрана */
  filter: drop-shadow(0 0 6px rgba(255,0,0,0.8));
  opacity: 0;
  animation: dmgDirFlash 1.2s ease-out;
}
@keyframes dmgDirFlash {
  0% { opacity: 0; }
  20% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* Капли дождя на объективе камеры */
.rain-overlay {
  position: fixed; inset: 0; z-index: 42; pointer-events: none;
  background:
    radial-gradient(ellipse 3px 8px at 20% 30%, rgba(200,220,255,0.5), transparent 70%),
    radial-gradient(ellipse 2px 6px at 60% 20%, rgba(200,220,255,0.4), transparent 70%),
    radial-gradient(ellipse 4px 10px at 80% 60%, rgba(200,220,255,0.45), transparent 70%),
    radial-gradient(ellipse 2px 5px at 35% 70%, rgba(200,220,255,0.35), transparent 70%),
    radial-gradient(ellipse 3px 7px at 75% 85%, rgba(200,220,255,0.4), transparent 70%),
    radial-gradient(ellipse 2px 4px at 15% 80%, rgba(200,220,255,0.3), transparent 70%);
  animation: rainDrip 0.6s linear infinite;
}
@keyframes rainDrip {
  0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; opacity: 0.5; }
  100% { background-position: 0 40px, 0 30px, 0 50px, 0 25px, 0 45px, 0 20px; opacity: 0.7; }
}

/* === Режим превью телефона на десктопе ===
   На широких экранах (>900px) показываем «телефон» по центру,
   внутри него — настоящая игра. На мобильных — полный экран. */
@media (min-width: 900px) and (pointer: fine) {
  body {
    background:
      radial-gradient(circle at 30% 20%, #1b2738 0%, #0a0e14 70%);
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
  }
  /* фон-стол: мягкая площадка под телефоном */
  body::before {
    content: ""; position: fixed; left: 50%; bottom: 8%;
    width: 520px; height: 90px; transform: translateX(-50%);
    background: radial-gradient(ellipse, rgba(0,0,0,0.5), transparent 70%);
    filter: blur(6px); z-index: 0; pointer-events: none;
  }

  /* Корпус телефона */
  #game {
    position: relative;
    width: 390px; height: 844px;            /* iPhone 14 пропорции */
    max-width: 92vh; max-height: 92vh;
    aspect-ratio: 390 / 844;
    border-radius: 52px;
    background: #000;
    box-shadow:
      0 0 0 12px #1a1d24,
      0 0 0 13px #2a2e38,
      0 30px 60px -10px rgba(0,0,0,0.8),
      0 18px 36px -12px rgba(0,0,0,0.6);
    overflow: hidden;
    z-index: 1;
  }
  #game > canvas:first-child {
    position: absolute !important; inset: 0;
    width: 100% !important; height: 100% !important;
    border-radius: 40px;
  }
  /* Чёлка / Dynamic Island */
  #game::after {
    content: ""; position: absolute;
    top: 18px; left: 50%; transform: translateX(-50%);
    width: 120px; height: 34px;
    background: #000; border-radius: 20px; z-index: 100;
    pointer-events: none;
  }
  /* Подпись под телефоном */
  #game::before {
    content: "I Need Exit • iPhone preview";
    position: absolute; top: calc(100% + 28px); left: 50%;
    transform: translateX(-50%);
    color: #5a6678; font-size: 13px; letter-spacing: .5px;
    white-space: nowrap; z-index: 0;
    font-family: -apple-system, sans-serif;
  }

  /* Контролы/overlay привязаны к #game, не к окну */
  .hud, .controls, .overlay, .toast {
    position: absolute;
  }
  .overlay, .controls { inset: 0; }
}

.hidden { display: none !important; }

/* ===== Overlay экраны (меню/конец) ===== */
.overlay {
  position: fixed; inset: 0;
  /* column + justify flex-start + margin:auto на .screen = центрируем когда влезает,
     и прокручиваем когда контент выше экрана (иначе верх уезжал под чёлку iPhone) */
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(circle at 50% 30%, #1a2332 0%, #0a0e14 70%);
  z-index: 50;
  padding:
    max(env(safe-area-inset-top), 16px)
    env(safe-area-inset-right)
    max(env(safe-area-inset-bottom), 16px)
    env(safe-area-inset-left);
}

.screen {
  max-width: 420px; width: 90%;
  text-align: center;
  padding: 24px 20px;
  margin-top: auto; margin-bottom: auto;   /* вертикальное центрирование при достатке места */
}

.screen h1 { font-size: 28px; margin-bottom: 8px; }
.subtitle { color: #9aa7b8; margin-bottom: 16px; }

.howto {
  text-align: left;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 22px;
  font-size: 15px; line-height: 1.6;
}
.howto p { margin-bottom: 8px; }
.howto b { color: #ffd166; }
.intro-best { color: #ffd166; font-size: 14px; font-weight: 700; margin-bottom: 6px; min-height: 18px; }

/* поле ввода имени игрока на стартовом экране */
.name-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 4px 0 14px; flex-wrap: wrap; }
.name-row label { color: #9aa7b8; font-size: 14px; font-weight: 600; }
.name-row input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,209,102,0.4);
  color: #fff; font-size: 16px; font-weight: 600;
  padding: 8px 12px; border-radius: 10px; width: 160px; text-align: center;
  outline: none;
}
.name-row input:focus { border-color: #ffd166; background: rgba(255,255,255,0.12); }
.name-row input::placeholder { color: #6a7585; }

/* блок кода комнаты (сетевая игра) */
.room-row { margin: 0 0 14px; text-align: center; }
.room-row > label { display: block; color: #9aa7b8; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.room-row .room-hint { color: #6a7585; font-weight: 400; font-size: 12px; }
.room-inputs { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.room-inputs input {
  background: rgba(120,180,255,0.10);
  border: 1px solid rgba(120,180,255,0.45);
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 1px;
  padding: 8px 12px; border-radius: 10px; width: 150px; text-align: center; text-transform: uppercase;
  outline: none;
}
.room-inputs input:focus { border-color: #7eb6ff; background: rgba(120,180,255,0.18); }
.room-inputs input::placeholder { color: #6a7585; text-transform: none; letter-spacing: 0; font-weight: 500; }
.btn-small { padding: 8px 12px; font-size: 14px; width: auto; }

.btn {
  display: inline-block;
  padding: 16px 40px;
  font-size: 18px; font-weight: 700;
  color: #0a0e14;
  background: linear-gradient(180deg, #ffd166, #f0a500);
  border: none; border-radius: 30px;
  box-shadow: 0 4px 0 #b07d00, 0 6px 16px rgba(240,165,0,0.4);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b07d00; }
.btn-ghost {
  background: rgba(255,255,255,0.08); color: #cfd8e3;
  box-shadow: none; border: 1px solid rgba(255,255,255,0.15);
  margin-top: 10px;
}
.btn-ghost:active { transform: translateY(2px); }

/* Кнопка паузы в HUD */
.pause-btn {
  pointer-events: auto;
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 10px;
  width: 34px; height: 30px; font-size: 16px; cursor: pointer; flex-shrink: 0;
}
.pause-btn:active { background: rgba(255,255,255,0.25); }

/* Настройки в экране паузы */
.settings { text-align: left; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.setting { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 15px; }
.setting:last-child { margin-bottom: 0; }
.setting span:first-child { width: 130px; flex-shrink: 0; }
.setting input[type=range] { flex: 1; }
.setting select { flex: 1; background: #1a2332; color: #fff; border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 6px; }
.setting-val { width: 42px; text-align: right; color: #ffd166; font-weight: 700; }
.ach-summary { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; line-height: 1.7; color: #cfd8e3; text-align: left; }
.ach-summary .ach-done { color: #7ee787; }
.ach-summary .ach-locked { color: #6a7484; }

.coins { font-size: 20px; margin-bottom: 16px; color: #ffd166; }

.shop-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.shop-item {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 12px;
  color: #e8edf2; text-align: left; cursor: pointer;
}
.shop-item:active { background: rgba(255,255,255,0.12); }
.si-icon { font-size: 26px; }
.si-name { font-weight: 700; }
.si-desc { font-size: 12px; color: #9aa7b8; grid-column: 2; }
.si-price { color: #ffd166; font-weight: 700; grid-row: 1 / span 2; }

/* ===== HUD (статы сверху) ===== */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  background: linear-gradient(180deg, rgba(10,14,20,0.85), rgba(10,14,20,0));
  z-index: 20;
  pointer-events: none;
}
.hud-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hud-row #timeIcon { font-size: 18px; }
.hud-row .bar { flex: 1; }
.badge {
  background: rgba(255,209,102,0.2);
  border: 1px solid rgba(255,209,102,0.4);
  color: #ffd166; font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
/* Текущая задача в HUD */
.objective {
  text-align: center;
  font-size: 12px; font-weight: 600;
  color: #ffd166;
  margin-bottom: 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* отдел магазина (локатор зоны) */
.badge.dept {
  background: rgba(60,46,24,0.45);
  border-color: rgba(255,180,84,0.5);
  color: #ffce8a;
}
/* строка ежедневного квеста */
.quest-line {
  text-align: center;
  font-size: 11px; font-weight: 700;
  color: #9be37a;
  margin-bottom: 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.quest-line.done { color: #ffd166; }

/* баннер при входе в новый отдел */
.zone-banner {
  position: fixed; top: 18%; left: 50%; transform: translateX(-50%);
  z-index: 30; pointer-events: none;
  font-size: 22px; font-weight: 900; letter-spacing: 2px;
  color: #ffce8a; text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 0 18px rgba(255,140,40,0.7);
  opacity: 0; transition: opacity 0.4s ease;
}
.zone-banner.show { opacity: 1; }

.hud-stats { display: flex; gap: 8px; margin-bottom: 4px; }
.stat { display: flex; align-items: center; gap: 4px; flex: 1; }
.stat span { font-size: 14px; }

.bar {
  height: 10px;
  background: rgba(0,0,0,0.4);
  border-radius: 5px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.bar-fill { height: 100%; width: 100%; border-radius: 5px; transition: width .2s; }
.day { background: linear-gradient(90deg, #ffd166, #ff8c42); }
.hp { background: linear-gradient(90deg, #ff5a5a, #c81e1e); transition: width 0.15s ease-out; }
.hud.lowhp .bar-fill.hp { animation: hpPulse 0.6s ease-in-out infinite; }
@keyframes hpPulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.6); } }
.hunger { background: linear-gradient(90deg, #a0e060, #4a8f2a); }
.energy { background: linear-gradient(90deg, #60d4ff, #2a7fc8); }

.hud-resources {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 14px; color: #cfd8e3;
}
.hud-resources b { color: #fff; }
.badge-shield { color: #60d4ff; }
.badge-lvl { color: #ffd166; font-size: 14px; font-weight: 700; }
.xp-bar { height: 4px; background: rgba(0,0,0,0.4); border-radius: 2px; overflow: hidden; margin-bottom: 2px; }
.bar-fill.xp { background: linear-gradient(90deg, #ffd166, #ff8c42); width: 0%; }

/* ===== Диалог NPC ===== */
.npc-dialog {
  position: fixed;
  left: 50%; bottom: calc(env(safe-area-inset-bottom) + 180px);
  transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 10px;
  max-width: 80%; z-index: 28; pointer-events: none;
  animation: pop .25s ease;
}
.npc-portrait {
  font-size: 40px;
  background: rgba(8,12,18,0.85);
  border: 2px solid rgba(96,212,255,0.5);
  border-radius: 50%;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.npc-bubble {
  background: rgba(8,12,18,0.92);
  border: 1px solid rgba(96,212,255,0.4);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 15px; line-height: 1.45;
  color: #e8edf2;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.npc-bubble p { margin: 0; }

/* ===== HP-бар босса ===== */
.boss-bar {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 150px);
  left: 50%; transform: translateX(-50%);
  width: 80%; max-width: 320px;
  z-index: 26; pointer-events: none;
  text-align: center;
}
.boss-bar .boss-name {
  display: block; color: #ff6060; font-size: 13px; font-weight: 800;
  letter-spacing: 1px; text-shadow: 0 0 8px #c00;
  margin-bottom: 4px; animation: bossPulse 0.8s ease-in-out infinite;
}
.boss-health { height: 14px !important; box-shadow: 0 0 10px rgba(255,0,0,0.5); }
.boss-hp { background: linear-gradient(90deg, #ff3030, #8a0000); }
@keyframes bossPulse { 0%,100%{opacity:0.85} 50%{opacity:1} }

/* ===== Мини-карта ===== */
.minimap {
  position: fixed;
  right: calc(env(safe-area-inset-right) + 12px);
  top: calc(env(safe-area-inset-top) + 88px);
  width: 150px; height: 120px;
  border-radius: 12px;
  background: rgba(8,12,18,0.8);
  border: 1px solid rgba(255,255,255,0.18);
  z-index: 22;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* ===== Стрелка-указатель к выходу ===== */
.exit-arrow {
  position: fixed;
  top: 50%; left: 50%;
  width: 56px; height: 90px;
  margin: -110px 0 0 -28px;       /* сверху-поцентру экрана */
  z-index: 25;
  pointer-events: none;
  display: flex; flex-direction: column; align-items: center;
  transform-origin: 50% 90px;     /* вращается вокруг нижней точки (центр экрана) */
  animation: arrowPulse 1.1s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(126,231,135,0.6));
}
.exit-arrow .exit-label {
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  color: #bff5c8; text-shadow: 0 0 6px #2a8a3a;
  margin-top: 2px;
}
@keyframes arrowPulse {
  0%,100% { opacity: 0.85; }
  50%     { opacity: 1; }
}

/* ===== Сенсорные контролы ===== */
.controls {
  position: fixed; inset: 0;
  z-index: 30;
  pointer-events: none;
}

/* Зона обзора: тянешь пальцем по экрану — крутишь камеру.
   Перекрывает весь экран под кнопками/джойстиком, чтобы можно было
   «осмотреться» в любом месте. */
.look-zone {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  touch-action: none;
}
/* Не перекрывать кнопки и джойстик (они сами перехватывают) */
.joystick, .action-buttons { pointer-events: auto; }

/* Левый джойстик */
.joystick {
  position: absolute;
  left: calc(env(safe-area-inset-left) + 24px);
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.2);
  pointer-events: auto;
  touch-action: none;
}
.stick {
  position: absolute; left: 50%; top: 50%;
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #9aa7b8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  transition: background .1s;
}

/* Правые кнопки */
.action-buttons {
  position: absolute;
  right: calc(env(safe-area-inset-right) + 24px);
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  display: flex; flex-direction: column; gap: 14px; align-items: flex-end;
  pointer-events: auto;
}
.action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  cursor: pointer;
  transition: transform .08s, background .1s;
}
.action-btn span { font-size: 10px; font-weight: 700; }
.action-btn.build { width: 92px; height: 92px; }
.action-btn.shop { width: 56px; height: 56px; font-size: 22px; }
.action-btn.craft { width: 56px; height: 56px; font-size: 22px; }
.action-btn.ally { width: 56px; height: 56px; font-size: 22px; }
.action-btn.inv { width: 56px; height: 56px; font-size: 22px; }

/* Слоты экипировки в инвентаре */
.equip-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.equip-slot {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px 8px;
  min-height: 80px;
}
.equip-slot .slot-icon { font-size: 26px; }
.equip-slot .slot-label { font-size: 11px; color: #9aa7b8; }
.equip-slot .slot-item { font-size: 13px; font-weight: 700; color: #ffd166; text-align: center; }
.equip-slot.equipped { border-color: rgba(126,231,135,0.5); background: rgba(126,231,135,0.08); }
.action-btn.attack { width: 92px; height: 92px; font-size: 26px; }
.action-btn.attack:active { background: rgba(255,90,90,0.35); }
.action-btn.throw { width: 92px; height: 92px; font-size: 26px; }
.action-btn.throw:active { background: rgba(200,154,91,0.35); }
.action-btn:active { transform: scale(0.92); background: rgba(255,209,102,0.3); }
.action-btn.disabled { opacity: 0.4; }

/* ===== Тосты-подсказки ===== */
.toast {
  position: fixed;
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10,14,20,0.92);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 16px; font-weight: 600;
  padding: 14px 24px; border-radius: 14px;
  z-index: 60;
  text-align: center; max-width: 80%;
  animation: pop .25s ease;
  pointer-events: none;
}
@keyframes pop {
  from { opacity: 0; transform: translate(-50%, -45%) scale(0.9); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ===== Монетизация: rewarded-реклама + возрождение ===== */
.btn-reward {
  background: linear-gradient(180deg,#2e7d32,#1b5e20);
  color: #eafff0;
}
.btn-reward:active { filter: brightness(1.1); }

/* промпт возрождения за рекламу */
.revive-prompt {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,9,13,0.86);
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
.revive-card { text-align: center; max-width: 360px; width: 90%; }
.revive-title { font-size: 26px; font-weight: 800; color: #ff6b6b; margin-bottom: 6px; }
.revive-sub { color: #9aa7b8; margin-bottom: 18px; }
.revive-btn { background: linear-gradient(180deg,#2e7d32,#1b5e20); color:#eafff0; margin-bottom: 10px; }

/* оверлей «рекламы» */
.ad-overlay {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.92);
}
.ad-box {
  position: relative; text-align: center;
  width: 92%; max-width: 420px; aspect-ratio: 3/4; max-height: 80vh;
  background: radial-gradient(circle at 50% 35%, #16314a, #060b12);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.ad-tag {
  position: absolute; top: 12px; left: 12px;
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  color: #0a0e14; background: #ffce5a; padding: 2px 7px; border-radius: 4px;
}
.ad-emoji { font-size: 64px; animation: adPulse 1.2s ease-in-out infinite; }
@keyframes adPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }
.ad-msg { color: #cfe0f2; font-size: 15px; padding: 0 20px; }
.ad-timer { font-size: 34px; font-weight: 800; color: #fff; }
.ad-skip {
  position: absolute; top: 10px; right: 12px;
  background: rgba(255,255,255,0.12); color: #fff; border: none;
  width: 30px; height: 30px; border-radius: 50%; font-size: 15px; cursor: pointer;
}
