/* =========================================================
   Игра «Пекарня Заквасича» — оформление (v2).
   Токены, стекло и кнопки берутся из css/style.css сайта.
   ========================================================= */
:root { --ok: #7f9a6c; --bad: #b0645a; --gold-d: #b08a3c; --wood: #e3cfac; --wood-d: #cdb18a; }
[hidden] { display: none !important; }
.g-body { min-height: 100svh; background: var(--len); overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
.g-body button { touch-action: manipulation; }
.g-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(900px 600px at 85% 0%, rgba(185,162,122,.22), transparent 60%), radial-gradient(700px 500px at 0% 100%, rgba(86,98,125,.13), transparent 60%); }
.g-bg .orb, .g-bg .ring { position: absolute; left: var(--x); top: var(--y); }
.g-dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.g-app { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 12px var(--gutter) 40px; }

/* ---------- загрузка ---------- */
.g-loader { position: fixed; inset: 0; z-index: 900; display: grid; place-content: center; justify-items: center; gap: 10px; background: var(--len); transition: opacity .6s, visibility 0s .6s; }
.g-loader img { width: 120px; animation: jump .8s var(--ease) infinite alternate; }
.g-loader p { margin: 0; font-family: var(--serif); font-style: italic; color: var(--blue); font-size: 19px; }
.g-loader__bar { width: 180px; height: 5px; border-radius: 5px; background: var(--oves); overflow: hidden; }
.g-loader__bar i { display: block; height: 100%; width: 0; background: var(--champ); transition: width .3s; }
.g-loader.is-done { opacity: 0; visibility: hidden; }

/* ---------- верхняя панель ---------- */
.g-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 14px; }
.g-top__actions { display: flex; gap: 8px; }
.g-icon, .hud__btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--graph); flex: none;
  background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 8px 20px -10px rgba(38,43,54,.3);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: transform .45s var(--ease-spring), background .3s; }
.g-icon svg, .hud__btn svg { width: 22px; height: 22px; }
.g-icon:hover, .hud__btn:hover { transform: translateY(-3px) rotate(-6deg); background: #fff; }
.snd .snd-off { display: none; }
.snd.is-muted .snd-on { display: none; }
.snd.is-muted .snd-off { display: block; }

.g-screen { display: none; }
.g-screen.is-active { display: block; animation: screenIn .7s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(22px); } }
/* игровой экран — без сдвига: transform у предка ломает position: fixed */
#sPlay.is-active { animation: fadeIn .5s ease both; }
@keyframes fadeIn { from { opacity: 0; } }

/* ============ ЗАСТАВКА ============ */
.t-wrap { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 34px; align-items: center; min-height: calc(100svh - 130px); }
.t-card { padding: clamp(24px, 3.4vw, 44px); border-radius: 36px; }
.t-title { font-size: clamp(42px, 5.6vw, 74px); line-height: 1.02; font-weight: 800; letter-spacing: -.03em; margin: 0 0 14px; }
.t-title .serif { font-weight: 400; letter-spacing: 0; }
.t-title__l { display: inline-block; animation: titleIn .9s var(--ease) both; }
.t-title__l + .t-title__l { animation-delay: .12s; }
@keyframes titleIn { from { opacity: 0; transform: translateY(40%) rotate(-3deg); } }
.t-record { display: flex; align-items: center; gap: 14px; margin: 22px 0 12px; padding: 12px 18px; border-radius: 18px; }
.t-record svg { width: 30px; height: 30px; color: var(--champ-d); flex: none; }
.t-record small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.t-record b { font-size: 17px; }
.t-record .nick, .nick { color: var(--gold-d); }
.t-progress { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.t-progress span { padding: 6px 12px; border-radius: 999px; font-size: 13px; background: rgba(86,98,125,.09); }
.t-form label { display: block; font-weight: 600; margin-bottom: 8px; }
.t-input input { width: 100%; height: 56px; padding: 0 20px; font: inherit; font-size: 18px; font-weight: 600; color: var(--graph);
  background: rgba(255,255,255,.78); border: 1.5px solid rgba(86,98,125,.25); border-radius: 18px; outline: none; transition: border-color .3s, box-shadow .3s, background .3s; }
.t-input input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(86,98,125,.15); }
.t-input input::placeholder { color: #9aa0ad; font-weight: 400; }
.t-error { min-height: 22px; margin: 6px 4px; font-size: 14px; color: var(--bad); font-weight: 600; }
.t-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.t-skip { margin-top: 12px; padding: 4px 0; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.t-skip:hover { color: var(--blue); }
.t-note { margin: 16px 0 0; font-size: 13px; color: var(--muted); }

.t-hero { position: relative; padding: 0 0 8% 8%; }
.t-hero__scene { position: relative; aspect-ratio: 16 / 9; border-radius: 30px; overflow: hidden; box-shadow: 0 40px 70px -30px rgba(38,43,54,.5), 0 0 0 1px rgba(255,255,255,.8); transform: rotate(1.5deg); }
.t-hero__bg, .t-hero__counter { position: absolute; inset: 0; background: url(../assets/img/game/bg-day.webp) center / cover no-repeat; }
.t-hero__counter { clip-path: inset(72.5% 0 0 0); z-index: 3; }
.t-hero__c { position: absolute; bottom: 14%; height: 60%; z-index: 2; transform-origin: 50% 100%; animation: breathe 4.4s ease-in-out infinite; filter: drop-shadow(0 12px 14px rgba(70,48,25,.28)); }
.t-hero__c--1 { left: 18%; } .t-hero__c--2 { left: 46%; animation-delay: -2s; }
.t-hero__bread { position: absolute; z-index: 4; bottom: 24%; width: 14%; filter: drop-shadow(0 10px 10px rgba(70,48,25,.35)); }
.t-hero__bread--1 { left: 28%; } .t-hero__bread--2 { left: 42%; width: 12%; } .t-hero__bread--3 { left: 56%; width: 12%; }
.t-hero__zak { position: absolute; left: 0; bottom: 0; width: 24%; z-index: 5; cursor: pointer; transform-origin: 50% 100%; filter: drop-shadow(0 22px 22px rgba(80,55,30,.3)); animation: sway 4s ease-in-out infinite; }
.t-hero__zak.pop { animation: popZak .6s var(--ease-spring), sway 4s ease-in-out .6s infinite; }
.t-hero__bubble { left: 22%; bottom: 26%; top: auto; z-index: 6; }
@keyframes breathe { 50% { transform: scale(1.012, 1.024); } }

/* ============ КАРТА ============ */
.map-wrap { display: grid; grid-template-columns: minmax(0, 560px) minmax(300px, 400px); gap: 24px; align-items: start; justify-content: center; }
.map { position: relative; width: min(100%, calc((100svh - 110px) * .75)); justify-self: end; aspect-ratio: 3 / 4; border-radius: 34px; overflow: hidden; padding: 0; border: 3px solid #fff; }
.map__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map__path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mp-glow { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 3; stroke-linecap: round; }
.mp-road { fill: none; stroke: #b9a27a; stroke-width: 1.2; stroke-linecap: round; stroke-dasharray: .1 2.8; }
.mp-done { fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: .1 2.8; }
.map__nodes { position: absolute; inset: 0; }
.mnode { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px; z-index: 2; }
.mnode__n { width: clamp(42px, 9.5%, 56px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 19px; color: var(--blue);
  background: linear-gradient(160deg, #fff, #efe9dd); border: 3px solid #fff; box-shadow: 0 10px 18px -8px rgba(38,43,54,.5), inset 0 -3px 0 rgba(86,98,125,.12); transition: transform .45s var(--ease-spring); }
.mnode__n svg { width: 20px; height: 20px; }
.mnode:not(:disabled):hover .mnode__n { transform: scale(1.12) translateY(-3px); }
.mnode__s { font-size: 13px; letter-spacing: 1px; color: #f3dd9a; text-shadow: 0 1px 2px rgba(70,48,25,.6); min-height: 15px; }
.mnode__t { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); white-space: nowrap; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.92); box-shadow: 0 6px 14px -8px rgba(38,43,54,.5); opacity: 0; transition: opacity .3s; pointer-events: none; }
.mnode:hover .mnode__t, .mnode.is-current .mnode__t { opacity: 1; }
.mnode.is-done .mnode__n { color: #fff; background: linear-gradient(160deg, #d6c299, #a88d5e); }
.mnode.is-current .mnode__n { color: #fff; background: linear-gradient(160deg, #6d7a98, #4a5571); animation: nodePulse 1.8s ease-in-out infinite; }
.mnode.is-locked .mnode__n { color: #8f95a3; background: linear-gradient(160deg, #e9e6df, #cfcabf); }
@keyframes nodePulse { 50% { box-shadow: 0 0 0 10px rgba(86,98,125,.22), 0 10px 18px -8px rgba(38,43,54,.5); } }
.mzak { position: absolute; width: 13%; transform: translate(30%, -104%); z-index: 3; pointer-events: none; filter: drop-shadow(0 10px 10px rgba(70,48,25,.35)); animation: mzak 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes mzak { 50% { translate: 0 -6px; } }

.map-side { display: grid; gap: 14px; }
.ms-card { padding: 20px 22px; border-radius: 26px; }
.ms-total b { display: block; font-size: 44px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ms-total span { color: var(--muted); font-size: 14px; }
.ms-meta { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 4px; font-size: 14px; font-weight: 600; color: var(--champ-d); }
.ms-nick { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.ms-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ms-actions .btn--primary { flex: 1 1 100%; }
.ms-h { margin: 0 0 12px; font-size: 16px; display: flex; justify-content: space-between; align-items: baseline; }
.ms-h small { font-size: 13px; color: var(--muted); font-weight: 600; }
.coll { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.coll__i { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 14px; background: rgba(255,255,255,.7); border: 1px solid #fff; border-bottom: 3px solid var(--c); transition: transform .4s var(--ease-spring); }
.coll__i:hover { transform: translateY(-3px) rotate(-2deg); }
.coll__i img { width: 100%; max-width: 54px; height: 40px; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(70,48,25,.25)); }
.coll__i span { font-size: 10.5px; font-weight: 700; }
.coll__i.is-locked { border-bottom-color: #d6d2c8; }
.coll__i.is-locked img { filter: brightness(0) opacity(.18); }
.coll__i.is-locked span { color: #a0a5b1; }
.ach { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.ach__i { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; color: #b1b5bf; background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.9); }
.ach__i svg { width: 60%; height: 60%; }
.ach__i.is-got { color: #fff; background: linear-gradient(160deg, #d6c299, #a88d5e); box-shadow: 0 6px 12px -6px rgba(140,110,60,.7); }

/* ============ ИГРОВОЙ ЭКРАН ============ */
body[data-screen="sPlay"] { overflow: hidden; }
body[data-screen="sPlay"] .g-top, body[data-screen="sPlay"] .g-bg, body[data-screen="sPlay"] .g-dust { display: none; }
body[data-screen="sPlay"] .g-app { padding: 0; max-width: none; }
.play { --dockH: 152px; --w: min(calc(100vw - 24px), calc((100svh - var(--dockH) - 92px) * 1.7778), 1500px);
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; overflow-y: auto;
  padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  background: radial-gradient(1200px 700px at 50% 0%, #f8f5ef, var(--len) 60%, #ebe5da); }
.hud, .stage, .dock { width: var(--w); flex: none; }

/* HUD */
.hud { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 6px 0 16px; border-radius: 999px; background: rgba(255,255,255,.66); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 12px 24px -16px rgba(38,43,54,.35); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.hud__day { display: grid; min-width: 0; flex: 1 1 auto; line-height: 1.15; }
.hud__day small { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.hud__day b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud__clock { display: flex; align-items: center; gap: 8px; flex: 0 1 260px; min-width: 120px; }
.hud__sun { width: 20px; height: 20px; color: #e3b35a; flex: none; animation: spin 14s linear infinite; }
.hud__track { flex: 1; height: 8px; border-radius: 8px; background: rgba(86,98,125,.14); overflow: hidden; }
.hud__track i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, #cfe0ff, var(--champ) 50%, #e8935b); border-radius: inherit; }
.hud__clock b { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 34px; }
.hud.is-late .hud__clock b { color: var(--bad); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .4; } }
.hud__score { display: flex; align-items: baseline; gap: 8px; padding: 0 8px; }
.hud__score b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.hud__stars { font-size: 16px; letter-spacing: 1px; color: var(--champ-d); }
.hud__score b.bump, .hud__stars.bump { animation: bump .5s var(--ease-spring); }
.hud__btn { width: 40px; height: 40px; }
@keyframes bump { 40% { transform: scale(1.3); color: var(--gold-d); } }

/* Сцена */
.stage { position: relative; aspect-ratio: 16 / 9; border-radius: 28px; overflow: hidden; background: var(--oves); user-select: none; -webkit-user-select: none;
  box-shadow: 0 30px 60px -28px rgba(38,43,54,.5), 0 0 0 1px rgba(255,255,255,.8); }
.st-bg, .st-counter { position: absolute; inset: 0; background: var(--bg) center / cover no-repeat; pointer-events: none; }
.st-bg { animation: bgIn 1.2s var(--ease) both; }
@keyframes bgIn { from { transform: scale(1.06); filter: blur(4px); } }
.st-counter { clip-path: inset(72.5% 0 0 0); z-index: 4; }
.st-light { position: absolute; inset: 0; z-index: 7; pointer-events: none; mix-blend-mode: soft-light; transition: background 1s; }
.st-weather { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.stage[data-weather="rain"] .st-weather { background: repeating-linear-gradient(105deg, rgba(255,255,255,0) 0 14px, rgba(255,255,255,.35) 14px 15px, rgba(255,255,255,0) 15px 40px); background-size: 200px 200px; opacity: .35; animation: rain .45s linear infinite; -webkit-mask-image: linear-gradient(#000 0 60%, transparent 75%); mask-image: linear-gradient(#000 0 60%, transparent 75%); }
@keyframes rain { to { background-position: -40px 200px; } }
.st-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 8; pointer-events: none; }
.st-pop { position: absolute; inset: 0; z-index: 9; pointer-events: none; }

/* Покупатели — стоят глубоко за прилавком, обрезанный край картинки всегда под столешницей */
.st-cust { position: absolute; inset: 0; z-index: 3; }
.cust { --x: 21%; position: absolute; left: var(--x); bottom: 15%; height: 60%; aspect-ratio: .66; transform: translateX(-50%); cursor: pointer; outline: none; transition: filter .3s; }
.cust[data-slot="1"] { --x: 44%; } .cust[data-slot="2"] { --x: 67%; }
.cust__img { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; max-width: none; transform: translateX(-50%); transform-origin: 50% 100%; pointer-events: none; filter: drop-shadow(0 12px 14px rgba(70,48,25,.28)); animation: breathe 4.4s ease-in-out infinite; }
.cust:nth-child(2n) .cust__img { animation-delay: -1.8s; }
.cust.is-enter { animation: custIn .9s var(--ease) both; }
.cust.is-enter .cust__img { animation: walk .3s ease-in-out 3 alternate; }
@keyframes custIn { from { transform: translateX(calc(-50% + 60vw)); } }
@keyframes walk { to { transform: translateX(-50%) rotate(2.5deg) translateY(-2%); } }
.cust.is-happy { animation: custOutHappy .9s var(--ease) forwards; pointer-events: none; }
.cust.is-sad { animation: custOutSad .9s var(--ease) forwards; pointer-events: none; filter: grayscale(.7); }
@keyframes custOutHappy { 20% { transform: translateX(-50%) translateY(-4%); } 100% { transform: translateX(calc(-50% - 60vw)); opacity: .4; } }
@keyframes custOutSad { 100% { transform: translateX(calc(-50% + 60vw)); opacity: 0; } }
.cust.is-match .cust__img, .cust.is-hover .cust__img { filter: drop-shadow(0 0 16px rgba(233,196,106,.95)); }
.cust.is-hover .cust__img { transform: translateX(-50%) scale(1.03); }
.cust.is-worried .cust__img { animation: worry .5s ease-in-out infinite alternate; }
@keyframes worry { to { transform: translateX(-50%) rotate(1.5deg); } }
.cust.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }
.cust__name { position: absolute; left: 50%; bottom: 31%; transform: translateX(-50%); padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--graph); background: rgba(255,255,255,.85); opacity: 0; transition: opacity .3s; pointer-events: none; }
.cust:hover .cust__name { opacity: 1; }

/* Заказ над головой */
.ocard { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); width: max-content; max-width: 280px; padding: 9px 11px 9px; border-radius: 18px; background: rgba(255,255,255,.93); border: 1px solid #fff;
  box-shadow: 0 16px 28px -14px rgba(38,43,54,.45); display: grid; gap: 6px; transition: box-shadow .3s, transform .4s var(--ease-spring); animation: orderIn .6s var(--ease-spring) .5s both; }
.ocard::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 0 0 4px 0; border-right: 1px solid #fff; border-bottom: 1px solid #fff; }
@keyframes orderIn { from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.85); } }
.cust.is-match .ocard { box-shadow: 0 0 0 3px #e9c46a, 0 16px 28px -14px rgba(38,43,54,.45); }
.cust:hover .ocard { transform: translateX(-50%) translateY(-3px); }
.ocard__say { display: block; max-width: 230px; font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--graph); max-height: 70px; overflow: hidden; transition: max-height .5s var(--ease), opacity .4s, margin .4s; }
.ocard__say.is-off { max-height: 0; opacity: 0; margin-bottom: -6px; }
.ocard__tag { justify-self: start; padding: 2px 8px; border-radius: 8px; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--blue); }
.ocard__gf { position: absolute; right: -6px; top: -9px; white-space: nowrap; padding: 2px 7px; border-radius: 8px; font-size: 10px; font-weight: 800; background: #dfe9d3; color: #4d6a3b; box-shadow: 0 4px 8px -4px rgba(0,0,0,.3); }
.ocard__items { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; max-width: 250px; }
.ocard.is-big .ocard__items { display: grid; grid-template-columns: repeat(4, auto); }
.oi { position: relative; display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; }
.oi__img { display: flex; flex: none; }
.oi__img img { width: 38px; height: 30px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(70,48,25,.25)); }
.oi.is-two .oi__img img { width: 30px; } .oi.is-two .oi__img img + img { margin-left: -12px; }
.ocard.is-big .oi__t { display: none; }
.oi.is-done { opacity: .45; }
.oi.is-done .oi__t { text-decoration: line-through; }
.oi__ok { position: absolute; left: 10px; top: -4px; font-style: normal; font-weight: 800; color: #fff; background: var(--ok); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; }
.ocard__pat { display: block; height: 6px; border-radius: 6px; background: rgba(86,98,125,.15); overflow: hidden; }
.ocard__pat i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; border-radius: inherit; background: var(--ok); transition: background .5s; }

/* Очередь у двери */
.st-queue { position: absolute; right: 2%; top: 4%; z-index: 6; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.88); box-shadow: 0 8px 16px -8px rgba(38,43,54,.4); animation: bubbleIn .5s var(--ease-spring); }

/* Прилавок — хлеб лежит прямо на столешнице */
.st-shelf { position: absolute; z-index: 5; left: 3%; right: 20%; top: 74.5%; bottom: 3%; display: grid; grid-template-columns: repeat(8, 1fr); gap: .8%; }
.loaf { position: relative; display: grid; place-items: center; align-content: end; padding: 0 0 2px; border-radius: 14px; touch-action: none; cursor: grab; transition: transform .4s var(--ease-spring), background .3s, box-shadow .3s; }
.loaf img { width: 92%; max-height: 74%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 8px 6px rgba(70,48,25,.4)); transition: transform .4s var(--ease-spring); }
.loaf:hover img { transform: translateY(-6%) rotate(-4deg) scale(1.05); }
.loaf.is-empty { border: 1.5px dashed rgba(255,255,255,.55); background: rgba(255,255,255,.08); pointer-events: none; }
.loaf.is-sel { background: rgba(255,255,255,.5); box-shadow: 0 0 0 3px var(--blue); transform: translateY(-8%); }
.loaf.is-drag { opacity: .35; }
.loaf.is-fresh img { animation: loafIn .7s var(--ease-spring) both; }
@keyframes loafIn { from { transform: translateY(-60%) scale(.5); opacity: 0; } }
.loaf__st { font-size: 10px; letter-spacing: 1px; color: #fff; text-shadow: 0 1px 2px rgba(70,48,25,.8); line-height: 1; }
.loaf__tag { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 8.5px; font-weight: 800; padding: 1px 5px; border-radius: 6px; background: var(--bad); color: #fff; white-space: nowrap; }

/* Заквасич на сцене */
.st-zak { position: absolute; right: 2.2%; bottom: 2.5%; width: 14%; z-index: 6; pointer-events: none; }
.st-zak img { width: 100%; display: block; filter: drop-shadow(0 14px 14px rgba(80,55,30,.3)); transform-origin: 50% 100%; animation: sway 4s ease-in-out infinite; }
.st-zak img.pop { animation: popZak .6s var(--ease-spring), sway 4s ease-in-out .6s infinite; }
.st-bubble { right: 88%; bottom: 58%; left: auto; top: auto; max-width: min(260px, 40vw); border-radius: 18px 18px 4px 18px; transform-origin: 100% 100%; font-size: 13px; }

/* Всплывающие очки и метки */
.fx { position: absolute; transform: translate(-50%, -50%); font-weight: 800; font-size: clamp(17px, 2vw, 26px); color: var(--blue); text-shadow: 0 2px 0 #fff, 0 6px 14px rgba(255,255,255,.8); white-space: nowrap; animation: fxUp 1.4s ease-out forwards; }
.fx.is-gold { color: var(--gold-d); } .fx.is-bad { color: var(--bad); } .fx.is-sm { font-size: 14px; }
@keyframes fxUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -200%) scale(1); } }

/* ---------- Нижняя панель: тесто, корзины, печи ---------- */
.dock { height: var(--dockH); overflow: hidden; display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr) minmax(0, 2.4fr); grid-template-rows: minmax(0, 1fr); gap: 12px; padding: 12px; border-radius: 26px;
  background: repeating-linear-gradient(90deg, rgba(120,90,50,.05) 0 2px, transparent 2px 11px), linear-gradient(180deg, #ecdcbf, var(--wood) 45%, var(--wood-d));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.7), inset 0 -3px 0 rgba(120,90,50,.18), 0 20px 30px -18px rgba(70,48,25,.55); }
.dock__new { position: relative; min-height: 0; height: 100%; display: grid; justify-items: center; align-content: center; gap: 4px; border-radius: 20px; color: #fff; background: linear-gradient(160deg, #6a7694, var(--blue) 60%, #48526b);
  box-shadow: 0 12px 20px -10px rgba(86,98,125,.85), inset 0 1px 0 rgba(255,255,255,.3); transition: transform .4s var(--ease-spring), box-shadow .3s; overflow: hidden; }
.dock__new img { height: 58px; max-height: 50%; filter: drop-shadow(0 6px 6px rgba(0,0,0,.25)); transition: transform .5s var(--ease-spring); }
.dock__new:hover { transform: translateY(-3px); }
.dock__new:hover img { transform: rotate(-8deg) scale(1.08); }
.dock__new:active { transform: scale(.96); }
.dock__new b { display: block; font-size: 15px; line-height: 1.1; }
.dock__new small { display: block; font-size: 11.5px; opacity: .8; }
.dock__new span { text-align: center; }
.dock__group { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; gap: 6px; min-width: 0; }
.dock__label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #7a6544; padding-left: 4px; }
.dock__slots { display: grid; gap: 8px; min-height: 0; height: 100%; }
.dock__slots > .slot { height: 100%; }
.dock__slots--baskets { grid-template-columns: repeat(3, 1fr); }
.dock__slots--ovens { grid-template-columns: repeat(2, 1fr); }

.slot { position: relative; display: grid; place-items: center; align-content: center; text-align: center; overflow: hidden; padding: 4px; min-height: 0; border-radius: 18px;
  background: rgba(255,255,255,.55); border: 1.5px solid rgba(255,255,255,.95); box-shadow: 0 8px 14px -10px rgba(70,48,25,.5); transition: transform .4s var(--ease-spring), box-shadow .3s, background .3s; outline: none; }
.slot.is-empty { background: rgba(255,255,255,.22); border: 1.5px dashed rgba(122,101,68,.35); box-shadow: none; }
.slot__empty { font-size: 11px; font-weight: 600; color: #8a7553; position: relative; z-index: 1; }
.slot__img { height: 54%; width: auto; max-width: 72%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(70,48,25,.25)); position: relative; z-index: 1; transition: transform .3s linear; }
.slot__name { position: relative; z-index: 1; font-size: 11px; font-weight: 800; line-height: 1.1; margin-top: 2px; }
.slot__st { position: relative; z-index: 1; font-size: 11px; font-weight: 700; color: var(--blue); }
.ring2 { position: absolute; left: 50%; top: 50%; height: 94%; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(-90deg); pointer-events: none; }
.ring2 circle { fill: none; stroke-linecap: round; }
.ring2__bg { stroke: rgba(86,98,125,.13); stroke-width: 3; }
.ring2__fg { stroke: var(--blue); stroke-width: 3.4; transition: stroke-dashoffset .12s linear; }
.ring2__gold { stroke: #e9c46a; stroke-width: 5; stroke-linecap: butt; }
.basket { cursor: pointer; }
.basket.is-empty:hover { background: rgba(255,255,255,.4); }
.basket.is-rest, .basket.is-prep { background: rgba(255,255,255,.78); }
.basket.is-ready { background: #fff; box-shadow: 0 0 0 3px var(--champ), 0 8px 14px -10px rgba(70,48,25,.5); animation: readyPulse 1s ease-in-out infinite; }
.basket.is-ready .slot__st { color: var(--gold-d); }
.basket.is-landed { animation: landed .6s var(--ease-spring); }
@keyframes landed { 0% { transform: scale(.8); } 60% { transform: scale(1.08); } }
@keyframes readyPulse { 50% { box-shadow: 0 0 0 6px rgba(185,162,122,.45); transform: scale(1.03); } }
.hurry { position: absolute; z-index: 3; right: 5px; top: 5px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--bad); opacity: .8; transition: transform .3s var(--ease-spring), opacity .2s; }
.hurry svg { width: 14px; height: 14px; }
.hurry:hover { transform: scale(1.18); opacity: 1; }
.oven { cursor: pointer; grid-template-rows: minmax(0, 1fr) auto auto; }
.oven.is-empty .oven__img { height: 56%; opacity: .5; filter: grayscale(.3); }
.oven__body { position: relative; z-index: 1; height: 100%; max-height: 80px; min-height: 0; aspect-ratio: .97; }
.oven__body .oven__img { height: 100%; width: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(70,48,25,.3)); }
.oven__win { position: absolute; left: 28.5%; right: 28.5%; top: 23%; height: 33%; border-radius: 50% 50% 6px 6px / 70% 70% 6px 6px; overflow: hidden;
  background: radial-gradient(circle at 50% 78%, #ffe1a0, #f0a24a 55%, #a5521f); box-shadow: inset 0 0 10px rgba(120,40,0,.55); }
.oven__loaf { position: absolute; left: 50%; top: 62%; width: 86%; transform: translate(-50%, -50%) scale(.82); filter: brightness(1.45) saturate(.3); transition: filter .25s linear; }
.oven__steam { position: absolute; left: 50%; top: -6%; width: 40%; height: 40%; transform: translateX(-50%); pointer-events: none; }
.oven__steam i { position: absolute; bottom: 0; left: 40%; width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.85); filter: blur(3px); animation: steam 1.8s ease-out infinite; }
.oven__steam i:nth-child(2) { left: 15%; animation-delay: .6s; } .oven__steam i:nth-child(3) { left: 65%; animation-delay: 1.2s; }
@keyframes steam { 0% { transform: translateY(0) scale(.6); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-34px) scale(1.6); opacity: 0; } }
.oven.is-bake { background: rgba(255,255,255,.82); }
.oven.is-gold { background: #fff; box-shadow: 0 0 0 3px #e9c46a, 0 0 26px rgba(233,196,106,.95); animation: readyPulse .7s ease-in-out infinite; }
.oven.is-gold .slot__st { color: var(--gold-d); font-size: 12px; }
.oven.is-gold .oven__win { box-shadow: inset 0 0 10px rgba(120,40,0,.4), 0 0 18px rgba(255,200,90,.9); }
.oven.is-late .slot__st { color: var(--bad); }
.oven.is-late .oven__steam i { background: rgba(90,80,70,.7); }

/* ---------- Шторка с мини-играми ---------- */
.sheet { position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 60; width: min(640px, calc(100vw - 20px)); transform: translate(-50%, 110%); transition: transform .5s var(--ease-spring); }
.sheet.is-open { transform: translate(-50%, 0); }
.sheet__card { position: relative; padding: 16px 18px 18px; border-radius: 28px; background: rgba(251,249,245,.94); box-shadow: 0 -10px 40px -12px rgba(38,43,54,.4), 0 30px 60px -20px rgba(38,43,54,.5); max-height: 78svh; overflow: auto; overscroll-behavior: contain; }
.sh-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sh-h > div { flex: 1; min-width: 0; display: grid; }
.sh-h b { font-size: 18px; line-height: 1.15; }
.sh-h small { font-size: 12.5px; color: var(--muted); }
.sh-steps { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.sh-steps li { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(86,98,125,.1); color: var(--muted); }
.sh-steps li.is-on { background: var(--blue); color: #fff; }
.sh-steps li.is-done { background: rgba(127,154,108,.25); color: #4d6a3b; }
.sh-x { position: relative; width: 36px; height: 36px; flex: none; border-radius: 50%; background: rgba(86,98,125,.1); transition: transform .4s var(--ease-spring); }
.sh-x:hover { transform: rotate(90deg); }
.sh-x span { position: absolute; left: 11px; right: 11px; top: 17px; height: 2px; border-radius: 2px; background: var(--graph); transform: rotate(45deg); }
.sh-x span + span { transform: rotate(-45deg); }
.mg-btn { width: 100%; margin-top: 12px; user-select: none; -webkit-user-select: none; touch-action: none; }
.mg-btn:active { transform: scale(.97); }
.mg-tip { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.mg-flash { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; font-size: 34px; font-weight: 800; background: rgba(255,255,255,.66); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); border-radius: inherit; animation: flashIn .9s ease both; pointer-events: none; }
.mg-flash.is-sm { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; font-size: 24px; align-items: start; padding-top: 70px; }
.mg-flash.is-perfect { color: var(--gold-d); } .mg-flash.is-ok { color: var(--blue); } .mg-flash.is-miss { color: var(--bad); }
@keyframes flashIn { 0% { opacity: 0; transform: scale(.8); } 20% { opacity: 1; transform: scale(1.05); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* выбор сорта */
.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pick { position: relative; display: grid; justify-items: center; gap: 1px; padding: 10px 4px 8px; border-radius: 18px; background: rgba(255,255,255,.8); border: 1px solid #fff; border-bottom: 4px solid var(--c);
  box-shadow: 0 8px 14px -10px rgba(38,43,54,.4); transition: transform .4s var(--ease-spring), box-shadow .3s; animation: pickIn .5s var(--ease-spring) both; }
.pick:nth-child(2) { animation-delay: .03s; } .pick:nth-child(3) { animation-delay: .06s; } .pick:nth-child(4) { animation-delay: .09s; } .pick:nth-child(5) { animation-delay: .12s; } .pick:nth-child(6) { animation-delay: .15s; } .pick:nth-child(7) { animation-delay: .18s; } .pick:nth-child(8) { animation-delay: .21s; }
@keyframes pickIn { from { opacity: 0; transform: translateY(16px) scale(.9); } }
.pick:hover { transform: translateY(-4px) rotate(-1.5deg); box-shadow: 0 18px 24px -14px rgba(38,43,54,.5); }
.pick img { width: 100%; max-width: 72px; height: 52px; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(70,48,25,.28)); }
.pick b { font-size: 13px; line-height: 1.1; text-align: center; }
.pick small { font-size: 10.5px; color: var(--muted); line-height: 1.15; text-align: center; }
.pick__need { position: absolute; left: 6px; top: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 800; color: #fff; background: var(--champ-d); box-shadow: 0 4px 10px -4px rgba(140,110,60,.9); animation: needPulse 1.4s ease-in-out infinite; }
@keyframes needPulse { 50% { transform: scale(1.12); } }
.pick__gf { position: absolute; right: 5px; top: 6px; font-style: normal; font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 6px; background: #dfe9d3; color: #4d6a3b; }

/* 1. мука */
.sift { display: grid; grid-template-columns: 1fr 34px; gap: 16px; align-items: stretch; }
.sift__scene { position: relative; height: 190px; border-radius: 20px; background: radial-gradient(circle at 50% 100%, rgba(185,162,122,.18), transparent 70%); }
.sift__sieve { position: absolute; left: 50%; top: 0; height: 40%; transform: translateX(-50%) rotate(-6deg); transform-origin: 50% 100%; z-index: 2; }
.sift__sieve.shaking { animation: sieveShake .2s ease-in-out infinite; }
@keyframes sieveShake { 0%, 100% { transform: translateX(-50%) rotate(-6deg); } 50% { transform: translateX(-44%) rotate(-1deg); } }
.sift__fall { position: absolute; left: 34%; right: 34%; top: 30%; height: 44%; pointer-events: none; }
.sift__fall i { position: absolute; top: 0; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.95), 0 0 1px rgba(150,130,100,.6); animation: fall .6s linear forwards; }
@keyframes fall { to { transform: translateY(80px); opacity: .2; } }
.sift__bowl { position: absolute; left: 50%; bottom: 0; height: 46%; transform: translateX(-50%); }
.sift__bowl img { height: 100%; position: relative; }
.sift__mound { position: absolute; left: 50%; top: 4%; width: 62%; height: 46%; z-index: 2; border-radius: 50% 50% 40% 40%; background: radial-gradient(ellipse at 45% 35%, #fff, #f3ede2 60%, #e2d8c6); transform: translateX(-50%) scale(.2); transform-origin: 50% 100%; box-shadow: 0 -2px 8px rgba(255,255,255,.8); }
.sift__gauge { position: relative; border-radius: 18px; background: rgba(86,98,125,.12); overflow: visible; box-shadow: inset 0 2px 4px rgba(38,43,54,.12); }
.sift__fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; border-radius: 18px; background: linear-gradient(0deg, #e7dcc4, #fbf7ef); box-shadow: inset 0 -4px 8px rgba(185,162,122,.35); }
.sift__target { position: absolute; left: -4px; right: -4px; border-radius: 6px; background: repeating-linear-gradient(135deg, rgba(233,196,106,.65) 0 5px, rgba(233,196,106,.3) 5px 10px); border: 2px solid var(--champ-d); z-index: 1; }
.sift__mark { position: absolute; right: calc(100% + 6px); transform: translateY(50%); font-size: 11px; font-weight: 800; color: var(--gold-d); white-space: nowrap; }

/* 2. замес */
.kn { position: relative; height: 190px; display: grid; place-items: center; }
.kn__dough { width: 116px; height: 104px; border-radius: 52% 48% 50% 50% / 56% 56% 44% 44%; position: relative;
  background: radial-gradient(ellipse at 38% 30%, #fffdf8, #f4ead7 45%, #e6d4b3 85%); box-shadow: inset -8px -10px 18px rgba(150,115,60,.25), 0 14px 20px -10px rgba(70,48,25,.4); }
.kn__dough i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.9); }
.kn__dough i:nth-child(1) { left: 28%; top: 30%; } .kn__dough i:nth-child(2) { left: 58%; top: 22%; width: 4px; height: 4px; } .kn__dough i:nth-child(3) { left: 46%; top: 52%; width: 3px; height: 3px; }
.kn__dough.squish { animation: squish .45s var(--ease-spring); }
@keyframes squish { 30% { transform: scale(1.22, .78); } 60% { transform: scale(.92, 1.08); } }
.kn__ring { position: absolute; width: 116px; height: 116px; border-radius: 50%; border: 5px solid var(--champ); box-shadow: 0 0 14px rgba(185,162,122,.5); will-change: transform; transform: scale(2.5); pointer-events: none; }
.kn__ring.is-gold { border-color: #e9c46a; box-shadow: 0 0 28px rgba(233,196,106,1); }
.kn__fb { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 20px; opacity: 0; pointer-events: none; }
.kn__fb.on { animation: fbIn .6s ease-out forwards; }
.kn__fb.is-perfect { color: var(--gold-d); } .kn__fb.is-ok { color: var(--blue); } .kn__fb.is-miss { color: var(--bad); }
@keyframes fbIn { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.kn__dots { display: flex; justify-content: center; gap: 8px; }
.kn__dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(86,98,125,.15); transition: background .3s, transform .3s var(--ease-spring); }
.kn__dots i.is-perfect { background: #e9c46a; transform: scale(1.25); } .kn__dots i.is-ok { background: var(--blue); } .kn__dots i.is-miss { background: var(--bad); }

/* 3. посыпка */
.tp { position: relative; height: 200px; border-radius: 20px; background: radial-gradient(ellipse at 50% 90%, rgba(185,162,122,.22), transparent 70%); overflow: hidden; }
.tp__loaf { position: absolute; left: 50%; bottom: 4%; width: 66%; max-width: 330px; transform: translateX(-50%); filter: brightness(1.35) saturate(.35) drop-shadow(0 10px 10px rgba(70,48,25,.25)); }
.tp__target { position: absolute; top: 34%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; border: 3px dashed rgba(86,98,125,.55); background: rgba(255,255,255,.25); }
.tp__target.is-hit { border-style: solid; border-color: var(--ok); background: rgba(127,154,108,.18); }
.tp__target.is-miss { border-style: solid; border-color: var(--bad); }
.tp__jar { position: absolute; top: 4%; width: 38px; height: 46px; transform: translateX(-50%); border-radius: 10px 10px 14px 14px; background: linear-gradient(160deg, #fff, #e8e1d3); border: 2px solid #fff; box-shadow: 0 8px 14px -6px rgba(38,43,54,.45); }
.tp__jar::before { content: ""; position: absolute; left: 4px; right: 4px; top: -8px; height: 10px; border-radius: 6px 6px 2px 2px; background: var(--blue); }
.tp__jar i { position: absolute; left: 50%; bottom: -10px; width: 3px; height: 10px; transform: translateX(-50%); border-left: 2px dotted var(--champ-d); }
.tp__seeds { position: absolute; inset: 0; pointer-events: none; }
.tp__seeds i { position: absolute; width: 5px; height: 3px; border-radius: 50%; transform: rotate(var(--r)); animation: seedIn .45s ease-out both; }
@keyframes seedIn { from { transform: translateY(-120px) rotate(var(--r)); opacity: 0; } }

/* ---------- Подсветка подсказки ---------- */
.coach { animation: coach 1.15s ease-in-out infinite !important; }
@keyframes coach { 0%, 100% { box-shadow: 0 0 0 3px #e9c46a, 0 0 0 0 rgba(233,196,106,.6); } 50% { box-shadow: 0 0 0 3px #e9c46a, 0 0 0 12px rgba(233,196,106,0); } }
.cust.coach { animation: none !important; }
.cust.coach .cust__img { filter: drop-shadow(0 0 18px rgba(233,196,106,1)); }
.cust.coach .ocard { box-shadow: 0 0 0 3px #e9c46a, 0 16px 28px -14px rgba(38,43,54,.45); }
.loaf.coach { border-radius: 14px; }

/* ---------- Перетаскивание ---------- */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 700; pointer-events: none; }
.drag-ghost img { width: 96px; transform: translate(-50%, -65%) rotate(-8deg); filter: drop-shadow(0 18px 16px rgba(70,48,25,.45)); }

/* ============ ОКНА ============ */
.g-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; }
.g-modal__back { position: absolute; inset: 0; background: rgba(38,43,54,.38); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .3s; }
.g-modal.is-open .g-modal__back { opacity: 1; }
.md { position: relative; width: min(560px, 100%); max-height: calc(100svh - 32px); overflow: auto; padding: 28px clamp(20px, 4vw, 34px) 26px; border-radius: 32px;
  background: rgba(251,249,245,.94); opacity: 0; transform: translateY(34px) scale(.95); transition: opacity .35s, transform .6s var(--ease-spring); overscroll-behavior: contain; }
.g-modal.is-open .md { opacity: 1; transform: none; }
.md__x { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 50%; background: rgba(86,98,125,.08); z-index: 2; transition: transform .4s var(--ease-spring); }
.md__x:hover { transform: rotate(90deg); }
.md__x span { position: absolute; left: 12px; right: 12px; top: 19px; height: 2px; border-radius: 2px; background: var(--graph); transform: rotate(45deg); }
.md__x span + span { transform: rotate(-45deg); }
.md__title { margin: 0 0 10px; font-size: clamp(26px, 4vw, 34px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; padding-right: 36px; }
.md__title .serif { font-weight: 400; }
.md__text { margin: 0 0 14px; color: var(--muted); }
.gold { color: var(--gold-d); font-style: normal; }
.intro { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: end; margin-bottom: 10px; }
.intro__zak { width: 96px; filter: drop-shadow(0 12px 12px rgba(80,55,30,.28)); animation: sway 4s ease-in-out infinite; transform-origin: 50% 100%; }
.md__new { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: 4px 0 14px; border-radius: 18px; background: rgba(255,255,255,.8); border: 1px solid #fff; border-left: 5px solid var(--c); }
.md__new img { width: 84px; filter: drop-shadow(0 10px 10px rgba(70,48,25,.3)); animation: bob 6s ease-in-out infinite; }
.md__new small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.md__new b { display: block; font-size: 20px; }
.md__goal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.md__goal span { display: grid; justify-items: center; padding: 10px 6px; border-radius: 16px; background: rgba(255,255,255,.75); border: 1px solid #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.md__goal i { font-style: normal; color: var(--champ-d); font-size: 15px; letter-spacing: 1px; }
.md__facts { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); text-align: center; }
.md__best { margin: 0 0 6px; font-size: 14px; color: var(--muted); text-align: center; }
.md__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.md--day .md__actions .btn--primary { flex: 1 1 100%; }
.md__zak { display: block; width: 92px; margin: 14px auto -6px; filter: drop-shadow(0 12px 12px rgba(80,55,30,.25)); animation: sway 4s ease-in-out infinite; transform-origin: 50% 100%; }
.md__stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 8px; }
.mstar { font-style: normal; font-size: 58px; line-height: 1; color: #d9d3c6; }
.mstar.is-on { color: var(--champ); text-shadow: 0 6px 16px rgba(185,162,122,.55); transform: scale(0); animation: starIn .7s var(--ease-spring) forwards; animation-delay: calc(var(--d) + .25s); }
@keyframes starIn { to { transform: scale(1); } }
.md__score { text-align: center; margin: 4px 0 10px; }
.md__score b { display: block; font-size: 54px; line-height: 1; font-weight: 800; color: var(--graph); font-variant-numeric: tabular-nums; }
.md__score span { color: var(--muted); font-size: 14px; }
.md__stats { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.md__stats li { padding: 10px 6px; text-align: center; border-radius: 16px; background: rgba(255,255,255,.75); border: 1px solid #fff; }
.md__stats b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.md__stats span { font-size: 11.5px; color: var(--muted); line-height: 1.2; display: block; }
.md__tip { margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; background: rgba(185,162,122,.16); font-size: 14px; }
.md__rank { min-height: 24px; text-align: center; font-size: 15px; }
.muted { color: var(--muted); font-size: 14px; }
.linkbtn { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; font-size: 14px; }
.help { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 10px; }
.help li::marker { color: var(--champ-d); font-weight: 800; }
.toplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.toplist li { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 14px 9px 10px; border-radius: 16px; background: rgba(255,255,255,.75); border: 1px solid #fff; animation: pickIn .5s var(--ease-spring) both; animation-delay: calc(var(--i) * .04s); }
.toplist li.is-me { box-shadow: 0 0 0 2px var(--champ); background: #fff; }
.toplist__n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist__d { font-size: 12px; color: var(--muted); white-space: nowrap; }
.toplist b { font-variant-numeric: tabular-nums; }
.medal { font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--oves); color: var(--graph); }
.medal.m1 { background: linear-gradient(145deg, #f3dd9a, #c8a85a); color: #4a3a12; } .medal.m2 { background: linear-gradient(145deg, #eceff4, #b3bac8); } .medal.m3 { background: linear-gradient(145deg, #efc9a6, #c4875a); }
.top__foot { margin: 10px 4px 0; }
.sort-md__img { display: grid; place-items: center; height: 150px; margin: -6px 0 8px; border-radius: 22px; background: radial-gradient(circle, color-mix(in srgb, var(--c) 40%, transparent), transparent 70%); }
.sort-md__img img { height: 130px; filter: drop-shadow(0 20px 18px rgba(70,48,25,.35)); animation: bob 7s ease-in-out infinite; }
.sort-md__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin-bottom: 10px; }
.sort-md__meta b { font-size: 28px; color: var(--blue); }
.sort-md__meta span { color: var(--muted); font-size: 14px; }
.sort-md__meta i { font-style: normal; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--oves); }
.sort-md__comp { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.sort-md__comp b { color: var(--graph); }
.kbju { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(86,98,125,.15); border-bottom: 1px solid rgba(86,98,125,.15); }
.kbju div { padding: 10px 4px; text-align: center; }
.kbju div + div { border-left: 1px solid rgba(86,98,125,.12); }
.kbju b { display: block; font-size: 19px; }
.kbju span { font-size: 11.5px; color: var(--muted); }
.achlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.achlist li { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 16px; background: rgba(255,255,255,.6); border: 1px solid #fff; opacity: .7; }
.achlist li.is-got { opacity: 1; background: #fff; }
.achlist i { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #b1b5bf; background: rgba(86,98,125,.08); }
.achlist li.is-got i { color: #fff; background: linear-gradient(160deg, #d6c299, #a88d5e); }
.achlist i svg { width: 24px; height: 24px; }
.achlist b { display: block; font-size: 15px; }
.achlist small { color: var(--muted); font-size: 13px; }
.achlist em { font-style: normal; font-weight: 800; color: var(--ok); }

/* уведомления */
.g-toasts { position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 800; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; background: rgba(255,255,255,.95); animation: toastIn .6s var(--ease-spring) both; transition: opacity .5s, transform .5s; }
.toast.is-out { opacity: 0; transform: translateY(-14px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-24px) scale(.9); } }
.toast__ic { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #d6c299, #a88d5e); }
.toast__ic svg { width: 24px; height: 24px; }
.toast small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.toast b { display: block; font-size: 15px; }
.toast em { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); }
.toast--info b { font-size: 14px; font-weight: 600; }
.g-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.g-confetti i { position: absolute; top: -20px; border-radius: 2px; animation: confFall linear forwards; }
@keyframes confFall { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: .9; } }

/* ============ АДАПТИВ ============ */
@media (max-width: 1100px) {
  .map-wrap { grid-template-columns: 1fr; justify-items: center; }
  .map-side { width: min(560px, 100%); }
}
@media (max-width: 860px) {
  .t-wrap { grid-template-columns: 1fr; min-height: 0; }
  .t-hero { order: -1; padding: 0 0 10% 10%; }
}
@media (max-width: 760px) {
  .play { --dockH: 140px; }
  .hud { gap: 8px; padding-left: 12px; }
  .hud__day b { font-size: 14px; }
  .hud__clock { min-width: 90px; }
  .hud__stars { display: none; }
  .ocard__say { display: none; }
  .st-bubble { font-size: 11.5px; padding: 8px 10px; max-width: 46vw; }
  .md { padding: 22px 18px 20px; border-radius: 26px; }
}
/* телефон вертикально: сцена квадратная, панель в две строки */
@media (max-aspect-ratio: 4 / 5) {
  .play { --w: calc(100vw - 16px); justify-content: flex-start; gap: 8px; padding-left: 8px; padding-right: 8px; }
  .stage { aspect-ratio: 1 / 1; border-radius: 22px; }
  .cust { --x: 17%; height: 56%; }
  .cust[data-slot="1"] { --x: 50%; } .cust[data-slot="2"] { --x: 83%; }
  .ocard { max-width: 31vw; padding: 6px 7px; border-radius: 14px; }
  .ocard__items { max-width: 31vw; gap: 3px; }
  .ocard.is-big .ocard__items { grid-template-columns: repeat(4, auto); }
  .oi__t { display: none; }
  .oi__img img { width: 30px; height: 24px; }
  .oi.is-two .oi__img img { width: 24px; }
  .ocard__tag { font-size: 9px; }
  .st-shelf { right: 21%; top: 74%; bottom: 2%; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: 2px 4px; }
  .loaf__st { font-size: 8px; }
  .st-zak { width: 19%; }
  .dock { height: auto; grid-template-rows: auto auto; grid-template-columns: 92px 1fr; grid-template-areas: "new baskets" "ovens ovens"; padding: 10px; gap: 8px; border-radius: 22px; }
  .dock__new { grid-area: new; }
  .dock__group { grid-area: baskets; }
  .dock__group--ovens { grid-area: ovens; }
  .dock__slots--baskets .slot { aspect-ratio: 1 / .95; }
  .dock__slots--ovens .slot { aspect-ratio: 2.3 / 1; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; }
  .dock__slots--ovens .oven__body { grid-row: span 2; height: 64px; }
  .dock__new img { height: 38px; }
  .dock__new b { font-size: 12.5px; }
  .dock__new small { font-size: 10px; }
  .sheet { width: calc(100vw - 12px); bottom: max(6px, env(safe-area-inset-bottom)); }
  .sheet__card { padding: 14px 14px 16px; border-radius: 24px; }
  .sh-steps { display: none; }
  .picker { gap: 6px; }
  .pick { padding: 8px 2px 6px; }
  .pick img { height: 40px; }
  .pick b { font-size: 11.5px; }
  .pick small { display: none; }
  .sift__scene, .kn, .tp { height: 160px; }
}
@media (max-aspect-ratio: 4 / 5) and (min-height: 740px) {
  .stage { aspect-ratio: 4 / 5; }
  .cust { height: 50%; bottom: 16%; }
  .st-shelf { top: 75%; }
}
@media (max-aspect-ratio: 4 / 5) {
  .ocard__gf { top: -13px; right: -4px; font-size: 8.5px; padding: 1px 5px; }
  .ocard { padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .g-confetti, .st-weather { display: none; } }

/* все корзины заняты — кнопка новой партии приглушена */
.dock__new.is-full { filter: grayscale(.6) brightness(1.05); opacity: .7; }
.dock__new.is-full small::after { content: " · корзины заняты"; }

/* касания: перетаскивание хлеба и удержание кнопок не должны превращаться в прокрутку */
.g-body .loaf, .g-body .mg-btn, .g-body #holdBtn, .g-body #kTap, .g-body #tpTap { touch-action: none; }
