
:root {
  --bg-1: #fff4d9;
  --bg-2: #ffe9f1;
  --bg-3: #eafff4;
  --card: rgba(255, 252, 244, 0.92);
  --white: #ffffff;
  --text: #451625;
  --muted: #7e6372;
  --brand: #8f1f3d;
  --brand-dark: #6b1430;
  --pink: #ff90b8;
  --gold: #f6c25b;
  --mint: #67d7a8;
  --mint-dark: #34ab7f;
  --danger: #ff7a72;
  --sky: #94d8ff;
  --shadow: 0 24px 70px rgba(104, 34, 55, 0.16);
  --soft-shadow: 0 14px 40px rgba(104, 34, 55, 0.10);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
html { overflow-x: hidden; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 144, 184, .34), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(103, 215, 168, .34), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(246, 194, 91, .28), transparent 28%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 52%, var(--bg-3));
  -webkit-font-smoothing: antialiased;
  user-select: none;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}
img { display: block; max-width: 100%; }
button, a, input { font: inherit; -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }

.app {
  width: min(1180px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(12px, var(--safe-top)) clamp(10px, 3vw, 30px) max(12px, var(--safe-bottom));
  display: grid;
  align-items: center;
}
.screen { display: none; width: 100%; }
.screen--active { display: block; }
.card {
  background: var(--card);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.72);
  overflow: hidden;
  position: relative;
}
.card::before,
.card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.card::before { width: 260px; height: 260px; left: -90px; top: -90px; background: rgba(255, 144, 184, .14); }
.card::after { width: 220px; height: 220px; right: -80px; bottom: -80px; background: rgba(103, 215, 168, .14); }

.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(310px, .85fr); gap: clamp(18px, 3vw, 32px); padding: clamp(18px, 4vw, 42px); }
.hero__content, .side-stack, .level-select-card__inner, .tutorial-card > *, .game > *, .end-card > * { position: relative; z-index: 1; }
.pill {
  width: fit-content;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(143, 31, 61, .11);
  color: var(--brand);
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
h1, h2, h3 { font-family: Nunito, Inter, sans-serif; line-height: .98; letter-spacing: -.04em; margin: 0; color: var(--brand-dark); }
h1 { font-size: clamp(40px, 7.4vw, 82px); margin-top: 16px; }
h2 { font-size: clamp(28px, 5vw, 48px); }
h3 { font-size: clamp(20px, 4vw, 30px); }
p { margin: 0; }
.hero__lead { margin-top: 16px; font-size: clamp(16px, 2vw, 20px); color: var(--muted); max-width: 640px; line-height: 1.55; }

.chef-intro { display: grid; grid-template-columns: minmax(120px, 156px) 1fr; gap: 16px; align-items: end; margin-top: 18px; }
.chef-intro__img { width: min(156px, 100%); height: auto; max-height: 180px; justify-self: center; filter: drop-shadow(0 14px 18px rgba(104,34,55,.14)); animation: mascotFloat 3.4s ease-in-out infinite; }
.chef-bubble { background: rgba(255,255,255,.82); color: var(--brand-dark); padding: 14px 16px; border-radius: 18px 18px 18px 6px; line-height: 1.45; box-shadow: var(--soft-shadow); font-weight: 750; }
@keyframes mascotFloat { 0%,100%{ transform: translateY(0) rotate(-2deg); } 50%{ transform: translateY(-5px) rotate(2deg); } }

.hero__features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.feature { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); background: rgba(255,255,255,.76); box-shadow: var(--soft-shadow); font-weight: 800; color: var(--brand-dark); min-width: 0; }
.feature img { width: 42px; height: 42px; flex: 0 0 auto; }
.feature span { min-width: 0; overflow-wrap: anywhere; }
.feature--bad { background: rgba(255, 122, 114, .13); }
.feature--bonus { background: rgba(103, 215, 168, .15); }
.hero__actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero__hint { margin-top: 14px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.side-stack { display: grid; gap: 14px; align-self: start; }

.btn { appearance: none; border: 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 12px 22px; border-radius: 999px; font-weight: 900; font-size: 16px; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { color: white; background: linear-gradient(180deg, #b62a55, var(--brand)); box-shadow: 0 16px 28px rgba(143,31,61,.26); }
.btn--ghost { color: var(--brand-dark); background: rgba(255,255,255,.86); box-shadow: var(--soft-shadow); }
.btn--small { min-height: 44px; padding: 10px 16px; font-size: 14px; }
.icon-btn { width: 48px; height: 48px; border-radius: 16px; border: 0; cursor: pointer; background: rgba(255,255,255,.84); box-shadow: var(--soft-shadow); font-size: 22px; }
.icon-btn.is-active { outline: 3px solid rgba(246,194,91,.72); }

.levels-preview, .leaderboard-card, .skin-card { padding: 20px; border-radius: var(--radius-lg); background: rgba(255,255,255,.70); box-shadow: var(--soft-shadow); }
.levels-preview { background: linear-gradient(180deg, rgba(143,31,61,.96), rgba(107,20,48,.96)); color: rgba(255,255,255,.96); }
.levels-preview h2 { color: white; font-size: 32px; }
.reward-row { margin-top: 12px; display: grid; grid-template-columns: 42px 64px 1fr; gap: 8px; align-items: center; padding: 11px 12px; border-radius: 16px; background: rgba(255,255,255,.12); }
.reward-row span { font-size: 28px; }
.reward-row b { font-size: 28px; color: var(--gold); }
.reward-row small { opacity: .86; }
.best-card { margin-top: 14px; padding: 16px; border-radius: 18px; background: rgba(255,255,255,.12); display: grid; gap: 8px; }
.best-card span { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; opacity: .86; }
.best-card strong { font-size: clamp(28px, 5vw, 44px); color: var(--gold); }
.sound-row { margin-top: 12px; }
.mini-head p { color: var(--muted); margin-top: 5px; font-size: 14px; }
.skin-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.skin-option { position: relative; border: 0; border-radius: 16px; background: rgba(255,255,255,.82); padding: 9px 6px; box-shadow: var(--soft-shadow); display: grid; gap: 5px; justify-items: center; cursor: pointer; min-height: 86px; }
.skin-option img { width: 54px; height: 34px; object-fit: contain; }
.skin-option span { font-size: 11px; font-weight: 900; color: var(--brand-dark); text-align: center; }
.skin-option.is-selected { outline: 3px solid var(--gold); }
.skin-option.is-locked { opacity: .48; filter: grayscale(.3); cursor: not-allowed; }
.skin-option small { position: absolute; top: 5px; right: 6px; font-size: 13px; }
.leaderboard-card h2, .skin-card h2 { font-size: 28px; }
.leaderboard-list { display: grid; gap: 8px; margin-top: 12px; }
.leaderboard-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.82); color: var(--brand-dark); }
.leaderboard-row b { color: var(--brand); }
.leaderboard-row span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 800; }
.leaderboard-row small { color: var(--muted); font-weight: 700; }
.leaderboard-row strong { color: var(--brand-dark); }
.leaderboard-empty { color: var(--muted); line-height: 1.45; }

.screen-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.screen-head p { margin-top: 10px; color: var(--muted); line-height: 1.5; }
.level-select-card, .tutorial-card { padding: clamp(18px, 4vw, 38px); }
.level-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; }
.level-card { position: relative; min-height: 215px; border: 0; border-radius: 24px; padding: 18px; background: rgba(255,255,255,.78); box-shadow: var(--soft-shadow); text-align: left; cursor: pointer; display: grid; gap: 10px; align-content: start; overflow: hidden; }
.level-card::after { content:""; position:absolute; width:90px; height:90px; right:-25px; bottom:-30px; border-radius:50%; background: rgba(246,194,91,.18); }
.level-card__num { width: fit-content; padding: 7px 10px; border-radius: 999px; background: rgba(143,31,61,.10); color: var(--brand); font-size: 12px; font-weight: 900; }
.level-card h3 { font-size: 24px; }
.level-card p { color: var(--muted); line-height: 1.45; font-size: 14px; }
.level-card__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.level-card__meta span { padding: 7px 9px; border-radius: 999px; background: rgba(255,255,255,.9); font-size: 12px; font-weight: 850; color: var(--brand-dark); }
.level-card__stars { font-size: 18px; letter-spacing: 2px; }
.level-card--hard { background: rgba(255, 241, 229, .82); }

.tutorial-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; margin-top: 22px; align-items: start; }
.tutorial-chef { display: grid; justify-items: center; gap: 12px; }
.tutorial-chef img { width: min(250px, 100%); filter: drop-shadow(0 14px 18px rgba(104,34,55,.14)); }
.tutorial-steps { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.tutorial-step { background: rgba(255,255,255,.78); border-radius: 22px; padding: 18px; box-shadow: var(--soft-shadow); }
.tutorial-step b { display: inline-grid; place-items:center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: white; margin-bottom: 10px; }
.tutorial-step h3 { font-size: 24px; }
.tutorial-step p { margin-top: 8px; color: var(--muted); line-height: 1.5; }
.tutorial-actions { margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.game { padding: clamp(10px, 2.2vw, 22px); }
.hud { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.hud__left, .hud__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.level-title { display: grid; gap: 4px; min-width: 170px; }
.level-title small, .stat small { color: var(--muted); font-size: 12px; }
.level-title strong { font-size: 16px; color: var(--brand-dark); }
.stat { min-width: 86px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.82); box-shadow: var(--soft-shadow); display: grid; gap: 4px; }
.stat strong { font-size: 24px; color: var(--brand-dark); }
.stat--level strong { color: var(--brand); }
.game-message { display: grid; grid-template-columns: minmax(64px, 88px) 1fr; gap: 10px; align-items: center; margin-top: 12px; }
.game-message img { width: min(84px, 100%); height: auto; filter: drop-shadow(0 10px 12px rgba(104,34,55,.14)); }
.game-message .chef-bubble { padding: 11px 13px; font-size: 14px; }

.progress-panel { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 210px; gap: 12px; margin-top: 12px; }
.order-box, .combo-box { background: rgba(255,255,255,.80); box-shadow: var(--soft-shadow); border-radius: 18px; padding: 12px 14px; }
.order-box small, .combo-box small { color: var(--muted); font-size: 12px; }
.targets { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 9px; }
.target-card { min-width: 132px; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 15px; background: rgba(248,248,248,.95); }
.target-card img { width: 38px; height: 38px; flex: 0 0 auto; }
.target-card b { display: block; font-size: 14px; color: var(--brand-dark); }
.target-card span { font-size: 13px; color: var(--muted); }
.target-card.is-done { background: rgba(103, 215, 168, .18); }
.target-card.is-done b { color: var(--mint-dark); }
.combo-box { display: grid; align-content: center; justify-items: center; text-align: center; }
.combo-box strong { font-size: 38px; color: var(--brand); line-height: 1; }
.combo-box span { font-size: 13px; color: var(--muted); margin-top: 4px; }
.effect-bar { display: flex; gap: 8px; flex-wrap: wrap; min-height: 40px; margin-top: 10px; align-items: center; }
.effect-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.84); box-shadow: var(--soft-shadow); font-size: 13px; font-weight: 900; color: var(--brand-dark); }
.effect-badge img { width: 22px; height: 22px; }
.effect-badge--empty { color: var(--muted); }

.playfield-wrap { margin-top: 10px; position: relative; z-index: 1; }
.playfield { position: relative; overflow: hidden; border-radius: 26px; min-height: clamp(400px, 58dvh, 650px); background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.08)), url('../img/background.svg') center/cover no-repeat; box-shadow: inset 0 -6px 0 rgba(255,255,255,.24), inset 0 1px 0 rgba(255,255,255,.4); touch-action: none; }
.playfield::after { content:""; position:absolute; left:0; right:0; bottom:0; height:34%; background: linear-gradient(180deg, rgba(255,255,255,0), rgba(246,194,91,.15) 42%, rgba(188,228,182,.38)); pointer-events:none; }
.bg-decor { position: absolute; border-radius: 999px; opacity: .55; filter: blur(1px); pointer-events: none; }
.bg-decor--1 { width: 120px; height: 44px; left: 7%; top: 8%; background: rgba(255,255,255,.78); }
.bg-decor--2 { width: 100px; height: 38px; right: 10%; top: 15%; background: rgba(255,255,255,.68); }
.bg-decor--3 { width: 80px; height: 32px; left: 52%; top: 12%; background: rgba(255,255,255,.6); }
.item { position: absolute; width: 66px; height: 66px; pointer-events: none; will-change: transform; z-index: 2; }
.item img { width: 100%; height: 100%; filter: drop-shadow(0 10px 12px rgba(74, 40, 30, .16)); }
.item--magnet img, .item--shield img, .item--clock img, .item--x2 img { filter: drop-shadow(0 10px 14px rgba(143,31,61,.20)); animation: bonusPulse 1s ease-in-out infinite; }
@keyframes bonusPulse { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.08); } }
.tray { position: absolute; left: 0; bottom: 16px; width: clamp(126px, 18vw, 176px); height: clamp(84px, 12vw, 110px); background: var(--tray-img, url('../img/tray-classic.svg')) center/contain no-repeat; z-index: 3; will-change: transform; transition: filter .15s ease; }
.tray.is-shielded { filter: drop-shadow(0 0 16px rgba(103,215,168,.95)); }
.tray.is-x2 { filter: drop-shadow(0 0 16px rgba(246,194,91,.95)); }
.tray.is-magnet { filter: drop-shadow(0 0 16px rgba(148,216,255,.95)); }
.floating-layer, .confetti-layer { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.float-text { position: absolute; transform: translate(-50%, -50%); padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 900; background: rgba(255,255,255,.94); color: var(--brand-dark); box-shadow: var(--soft-shadow); animation: floatUp .9s ease forwards; }
.float-text--good { color: var(--mint-dark); }
.float-text--bad { color: #d2554f; }
.float-text--bonus { color: var(--brand); }
@keyframes floatUp { 0%{ opacity:0; transform: translate(-50%, -10px) scale(.92); } 12%{ opacity:1; } 100%{ opacity:0; transform: translate(-50%, -76px) scale(1.05); } }
.confetti { position: absolute; width: 9px; height: 14px; border-radius: 3px; animation: confettiDrop 1.25s ease-out forwards; }
@keyframes confettiDrop { 0% { opacity: 0; transform: translateY(-30px) rotate(0deg); } 10% { opacity: 1; } 100% { opacity: 0; transform: translateY(280px) rotate(540deg); } }
.game.shake .playfield { animation: fieldShake .28s ease; }
@keyframes fieldShake { 0%,100%{ transform: translateX(0); } 25%{ transform: translateX(-6px); } 50%{ transform: translateX(5px); } 75%{ transform: translateX(-3px); } }

.end-card { padding: clamp(20px, 5vw, 42px); text-align: center; }
.end-card .pill { margin: 0 auto 14px; }
.end-badge { font-size: 64px; line-height: 1; margin-bottom: 12px; }
#endText { margin: 14px auto 0; color: var(--muted); max-width: 720px; line-height: 1.55; }
.result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.result-card { padding: 16px; background: rgba(255,255,255,.82); border-radius: 20px; box-shadow: var(--soft-shadow); }
.result-card small { display: block; color: var(--muted); font-size: 12px; }
.result-card strong { display: block; margin-top: 6px; font-size: clamp(24px, 5vw, 40px); color: var(--brand-dark); }
.promo-box { margin: 18px auto 0; max-width: 760px; display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; text-align: left; padding: 18px; border-radius: 24px; background: linear-gradient(180deg, rgba(246,194,91,.24), rgba(255,255,255,.8)); box-shadow: var(--soft-shadow); }
.promo-box.hidden { display: none; }
.promo-box__icon { font-size: 46px; }
.promo-box small { color: var(--muted); text-transform: uppercase; font-weight: 900; letter-spacing: .05em; }
.promo-box strong { display: block; margin-top: 4px; color: var(--brand); font-size: clamp(28px, 6vw, 48px); letter-spacing: .08em; }
.promo-box p { color: var(--muted); line-height: 1.45; margin-top: 4px; }
.result-summary { margin-top: 18px; padding: 18px; border-radius: 20px; background: rgba(255,255,255,.78); color: var(--muted); line-height: 1.6; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; text-align: left; }
.save-score-box { margin: 18px auto 0; width: min(560px, 100%); display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; text-align: left; }
.save-score-box label { grid-column: 1 / -1; color: var(--muted); font-size: 13px; font-weight: 900; }
.save-score-box input { min-height: 48px; border: 0; outline: none; border-radius: 16px; background: rgba(255,255,255,.86); padding: 0 14px; color: var(--text); box-shadow: var(--soft-shadow); }
.end-leaderboard { margin: 18px auto 0; width: min(620px, 100%); text-align: left; }
.end-leaderboard h3 { font-size: 26px; text-align: center; }
.end-host { margin: 18px auto 0; max-width: 760px; display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: center; text-align: left; }
.end-host__img { width: min(190px, 100%); margin-inline: auto; filter: drop-shadow(0 14px 18px rgba(104,34,55,.14)); }

.cta-box { margin-top: 20px; padding: 22px; border-radius: 24px; background: linear-gradient(180deg, rgba(143,31,61,.96), rgba(107,20,48,.96)); color: white; }
.cta-box p { color: rgba(255,255,255,.92); line-height: 1.55; }
.cta-box__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(34, 16, 24, .42); backdrop-filter: blur(3px); }
.modal__body { position: relative; z-index: 1; width: min(540px, 100%); background: rgba(255,252,244,.97); border-radius: 28px; box-shadow: var(--shadow); padding: 26px; text-align: center; max-height: calc(100dvh - 32px); overflow: auto; }
.modal__emoji { font-size: 54px; line-height: 1; margin-bottom: 12px; }
.modal__body p { color: var(--muted); margin-top: 10px; line-height: 1.55; }
.modal__extra { margin-top: 14px; }
.star-award { font-size: 42px; letter-spacing: 4px; color: var(--gold); text-shadow: 0 5px 14px rgba(143,31,61,.16); }
.unlock-note { margin-top: 10px; padding: 12px; border-radius: 16px; background: rgba(103,215,168,.14); color: var(--mint-dark); font-weight: 900; }
.modal__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leaderboard-card { grid-column: 1 / -1; }
  .level-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .tutorial-layout { grid-template-columns: 1fr; }
  .tutorial-chef { grid-template-columns: 140px 1fr; text-align: left; }
  .tutorial-chef img { width: 140px; }
  .progress-panel { grid-template-columns: 1fr; }
  .combo-box { justify-items: start; text-align: left; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  :root { --radius-xl: 24px; --radius-lg: 20px; }
  .app { padding: max(8px, var(--safe-top)) 8px max(8px, var(--safe-bottom)); align-items: start; }
  .hero, .tutorial-card, .level-select-card, .end-card { padding: 16px; }
  h1 { font-size: clamp(36px, 12vw, 54px); }
  h2 { font-size: clamp(26px, 9vw, 38px); }
  .chef-intro { grid-template-columns: 92px 1fr; }
  .chef-intro__img { width: 92px; height: auto; max-height: 116px; }
  .hero__features { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .feature { padding: 10px 11px; font-size: 14px; }
  .feature img { width: 34px; height: 34px; }
  .hero__actions, .tutorial-actions, .cta-box__actions { display: grid; grid-template-columns: 1fr; }
  .btn { width: 100%; min-height: 52px; }
  .side-stack { grid-template-columns: 1fr; }
  .skin-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .skin-option { min-height: 74px; padding: 7px 4px; }
  .skin-option img { width: 46px; height: 29px; }
  .skin-option span { font-size: 10px; }
  .level-grid { grid-template-columns: 1fr; }
  .level-card { min-height: auto; }
  .tutorial-steps { grid-template-columns: 1fr; }
  .tutorial-chef { grid-template-columns: 96px 1fr; }
  .tutorial-chef img { width: 96px; }
  .hud { align-items: stretch; }
  .hud__left { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; width: 100%; }
  .stat { min-width: 0; padding: 8px 8px; border-radius: 14px; }
  .stat small { font-size: 10px; }
  .stat strong { font-size: clamp(18px, 5.5vw, 23px); }
  .hud__right { width: 100%; justify-content: space-between; gap: 8px; }
  .level-title { min-width: 0; flex: 1; padding: 9px 10px; border-radius: 16px; background: rgba(255,255,255,.70); }
  .icon-btn { width: 44px; height: 44px; border-radius: 14px; }
  .game { padding: 8px; }
  .game-message { grid-template-columns: 58px 1fr; margin-top: 8px; }
  .game-message img { width: 58px; height: auto; }
  .game-message .chef-bubble { padding: 9px 10px; font-size: 13px; }
  .order-box, .combo-box { padding: 10px; }
  .targets { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
  .target-card { min-width: 0; padding: 8px 7px; gap: 6px; }
  .target-card img { width: 30px; height: 30px; }
  .target-card b { font-size: 12px; }
  .target-card span { font-size: 12px; }
  .combo-box strong { font-size: 30px; }
  .effect-bar { min-height: 35px; gap: 6px; }
  .effect-badge { min-height: 30px; font-size: 12px; padding: 6px 8px; }
  .playfield { border-radius: 20px; min-height: calc(100dvh - 330px); }
  .result-grid, .result-summary { grid-template-columns: 1fr; }
  .promo-box { grid-template-columns: 1fr; text-align: center; }
  .end-host { grid-template-columns: 1fr; text-align: center; }
  .save-score-box { grid-template-columns: 1fr; }
  .modal { padding: 10px; }
  .modal__body { padding: 20px; border-radius: 24px; max-height: calc(100dvh - 20px); }
  .modal__actions { display: grid; grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .hud__left { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .targets { grid-template-columns: 1fr; }
  .hero__features { grid-template-columns: 1fr; }
  .skin-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .playfield { min-height: calc(100dvh - 365px); }
}
@media (max-height: 680px) and (max-width: 720px) {
  .chef-intro, .game-message { display: none; }
  .hero__features { margin-top: 14px; }
  .hero__lead { margin-top: 10px; }
  .progress-panel { margin-top: 8px; }
  .playfield { min-height: 330px; }
  .effect-bar { min-height: 30px; }
}


/* === v1.3.2: мобильный UX игрового экрана === */
.mobile-game-hint {
  display: none;
}

@media (max-width: 720px) {
  html.is-game-active,
  body.is-game-active {
    width: 100%;
    height: var(--game-vh, 100dvh);
    min-height: var(--game-vh, 100dvh);
    overflow: hidden;
    position: fixed;
    inset: 0;
    overscroll-behavior: none;
    touch-action: none;
  }

  body.is-game-active .app {
    width: 100%;
    height: var(--game-vh, 100dvh);
    min-height: var(--game-vh, 100dvh);
    padding: max(4px, var(--safe-top)) 6px max(4px, var(--safe-bottom));
    display: block;
    overflow: hidden;
  }

  body.is-game-active #gameScreen {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body.is-game-active .game {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 6px;
    border-radius: 18px;
    overflow: hidden;
  }

  body.is-game-active .game::before,
  body.is-game-active .game::after {
    display: none;
  }

  body.is-game-active .hud {
    flex: 0 0 auto;
    gap: 6px;
    align-items: stretch;
  }

  body.is-game-active .hud__left {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
  }

  body.is-game-active .stat {
    min-width: 0;
    min-height: 48px;
    padding: 6px 7px;
    border-radius: 13px;
    gap: 1px;
  }

  body.is-game-active .stat small {
    font-size: 10px;
    line-height: 1;
  }

  body.is-game-active .stat strong {
    font-size: clamp(17px, 5vw, 22px);
    line-height: 1.05;
  }

  body.is-game-active .hud__right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 42px 42px;
    gap: 6px;
    align-items: stretch;
  }

  body.is-game-active .level-title {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255,255,255,.72);
  }

  body.is-game-active .level-title small {
    font-size: 10px;
    line-height: 1;
  }

  body.is-game-active .level-title strong {
    font-size: clamp(15px, 4.5vw, 20px);
    line-height: 1.05;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.is-game-active .icon-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 13px;
    font-size: 18px;
  }

  body.is-game-active .game-message {
    flex: 0 0 auto;
    grid-template-columns: 36px 1fr;
    gap: 7px;
    margin-top: 6px;
    min-height: 38px;
  }

  body.is-game-active .game-message img {
    width: 36px;
    max-height: 42px;
    object-fit: contain;
  }

  body.is-game-active .game-message .chef-bubble {
    padding: 8px 10px;
    border-radius: 14px 14px 14px 6px;
    font-size: 13px;
    line-height: 1.2;
    max-height: 48px;
    overflow: hidden;
  }

  body.is-game-active .progress-panel {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 6px;
    margin-top: 6px;
    align-items: stretch;
  }

  body.is-game-active .order-box,
  body.is-game-active .combo-box {
    border-radius: 15px;
    padding: 8px;
  }

  body.is-game-active .order-box small,
  body.is-game-active .combo-box small {
    font-size: 10px;
    line-height: 1;
  }

  body.is-game-active .targets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 6px;
  }

  body.is-game-active .target-card {
    min-width: 0;
    padding: 6px 5px;
    gap: 5px;
    border-radius: 13px;
    display: grid;
    grid-template-columns: 26px 1fr;
    align-items: center;
  }

  body.is-game-active .target-card img {
    width: 26px;
    height: 26px;
  }

  body.is-game-active .target-card b {
    font-size: 11px;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.is-game-active .target-card span {
    font-size: 12px;
    line-height: 1.1;
  }

  body.is-game-active .combo-box {
    display: grid;
    justify-items: center;
    text-align: center;
    align-content: center;
  }

  body.is-game-active .combo-box strong {
    font-size: 31px;
    line-height: .95;
  }

  body.is-game-active .combo-box span {
    display: none;
  }

  body.is-game-active .effect-bar {
    flex: 0 0 auto;
    min-height: 30px;
    margin-top: 5px;
    gap: 5px;
    overflow: hidden;
    flex-wrap: nowrap;
  }

  body.is-game-active .effect-badge {
    min-height: 28px;
    padding: 5px 8px;
    gap: 5px;
    border-radius: 999px;
    font-size: 11px;
    white-space: nowrap;
  }

  body.is-game-active .effect-badge img {
    width: 18px;
    height: 18px;
  }

  body.is-game-active .mobile-game-hint {
    flex: 0 0 auto;
    display: block;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.62);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    line-height: 1.1;
  }

  body.is-game-active .playfield-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    margin-top: 5px;
  }

  body.is-game-active .playfield {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 18px;
  }

  body.is-game-active .tray {
    width: clamp(104px, 27vw, 132px);
    height: clamp(70px, 18vw, 90px);
    bottom: calc(8px + var(--safe-bottom));
  }

  body.is-game-active .item {
    width: 54px;
    height: 54px;
  }
}

@media (max-width: 420px) {
  body.is-game-active .hud__left {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.is-game-active .stat {
    min-height: 45px;
    padding: 5px 5px;
  }

  body.is-game-active .stat small {
    font-size: 9px;
  }

  body.is-game-active .progress-panel {
    grid-template-columns: 1fr 74px;
  }

  body.is-game-active .target-card {
    grid-template-columns: 23px 1fr;
    padding: 5px 4px;
  }

  body.is-game-active .target-card img {
    width: 23px;
    height: 23px;
  }

  body.is-game-active .target-card b {
    font-size: 10px;
  }

  body.is-game-active .target-card span {
    font-size: 11px;
  }

  body.is-game-active .combo-box strong {
    font-size: 27px;
  }
}

@media (max-width: 720px) and (max-height: 760px) {
  body.is-game-active .game-message {
    display: none;
  }

  body.is-game-active .mobile-game-hint {
    display: none;
  }

  body.is-game-active .hud__right {
    grid-template-columns: 1fr 38px 38px;
  }

  body.is-game-active .icon-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  body.is-game-active .level-title {
    padding: 6px 8px;
  }

  body.is-game-active .effect-bar {
    min-height: 26px;
  }

  body.is-game-active .effect-badge {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 10px;
  }

  body.is-game-active .playfield-wrap {
    margin-top: 4px;
  }
}

@media (max-width: 720px) and (max-height: 660px) {
  body.is-game-active .progress-panel {
    grid-template-columns: 1fr 66px;
  }

  body.is-game-active .order-box small,
  body.is-game-active .combo-box small {
    display: none;
  }

  body.is-game-active .targets {
    margin-top: 0;
  }

  body.is-game-active .target-card {
    padding: 4px;
  }

  body.is-game-active .effect-bar {
    display: none;
  }

  body.is-game-active .combo-box strong {
    font-size: 24px;
  }
}

