:root {
  --ink: #17324d;
  --muted: #58748a;
  --blue: #1776c7;
  --blue-dark: #075a9e;
  --sky: #dff4ff;
  --yellow: #ffd84d;
  --coral: #ff6b5d;
  --green: #3bad72;
  --paper: #fffdf8;
  --white: #ffffff;
  --shadow: 0 12px 0 rgba(28, 93, 132, .1), 0 22px 46px rgba(29, 91, 131, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: linear-gradient(180deg, #bdeaff 0, #f4fcff 43rem, #fffdf8 100%); font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif; font-size: 1rem; line-height: 1.5; }
body:has(dialog[open]) { overflow: hidden; }
button, a { font: inherit; }
button { touch-action: manipulation; }

.topbar { width: min(1160px, calc(100% - 32px)); height: 78px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.22rem; font-weight: 900; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 3px solid var(--ink); border-radius: 14px; background: var(--yellow); color: var(--blue); transform: rotate(-5deg); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.parent-button { min-height: 43px; padding: 9px 14px; display: inline-flex; align-items: center; gap: 7px; border: 2px solid rgba(23, 50, 77, .13); border-radius: 999px; background: rgba(255,255,255,.84); color: var(--ink); font-weight: 900; cursor: pointer; }
.parent-button strong:empty { display: none; }
.parent-button.timer-active { background: #fff3bd; border-color: #e1b52a; }
.parent-button.timer-active strong { padding-left: 7px; border-left: 2px solid rgba(23,50,77,.14); font-variant-numeric: tabular-nums; }
.sound-button, .icon-button { border: 2px solid rgba(23, 50, 77, .13); background: rgba(255,255,255,.84); color: var(--ink); font-weight: 800; cursor: pointer; }
.sound-button { padding: 10px 15px; border-radius: 999px; }
.sound-button:focus-visible, button:focus-visible, a:focus-visible { outline: 4px solid #ff9f1c; outline-offset: 3px; }

main { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 64px; }
.hero { min-height: 445px; position: relative; overflow: hidden; display: grid; grid-template-columns: .86fr 1.4fr; align-items: stretch; border: 4px solid var(--white); border-radius: 40px; background: var(--white); box-shadow: var(--shadow); }
.hero-copy { position: relative; z-index: 2; padding: clamp(32px, 5vw, 62px); display: flex; flex-direction: column; justify-content: center; background: linear-gradient(90deg, #fff 80%, rgba(255,255,255,0)); }
.hero img { width: 100%; height: 100%; min-height: 445px; object-fit: cover; object-position: 64% center; }
.eyebrow, .level-kicker, .game-badge { color: var(--blue-dark); font-weight: 900; letter-spacing: .045em; text-transform: uppercase; font-size: .88rem; }
h1 { max-width: 500px; margin: 9px 0 12px; font-size: clamp(2.8rem, 6vw, 5rem); line-height: .94; letter-spacing: -.045em; }
.hero p { max-width: 500px; margin: 0 0 24px; font-size: 1.14rem; font-weight: 700; }
.primary-button { width: fit-content; min-height: 58px; padding: 14px 22px; display: inline-flex; align-items: center; gap: 28px; border: 0; border-radius: 18px; background: var(--coral); box-shadow: 0 7px 0 #cc443b; color: white; font-size: 1.06rem; font-weight: 900; cursor: pointer; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 9px 0 #cc443b; }
.primary-button:active { transform: translateY(5px); box-shadow: 0 2px 0 #cc443b; }
.hero-progress { width: min(330px, 100%); margin-top: 22px; display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; font-weight: 800; }
.progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: #d8e8ef; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .4s ease; }

.journey { padding: 60px 8px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 25px; }
h2 { margin: 4px 0 0; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.06; letter-spacing: -.025em; }
.stars { flex: 0 0 auto; padding: 11px 17px; border-radius: 18px; background: var(--yellow); font-size: 1.08rem; box-shadow: 0 5px 0 #e5b92f; }
.level-stack { display: grid; gap: 20px; }
.level-card { min-height: 205px; display: grid; grid-template-columns: 82px 1fr; border: 3px solid rgba(23,50,77,.08); border-radius: 31px; background: rgba(255,255,255,.92); box-shadow: 0 8px 0 rgba(23,50,77,.07); }
.level-one { border-color: #82d3a9; background: #f3fff8; }
.level-two:not(.is-locked) { border-color: #8fcbed; background: #f1faff; }
.level-three:not(.is-locked) { border-color: #ffbf73; background: #fff9ed; }
.level-side { position: relative; display: flex; justify-content: center; padding-top: 28px; }
.level-number { position: relative; z-index: 2; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; background: var(--green); color: white; font-size: 1.45rem; font-weight: 900; box-shadow: 0 5px 0 #238754; }
.level-two .level-number { background: var(--blue); box-shadow: 0 5px 0 #075a9e; }
.level-three .level-number { background: #ee8c30; box-shadow: 0 5px 0 #ba6417; }
.level-line { position: absolute; top: 80px; bottom: -36px; width: 8px; background: repeating-linear-gradient(to bottom, #8ac6a7 0 11px, transparent 11px 18px); }
.level-body { padding: 28px 28px 30px 0; }
.level-heading { min-height: 60px; display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.level-card h3 { margin: 2px 0 0; font-size: 1.65rem; line-height: 1.1; }
.level-status { padding: 8px 13px; border-radius: 999px; background: #dff6e9; color: #147044; font-size: .84rem; font-weight: 900; white-space: nowrap; }

.game-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.game-card { min-height: 98px; padding: 15px 17px; display: grid; grid-template-columns: 62px 1fr 36px; align-items: center; gap: 13px; border: 2px solid rgba(23,50,77,.08); border-radius: 22px; background: var(--white); color: var(--ink); text-align: left; box-shadow: 0 5px 0 rgba(23,50,77,.09); cursor: pointer; }
.game-card:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 0 rgba(23,50,77,.09); }
.game-card:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 rgba(23,50,77,.09); }
.game-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: var(--sky); font-size: 2rem; }
.game-card strong, .game-card small { display: block; }
.game-card strong { font-size: 1.05rem; line-height: 1.15; }
.game-card small { margin-top: 6px; color: var(--muted); font-size: .87rem; font-weight: 700; }
.game-state { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: var(--yellow); font-size: .9rem; }
.game-card.is-done .game-state { background: var(--green); color: white; }
.game-card.is-done { border-color: #7fd3a8; }
.game-card:disabled { cursor: not-allowed; opacity: .57; filter: grayscale(.35); }
.game-card:disabled .game-state { background: #e3e9ec; }
.is-locked { background: #eef4f7; opacity: .78; }
.is-locked .level-number { background: #95aab9; box-shadow: 0 5px 0 #718794; }
.is-locked .level-status { background: #dfe7eb; color: #5f7482; }

.grownups { margin: 34px 8px 0; padding: 24px 26px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; border: 2px dashed #a7cbd9; border-radius: 25px; background: rgba(255,255,255,.65); }
.grownups-icon { font-size: 2rem; }
.grownups strong { font-size: 1.02rem; }
.grownups p { margin: 3px 0 0; color: var(--muted); font-weight: 700; }
.text-button { border: 0; padding: 10px 0; background: transparent; color: var(--blue-dark); font-weight: 900; text-decoration: underline; cursor: pointer; }
footer { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 30px 8px 36px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid #d8e8ef; color: var(--muted); font-size: .9rem; font-weight: 700; }

.game-dialog { width: min(780px, calc(100% - 22px)); max-height: calc(100dvh - 22px); padding: 0; border: 0; border-radius: 34px; background: transparent; }
.game-dialog::backdrop { background: rgba(9, 40, 65, .7); backdrop-filter: blur(5px); }
.game-shell { min-height: 540px; max-height: calc(100dvh - 22px); overflow-x: hidden; overflow-y: auto; border: 5px solid white; border-radius: 34px; background: linear-gradient(180deg, #dff4ff, #fff 55%); box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.game-topline { padding: 18px; display: grid; grid-template-columns: 50px 1fr 50px; align-items: center; gap: 14px; }
.icon-button { width: 48px; height: 48px; border-radius: 15px; font-size: 1.15rem; }
.round-progress { display: flex; justify-content: center; gap: 8px; }
.round-dot { width: 34px; height: 10px; border-radius: 99px; background: #c8dae3; }
.round-dot.is-done, .round-dot.is-current { background: var(--green); }
.round-dot.is-current { box-shadow: 0 0 0 3px rgba(59,173,114,.2); }
.game-content { padding: 7px 30px 38px; text-align: center; }
.game-content h2 { max-width: 650px; margin: 8px auto 0; }
.game-content > p { margin: 9px 0 0; color: var(--muted); font-size: 1.05rem; font-weight: 700; }
.play-area { min-height: 185px; margin-top: 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.feedback { min-height: 34px; color: #167349 !important; font-size: 1.07rem !important; }
.choice-row, .number-row, .shape-row { width: 100%; display: flex; justify-content: center; align-items: end; flex-wrap: wrap; gap: clamp(13px, 4vw, 30px); }
.answer-button { min-width: 92px; min-height: 92px; display: grid; place-items: center; border: 5px solid white; border-radius: 24px; background: white; color: var(--ink); box-shadow: 0 7px 0 rgba(23,50,77,.15), 0 0 0 3px rgba(23,50,77,.07); font-size: 2.25rem; font-weight: 900; cursor: pointer; }
.answer-button:hover { transform: translateY(-4px) rotate(1deg); }
.answer-button.is-wrong { border-color: #a91f2c !important; background: #e74350 !important; box-shadow: 0 7px 0 #9c1c27, 0 0 0 4px rgba(231,67,80,.22) !important; color: white !important; }
.color-choice { width: clamp(90px, 18vw, 126px); aspect-ratio: 1; border-radius: 50%; }
.animal-choice { min-width: 150px; min-height: 145px; align-content: center; gap: 4px; }
.animal-choice small { font-size: .9rem; }
.count-scene { margin-bottom: 25px; padding: 20px 28px; border-radius: 24px; background: #fff6cf; font-size: clamp(2.2rem, 8vw, 4rem); letter-spacing: .1em; line-height: 1.25; }
.finger-count { width: min(330px, 100%); min-height: 250px; margin-bottom: 22px; display: grid; place-items: center; border: 4px solid white; border-radius: 30px; background: linear-gradient(180deg, #8edaff, #dff6ff 68%, #a8dc84 69%); box-shadow: 0 8px 0 #b6d8e5; }
.finger-hand { position: relative; width: 230px; height: 220px; }
.finger-row { position: absolute; z-index: 1; left: 30px; bottom: 89px; width: 170px; height: 122px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.cartoon-finger { width: 33px; height: 49px; display: block; border: 4px solid #723723; border-bottom: 0; border-radius: 22px 22px 6px 6px; background: linear-gradient(90deg, #efa47d, #ffc3a1 55%, #ed9a76); transform: translateY(38px); transition: height .2s ease, transform .2s ease; }
.cartoon-finger:nth-child(1), .cartoon-finger:nth-child(5) { height: 43px; }
.cartoon-finger:nth-child(2), .cartoon-finger:nth-child(4) { height: 54px; }
.cartoon-finger:nth-child(3) { height: 61px; }
.cartoon-finger.is-up { height: 108px; transform: translateY(0); }
.cartoon-finger:nth-child(1).is-up, .cartoon-finger:nth-child(5).is-up { height: 88px; }
.cartoon-finger:nth-child(2).is-up, .cartoon-finger:nth-child(4).is-up { height: 102px; }
.cartoon-palm { position: absolute; z-index: 2; left: 36px; bottom: 21px; width: 158px; height: 100px; border: 4px solid #723723; border-radius: 36px 36px 48px 48px; background: linear-gradient(110deg, #efa47d, #ffc3a1 55%, #ef9d78); }
.cartoon-thumb { position: absolute; z-index: 3; left: 15px; bottom: 69px; width: 75px; height: 37px; border: 4px solid #723723; border-radius: 30px 18px 18px 30px; background: linear-gradient(#ffc3a1, #ed9b76); transform: rotate(32deg); }
.number-choice { min-width: 75px; min-height: 75px; border-radius: 21px; font-size: 1.7rem; }
.shape-choice { min-width: 105px; min-height: 105px; font-size: 3.1rem; }
.pattern-strip { margin-bottom: 25px; padding: 15px 20px; display: flex; align-items: center; gap: 11px; border-radius: 24px; background: white; box-shadow: inset 0 0 0 3px #e1edf2; font-size: clamp(2rem, 7vw, 3.5rem); }
.pattern-question { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--yellow); color: var(--ink); font-size: 2rem; }
.memory-grid { width: min(460px, 100%); display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.memory-card { min-height: 88px; border: 0; border-radius: 18px; background: var(--blue); box-shadow: 0 6px 0 #075a9e; color: white; font-size: 0; cursor: pointer; }
.memory-card::before { content: '★'; font-size: 1.7rem; color: var(--yellow); }
.memory-card.is-open, .memory-card.is-matched { background: white; box-shadow: 0 6px 0 #c7dbe5, 0 0 0 3px #d9eaf2; color: var(--ink); font-size: 2.2rem; }
.memory-card.is-open::before, .memory-card.is-matched::before { display: none; }
.memory-card.is-matched { background: #e7fff1; box-shadow: 0 6px 0 #80cfa6; }
.memory-card.is-open.is-wrong { background: #e74350; box-shadow: 0 6px 0 #9c1c27, 0 0 0 3px rgba(231,67,80,.22); color: white; }
.complete-card { width: min(500px, 100%); padding: 30px; border-radius: 28px; background: white; box-shadow: 0 8px 0 #d5e6ed; }
.complete-star { display: block; font-size: 5rem; line-height: 1; animation: starPop .55s ease both; }
.complete-card h3 { margin: 13px 0 8px; font-size: 2rem; }
.complete-card p { margin: 0 0 22px; color: var(--muted); font-weight: 700; }
.complete-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 11px; }
.secondary-button { min-height: 50px; padding: 12px 18px; border: 2px solid #c9dce5; border-radius: 15px; background: white; color: var(--ink); font-weight: 900; cursor: pointer; }
.is-hidden { display: none !important; }
.shake { animation: shake .3s linear; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
@keyframes starPop { from { transform: scale(.25) rotate(-25deg); opacity: 0; } 70% { transform: scale(1.14) rotate(5deg); } }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 28px; background: white; }
  .hero img { min-height: 280px; max-height: 340px; object-position: 61% center; }
  .game-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar { height: 68px; }
  .sound-label { display: none; }
  main { width: min(100% - 20px, 1160px); }
  .hero { min-height: 0; border-radius: 28px; }
  .hero-copy { padding: 30px 24px 26px; }
  .hero img { min-height: 215px; }
  h1 { font-size: 2.8rem; }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 2rem; }
  .stars { padding: 8px 12px; }
  .journey { padding-inline: 0; }
  .level-card { grid-template-columns: 58px 1fr; border-radius: 25px; }
  .level-body { padding: 22px 17px 24px 0; }
  .level-side { padding-top: 23px; }
  .level-number { width: 44px; height: 44px; border-radius: 14px; font-size: 1.2rem; }
  .level-line { top: 65px; }
  .level-heading { display: block; }
  .level-status { display: inline-block; margin-top: 10px; white-space: normal; }
  .game-card { min-height: 91px; padding: 13px; grid-template-columns: 52px 1fr 32px; }
  .game-icon { width: 50px; height: 50px; font-size: 1.65rem; }
  .grownups { grid-template-columns: auto 1fr; padding: 20px; }
  .grownups .text-button { grid-column: 2; justify-self: start; }
  footer { display: grid; }
  .game-dialog { max-height: calc(100dvh - 10px); }
  .game-shell { min-height: 520px; }
  .game-content { padding-inline: 15px; }
  .answer-button { min-width: 76px; min-height: 76px; }
  .animal-choice { min-width: 128px; min-height: 125px; }
  .memory-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
  .primary-button, .game-card, .answer-button { transition: transform .18s ease, box-shadow .18s ease; }
  .hero { animation: arrive .55s ease-out both; }
  @keyframes arrive { from { opacity: 0; transform: translateY(12px); } }
}

/* Game catalog: every game is available, difficulty lives inside each game. */
.section-intro { max-width: 670px; margin: 10px 0 0; color: var(--muted); font-size: 1rem; font-weight: 700; }
.games-catalog { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.game-pick-card { --card-accent: var(--blue); min-height: 210px; padding: 24px; display: grid; grid-template-columns: 74px 1fr; grid-template-rows: 1fr auto; gap: 15px 18px; border: 3px solid color-mix(in srgb, var(--card-accent) 35%, white); border-radius: 29px; background: color-mix(in srgb, var(--card-accent) 8%, white); box-shadow: 0 8px 0 rgba(23,50,77,.08); }
.theme-pink { --card-accent: #ef6b72; }
.theme-green { --card-accent: #3bad72; }
.theme-yellow { --card-accent: #e3a51d; }
.theme-blue { --card-accent: #2489cf; }
.theme-orange { --card-accent: #eb8232; }
.theme-purple { --card-accent: #7d62d9; }
.theme-speech { --card-accent: #d05287; }
.theme-puzzle { --card-accent: #4f72c9; }
.catalog-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 23px; background: white; box-shadow: 0 5px 0 color-mix(in srgb, var(--card-accent) 30%, white); font-size: 2.45rem; }
.catalog-copy { min-width: 0; }
.game-number { color: var(--card-accent); font-size: .82rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.game-pick-card h3 { margin: 3px 0 4px; font-size: 1.55rem; line-height: 1.1; }
.game-pick-card p { margin: 0; color: var(--muted); font-size: .95rem; font-weight: 700; }
.players { display: block; margin-top: 10px; color: var(--ink); font-size: .86rem; font-weight: 900; }
.catalog-actions { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-level-status { padding: 7px 11px; border-radius: 999px; background: white; color: var(--muted); font-size: .82rem; font-weight: 900; }
.play-game-button { min-height: 48px; padding: 11px 16px; display: inline-flex; align-items: center; gap: 15px; border: 0; border-radius: 15px; background: var(--card-accent); box-shadow: 0 5px 0 color-mix(in srgb, var(--card-accent) 72%, #222); color: white; font-weight: 900; cursor: pointer; }
.play-game-button:hover { transform: translateY(-2px); }
.play-game-button:active { transform: translateY(3px); box-shadow: 0 2px 0 color-mix(in srgb, var(--card-accent) 72%, #222); }
.game-pick-card.is-mastered .game-level-status { background: #ddf7e9; color: #147044; }

.level-progress { display: flex; justify-content: center; gap: 8px; }
.level-pill { min-width: 58px; height: 30px; padding: 0 10px; display: grid; place-items: center; border-radius: 99px; background: #c8dae3; color: #557080; font-size: .78rem; font-weight: 900; }
.level-pill.is-done { background: #bcebd1; color: #176e46; }
.level-pill.is-current { background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 3px rgba(255,216,77,.25); }
.round-owner { width: fit-content; margin: 0 auto 12px; padding: 9px 18px 9px 10px; display: inline-flex; align-items: center; gap: 11px; border: 3px solid #8acbec; border-radius: 999px; background: #e7f4ff; color: var(--blue-dark); box-shadow: 0 5px 0 #bdddec; }
.round-owner.amelia { border-color: #eeaac4; background: #fff0f4; color: #ad3e67; box-shadow: 0 5px 0 #f0c8d7; }
.round-owner.is-hidden { display: none; }
.owner-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: white; font-size: 1.5rem; }
.round-owner small, .round-owner strong { display: block; text-align: left; line-height: 1.05; }
.round-owner small { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.round-owner strong { margin-top: 3px; font-size: 1.02rem; }
.level-picker { width: min(560px, 100%); display: grid; gap: 13px; }
.level-choice { min-height: 82px; padding: 15px 18px; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; border: 3px solid #e0ecf1; border-radius: 21px; background: white; color: var(--ink); text-align: left; box-shadow: 0 5px 0 #d5e4eb; cursor: pointer; }
.level-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: #8acbae; }
.level-choice:disabled { opacity: .57; cursor: not-allowed; }
.level-choice-number { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--green); color: white; font-size: 1.2rem; font-weight: 900; }
.level-choice:nth-child(2) .level-choice-number { background: var(--blue); }
.level-choice:nth-child(3) .level-choice-number { background: #e98230; }
.level-choice strong, .level-choice small { display: block; }
.level-choice strong { font-size: 1.05rem; }
.level-choice small { margin-top: 3px; color: var(--muted); font-size: .84rem; font-weight: 700; }
.level-choice-state { font-size: 1.25rem; }
.round-turns { margin-top: 15px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.turn-chip { padding: 6px 10px; border-radius: 999px; background: #edf4f7; color: var(--muted); font-size: .78rem; font-weight: 900; }
.turn-chip.is-current { background: var(--yellow); color: var(--ink); box-shadow: inset 0 0 0 2px #e5b92f; }
.turn-chip.is-current::after { content: ' — сейчас'; }
.turn-chip.is-done { background: #dff6e9; color: #147044; }
.turn-chip.is-done::after { content: ' ✓'; }

.speech-practice { width: min(560px, 100%); display: grid; gap: 20px; }
.speech-bubble { position: relative; padding: 25px 28px; display: grid; justify-items: center; gap: 6px; border: 4px solid #f2b1cb; border-radius: 30px; background: #fff4f8; box-shadow: 0 7px 0 #f3cedd; }
.speech-bubble > span { font-size: 2rem; }
.speech-bubble strong { color: #a93f69; font-size: clamp(2rem, 7vw, 3.3rem); line-height: 1.05; }
.speech-bubble small { color: var(--muted); font-weight: 800; }
.speech-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 13px; }
.puzzle-practice { width: min(610px, 100%); display: grid; justify-items: center; gap: 14px; }
.puzzle-status { width: 100%; min-height: 66px; padding: 8px 10px 8px 17px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 12px; border-radius: 20px; background: white; box-shadow: 0 5px 0 #cbdde6; text-align: left; }
.puzzle-status strong { font-size: 1.05rem; }
.puzzle-status > span { grid-column: 1; color: var(--muted); font-size: .8rem; font-weight: 800; }
.puzzle-preview { grid-column: 2; grid-row: 1 / 3; width: 92px; aspect-ratio: 16 / 9; border: 3px solid white; border-radius: 12px; background-position: center; background-size: cover; box-shadow: 0 0 0 2px #cbdde6; }
.puzzle-place-board { --puzzle-columns: 2; --puzzle-rows: 2; width: 100%; aspect-ratio: 16 / 9; display: grid; grid-template-columns: repeat(var(--puzzle-columns), 1fr); grid-template-rows: repeat(var(--puzzle-rows), 1fr); gap: 3px; padding: 6px; border: 4px solid white; border-radius: 24px; background: #d7ddec; box-shadow: 0 8px 0 #aebbd2; }
.puzzle-slot, .puzzle-tray-piece { min-width: 0; min-height: 0; overflow: hidden; padding: 0; border: 0; background: #edf1fa; cursor: pointer; }
.puzzle-slot { border-radius: 7px; box-shadow: inset 0 0 0 2px rgba(106,124,159,.2); }
.puzzle-slot:disabled { cursor: default; }
.puzzle-slot.is-wrong { background: #ef5260; box-shadow: inset 0 0 0 4px #a91f2c, 0 0 0 3px rgba(239,82,96,.25); }
.puzzle-slot span, .puzzle-tray-piece span { display: block; width: 100%; height: 100%; background-color: #dff4ff; background-repeat: no-repeat; }
.puzzle-tray { width: 100%; padding: 12px; display: grid; grid-template-columns: repeat(var(--puzzle-columns), minmax(0, 1fr)); gap: 8px; border: 4px solid white; border-radius: 24px; background: #e9ddf7; box-shadow: 0 7px 0 #c7b4df; }
.puzzle-tray:empty::after { content: 'Все детали на месте!'; grid-column: 1 / -1; padding: 12px; color: #65547b; font-weight: 900; }
.puzzle-tray-piece { min-height: 44px; border: 3px solid white; border-radius: 10px; box-shadow: 0 3px 0 #b8a6d0; }
.puzzle-tray-piece:hover { filter: brightness(1.05); }
.puzzle-tray-piece.is-selected { position: relative; z-index: 2; outline: 5px solid var(--yellow); outline-offset: 0; transform: scale(.94); }

.parent-dialog, .rest-dialog { padding: 0; border: 0; background: transparent; }
.parent-dialog { width: min(570px, calc(100% - 24px)); }
.rest-dialog { width: min(870px, calc(100% - 24px)); }
.parent-dialog::backdrop, .rest-dialog::backdrop { background: rgba(9, 40, 65, .78); backdrop-filter: blur(6px); }
.parent-shell { position: relative; padding: clamp(28px, 5vw, 45px); border: 5px solid white; border-radius: 32px; background: linear-gradient(180deg, #eff9ff, #fff); box-shadow: 0 30px 90px rgba(0,0,0,.28); text-align: center; }
.parent-close { position: absolute; top: 14px; right: 14px; }
.parent-lock { display: block; margin-bottom: 6px; font-size: 3.1rem; }
.parent-shell p { margin: 10px auto 18px; color: var(--muted); font-weight: 700; }
.parent-shell label { display: block; margin-bottom: 8px; font-weight: 900; }
.parent-answer-row { display: flex; justify-content: center; align-items: stretch; gap: 10px; }
.parent-answer-row input { width: 110px; border: 3px solid #b9d6e5; border-radius: 17px; color: var(--ink); font: 900 1.5rem/1 inherit; text-align: center; }
.parent-answer-row .primary-button { min-height: 52px; }
.parent-error { min-height: 24px; margin-bottom: 0 !important; color: #b52e39 !important; }
.timer-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.timer-options button { min-height: 54px; border: 2px solid #b7d6e4; border-radius: 16px; background: white; color: var(--ink); font-weight: 900; cursor: pointer; }
.timer-options button:hover { border-color: var(--blue); background: #edf8ff; }
.no-timer { margin-top: 14px; }
.rest-shell { overflow: hidden; display: grid; grid-template-columns: 1.08fr .92fr; border: 5px solid white; border-radius: 34px; background: white; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.rest-shell img { width: 100%; height: 100%; min-height: 430px; object-fit: cover; }
.rest-copy { padding: 38px 34px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.rest-copy h2 { color: #675179; font-size: clamp(2.4rem, 6vw, 4rem); }
.rest-copy p { color: var(--muted); font-size: 1.08rem; font-weight: 800; }
.rest-parent-button { margin-top: 12px; background: #fff3bd; }

@media (max-width: 760px) {
  .games-catalog { grid-template-columns: 1fr; }
  .game-pick-card { min-height: 190px; }
  .rest-shell { grid-template-columns: 1fr; }
  .rest-shell img { min-height: 240px; max-height: 340px; }
  .rest-copy { padding: 28px; }
}

@media (max-width: 520px) {
  .topbar { width: calc(100% - 20px); gap: 8px; }
  .brand { font-size: 1rem; }
  .brand-mark { width: 37px; height: 37px; }
  .header-actions { gap: 6px; }
  .parent-button { padding: 8px 10px; }
  .parent-button > span:nth-child(2) { display: none; }
  .sound-button { padding: 8px 11px; }
  .games-section .section-heading { display: grid; grid-template-columns: 1fr auto; }
  .games-section .section-heading > div:first-child { grid-column: 1 / 3; }
  .games-catalog { gap: 14px; }
  .game-pick-card { padding: 18px; grid-template-columns: 58px 1fr; gap: 12px; border-radius: 24px; }
  .catalog-icon { width: 58px; height: 58px; border-radius: 18px; font-size: 1.9rem; }
  .game-pick-card h3 { font-size: 1.3rem; }
  .catalog-actions { align-items: end; flex-direction: column; }
  .game-level-status { align-self: start; }
  .play-game-button { width: 100%; justify-content: space-between; }
  .level-pill { min-width: 45px; padding-inline: 6px; font-size: .7rem; }
  .level-choice { grid-template-columns: 48px 1fr auto; padding: 12px; }
  .level-progress { gap: 4px; }
  .level-pill { min-width: 42px; padding-inline: 4px; }
  .parent-answer-row { align-items: center; flex-direction: column; }
  .parent-answer-row input { min-height: 54px; }
  .timer-options { grid-template-columns: repeat(2, 1fr); }
  .speech-actions { align-items: stretch; flex-direction: column; }
  .speech-actions button { width: 100%; justify-content: center; }
}
