:root {
  color-scheme: light;
  --ink: #244c46;
  --muted: #60736d;
  --cream: #f7f0df;
  --paper: #fffdf7;
  --line: #e6dcc7;
  --green: #4f9f7b;
  --coral: #e47b65;
  --gold: #e4ac42;
  --blue: #6d82c5;
  font-family: Inter, ui-rounded, "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; background: var(--cream); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 7%, rgba(228, 172, 66, .16) 0 90px, transparent 92px),
    radial-gradient(circle at 94% 19%, rgba(79, 159, 123, .13) 0 130px, transparent 132px),
    linear-gradient(180deg, #fbf6e9 0%, #f6efde 100%);
  overflow-x: clip;
}

button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 4px solid rgba(75, 145, 189, .35); outline-offset: 3px; }

.app {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 54px;
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 58px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0; color: var(--ink); text-align: left; background: none; border: 0; cursor: pointer; }
.brand-mark { position: relative; display: grid; width: 48px; height: 48px; place-items: center; color: white; background: var(--green); border: 3px solid white; border-radius: 17px; box-shadow: 0 7px 17px rgba(49, 94, 77, .18); transform: rotate(-3deg); }
.brand-mark b { font-family: Georgia, serif; font-size: 25px; line-height: 1; transform: rotate(3deg); }
.brand-mark i { position: absolute; right: 3px; bottom: 1px; color: #f4c75c; font-size: 13px; font-style: normal; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 19px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.sound-button, .quiet-button { min-height: 44px; color: var(--ink); font-size: 13px; font-weight: 800; background: rgba(255, 253, 247, .78); border: 1px solid rgba(80, 105, 95, .17); border-radius: 14px; cursor: pointer; box-shadow: 0 5px 13px rgba(59, 74, 65, .05); }
.sound-button { display: flex; align-items: center; gap: 8px; padding: 0 16px; }
.quiet-button { padding: 0 17px; }
.sound-button:hover, .quiet-button:hover { background: white; transform: translateY(-1px); }
.sound-button:active, .quiet-button:active { transform: translateY(1px); }

.eyebrow { margin: 0 0 8px; color: #a46251; font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(380px, .97fr); min-height: 400px; overflow: hidden; background: var(--paper); border: 1px solid rgba(74, 94, 84, .12); border-radius: 32px; box-shadow: 0 22px 58px rgba(71, 75, 55, .12); }
.hero::after { position: absolute; right: -65px; bottom: -80px; width: 320px; height: 320px; content: ""; background: #f0d990; border-radius: 50%; opacity: .32; }
.hero-copy { position: relative; z-index: 2; align-self: center; padding: 54px 30px 54px 58px; }
.hero h1 { max-width: 610px; margin: 0; color: #244b45; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5vw, 68px); font-weight: 700; line-height: .99; letter-spacing: -.035em; }
.hero-copy > p:not(.eyebrow) { max-width: 590px; margin: 22px 0 28px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.primary-button, .secondary-button, .hint-button { border: 0; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.primary-button { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; gap: 16px; padding: 0 24px; color: white; font-weight: 900; background: var(--coral); border-radius: 16px; box-shadow: 0 10px 20px rgba(190, 92, 72, .24); }
.primary-button span { font-size: 22px; }
.primary-button:hover { background: #d96e59; transform: translateY(-2px); box-shadow: 0 13px 25px rgba(190, 92, 72, .3); }
.primary-button:active { transform: translateY(1px); }
.primary-button.compact { min-height: 46px; margin-left: auto; padding: 0 18px; font-size: 14px; border-radius: 14px; }
.secondary-button { min-height: 50px; padding: 0 22px; color: var(--ink); font-weight: 900; background: #f3ead8; border: 1px solid #dfd2ba; border-radius: 15px; }
.secondary-button:hover { background: #eee0c7; transform: translateY(-1px); }
.hero-scene { position: relative; z-index: 1; min-height: 400px; }
.hero-number { position: absolute; z-index: 3; top: 82px; left: 15px; display: grid; width: 120px; height: 120px; place-items: center; color: white; font-family: Georgia, serif; font-size: 78px; font-weight: 800; line-height: 1; background: var(--blue); border: 8px solid white; border-radius: 35px; box-shadow: 0 16px 30px rgba(72, 87, 143, .25); transform: rotate(-4deg); }
.hero-quantity { position: absolute; z-index: 2; right: 28px; bottom: 55px; width: 270px; padding: 20px; background: rgba(255, 253, 247, .88); border: 3px solid white; border-radius: 34px; box-shadow: 0 18px 35px rgba(66, 82, 72, .15); transform: rotate(2deg); }
.hero-line { position: absolute; z-index: 1; top: 164px; left: 90px; right: 110px; height: 120px; border: 8px solid var(--gold); border-width: 8px 8px 0 0; border-radius: 0 80px 0 0; transform: rotate(12deg); }
.hero-line i { position: absolute; top: -13px; width: 18px; height: 18px; background: var(--gold); border: 4px solid white; border-radius: 50%; }
.hero-line i:nth-child(1) { left: 8%; }.hero-line i:nth-child(2) { left: 50%; }.hero-line i:nth-child(3) { right: -13px; }
.hero-check { position: absolute; z-index: 4; right: 18px; bottom: 35px; display: grid; width: 65px; height: 65px; place-items: center; color: white; font-size: 34px; font-weight: 900; background: var(--green); border: 6px solid white; border-radius: 50%; box-shadow: 0 10px 23px rgba(46, 116, 87, .24); }

.how, .levels { margin-top: 56px; }
.how > .eyebrow { text-align: center; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how article { position: relative; min-height: 135px; padding: 25px 25px 22px 76px; background: rgba(255, 253, 247, .72); border: 1px solid rgba(75, 91, 82, .11); border-radius: 22px; }
.how article > span { position: absolute; top: 25px; left: 22px; display: grid; width: 40px; height: 40px; place-items: center; color: white; font-family: Georgia, serif; font-size: 22px; font-weight: 800; background: var(--green); border-radius: 13px; }
.how article:nth-child(2) > span { background: var(--gold); }.how article:nth-child(3) > span { background: var(--blue); }
.how strong { display: block; margin-bottom: 7px; font-family: Georgia, serif; font-size: 20px; }
.how p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 34px; }
.section-heading > p { max-width: 390px; margin: 0 0 3px; color: var(--muted); text-align: right; line-height: 1.5; }
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.level-card { position: relative; display: flex; min-width: 0; min-height: 330px; flex-direction: column; overflow: hidden; padding: 26px; color: var(--ink); text-align: left; background: var(--paper); border: 1px solid rgba(72, 91, 81, .13); border-radius: 26px; cursor: pointer; box-shadow: 0 13px 32px rgba(77, 78, 60, .08); transition: transform .2s ease, box-shadow .2s ease; }
.level-card::before { position: absolute; inset: 0 0 auto; height: 7px; content: ""; background: var(--accent); }
.level-card:hover { transform: translateY(-5px); box-shadow: 0 19px 38px rgba(77, 78, 60, .13); }
.level-card:active { transform: translateY(-1px); }
.level-number { position: absolute; top: 22px; right: 23px; display: grid; width: 35px; height: 35px; place-items: center; color: var(--accent); font-family: Georgia, serif; font-size: 19px; font-weight: 900; background: color-mix(in srgb, var(--accent) 12%, white); border-radius: 50%; }
.level-visual { display: flex; width: 100%; height: 105px; align-items: center; justify-content: center; gap: 14px; margin: 19px 0 22px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, #fffdf7); border-radius: 21px; }
.level-visual b { display: grid; width: 58px; height: 58px; place-items: center; color: white; font-family: Georgia, serif; font-size: 37px; background: var(--accent); border-radius: 18px; }
.level-visual span { max-width: 108px; color: var(--accent); font-size: 21px; font-weight: 900; letter-spacing: 5px; line-height: 1.45; }
.level-visual i { width: 40px; height: 7px; background: var(--accent); border-radius: 9px; }
.level-copy { display: block; }
.level-copy small, .level-copy strong, .level-copy em { display: block; }
.level-copy small { color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.level-copy strong { margin-top: 7px; font-family: Georgia, serif; font-size: 24px; line-height: 1.1; }
.level-copy em { margin-top: 9px; color: var(--muted); font-size: 14px; font-style: normal; line-height: 1.45; }
.level-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 18px; color: var(--muted); font-size: 12px; font-weight: 800; border-top: 1px solid #eee5d4; }
.level-status > b { color: var(--accent); font-size: 22px; }
.mini-stars { color: var(--gold); font-size: 16px; letter-spacing: 2px; }
.adult-note { display: flex; max-width: 760px; align-items: center; gap: 18px; margin: 42px auto 0; padding: 18px 24px; background: rgba(79, 159, 123, .1); border: 1px solid rgba(79, 159, 123, .2); border-radius: 20px; }
.adult-note > span { font-size: 29px; }.adult-note p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }.adult-note strong { display: block; margin-bottom: 2px; color: var(--ink); }

.game-shell { padding: 29px; background: var(--paper); border: 1px solid rgba(72, 91, 81, .13); border-radius: 30px; box-shadow: 0 20px 50px rgba(76, 79, 60, .11); }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.game-head h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(27px, 3.2vw, 39px); line-height: 1.08; }
.round-count { display: flex; min-width: 82px; align-items: baseline; justify-content: center; gap: 5px; padding: 10px 14px; color: var(--level-accent); background: color-mix(in srgb, var(--level-accent) 11%, white); border-radius: 16px; }
.round-count strong { font-family: Georgia, serif; font-size: 28px; }.round-count span { color: var(--muted); font-size: 13px; font-weight: 800; }
.progress-track { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin: 20px 0 25px; }
.progress-track i { height: 7px; background: #e8e0d1; border-radius: 9px; }.progress-track i.done { background: var(--green); }.progress-track i.current { background: var(--level-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--level-accent) 14%, transparent); }
.question-card { display: grid; min-height: 280px; grid-template-columns: minmax(210px, .72fr) minmax(0, 1.28fr); align-items: center; gap: 28px; padding: 24px 32px; background: linear-gradient(135deg, #f3ead8, #f9f3e8); border: 1px solid #eadfc9; border-radius: 25px; }
.question-heading h2 { max-width: 300px; margin: 0; font-family: Georgia, serif; font-size: 30px; line-height: 1.15; }
.quantity-stage { display: grid; min-height: 225px; place-items: center; padding: 18px; background: rgba(255, 255, 255, .62); border: 2px dashed rgba(85, 115, 101, .2); border-radius: 23px; }
.number-question { grid-template-columns: minmax(0, 1fr) 240px; }
.target-number { display: grid; width: 180px; height: 180px; place-self: center; place-items: center; padding-bottom: 5px; color: white; font-family: Georgia, serif; font-size: 116px; font-weight: 900; line-height: 1; background: var(--level-accent); border: 10px solid white; border-radius: 44px; box-shadow: 0 17px 33px color-mix(in srgb, var(--level-accent) 25%, transparent); transform: rotate(2deg); }
.quantity-group { display: grid; width: min(100%, 520px); grid-template-columns: repeat(var(--columns), minmax(54px, 1fr)); align-items: center; justify-items: center; gap: 9px 12px; }
.quantity-group.compact { grid-template-columns: repeat(var(--columns), minmax(24px, 1fr)); gap: 4px 5px; }
.quantity-item { position: relative; display: grid; width: clamp(58px, 7vw, 82px); aspect-ratio: 1; place-items: center; transform: rotate(var(--turn)); animation: item-in .32s ease both; animation-delay: var(--delay); }
.quantity-group.compact .quantity-item { width: clamp(30px, 4.6vw, 50px); }
.quantity-item svg { display: block; width: 100%; height: 100%; overflow: visible; }
.quantity-item b { position: absolute; right: -3px; bottom: -2px; display: grid; width: 25px; height: 25px; place-items: center; color: white; font-family: Georgia, serif; font-size: 14px; background: var(--green); border: 2px solid white; border-radius: 50%; box-shadow: 0 4px 9px rgba(43, 87, 70, .18); }
.quantity-group.compact .quantity-item b { width: 20px; height: 20px; font-size: 11px; }
.answer-zone { margin-top: 22px; }.answer-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }.answer-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 24px; }
.hint-button { min-height: 44px; padding: 0 17px; color: #755b22; font-size: 13px; font-weight: 900; background: #fff1be; border: 1px solid #eed783; border-radius: 14px; }
.hint-button:hover:not(:disabled) { background: #ffe89a; transform: translateY(-1px); }.hint-button:active:not(:disabled) { transform: translateY(1px); }.hint-button:disabled { cursor: default; opacity: .55; }
.number-options, .group-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.number-option, .group-option { position: relative; min-width: 0; color: var(--ink); background: white; border: 2px solid #dfd5c3; border-radius: 22px; cursor: pointer; box-shadow: 0 7px 15px rgba(74, 77, 58, .07); transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease; }
.number-option { display: flex; min-height: 126px; align-items: center; justify-content: center; gap: 16px; padding: 15px; }
.number-option strong { display: grid; width: 82px; height: 82px; place-items: center; padding-bottom: 4px; color: white; font-family: Georgia, serif; font-size: 56px; background: var(--level-accent); border-radius: 25px; }
.number-option small { color: var(--muted); font-weight: 800; }
.group-option { display: grid; min-height: 205px; place-items: center; padding: 17px 12px 12px; }
.group-option .quantity-group { width: 100%; }
.option-caption { align-self: end; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.number-option:hover:not(:disabled), .group-option:hover:not(:disabled) { border-color: var(--level-accent); transform: translateY(-3px); box-shadow: 0 12px 22px color-mix(in srgb, var(--level-accent) 15%, transparent); }
.number-option:active:not(:disabled), .group-option:active:not(:disabled) { transform: translateY(0); }
.number-option.is-wrong, .group-option.is-wrong { background: #fff4f1; border-color: #df8878; opacity: .68; }
.number-option.is-wrong::after, .group-option.is-wrong::after { position: absolute; top: 9px; right: 10px; display: grid; width: 28px; height: 28px; place-items: center; color: white; content: "×"; font-size: 21px; font-weight: 900; background: #df7464; border-radius: 50%; }
.number-option.is-hint, .group-option.is-hint { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(228, 172, 66, .2); animation: hint-pulse 1.2s ease-in-out infinite; }
.number-option.is-correct, .group-option.is-correct { background: #f0faf4; border-color: var(--green); box-shadow: 0 0 0 5px rgba(79, 159, 123, .16); }

.pair-zone { padding: 22px; background: linear-gradient(145deg, #f4ecdb, #faf6ec); border: 1px solid #e7dcc6; border-radius: 25px; }
.pair-instruction { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.pair-instruction h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; }.pair-instruction > span { min-width: 84px; padding: 10px 14px; color: var(--muted); text-align: center; background: white; border-radius: 14px; box-shadow: 0 5px 12px rgba(71, 76, 59, .07); }.pair-instruction > span b { color: var(--level-accent); font-family: Georgia, serif; font-size: 24px; }
.match-board { position: relative; display: grid; grid-template-columns: minmax(110px, .72fr) minmax(230px, 1.28fr); gap: clamp(55px, 10vw, 128px); padding: 4px; }
.connections { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.connections path { fill: none; stroke: var(--line-color); stroke-width: 7; stroke-linecap: round; opacity: .8; filter: drop-shadow(0 3px 2px rgba(51, 76, 63, .12)); animation: line-in .35s ease both; }
.pair-column { position: relative; z-index: 2; display: grid; align-content: start; gap: 9px; }
.pair-column h3 { margin: 0 0 2px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .11em; text-align: center; text-transform: uppercase; }
.pair-card { position: relative; display: grid; min-width: 0; min-height: 88px; place-items: center; padding: 8px 13px; color: var(--ink); background: white; border: 2px solid #ddd2bd; border-radius: 20px; cursor: pointer; box-shadow: 0 6px 13px rgba(72, 77, 59, .07); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.pair-card.number strong { display: grid; width: 58px; height: 58px; place-items: center; padding-bottom: 3px; color: white; font-family: Georgia, serif; font-size: 42px; background: var(--level-accent); border-radius: 18px; }
.pair-card.number small { position: absolute; right: 10px; bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.pair-card.group { min-height: 98px; }.pair-card.group .quantity-group { width: min(100%, 300px); }.pair-card.group .quantity-item { width: clamp(24px, 4vw, 42px); }
.pair-socket { position: absolute; top: 50%; display: grid; width: 20px; height: 20px; background: #f8f2e7; border: 4px solid #cfc3ae; border-radius: 50%; transform: translateY(-50%); }
.pair-card.number .pair-socket { right: -12px; }.pair-card.group .pair-socket { left: -12px; }
.pair-card:hover:not(:disabled) { border-color: var(--level-accent); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(72, 77, 59, .12); }
.pair-card.is-selected { border-color: var(--level-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--level-accent) 18%, transparent); transform: scale(1.02); }.pair-card.is-selected .pair-socket { background: var(--level-accent); border-color: white; }
.pair-card.is-matched { background: color-mix(in srgb, var(--pair-color) 11%, white); border-color: var(--pair-color); opacity: 1; }.pair-card.is-matched .pair-socket { background: var(--pair-color); border-color: white; }.pair-card.is-matched.number strong { background: var(--pair-color); }
.pair-card.is-wrong { background: #fff2ef; border-color: #de7767; animation: shake .28s ease; }
.pair-card.is-hint { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(228, 172, 66, .2); animation: hint-pulse 1.2s ease-in-out infinite; }
.pair-tools { display: flex; justify-content: flex-end; margin-top: 13px; }

.feedback-card { display: flex; min-height: 76px; align-items: center; gap: 14px; margin-top: 17px; padding: 13px 16px; background: #f4f0e7; border: 1px solid #e5dccb; border-radius: 19px; }
.feedback-card.correct { background: #edf8f1; border-color: #b8dfc7; }.feedback-card.correct-pair { background: #eef7f3; border-color: #c2dfd1; }.feedback-card.wrong { background: #fff2ef; border-color: #efc0b7; }.feedback-card.hint { background: #fff7d8; border-color: #edd98d; }
.feedback-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; font-size: 22px; background: white; border-radius: 14px; box-shadow: 0 5px 12px rgba(68, 74, 58, .08); }
.feedback-card p { min-width: 0; margin: 0; }.feedback-card strong, .feedback-card small { display: block; }.feedback-card strong { font-family: Georgia, serif; font-size: 18px; }.feedback-card small { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.result-card { position: relative; overflow: hidden; padding: 54px 48px 46px; text-align: center; background: var(--paper); border: 1px solid rgba(72, 91, 81, .13); border-radius: 31px; box-shadow: 0 22px 55px rgba(73, 77, 58, .12); }
.result-card > * { position: relative; z-index: 2; }.result-icon { display: grid; width: 86px; height: 86px; place-items: center; margin: 0 auto 18px; color: white; font-size: 45px; font-weight: 900; background: var(--level-accent); border: 8px solid #fff; border-radius: 50%; box-shadow: 0 14px 26px color-mix(in srgb, var(--level-accent) 23%, transparent); }
.result-card h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(38px, 5vw, 58px); line-height: 1; }.result-lead { max-width: 650px; margin: 17px auto 15px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.result-stars { color: var(--gold); font-size: 35px; letter-spacing: 7px; }.result-stars span { color: #ded5c4; }
.result-pairs { display: flex; max-width: 620px; align-items: center; justify-content: center; gap: 13px; margin: 24px auto; }
.result-pairs > span { display: flex; min-width: 150px; min-height: 70px; align-items: center; justify-content: center; gap: 9px; padding: 9px 13px; background: color-mix(in srgb, var(--pair-color) 10%, white); border: 2px solid var(--pair-color); border-radius: 18px; }.result-pairs b { display: grid; width: 43px; height: 43px; place-items: center; color: white; font-family: Georgia, serif; font-size: 28px; background: var(--pair-color); border-radius: 13px; }.result-pairs i { width: 19px; height: 5px; background: var(--pair-color); border-radius: 5px; }.result-pairs em { max-width: 42px; color: var(--pair-color); font-size: 10px; font-style: normal; letter-spacing: 3px; line-height: 1.3; }
.result-stats { display: grid; max-width: 610px; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 auto 26px; }.result-stats > span { padding: 15px 8px; background: #f5eee1; border-radius: 17px; }.result-stats strong, .result-stats small { display: block; }.result-stats strong { color: var(--level-accent); font-family: Georgia, serif; font-size: 28px; }.result-stats small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 800; }
.result-actions { display: flex; justify-content: center; gap: 11px; }
.result-confetti { position: absolute; z-index: 1; inset: 0; pointer-events: none; }.result-confetti i { position: absolute; color: var(--level-accent); font-family: Georgia, serif; font-size: 23px; font-style: normal; font-weight: 900; opacity: .4; }.result-confetti i:nth-child(1) { top: 12%; left: 9%; transform: rotate(-15deg); }.result-confetti i:nth-child(2) { top: 23%; right: 11%; }.result-confetti i:nth-child(3) { bottom: 18%; left: 13%; transform: rotate(13deg); }.result-confetti i:nth-child(4) { top: 8%; right: 27%; color: var(--gold); }.result-confetti i:nth-child(5) { right: 8%; bottom: 15%; transform: rotate(-12deg); }.result-confetti i:nth-child(6) { top: 43%; left: 5%; color: var(--green); }

@keyframes item-in { from { opacity: 0; transform: translateY(8px) scale(.85) rotate(var(--turn)); } to { opacity: 1; transform: translateY(0) scale(1) rotate(var(--turn)); } }
@keyframes hint-pulse { 50% { box-shadow: 0 0 0 9px rgba(228, 172, 66, .08); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes line-in { from { stroke-dasharray: 12 120; opacity: 0; } to { stroke-dasharray: 140 0; opacity: .8; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) 350px; }.hero-copy { padding-left: 40px; }.hero h1 { font-size: 49px; }.hero-number { left: 5px; }.hero-quantity { right: 10px; width: 245px; }
  .level-grid { grid-template-columns: 1fr; }.level-card { min-height: 190px; display: grid; grid-template-columns: 175px 1fr; grid-template-rows: 1fr auto; column-gap: 22px; }.level-visual { grid-row: 1 / 3; margin: 0; height: 100%; }.level-copy { align-self: center; padding-top: 14px; }.level-status { align-self: end; }
  .question-card { grid-template-columns: 190px minmax(0, 1fr); }.group-option { min-height: 185px; }.quantity-group.compact .quantity-item { width: clamp(28px, 5.4vw, 47px); }
}

@media (max-width: 680px) {
  .app { width: min(100% - 20px, 1120px); padding-top: 10px; padding-bottom: 30px; }.topbar { min-height: 48px; margin-bottom: 12px; }.brand-mark { width: 42px; height: 42px; border-radius: 14px; }.brand-mark b { font-size: 22px; }.brand strong { font-size: 16px; }.brand small, .sound-button span:last-child, .quiet-button { display: none; }.sound-button { width: 44px; padding: 0; justify-content: center; }.top-actions { gap: 6px; }
  .hero { display: block; min-height: auto; border-radius: 25px; }.hero-copy { padding: 35px 25px 30px; }.hero h1 { font-size: clamp(37px, 11vw, 50px); }.hero-copy > p:not(.eyebrow) { margin: 17px 0 22px; font-size: 15px; }.hero-scene { min-height: 310px; }.hero-number { top: 28px; left: 22px; width: 96px; height: 96px; font-size: 62px; border-width: 6px; border-radius: 28px; }.hero-quantity { right: 20px; bottom: 34px; width: 235px; }.hero-line { top: 95px; left: 83px; right: 105px; }.hero-check { right: 8px; bottom: 17px; width: 55px; height: 55px; font-size: 29px; }
  .how, .levels { margin-top: 38px; }.how-grid { grid-template-columns: 1fr; }.how article { min-height: 100px; }.section-heading { display: block; }.section-heading h2 { font-size: 29px; }.section-heading > p { margin-top: 9px; text-align: left; font-size: 14px; }
  .level-card { display: flex; min-height: 300px; }.level-visual { height: 95px; margin: 15px 0 18px; }.level-copy { padding: 0; }.adult-note { align-items: flex-start; padding: 15px 17px; }
  .game-shell { padding: 17px; border-radius: 24px; }.game-head { align-items: flex-start; }.game-head h1 { font-size: 26px; }.round-count { min-width: 67px; padding: 8px 9px; }.round-count strong { font-size: 23px; }.progress-track { margin: 15px 0 19px; gap: 4px; }.progress-track i { height: 6px; }
  .question-card { display: block; min-height: 0; padding: 20px; }.question-heading h2 { font-size: 25px; }.quantity-stage { min-height: 215px; margin-top: 16px; padding: 13px; }.number-question { display: grid; grid-template-columns: minmax(0, 1fr) 125px; }.target-number { width: 112px; height: 112px; font-size: 75px; border-width: 7px; border-radius: 31px; }
  .number-options { grid-template-columns: repeat(3, 1fr); gap: 8px; }.number-option { min-height: 105px; flex-direction: column; gap: 5px; padding: 10px 5px; }.number-option strong { width: 64px; height: 64px; font-size: 44px; border-radius: 20px; }.number-option small { font-size: 10px; }
  .group-options { grid-template-columns: 1fr; }.group-option { min-height: 132px; grid-template-columns: 1fr auto; padding: 11px 14px; }.group-option .quantity-group { max-width: 300px; }.group-option .quantity-item { width: clamp(26px, 9vw, 40px); }.option-caption { align-self: center; margin: 0; writing-mode: vertical-rl; }
  .pair-zone { padding: 14px; }.pair-instruction { align-items: flex-start; }.pair-instruction h2 { font-size: 22px; }.pair-instruction > span { min-width: 70px; padding: 8px; font-size: 11px; }.match-board { grid-template-columns: minmax(76px, .7fr) minmax(142px, 1.3fr); gap: 38px; }.pair-card { min-height: 78px; padding: 7px; border-radius: 17px; }.pair-card.number strong { width: 52px; height: 52px; font-size: 38px; border-radius: 16px; }.pair-card.number small { display: none; }.pair-card.group { min-height: 86px; }.pair-card.group .quantity-item { width: clamp(20px, 7vw, 33px); }.pair-socket { width: 17px; height: 17px; border-width: 3px; }.pair-card.number .pair-socket { right: -10px; }.pair-card.group .pair-socket { left: -10px; }.connections path { stroke-width: 6; }
  .feedback-card { align-items: flex-start; padding: 12px; }.feedback-icon { width: 40px; height: 40px; }.feedback-card.correct { flex-wrap: wrap; }.primary-button.compact { width: 100%; margin: 0; }
  .result-card { padding: 38px 18px 30px; border-radius: 25px; }.result-pairs { gap: 6px; }.result-pairs > span { min-width: 0; flex: 1; padding: 7px 5px; gap: 5px; }.result-pairs b { width: 36px; height: 36px; font-size: 24px; }.result-pairs i { width: 11px; }.result-pairs em { font-size: 8px; letter-spacing: 1px; }.result-stats { gap: 6px; }.result-stats > span { padding: 12px 4px; }.result-stats strong { font-size: 24px; }.result-stats small { font-size: 9px; }.result-actions { flex-direction: column; }.result-actions button { width: 100%; }
}

@media (max-width: 400px) {
  .app { width: calc(100% - 20px); }.hero-copy { padding-inline: 20px; }.hero-scene { min-height: 285px; }.hero-number { left: 13px; }.hero-quantity { right: 11px; width: 218px; }.hero-line { right: 85px; }.eyebrow { font-size: 10px; letter-spacing: .1em; }
  .game-shell { padding: 14px; }.game-head h1 { font-size: 23px; }.question-card { padding: 16px; }.quantity-stage { min-height: 190px; }.quantity-item { width: clamp(47px, 16vw, 65px); }.quantity-group { gap: 5px; }.number-question { grid-template-columns: minmax(0, 1fr) 105px; }.target-number { width: 96px; height: 96px; font-size: 64px; border-width: 6px; border-radius: 27px; }
  .answer-heading h2 { font-size: 21px; }.hint-button { min-height: 44px; padding: 0 12px; font-size: 11px; }.number-option strong { width: 56px; height: 56px; font-size: 39px; }.number-option { min-height: 96px; }
  .pair-zone { padding: 10px; }.pair-instruction h2 { font-size: 19px; }.match-board { grid-template-columns: 74px minmax(135px, 1fr); gap: 30px; }.pair-card { min-height: 72px; }.pair-card.number strong { width: 47px; height: 47px; font-size: 34px; }.pair-card.group { min-height: 80px; }.pair-card.group .quantity-item { width: clamp(18px, 6.4vw, 29px); }.pair-column { gap: 7px; }.connections path { stroke-width: 5; }
  .feedback-card small { font-size: 12px; }.result-card h1 { font-size: 37px; }
}

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