/* ===== screens.css — стартовый экран, финал/итоги, эффекты ===== */

/* ===== START ===== */
#screen-start .start-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 3.4vh, 30px) 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
#screen-start .start-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 240px at 50% -10%, rgba(90,215,255,0.18), transparent 60%);
}
.start-inner { position: relative; z-index: 1; }
.logo-block { text-align: center; margin-bottom: 12px; }
.game-logo {
  font-size: clamp(1.9rem, min(5.2vw, 6.4vh), 3.4rem); font-weight: 700; letter-spacing: 0.5px; margin: 4px 0 6px;
  background: linear-gradient(90deg, #ffd166, #5ad7ff 50%, #b388ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shineLogo 6s linear infinite; background-size: 200% auto;
}
@keyframes shineLogo { to { background-position: 200% center; } }
.game-sub { color: var(--text-muted); font-size: 1.05rem; margin: 0 0 8px; }

/* Дед Мороз + Ёлка + Снегурочка — CSS-сцена */
.festive-scene { display: flex; justify-content: center; align-items: flex-end; gap: 8px; height: clamp(92px, 14vh, 140px); margin: 4px 0 12px; position: relative; }
.festive-scene .ded-moroz, .festive-scene .snegur, .festive-scene .tree { font-size: 2.5rem; line-height: 1; filter: drop-shadow(0 6px 16px rgba(0,0,0,0.45)); }
.festive-scene .ded-moroz { animation: dedBob 4s ease-in-out infinite; }
.festive-scene .sneg { font-size: 2.2rem; animation: floatBob 5s ease-in-out infinite; }
.festive-scene .tree { font-size: 2.8rem; animation: treeGlow 3.2s ease-in-out infinite; }
@keyframes dedBob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes floatBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes treeGlow { 0%,100% { filter: drop-shadow(0 0 4px rgba(255,209,102,0.4)); } 50% { filter: drop-shadow(0 0 16px rgba(255,209,102,0.85)); } }

/* Форма */
.start-form { display: flex; flex-direction: column; gap: 14px; }
.field-label { font-size: 1.1rem; color: var(--text); font-weight: 700; }
/* Выбор класса — на ВСЮ ширину карточки: 7 равных больших кнопок */
.grade-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; width: 100%; }
.grade-btn {
  width: 100%; height: clamp(60px, min(7.5vw, 9.5vh), 104px); border-radius: 18px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-weight: 700; font-size: clamp(1.5rem, min(2.7vw, 4.2vh), 2.8rem); line-height: 1;
  transition: transform .12s ease, border-color .2s, background .2s;
}
.grade-btn:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.grade-btn:active { transform: translateY(1px); }
.grade-btn.active {
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2)); color: #1a0f30; border: 0;
  box-shadow: 0 8px 24px rgba(255,209,102,0.45);
}

.cr-add-row { display: flex; gap: 8px; }
.quest-input {
  flex: 1; padding: 11px 14px; border-radius: 12px; font-family: inherit; font-size: 0.95rem;
  background: rgba(6, 10, 28, 0.6); border: 1px solid var(--border); color: var(--text);
  transition: border-color .2s;
}
.quest-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90,215,255,0.15); }
.btn-add {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  font-size: 1.2rem; font-family: inherit; transition: transform .12s ease, border-color .2s;
}
.btn-add:hover { transform: translateY(-1px); border-color: var(--border-strong); }

/* Чипы учеников */
.cr-setup-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 8px; }
.student-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px;
  border-radius: 999px; background: rgba(40, 54, 110, 0.55); border: 1px solid var(--border-strong);
  font-size: 0.88rem; animation: bounceIn .3s ease both;
}
.student-chip .av { font-size: 1rem; }
.student-chip .nm { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-chip .sc { font-weight: 700; color: var(--accent-3); }
.student-chip .x { width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(255,93,115,0.25);
  color: var(--wrong); cursor: pointer; font-size: 0.8rem; line-height: 1; }
.student-chip .x:hover { background: rgba(255,93,115,0.45); }
@keyframes bounceIn { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }

/* Тэглайн концепции «Дети vs Родители» на старте */
.vs-tagline { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  font-size: 1.02rem; font-weight: 800; padding: 10px 16px; border-radius: 14px;
  background: rgba(255,209,102,0.08); border: 1px solid rgba(255,209,102,0.25); }
.vs-side { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; }
.vs-side.vs-kids { background: rgba(74,222,128,0.14); color: var(--good); }
.vs-side.vs-parents { background: rgba(255,179,64,0.14); color: var(--accent-3); }
.vs-badge { display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 6px; border-radius: 50%;
  background: linear-gradient(135deg, var(--wrong), #ff8ba0); color: #fff;
  font-size: 0.86rem; font-weight: 800; letter-spacing: 0.5px;
  box-shadow: 0 3px 10px rgba(255,93,115,0.35); }
.vs-note { color: var(--text-muted); font-weight: 600; }

.start-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.start-links .btn-ghost { flex: 1; min-width: 200px; }

.news-ticker { margin-top: 14px; padding: 10px 14px; border-radius: 12px; overflow: hidden;
  background: rgba(255,209,102,0.1); border: 1px solid rgba(255,209,102,0.3); display: flex; gap: 12px; align-items: center; }
.news-badge { background: var(--accent-3); color: #1a1400; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; flex: 0 0 auto; }
.news-text { font-size: 0.95rem; color: var(--text); }

/* ===== FINAL / ИТОГИ ===== */
#screen-final .final-card { text-align: center; padding: clamp(20px, 3.4vh, 30px) 24px; }
.final-trophy { font-size: clamp(3.4rem, min(6vw, 9vh), 4.8rem); animation: trophyGlow 2.5s ease-in-out infinite; }
@keyframes trophyGlow { 0%,100% { filter: drop-shadow(0 0 8px rgba(255,209,102,0.5)); transform: scale(1); } 50% { filter: drop-shadow(0 0 24px rgba(255,209,102,0.9)); transform: scale(1.05); } }
.final-stars { font-size: clamp(2.4rem, min(4vw, 6vh), 3rem); margin: 10px 0; }
.final-stars .star { color: var(--accent-3); display: inline-block; animation: twinkle 1.6s ease-in-out infinite; }
.final-stars .star.dim { color: rgba(255,255,255,0.15); animation: none; }
@keyframes twinkle { 0%,100% { opacity: 0.8; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }
.final-stars .star svg { width: 1.6em; height: 1.6em; }
.final-praise { font-size: 1.2rem; font-weight: 700; color: var(--accent-3); margin: 4px 0 8px; }

/* Табло «Дети vs Родители» на финале */
.vs-scoreboard { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 10px auto 6px; max-width: 640px; }
.vs-team { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 22px;
  border-radius: 16px; background: var(--panel-2); border: 1px solid var(--border); min-width: 128px;
  animation: bounceIn .4s ease both; }
.vs-team .vs-av { font-size: clamp(1.8rem, min(3vw, 5vh), 2.4rem); }
.vs-team .vs-name { font-weight: 700; font-size: 0.95rem; color: var(--text-muted); }
.vs-team .vs-pts { font-size: clamp(1.6rem, min(3vw, 5vh), 2.3rem); font-weight: 800; line-height: 1.1; }
.vs-team.kids .vs-pts { color: var(--good); }
.vs-team.parents .vs-pts { color: var(--accent-3); }
.vs-team.winner { border-color: var(--accent-3); box-shadow: 0 0 0 2px rgba(255,179,64,0.35);
  animation: winnerPulse 1.6s ease-in-out infinite; }
@keyframes winnerPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }
.vs-mid { font-size: clamp(1.05rem, min(1.6vw, 2.6vh), 1.3rem); font-weight: 800; text-align: center; max-width: 220px; }

.final-podium { display: flex; flex-direction: column; gap: 8px; max-width: 480px; margin: 16px auto; }
.podium-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--border); animation: bounceIn .4s ease both; }
.podium-row.r1 { background: linear-gradient(90deg, rgba(255,209,102,0.25), var(--panel-2)); border-color: rgba(255,209,102,0.6); }
.podium-row.r2 { background: linear-gradient(90deg, rgba(200,205,220,0.18), var(--panel-2)); border-color: rgba(200,205,220,0.5); }
.podium-row.r3 { background: linear-gradient(90deg, rgba(205,127,50,0.18), var(--panel-2)); border-color: rgba(205,127,50,0.5); }
.podium-medal { font-size: 1.8rem; flex: 0 0 auto; }
.podium-name { flex: 1 1 auto; font-weight: 700; text-align: left; }
.podium-score { font-weight: 700; color: var(--accent-3); flex: 0 0 auto; }

.final-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ===== Подсказка/ответ ===== */
.hint-box { margin-top: 10px; padding: 12px 16px; border-radius: 12px; background: rgba(179,136,255,0.12);
  border: 1px solid rgba(179,136,255,0.35); font-size: 1.02rem; color: #e0d4ff; display: none; }
.hint-box.show { display: block; animation: bounceIn .3s ease; }
.reveal-box { margin-top: 10px; padding: 14px 18px; border-radius: 12px; background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.35); font-size: 1.1rem; color: #c8f7d8; display: none; }
.reveal-box.show { display: block; animation: bounceIn .3s ease; }
.reveal-box b { color: var(--good); }

/* Салют-частицы */
.firework { position: fixed; width: 4px; height: 4px; border-radius: 50%; pointer-events: none; z-index: 180; }
@keyframes fwBurst { 0% { transform: translate(0,0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }

@media (max-width: 480px) {
  .festive-scene { height: 110px; }
  .festive-scene .ded-moroz, .festive-scene .sneg { font-size: 2.4rem; }
  .festive-scene .tree { font-size: 2.8rem; }
}

/* Выбор класса на телефоне: 4 колонки (4+3), кнопки компактнее */
@media (max-width: 620px) {
  .grade-row { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .grade-btn { height: 58px; font-size: 1.5rem; border-radius: 14px; }
  .field-label { font-size: 1.02rem; }
  .vs-tagline { font-size: 0.92rem; }
}
