/* ---------- Шрифты (лежат в папке fonts, интернет не нужен) ---------- */
@font-face { font-family: "Nunito"; font-weight: 400; src: url("fonts/nunito-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-weight: 400; src: url("fonts/nunito-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Nunito"; font-weight: 700; src: url("fonts/nunito-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-weight: 700; src: url("fonts/nunito-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Nunito"; font-weight: 800; src: url("fonts/nunito-cyrillic-800-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-weight: 800; src: url("fonts/nunito-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Rubik"; font-weight: 700; src: url("fonts/rubik-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Rubik"; font-weight: 700; src: url("fonts/rubik-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Rubik"; font-weight: 800; src: url("fonts/rubik-cyrillic-800-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Rubik"; font-weight: 800; src: url("fonts/rubik-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

/* ---------- Цвета ---------- */
:root {
  --bg: #E8F1FB;
  --bg-dots: #D6E5F5;
  --card: #FFFFFF;
  --ink: #23304A;
  --ink-soft: #66738A;
  --line: #DCE4EE;
  --violet: #5B4BD6;
  --violet-dark: #4234B0;
  --violet-light: #EEEBFF;
  --green: #22995E;
  --green-light: #E3F6EC;
  --red: #E0534A;
  --red-light: #FDEBEA;
  --yellow: #FFC53D;
  --yellow-light: #FFF5D6;
  --phone: #1F2533;
  --chat-bg: #F2F5FA;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(35, 48, 74, .08), 0 18px 40px rgba(35, 48, 74, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Nunito", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(var(--bg-dots) 2px, transparent 2px);
  background-size: 28px 28px;
  font-size: clamp(16px, 1.25vw, 22px);
  line-height: 1.4;
}
h1, h2, h3, .btn, .finish-title, .badge, .rule-label, .situation-label { font-family: "Rubik", "Nunito", sans-serif; }

.screen { display: none; min-height: 100vh; padding: clamp(16px, 2.5vw, 40px); }
.screen.active { display: flex; flex-direction: column; animation: fade .35s ease; }
.hidden { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Кнопки ---------- */
.btn {
  border: none; cursor: pointer; font-weight: 700; font-size: 1em;
  padding: .75em 1.4em; border-radius: 16px; transition: transform .12s, box-shadow .12s, background .2s;
}
.btn:active { transform: translateY(3px); }
.btn-primary { background: var(--violet); color: #fff; box-shadow: 0 5px 0 var(--violet-dark); }
.btn-primary:hover { background: #6A5BE0; }
.btn-primary:active { box-shadow: 0 2px 0 var(--violet-dark); }
.btn-secondary { background: #fff; color: var(--violet); box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); }
.btn-secondary:active { box-shadow: 0 2px 0 var(--line); }
.btn-big { font-size: 1.25em; padding: .85em 2em; }
.icon-btn { background: #fff; border: 2px solid var(--line); border-radius: 12px; width: 2.4em; height: 2.4em; font-size: 1em; cursor: pointer; }

/* ---------- Старт ---------- */
#screen-start { align-items: center; justify-content: center; }
.start-card {
  background: var(--card); border-radius: 32px; box-shadow: var(--shadow);
  max-width: 1200px; width: 100%; padding: clamp(24px, 4vw, 64px);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center;
}
.badge { display: inline-block; background: var(--yellow-light); color: #8A5A00; font-weight: 700; padding: .35em .9em; border-radius: 999px; font-size: .85em; margin-bottom: .8em; }
h1 { font-size: clamp(36px, 4.2vw, 76px); font-weight: 800; line-height: 1.05; color: var(--violet); margin-bottom: .4em; }
.start-lead { font-size: 1.15em; color: var(--ink-soft); margin-bottom: 1.2em; }
.how { list-style: none; display: grid; gap: .6em; margin-bottom: 1.8em; }
.how li { display: flex; align-items: center; gap: .7em; font-weight: 700; }
.how-num { flex: none; width: 1.9em; height: 1.9em; border-radius: 50%; background: var(--violet-light); color: var(--violet); display: grid; place-items: center; font-family: "Rubik"; }
.start-mascot { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.mascot-bubble {
  position: relative; background: var(--violet-light); color: var(--violet-dark); font-weight: 700;
  padding: 1em 1.2em; border-radius: 20px; max-width: 320px; text-align: center;
}
.mascot-bubble::after { content: ""; position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); border: 8px solid transparent; border-top: 8px solid var(--violet-light); border-width: 14px 12px 0; }

/* ---------- Совёнок ---------- */
.mascot svg { width: 100%; height: 100%; display: block; }
.mascot-large { width: clamp(180px, 20vw, 320px); height: clamp(180px, 20vw, 320px); animation: bob 3s ease-in-out infinite; }
.mascot-medium { width: 120px; height: 120px; flex: none; }
.mascot-small { width: 56px; height: 56px; flex: none; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* ---------- Верхняя панель ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: clamp(12px, 2vw, 28px); gap: 16px; }
.progress { display: flex; gap: 8px; flex-wrap: wrap; }
.dot {
  width: 2em; height: 2em; border-radius: 50%; background: #fff; border: 2px solid var(--line);
  display: grid; place-items: center; font-size: .8em; font-weight: 800; color: var(--ink-soft); font-family: "Rubik";
}
.dot.current { border-color: var(--violet); color: var(--violet); transform: scale(1.12); }
.dot.star { background: var(--yellow); border-color: var(--yellow); color: #fff; }
.dot.done { background: #CBD5E2; border-color: #CBD5E2; color: #fff; }
.topbar-right { display: flex; gap: 12px; align-items: center; }
.stars-count { white-space: nowrap; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: .3em .8em; font-weight: 800; font-family: "Rubik"; }
.star-icon { color: var(--yellow); }

/* ---------- Игровая раскладка ---------- */
.game-layout { flex: 1; display: grid; grid-template-columns: minmax(280px, 0.8fr) 1.4fr; gap: clamp(20px, 3vw, 56px); align-items: start; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ---------- Телефон ---------- */
.phone-wrap { display: flex; justify-content: center; }
.phone {
  width: 100%; max-width: 400px; background: var(--phone); border-radius: 44px; padding: 14px;
  box-shadow: var(--shadow); position: relative;
}
.phone::before { content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 80px; height: 8px; border-radius: 8px; background: #000; opacity: .5; }
.phone-status { display: flex; justify-content: space-between; color: #fff; font-size: .7em; padding: 4px 20px 10px; font-weight: 700; }
.phone-app {
  background: #fff; border-radius: 30px 30px 0 0; padding: .8em 1em; display: flex; align-items: center; gap: .7em;
  border-bottom: 1px solid var(--line);
}
.app-icon { width: 2.2em; height: 2.2em; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: .9em; flex: none; }
.app-icon svg { width: 60%; height: 60%; }
.app-name { font-size: .78em; color: var(--ink-soft); font-weight: 700; line-height: 1.2; }
.app-sender { font-weight: 800; font-size: .95em; line-height: 1.2; }
.phone-screen {
  background: var(--chat-bg); border-radius: 0 0 30px 30px; min-height: clamp(320px, 42vh, 520px);
  padding: 1em; display: flex; flex-direction: column; gap: .8em;
}
.msg-row { display: flex; gap: .6em; align-items: flex-end; animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }
.avatar { flex: none; width: 2.3em; height: 2.3em; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-family: "Rubik"; font-size: .85em; }
.bubble { background: #fff; border-radius: 20px 20px 20px 6px; padding: .8em 1em; box-shadow: 0 2px 0 var(--line); font-size: 1em; }
.bubble .who { font-size: .75em; font-weight: 800; margin-bottom: .2em; }
.bubble .time { font-size: .65em; color: var(--ink-soft); text-align: right; margin-top: .3em; }
.bubble .link { color: #1A73E8; text-decoration: underline; word-break: break-all; }
.bubble .file { display: flex; align-items: center; gap: .5em; background: var(--chat-bg); border-radius: 12px; padding: .5em .7em; margin-top: .5em; font-weight: 700; font-size: .9em; }
.typing { display: flex; gap: 5px; background: #fff; padding: .8em 1em; border-radius: 20px 20px 20px 6px; width: fit-content; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: #B6C0CF; animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .3; transform: translateY(-3px); } }

/* Входящий видеозвонок */
.call { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8em; text-align: center; animation: pop .35s ease; }
.call .avatar { width: 5em; height: 5em; font-size: 1.2em; animation: ring 1.2s infinite; }
@keyframes ring { 0%,100% { box-shadow: 0 0 0 0 rgba(91,75,214,.4); } 50% { box-shadow: 0 0 0 18px rgba(91,75,214,0); } }
.call-title { font-weight: 800; }
.call-sub { font-size: .8em; color: var(--ink-soft); }
.call-buttons { display: flex; gap: 2.5em; margin-top: .4em; }
.call-buttons span { width: 3em; height: 3em; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.1em; }

/* Заявка в друзья */
.friend { background: #fff; border-radius: 20px; padding: 1em; text-align: center; box-shadow: 0 2px 0 var(--line); animation: pop .35s ease; }
.friend .avatar { width: 4em; height: 4em; margin: 0 auto .5em; font-size: 1.1em; }
.friend-name { font-weight: 800; }
.friend-sub { font-size: .8em; color: var(--ink-soft); margin-bottom: .6em; }
.friend-buttons { display: flex; gap: .5em; justify-content: center; }
.friend-buttons span { padding: .4em .9em; border-radius: 10px; font-size: .8em; font-weight: 800; }

/* ---------- Панель вопроса ---------- */
.panel { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: clamp(20px, 2.2vw, 40px); }
.situation-label { color: var(--violet); font-weight: 700; font-size: .85em; letter-spacing: .02em; margin-bottom: .3em; }
.question { font-size: clamp(26px, 2.4vw, 44px); font-weight: 800; margin-bottom: .55em; line-height: 1.15; }
.answers { display: grid; gap: .65em; }
.answer {
  display: flex; align-items: center; gap: .9em; text-align: left; width: 100%;
  background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: .65em 1em;
  font-family: inherit; font-size: 1.05em; font-weight: 700; color: var(--ink); cursor: pointer;
  box-shadow: 0 4px 0 var(--line); transition: border-color .15s, background .15s, transform .1s;
}
.answer:hover:not(:disabled) { border-color: var(--violet); background: var(--violet-light); }
.answer:active:not(:disabled) { transform: translateY(2px); }
.answer .letter { flex: none; width: 2em; height: 2em; border-radius: 10px; background: var(--violet-light); color: var(--violet); display: grid; place-items: center; font-family: "Rubik"; font-weight: 800; }
.answer:disabled { cursor: default; }
.answer.dim { opacity: .45; }
.answer.right { border-color: var(--green); background: var(--green-light); box-shadow: 0 4px 0 #BFE6D0; }
.answer.right .letter { background: var(--green); color: #fff; }
.answer.wrong { border-color: var(--red); background: var(--red-light); box-shadow: 0 4px 0 #F6C9C5; animation: shake .4s; }
.answer.wrong .letter { background: var(--red); color: #fff; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

.feedback { display: flex; gap: 1em; align-items: center; margin-top: .9em; padding: .75em 1.1em; border-radius: 18px; animation: fade .3s ease; }
.feedback.good { background: var(--green-light); }
.feedback.bad { background: var(--red-light); }
.feedback-title { font-family: "Rubik"; font-weight: 800; font-size: 1.15em; }
.feedback.good .feedback-title { color: var(--green); }
.feedback.bad .feedback-title { color: var(--red); }

.rule { flex: 1; background: var(--yellow-light); border: 3px dashed var(--yellow); border-radius: 18px; padding: .7em 1.1em; animation: fade .3s ease .15s both; }
.rule-label { font-size: .8em; font-weight: 700; color: #8A5A00; margin-bottom: .2em; }
.rule-text { font-size: 1.15em; font-weight: 800; }

.panel-bottom { display: flex; gap: 16px; align-items: center; margin-top: .9em; }
.panel-actions { display: flex; justify-content: flex-end; gap: 12px; margin-left: auto; flex: none; }

/* ---------- Финал ---------- */
#screen-finish { align-items: center; }
.finish-card { background: var(--card); border-radius: 32px; box-shadow: var(--shadow); max-width: 1000px; width: 100%; padding: clamp(24px, 3.5vw, 56px); }
.finish-head { display: flex; gap: 24px; align-items: center; margin-bottom: 1.5em; }
.finish-title { font-size: clamp(28px, 3vw, 52px); font-weight: 800; color: var(--violet); line-height: 1.1; }
.finish-score { color: var(--ink-soft); font-weight: 700; margin: .3em 0; }
.finish-stars { font-size: 1.6em; letter-spacing: 2px; color: var(--yellow); }
.finish-stars .off { color: #D9E0EA; }
.memo-title { font-size: 1.2em; margin-bottom: .6em; }
.memo { padding-left: 0; list-style: none; counter-reset: m; display: grid; grid-template-columns: 1fr 1fr; gap: .6em 1.4em; margin-bottom: 1.6em; }
.memo li { counter-increment: m; display: flex; gap: .6em; font-weight: 700; font-size: .95em; }
.memo li::before { content: counter(m); flex: none; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--yellow-light); color: #8A5A00; display: grid; place-items: center; font-family: "Rubik"; font-size: .85em; }
.finish-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Узкие экраны ---------- */
@media (max-width: 860px) {
  .start-card, .game-layout { grid-template-columns: 1fr; }
  .start-mascot { order: -1; }
  .phone-screen { min-height: 240px; }
  .memo { grid-template-columns: 1fr; }
  .panel-bottom { flex-direction: column; align-items: stretch; }
}

/* ---------- Печать памятки ---------- */
@media print {
  body { background: #fff; font-size: 14pt; }
  .screen { display: none !important; }
  #screen-finish { display: block !important; padding: 0; }
  .finish-card { box-shadow: none; padding: 0; }
  .finish-actions, .finish-head { display: none; }
  .memo-title { font-size: 22pt; color: #5B4BD6; margin-bottom: 16pt; }
  .memo { grid-template-columns: 1fr; gap: 10pt; }
  .memo li::before { border: 1px solid #C9A33A; }
}
