/* ============================================================
   Светофор информации — стили игры
   ============================================================ */

:root {
  color-scheme: light;

  --bg: #f4f6ff;
  --bg-soft: #eef1ff;
  --surface: #ffffff;
  --surface-alt: #f7f8ff;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --ink: #19213d;
  --ink-soft: #303a5c;
  --muted: #6c7694;
  --border: #e4e8f5;
  --border-strong: #d5dbee;

  --primary: #5a57e8;
  --primary-strong: #4642d6;
  --primary-soft: #eeedff;
  --primary-ink: #ffffff;

  --green: #16a36f;
  --green-soft: #e7faf1;
  --green-line: #b9ecd7;
  --yellow: #e5a01c;
  --yellow-soft: #fff8e3;
  --yellow-line: #f4dfa2;
  --red: #ed4d62;
  --red-soft: #fff0f2;
  --red-line: #f8c9d0;

  --shadow-sm: 0 10px 24px -14px rgba(29, 39, 89, 0.28);
  --shadow-md: 0 22px 48px -24px rgba(29, 39, 89, 0.32);
  --shadow-lg: 0 36px 80px -36px rgba(29, 39, 89, 0.4);

  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --radius-xl: 40px;
  --container: 1220px;
  --font: "Nunito", "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b1020;
  --bg-soft: #11172a;
  --surface: #151d32;
  --surface-alt: #1a233a;
  --surface-glass: rgba(21, 29, 50, 0.82);
  --ink: #f3f6ff;
  --ink-soft: #d6dcf0;
  --muted: #9aa5c3;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --primary: #8885ff;
  --primary-strong: #9f9dff;
  --primary-soft: rgba(136, 133, 255, 0.14);
  --primary-ink: #111528;

  --green: #37cf96;
  --green-soft: rgba(55, 207, 150, 0.12);
  --green-line: rgba(55, 207, 150, 0.34);
  --yellow: #f6be4a;
  --yellow-soft: rgba(246, 190, 74, 0.11);
  --yellow-line: rgba(246, 190, 74, 0.34);
  --red: #ff7285;
  --red-soft: rgba(255, 114, 133, 0.12);
  --red-line: rgba(255, 114, 133, 0.34);

  --shadow-sm: 0 10px 28px -16px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 24px 52px -24px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 90px -38px rgba(0, 0, 0, 0.8);
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

::selection {
  color: #fff;
  background: var(--primary);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Фон */
.page-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 12%, rgba(128, 123, 255, 0.13), transparent 27%),
    radial-gradient(circle at 93% 20%, rgba(255, 190, 74, 0.13), transparent 25%),
    radial-gradient(circle at 55% 105%, rgba(55, 207, 150, 0.11), transparent 32%),
    var(--bg);
  transition: background-color 0.3s ease;
}

.blob {
  position: absolute;
  display: block;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.55;
  animation: blob-float 14s ease-in-out infinite alternate;
}

.blob--one {
  top: -140px;
  left: -90px;
  width: 360px;
  height: 360px;
  background: linear-gradient(135deg, rgba(90, 87, 232, 0.18), rgba(90, 87, 232, 0));
}

.blob--two {
  top: 16%;
  right: -180px;
  width: 460px;
  height: 460px;
  background: linear-gradient(135deg, rgba(229, 160, 28, 0.15), rgba(229, 160, 28, 0));
  animation-delay: -4s;
}

.blob--three {
  bottom: -220px;
  left: 40%;
  width: 520px;
  height: 520px;
  background: linear-gradient(135deg, rgba(22, 163, 111, 0.13), rgba(22, 163, 111, 0));
  animation-delay: -8s;
}

[data-theme="dark"] .blob {
  opacity: 0.32;
}

.app-shell {
  width: min(100% - 40px, var(--container));
  margin: 0 auto;
  padding: 22px 0 48px;
}

/* Общие элементы */
.screen {
  animation: screen-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
  margin-bottom: clamp(22px, 3vw, 38px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand__mark {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 28px;
  height: 34px;
  padding: 5px 6px;
  border-radius: 9px;
  background: #20263d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), var(--shadow-sm);
}

.brand__mark i {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #4b5269;
}

.brand__mark i:nth-child(1) {
  background: #ff6073;
  box-shadow: 0 0 7px rgba(255, 96, 115, 0.8);
}

.brand__text {
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-toggle__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.theme-toggle--round {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 900;
  background: var(--surface-alt);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.icon-button:hover {
  transform: rotate(6deg) scale(1.04);
  border-color: var(--border-strong);
  background: var(--primary-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 16px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.99);
}

.btn--large {
  min-height: 58px;
  padding: 15px 26px;
  border-radius: 18px;
  font-size: 1rem;
}

.btn--compact {
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 14px;
  font-size: 0.87rem;
}

.btn--block {
  width: 100%;
}

.btn--primary {
  color: var(--primary-ink);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 15px 30px -16px rgba(90, 87, 232, 0.9);
}

.btn--primary:hover {
  box-shadow: 0 19px 36px -16px rgba(90, 87, 232, 0.9);
}

.btn--soft {
  color: var(--ink-soft);
  background: var(--primary-soft);
  border-color: transparent;
}

.btn--soft:hover {
  background: var(--surface-alt);
  border-color: var(--border-strong);
}

.btn--ghost {
  color: var(--ink-soft);
  background: var(--surface-glass);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
  border-color: var(--primary);
}

.btn--danger-ghost {
  color: var(--red);
  background: transparent;
  border-color: var(--red-line);
}

.btn--danger-ghost:hover {
  background: var(--red-soft);
}

.btn__arrow {
  margin-left: auto;
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.btn--primary:hover .btn__arrow {
  transform: translateX(4px);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

/* Стартовый экран */
.start-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(390px, 0.98fr);
  align-items: center;
  gap: clamp(32px, 5.5vw, 78px);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.hero__copy {
  width: 100%;
}

.hero__title {
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 4.6vw, 4.35rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero__title span {
  display: inline-block;
  padding-right: 0.05em;
  color: transparent;
  background: linear-gradient(95deg, #ef476f 4%, #f0a41f 50%, #16a36f 96%);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero__lead {
  max-width: 520px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
  line-height: 1.7;
}

.hero__features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero__features li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

/* Светофор */
.traffic-light {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 154px;
  margin: 0 auto 24px;
  filter: drop-shadow(0 24px 24px rgba(28, 33, 67, 0.18));
}

.traffic-light__glow {
  position: absolute;
  top: -18px;
  left: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 75, 102, 0.34), rgba(255, 75, 102, 0) 70%);
  transform: translateX(-50%);
  animation: red-glow 2.6s ease-in-out infinite;
}

.traffic-light__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: 100%;
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 34px;
  background: linear-gradient(145deg, #303751 0%, #1b2034 48%, #111525 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.18),
    inset 0 -8px 18px rgba(0, 0, 0, 0.34),
    0 12px 26px -8px rgba(12, 16, 35, 0.55);
}

.traffic-light__light {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  background: #2b2e42;
  box-shadow:
    inset 0 8px 12px rgba(0, 0, 0, 0.42),
    inset 0 -3px 6px rgba(255, 255, 255, 0.06);
}

.traffic-light__light::after {
  content: "";
  position: absolute;
  top: 16%;
  left: 21%;
  width: 28%;
  height: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(-28deg);
}

.traffic-light__light--red.is-on {
  border-color: rgba(255, 143, 157, 0.5);
  background: radial-gradient(circle at 35% 28%, #ff9daa 0%, #ff526b 38%, #d22440 78%, #9e1029 100%);
  box-shadow:
    0 0 30px 7px rgba(255, 75, 105, 0.48),
    inset 0 4px 10px rgba(255, 255, 255, 0.32),
    inset 0 -6px 12px rgba(95, 0, 19, 0.38);
  animation: light-pulse 2.6s ease-in-out infinite;
}

.traffic-light__light--yellow {
  background: radial-gradient(circle at 35% 28%, #4f4527 0%, #383522 50%, #282819 100%);
}

.traffic-light__light--green {
  background: radial-gradient(circle at 35% 28%, #214a3c 0%, #18362c 50%, #10261f 100%);
}

.traffic-light__pole {
  width: 18px;
  height: 42px;
  background: linear-gradient(90deg, #1b2034, #3b425c 55%, #161a2c);
  box-shadow: inset 1px 0 rgba(255, 255, 255, 0.12);
}

.traffic-light__base {
  width: 86px;
  height: 12px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, #343b55, #181d2e);
  box-shadow: 0 7px 16px rgba(14, 18, 36, 0.35);
}

.start-card {
  position: relative;
  padding: clamp(25px, 3.2vw, 40px);
  overflow: hidden;
}

.start-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--red) 0 33.333%, var(--yellow) 33.333% 66.666%, var(--green) 66.666% 100%);
}

.start-card__head {
  margin-bottom: 24px;
}

.start-card__badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--green-soft);
}

.start-card__head h2 {
  margin-bottom: 7px;
  font-size: clamp(1.55rem, 2.6vw, 1.95rem);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.start-card__head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-field {
  min-width: 0;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.form-fieldset {
  min-width: 0;
}

.form-label {
  display: block;
  margin-bottom: 9px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 0.83rem;
  font-weight: 900;
}

.input-wrap {
  position: relative;
}

.input-wrap__icon {
  position: absolute;
  top: 50%;
  left: 17px;
  font-size: 1.02rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.text-input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 2px solid var(--border);
  border-radius: 16px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  background: var(--surface-alt);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input-wrap .text-input {
  padding-left: 47px;
}

.text-input::placeholder {
  color: var(--muted);
  font-weight: 600;
  opacity: 0.8;
}

.text-input:hover {
  border-color: var(--border-strong);
}

.text-input:focus {
  border-color: var(--primary);
  outline: 0;
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.text-input.is-invalid {
  border-color: var(--red);
  background: var(--red-soft);
}

.field-error {
  margin: 8px 0 0;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
}

.age-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.age-pill {
  min-height: 42px;
  padding: 7px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--surface-alt);
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.age-pill:hover {
  transform: translateY(-1px);
  color: var(--ink);
  border-color: var(--border-strong);
}

.age-pill[aria-checked="true"] {
  color: var(--primary-ink);
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 8px 18px -10px rgba(90, 87, 232, 0.9);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
}

.avatar-option {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  font-size: clamp(1.25rem, 2.7vw, 1.55rem);
  line-height: 1;
  background: var(--surface-alt);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.avatar-option:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: var(--border-strong);
  background: var(--surface);
}

.avatar-option[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--primary-soft);
  transform: scale(1.04);
}

.start-card__actions {
  display: grid;
  gap: 9px;
  margin-top: 26px;
}

.save-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

/* Сообщение о результате друга */
.shared-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
  padding: 13px 14px 13px 17px;
  border: 1px solid var(--yellow-line);
  border-radius: 18px;
  background: var(--yellow-soft);
  box-shadow: var(--shadow-sm);
  animation: slide-down 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.shared-banner__icon {
  flex: 0 0 auto;
  font-size: 1.25rem;
}

.shared-banner__text {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.shared-banner__text strong {
  font-weight: 900;
}

.shared-banner__close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

/* Экран игры */
.screen--game {
  width: min(100%, 1000px);
  margin: 0 auto;
}

.game-header {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(200px, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.player-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player-badge__avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 15px;
  font-size: 1.55rem;
  background: var(--surface-alt);
}

.player-badge__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.player-badge__info strong {
  overflow: hidden;
  max-width: 160px;
  font-size: 0.9rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-badge__info span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
}

.game-progress {
  min-width: 0;
}

.game-progress__text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.game-progress__text strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.progress-track__fill {
  display: block;
  width: 3.333%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--green));
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.game-content {
  margin-top: clamp(18px, 3vw, 28px);
}

.question-card {
  --state-color: var(--border);
  --state-soft: var(--surface);
  --state-line: var(--border);

  position: relative;
  padding: clamp(22px, 4vw, 42px);
  overflow: hidden;
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 100% 0, rgba(90, 87, 232, 0.045), transparent 36%),
    var(--surface);
  box-shadow: var(--shadow-lg);
  transition: border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
}

.question-card.is-changing {
  animation: card-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.question-card.state-green {
  --state-color: var(--green);
  --state-soft: var(--green-soft);
  --state-line: var(--green-line);
  border-color: var(--green);
  background:
    radial-gradient(circle at 100% 0, rgba(22, 163, 111, 0.12), transparent 40%),
    linear-gradient(150deg, var(--green-soft), var(--surface) 72%);
  box-shadow: 0 36px 80px -38px rgba(22, 163, 111, 0.5);
}

.question-card.state-yellow {
  --state-color: var(--yellow);
  --state-soft: var(--yellow-soft);
  --state-line: var(--yellow-line);
  border-color: var(--yellow);
  background:
    radial-gradient(circle at 100% 0, rgba(229, 160, 28, 0.13), transparent 40%),
    linear-gradient(150deg, var(--yellow-soft), var(--surface) 72%);
  box-shadow: 0 36px 80px -38px rgba(229, 160, 28, 0.45);
}

.question-card.state-red {
  --state-color: var(--red);
  --state-soft: var(--red-soft);
  --state-line: var(--red-line);
  border-color: var(--red);
  background:
    radial-gradient(circle at 100% 0, rgba(237, 77, 98, 0.12), transparent 40%),
    linear-gradient(150deg, var(--red-soft), var(--surface) 72%);
  box-shadow: 0 36px 80px -38px rgba(237, 77, 98, 0.45);
}

.question-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.question-number {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--primary);
  font-size: 0.83rem;
  font-weight: 900;
  background: var(--surface-alt);
}

.question-tag {
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--surface-alt);
}

.live-score {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 6px 11px;
  border: 1px solid var(--yellow-line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  background: var(--yellow-soft);
}

.question-emoji {
  display: grid;
  place-items: center;
  width: clamp(78px, 10vw, 104px);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: clamp(2.6rem, 5vw, 3.5rem);
  line-height: 1;
  background: var(--surface-alt);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), var(--shadow-sm);
  transform: rotate(-2deg);
  user-select: none;
}

.question-text {
  max-width: 760px;
  margin: 0 auto 10px;
  font-size: clamp(1.32rem, 2.7vw, 1.85rem);
  font-weight: 900;
  line-height: 1.32;
  letter-spacing: -0.025em;
  text-align: center;
  text-wrap: balance;
}

.question-hint {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.answers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 820px;
  margin: 0 auto;
}

.answer {
  --answer-color: var(--primary);
  --answer-soft: var(--primary-soft);
  --answer-line: var(--border);

  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 78px;
  padding: 13px 13px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-radius: 19px;
  color: var(--ink);
  text-align: left;
  background: var(--surface);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    opacity 0.18s ease,
    box-shadow 0.18s ease;
}

.answer--green {
  --answer-color: var(--green);
  --answer-soft: var(--green-soft);
  --answer-line: var(--green-line);
}

.answer--yellow {
  --answer-color: var(--yellow);
  --answer-soft: var(--yellow-soft);
  --answer-line: var(--yellow-line);
}

.answer--red {
  --answer-color: var(--red);
  --answer-soft: var(--red-soft);
  --answer-line: var(--red-line);
}

.answer:hover {
  z-index: 1;
  border-color: var(--answer-color);
  background: var(--answer-soft);
  box-shadow: 0 12px 26px -17px var(--answer-color);
  transform: translateY(-3px);
}

.answer__icon {
  flex: 0 0 auto;
  font-size: 1.3rem;
  line-height: 1;
}

.answer__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.answer__title {
  font-size: 0.88rem;
  font-weight: 900;
}

.answer__sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
}

.answer__mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  background: transparent;
}

.answers.is-locked .answer {
  cursor: default;
}

.answers.is-locked .answer:hover {
  transform: none;
  border-color: var(--border);
  background: var(--surface);
  box-shadow: none;
}

.answers.is-locked .answer:not(.is-correct):not(.is-wrong) {
  opacity: 0.45;
  filter: saturate(0.55);
}

.answer.is-correct,
.answers.is-locked .answer.is-correct:hover {
  border-color: var(--answer-color);
  background: var(--answer-soft);
  box-shadow: 0 0 0 3px var(--answer-soft), 0 15px 30px -20px var(--answer-color);
  opacity: 1;
  filter: none;
  transform: translateY(-2px);
}

.answer.is-correct .answer__mark {
  border-color: var(--answer-color);
  background: var(--answer-color);
}

.answer.is-correct .answer__mark::before {
  content: "✓";
}

.answer.is-wrong,
.answers.is-locked .answer.is-wrong:hover {
  border-color: var(--red);
  background: var(--red-soft);
  opacity: 1;
  filter: none;
}

.answer.is-wrong .answer__mark {
  border-color: var(--red);
  background: var(--red);
}

.answer.is-wrong .answer__mark::before {
  content: "✕";
}

.feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  max-width: 820px;
  margin: 23px auto 0;
  padding: 15px 15px 15px 17px;
  border: 1px solid var(--state-line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: feedback-in 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.feedback__icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 14px;
  font-size: 1.3rem;
  background: var(--state-soft);
}

.feedback__body {
  min-width: 0;
}

.feedback__title {
  display: block;
  margin-bottom: 2px;
  color: var(--state-color);
  font-size: 0.92rem;
  font-weight: 900;
}

.feedback__text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.48;
}

.feedback__next {
  min-height: 46px;
  padding: 10px 18px;
  white-space: nowrap;
}

.feedback__next span {
  transition: transform 0.2s ease;
}

.feedback__next:hover span {
  transform: translateX(3px);
}

.game-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

/* Результат */
.screen--result {
  width: min(100%, 850px);
  margin: 0 auto;
}

.topbar--result {
  margin-bottom: 12px;
}

.result-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
}

.result-card {
  position: relative;
  width: 100%;
  padding: clamp(30px, 5vw, 52px);
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 50% -15%, rgba(90, 87, 232, 0.13), transparent 38%),
    radial-gradient(circle at 8% 90%, rgba(22, 163, 111, 0.08), transparent 28%),
    radial-gradient(circle at 95% 82%, rgba(229, 160, 28, 0.09), transparent 28%),
    var(--surface);
}

.result-avatar {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 16px;
  border: 1px solid var(--border);
  border-radius: 29px;
  font-size: 3rem;
  line-height: 1;
  background: var(--surface-alt);
  box-shadow: var(--shadow-md);
  transform: rotate(-3deg);
  animation: avatar-pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.result-eyebrow {
  margin-bottom: 8px;
}

.result-title {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.result-eval {
  max-width: 530px;
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-bottom: -3px;
}

.result-score__value {
  color: transparent;
  font-size: clamp(5rem, 13vw, 8rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.08em;
  background: linear-gradient(135deg, #ef476f 5%, #f0a41f 50%, #16a36f 95%);
  background-clip: text;
  -webkit-background-clip: text;
}

.result-score__total {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.24rem);
  font-weight: 800;
}

.result-score__total strong {
  color: var(--ink);
}

.result-percent {
  margin: 13px 0 16px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.result-meter {
  width: min(100%, 380px);
  height: 11px;
  margin: 0 auto 29px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.result-meter__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red) 0%, var(--yellow) 45%, var(--green) 100%);
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  border-radius: 3px;
  animation: confetti-fall 4.2s linear infinite;
}

.confetti i:nth-child(1) { left: 7%; background: #ef476f; animation-delay: 0.1s; }
.confetti i:nth-child(2) { left: 19%; background: #f0a41f; animation-delay: 1.2s; animation-duration: 5s; }
.confetti i:nth-child(3) { left: 31%; background: #16a36f; animation-delay: 2.4s; }
.confetti i:nth-child(4) { left: 45%; background: #5a57e8; animation-delay: 0.7s; animation-duration: 4.8s; }
.confetti i:nth-child(5) { left: 58%; background: #ef476f; animation-delay: 2s; }
.confetti i:nth-child(6) { left: 69%; background: #f0a41f; animation-delay: 0.4s; animation-duration: 5.2s; }
.confetti i:nth-child(7) { left: 82%; background: #16a36f; animation-delay: 1.7s; }
.confetti i:nth-child(8) { left: 93%; background: #5a57e8; animation-delay: 3s; animation-duration: 4.6s; }

/* Профиль */
.screen--profile {
  width: min(100%, 930px);
  margin: 0 auto;
}

.profile-wrap {
  display: grid;
  place-items: center;
}

.profile-card {
  width: 100%;
  padding: clamp(25px, 4vw, 44px);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: clamp(17px, 3vw, 27px);
  margin-bottom: 30px;
}

.profile-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: clamp(86px, 12vw, 112px);
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 34px;
  font-size: clamp(3rem, 6vw, 4rem);
  line-height: 1;
  background:
    radial-gradient(circle at 50% 30%, var(--primary-soft), transparent 65%),
    var(--surface-alt);
  box-shadow: var(--shadow-md);
  transform: rotate(-2deg);
}

.profile-identity {
  min-width: 0;
}

.profile-identity .eyebrow {
  margin-bottom: 5px;
}

.profile-name {
  overflow: hidden;
  margin-bottom: 7px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-age {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  background: var(--surface-alt);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 30px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-alt);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.stat-card__icon {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.stat-card__value {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: clamp(1.3rem, 2.8vw, 1.7rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stat-card__label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.history {
  margin-bottom: 26px;
}

.history__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.history__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.history__hint {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.history-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-alt);
}

.history-item__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  font-size: 0.95rem;
  background: var(--primary-soft);
}

.history-item__info {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.history-item__date {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.history-item__label {
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 800;
}

.history-item__score {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 900;
  background: var(--surface);
}

.history-empty {
  margin: 0;
  padding: 24px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 17px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  background: var(--surface-alt);
}

.profile-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

/* Модальные окна */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(13, 18, 36, 0.62);
  backdrop-filter: blur(7px);
  animation: overlay-in 0.22s ease both;
}

.modal__dialog {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  padding: clamp(24px, 4vw, 36px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.08) both;
  overscroll-behavior: contain;
}

.modal__dialog--rules {
  width: min(100%, 650px);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
}

.modal__heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 44px 16px 0;
}

.modal__emoji {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 17px;
  font-size: 1.7rem;
  background: var(--primary-soft);
}

.modal__heading .eyebrow {
  margin-bottom: 3px;
  font-size: 0.66rem;
}

.modal__heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 1.8rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.modal__lead {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.modal__subtitle {
  margin: 24px 0 11px;
  font-size: 0.95rem;
  font-weight: 900;
}

.legend {
  display: grid;
  gap: 9px;
}

.legend__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-alt);
}

.legend__item--green {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.legend__item--yellow {
  border-color: var(--yellow-line);
  background: var(--yellow-soft);
}

.legend__item--red {
  border-color: var(--red-line);
  background: var(--red-soft);
}

.legend__light {
  flex: 0 0 auto;
  font-size: 1.2rem;
  line-height: 1.3;
}

.legend__item strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.85rem;
  font-weight: 900;
}

.legend__item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.rules-list {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.81rem;
  line-height: 1.45;
}

.rules-list li span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 900;
  background: var(--primary-soft);
}

.share-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(229, 160, 28, 0.12), transparent 45%),
    var(--surface-alt);
}

.share-preview__avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.7rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.share-preview div {
  min-width: 0;
  line-height: 1.3;
}

.share-preview strong {
  display: block;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-preview p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.share-preview p b {
  color: var(--ink);
  font-weight: 900;
}

.share-preview__emoji {
  margin-left: auto;
  font-size: 1.5rem;
}

.share-link-row {
  display: flex;
  gap: 8px;
}

.share-input {
  flex: 1;
  min-width: 0;
  height: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}

.share-link-row .btn {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 11px 17px;
  border-radius: 15px;
  font-size: 0.82rem;
}

.copy-status {
  min-height: 20px;
  margin: 9px 0 0;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
}

.copy-status.is-error {
  color: var(--red);
}

/* Анимации */
@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(9px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes feedback-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes avatar-pop {
  from { opacity: 0; transform: scale(0.75) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(-3deg); }
}

@keyframes light-pulse {
  0%, 100% {
    box-shadow:
      0 0 28px 5px rgba(255, 75, 105, 0.4),
      inset 0 4px 10px rgba(255, 255, 255, 0.32),
      inset 0 -6px 12px rgba(95, 0, 19, 0.38);
  }
  50% {
    box-shadow:
      0 0 42px 12px rgba(255, 75, 105, 0.6),
      inset 0 4px 10px rgba(255, 255, 255, 0.4),
      inset 0 -6px 12px rgba(95, 0, 19, 0.38);
  }
}

@keyframes red-glow {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(0.9); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

@keyframes blob-float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(24px, -22px, 0) scale(1.06); }
}

@keyframes confetti-fall {
  0% { opacity: 0; transform: translate3d(0, -15px, 0) rotate(0deg); }
  8% { opacity: 1; }
  90% { opacity: 0.9; }
  100% { opacity: 0; transform: translate3d(35px, 760px, 0) rotate(420deg); }
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.is-shaking {
  animation: shake 0.35s ease;
}

/* Адаптивность */
@media (max-width: 1060px) {
  .start-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(370px, 1.05fr);
    gap: 34px;
  }

  .hero__title {
    font-size: clamp(2.4rem, 4.7vw, 3.6rem);
  }

  .hero__lead {
    font-size: 0.96rem;
  }
}

@media (max-width: 880px) {
  .app-shell {
    width: min(100% - 30px, 760px);
    padding-top: 16px;
  }

  .start-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    gap: clamp(18px, 4vw, 32px);
    text-align: left;
  }

  .hero__copy {
    min-width: 0;
  }

  .traffic-light {
    width: 126px;
    margin: 0;
  }

  .traffic-light__body {
    gap: 9px;
    padding: 11px;
    border-radius: 29px;
  }

  .traffic-light__pole {
    height: 28px;
  }

  .hero__title {
    font-size: clamp(2.2rem, 5.8vw, 3.35rem);
  }

  .hero__lead {
    max-width: none;
    margin-bottom: 18px;
  }

  .hero__features {
    justify-content: flex-start;
  }

  .start-card {
    max-width: 620px;
    width: 100%;
    margin: 0 auto;
  }

  .game-header {
    grid-template-columns: minmax(0, auto) minmax(150px, 1fr) auto;
    gap: 13px;
  }

  .result-wrap {
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 24px, 620px);
    padding: 13px 0 32px;
  }

  .topbar {
    margin-bottom: 20px;
  }

  .theme-toggle__label {
    display: none;
  }

  .theme-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
  }

  .hero {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 18px;
  }

  .traffic-light {
    width: 100px;
  }

  .traffic-light__body {
    gap: 7px;
    padding: 9px;
    border-radius: 24px;
  }

  .traffic-light__light {
    border-width: 2px;
  }

  .traffic-light__pole {
    height: 20px;
    width: 14px;
  }

  .traffic-light__base {
    width: 62px;
    height: 9px;
  }

  .hero__title {
    font-size: clamp(1.95rem, 6.4vw, 2.8rem);
  }

  .hero__lead {
    margin-bottom: 15px;
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .hero__features {
    gap: 6px;
  }

  .hero__features li {
    padding: 6px 9px;
    font-size: 0.68rem;
  }

  .start-card {
    padding: 24px 18px;
    border-radius: 25px;
  }

  .start-card__head {
    margin-bottom: 20px;
  }

  .avatar-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 5px;
  }

  .avatar-option {
    border-radius: 11px;
    font-size: 1.2rem;
  }

  .age-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .age-pill {
    min-height: 40px;
  }

  .game-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
    border-radius: 20px;
  }

  .game-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .player-badge__avatar {
    width: 41px;
    height: 41px;
    font-size: 1.35rem;
    border-radius: 13px;
  }

  .question-card {
    padding: 22px 16px;
    border-radius: 27px;
  }

  .question-card__top {
    margin-bottom: 18px;
  }

  .question-number {
    width: 37px;
    height: 37px;
    border-radius: 12px;
    font-size: 0.76rem;
  }

  .question-tag {
    font-size: 0.64rem;
  }

  .live-score {
    font-size: 0.72rem;
  }

  .question-emoji {
    width: 70px;
    margin-bottom: 14px;
    border-radius: 22px;
    font-size: 2.3rem;
  }

  .question-text {
    font-size: 1.24rem;
  }

  .question-hint {
    margin-bottom: 20px;
    font-size: 0.74rem;
  }

  .answers {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .answer {
    min-height: 62px;
    padding: 10px 13px;
    border-radius: 16px;
  }

  .answer__title {
    font-size: 0.9rem;
  }

  .answer__sub {
    font-size: 0.67rem;
  }

  .feedback {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    padding: 13px;
  }

  .feedback__next {
    grid-column: 1 / -1;
    width: 100%;
  }

  .feedback__icon {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    font-size: 1.1rem;
  }

  .result-card {
    padding: 29px 17px;
    border-radius: 28px;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .btn {
    width: 100%;
  }

  .profile-card {
    padding: 22px 16px;
    border-radius: 27px;
  }

  .profile-head {
    gap: 15px;
    margin-bottom: 22px;
  }

  .profile-avatar {
    width: 78px;
    border-radius: 24px;
    font-size: 2.6rem;
  }

  .profile-name {
    font-size: 1.7rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .stat-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 11px;
    padding: 12px 14px;
  }

  .stat-card__icon {
    grid-row: 1 / 3;
    margin: 0;
    font-size: 1.15rem;
  }

  .stat-card__value {
    font-size: 1.15rem;
  }

  .stat-card__label {
    margin-top: -2px;
  }

  .profile-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .profile-footer .btn {
    width: 100%;
  }

  .modal {
    padding: 12px;
  }

  .modal__dialog {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 25px 18px;
    border-radius: 25px;
  }

  .modal__heading {
    margin-right: 38px;
  }

  .modal__emoji {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.4rem;
  }

  .share-link-row {
    flex-direction: column;
  }

  .share-link-row .btn {
    width: 100%;
  }
}

@media (max-width: 470px) {
  .brand__text {
    font-size: 0.9rem;
  }

  .hero {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 13px;
  }

  .traffic-light {
    width: 82px;
  }

  .traffic-light__body {
    gap: 6px;
    padding: 7px;
    border-radius: 20px;
  }

  .traffic-light__pole {
    width: 12px;
    height: 16px;
  }

  .traffic-light__base {
    width: 50px;
    height: 7px;
  }

  .eyebrow {
    margin-bottom: 7px;
    font-size: 0.62rem;
  }

  .hero__title {
    font-size: 1.8rem;
  }

  .hero__lead {
    font-size: 0.8rem;
  }

  .hero__features li:nth-child(3) {
    display: none;
  }

  .start-card {
    padding: 22px 14px;
  }

  .start-card__head p {
    font-size: 0.82rem;
  }

  .avatar-grid {
    gap: 4px;
  }

  .avatar-option {
    border-radius: 9px;
    font-size: 1.02rem;
  }

  .form-label {
    font-size: 0.78rem;
  }

  .question-card {
    padding: 19px 12px;
  }

  .question-card__top {
    gap: 6px;
  }

  .question-tag {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-badge__info strong {
    max-width: 120px;
  }

  .result-score {
    gap: 6px;
  }

  .confetti {
    display: none;
  }

  .profile-identity .eyebrow {
    font-size: 0.58rem;
  }

  .profile-name {
    font-size: 1.4rem;
  }

  .history-item {
    gap: 9px;
    padding: 10px;
  }

  .history-item__label {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
