/* ═══════════════════════════════════════════════
   НАСТАВНИК PWA — mobile.css
   Адаптация под смартфоны и PWA
═══════════════════════════════════════════════ */

/* ── СПЛЭШ ЭКРАН ─────────────────────────────── */
#splash-screen {
  position: fixed;
  inset: 0;
  background: var(--green-800);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  gap: 0;
  overflow: hidden;
}

.splash-mascots {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-bottom: 24px;
}

.splash-ponchik {
  width: 100px;
  object-fit: contain;
  animation: splashBounce .6s cubic-bezier(.34,1.56,.64,1) .2s both;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.3));
}

.splash-hvostik {
  width: 80px;
  object-fit: contain;
  animation: splashBounce .6s cubic-bezier(.34,1.56,.64,1) .35s both;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.3));
}

@keyframes splashBounce {
  from { opacity: 0; transform: translateY(40px) scale(.8); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-logo {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 900;
  color: var(--white);
  animation: splashFadeUp .4s ease .6s both;
  margin-bottom: 8px;
}

.splash-sub {
  font-size: 14px;
  color: rgba(255,255,255,.6);
  font-weight: 600;
  animation: splashFadeUp .4s ease .75s both;
  margin-bottom: 32px;
}

.splash-dots {
  display: flex;
  gap: 8px;
  animation: splashFadeUp .4s ease .9s both;
}

.splash-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  animation: dotPulse 1.2s ease infinite;
}

.splash-dot:nth-child(2) { animation-delay: .2s; }
.splash-dot:nth-child(3) { animation-delay: .4s; }

@keyframes splashFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dotPulse {
  0%,100% { background: rgba(255,255,255,.3); transform: scale(1); }
  50%      { background: rgba(255,255,255,.8); transform: scale(1.3); }
}

.splash-hidden {
  animation: splashHide .4s ease forwards;
}

@keyframes splashHide {
  to { opacity: 0; transform: scale(1.04); pointer-events: none; }
}

/* ── СТАРТОВЫЙ ЭКРАН (до логина) ─────────────── */
.start-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  overflow: hidden;
}

.start-hero {
  background: var(--green-800);
  padding: 48px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  position: relative;
}

.start-hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 32px;
  background: var(--white);
  border-radius: 32px 32px 0 0;
}

.start-mascots-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 24px;
}

.start-mascots-row img { filter: drop-shadow(0 8px 20px rgba(0,0,0,.25)); }

.start-hero h1 {
  color: var(--white);
  font-size: 26px;
  margin-bottom: 12px;
}

.start-hero p {
  color: rgba(255,255,255,.75);
  font-size: 15px;
  max-width: 300px;
  margin: 0 auto;
}

.start-actions {
  padding: 32px 24px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.start-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.start-divider::before, .start-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--green-50);
}

/* ── МОБИЛЬНЫЕ РАЗМЕРЫ ───────────────────────── */
@media (max-width: 390px) {
  .screen { padding: 12px; }
  h1 { font-size: 20px; }
  h2 { font-size: 17px; }
  .btn-primary { padding: 13px 22px; font-size: 14px; }
  .mascot-img { width: 64px; height: 64px; }
}

/* ── КРУПНЫЕ ТЕЛЕФОНЫ ────────────────────────── */
@media (min-width: 430px) {
  .screen { padding: 20px; }
}

/* ── ПЛАНШЕТЫ ────────────────────────────────── */
@media (min-width: 768px) {
  .app-content {
    max-width: 480px;
    margin: 0 auto;
  }
  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border: 1.5px solid var(--green-50);
  }
  .app-header {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ── ОРИЕНТАЦИЯ LANDSCAPE ────────────────────── */
@media (orientation: landscape) and (max-height: 500px) {
  .start-hero { padding: 24px 24px 20px; }
  .start-mascots-row img { width: 60px !important; }
  .splash-ponchik { width: 70px; }
  .splash-hvostik { width: 56px; }
}

/* ── iOS СПЕЦИФИКА ───────────────────────────── */
@supports (-webkit-touch-callout: none) {
  .form-input {
    font-size: 16px; /* prevent zoom on iOS */
  }
  select.form-input { font-size: 16px; }
}

/* ── ДЕТСКИЙ ЭКРАН ───────────────────────────── */
.child-screen-bg {
  background: linear-gradient(160deg, #085041 0%, #0F6E56 40%, #1D9E75 100%);
  min-height: 100dvh;
  padding: 0;
}

.child-welcome {
  padding: 48px 24px 24px;
  text-align: center;
}

.child-welcome h1 {
  color: var(--white);
  font-size: 28px;
  margin-bottom: 8px;
}

.child-welcome p {
  color: rgba(255,255,255,.8);
  font-size: 16px;
}

.child-mascots-big {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  margin: 16px 0;
}

.child-mascots-big .ponchik-big {
  width: 130px;
  filter: drop-shadow(0 12px 32px rgba(0,0,0,.3));
  animation: float 3s ease-in-out infinite;
}

.child-mascots-big .hvostik-small {
  width: 90px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.25));
  animation: float 3s ease-in-out infinite .5s;
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.child-action-card {
  background: var(--white);
  border-radius: 32px 32px 0 0;
  padding: 28px 24px calc(32px + var(--safe-bottom));
  margin-top: 8px;
}

/* ── ЭКРАН УРОКА ─────────────────────────────── */
.lesson-screen {
  position: fixed;
  inset: 0;
  background: var(--green-900);
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.lesson-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  background: rgba(255,255,255,.08);
}

.lesson-timer {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 900;
  color: var(--white);
  flex: 1;
  text-align: center;
}

.lesson-video-area {
  flex: 1;
  position: relative;
  background: #000;
}

.lesson-bottom-bar {
  padding: 12px 16px calc(16px + var(--safe-bottom));
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.lesson-control-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: background var(--ease);
}
.lesson-control-btn:hover { background: rgba(255,255,255,.25); }
.lesson-control-btn.danger { background: var(--red); }
.lesson-control-btn.sos { background: var(--amber); width: 64px; height: 64px; font-size: 26px; }

.mascot-corner {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 60px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
  cursor: pointer;
  transition: transform var(--ease);
}
.mascot-corner:hover { transform: scale(1.1); }

/* ── АНИМАЦИЯ SHAKE (неверный PIN) ────────────── */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  15%      { transform: translateX(-10px); }
  30%      { transform: translateX(10px); }
  45%      { transform: translateX(-8px); }
  60%      { transform: translateX(8px); }
  75%      { transform: translateX(-5px); }
  90%      { transform: translateX(5px); }
}

/* ── PIN ЭКРАН ───────────────────────────────── */
input[id^="pin-"]:focus {
  border-color: var(--amber) !important;
  box-shadow: 0 0 0 3px rgba(239,159,39,.25);
}
