@charset "UTF-8";
:root{--cream:#f7f4ee;--paper:#fffcf7;--blue:#b6cbd8;--blue-dark:#527387;--ink:#342e29;--muted:#817c73;--line:#e1dbd0;--caramel:#a36a3e;--pink:#c78075;--radius:26px;font-family:"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--cream);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;min-width:320px}button,input{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}button{color:inherit}a{color:inherit}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #618ca6;outline-offset:4px}button:active:not(:disabled){transform:translateY(1px)}button{transition:background .2s,transform .15s,box-shadow .2s}svg{fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.page-shell{width:min(760px,calc(100% - 48px));min-height:100svh;margin:auto;padding:24px 0;display:flex;flex-direction:column;justify-content:center}
.site-header{height:64px;display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px;flex:none}
.brand{display:block;line-height:0}.brand img{width:80px;height:54px;object-fit:contain}
.header-actions{display:flex;align-items:center;gap:16px}
.text-button{display:inline-flex;align-items:center;justify-content:center;gap:10px;border:0;background:none;padding:10px 0;min-height:44px;font-size:13px;font-weight:500}.text-button:hover{color:var(--blue-dark)}
.saved-prize{color:var(--blue-dark)}
.main-layout{min-height:0}
.dessert{display:block;background-image:url('./assets/desserts.webp');background-size:200% 200%;background-repeat:no-repeat;width:65px;height:65px}.dessert.cookie{background-position:0 0}.dessert.eclair{background-position:100% 0}.dessert.macaron{background-position:0 100%}.dessert.coffee{background-position:100% 100%}
.game-area{min-width:0}.game-machine{background:var(--blue);border:1px solid #a6bcc9;border-radius:var(--radius);padding:15px;box-shadow:0 14px 40px -24px #53646b65,inset 0 1px 0 #ffffff70;overflow:hidden}.game-topbar{display:flex;align-items:center;gap:22px;min-height:58px;padding:0 8px 12px}.score-display output{display:block;font-size:32px;font-weight:500;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:.04em;color:#34454b}.lives{display:flex;align-items:center;gap:6px;color:#fbf7ef}.lives span{display:block;width:22px;height:22px;flex:none}.lives svg{display:block;width:100%;height:100%;fill:currentColor;stroke:none}.lives .lost{color:#829fac}
.game-options{display:flex;gap:6px;align-items:center;margin-left:auto}.icon-button{display:grid;place-items:center;border:1px solid #7793a345;background:#ffffff19;width:44px;height:44px;border-radius:50%;padding:11px}.icon-button svg{width:18px;height:18px;stroke-width:1.6}.icon-button:hover{background:#fff6}.icon-button:disabled{cursor:default}.site-header .icon-button{border-color:var(--line);background:none;font:20px Georgia,serif}.rules-button{display:inline-flex;align-items:center;border:1px solid var(--line);background:none;min-height:44px;padding:0 17px;border-radius:999px;font-size:13px;font-weight:500}.rules-button:hover{background:#eee9df}#btn-pause:disabled{display:none}.stage{position:relative;overflow:hidden;border:1px solid #9ab2bc;border-radius:16px;background:#f5efdf;isolation:isolate}.stage canvas{display:block;width:100%;height:auto;aspect-ratio:800/510;touch-action:none;outline:none}.shop-awning{position:absolute;z-index:1;top:0;left:0;right:0;height:53px;background:repeating-linear-gradient(90deg,#ebe6d9 0 29px,#d8e2e3 29px 58px);border-bottom:1px solid #b9cac777;box-shadow:0 4px 12px #7566480e;pointer-events:none;display:flex;align-items:center;justify-content:center}.shop-awning:after{content:"";position:absolute;bottom:-7px;left:0;right:0;height:8px;background:radial-gradient(ellipse at 50% 0%,#d8e2e3 69%,transparent 72%) 0 0/58px 8px repeat-x}

/* Стартовый экран занимает всё поле: белка просвечивает фоном под вуалью,
   а по нажатию «Играть» вуаль уходит и начинается игра. */.welcome{position:absolute;z-index:3;inset:0;text-align:center;display:flex;align-items:center;justify-content:space-evenly;flex-direction:column;padding:24px 20px;overflow:auto;background:#f8f2e69e;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}.welcome-copy{margin-bottom:8px}.intro-title{margin:0 0 10px;font:400 40px/1.05 Georgia,serif;letter-spacing:-.03em;color:#3b2d20}.intro-text{margin:0 0 14px;font-size:16px;line-height:1.55;color:#574c3f;max-width:30ch;text-wrap:balance}.intro-locked{margin:0 0 14px;font-size:14px;font-weight:600;color:#8a4b3c}.intro-where{margin:0;font-size:16px;line-height:1.45;font-weight:600;color:#3f3124;max-width:30ch;text-wrap:balance}.primary-button{display:flex;align-items:center;justify-content:center;gap:40px;border:1px solid #91b0c3;background:var(--blue);padding:15px 27px;min-height:49px;border-radius:12px;font-size:14px;font-weight:600;box-shadow:0 3px 0 #7f9caf25}.primary-button:hover{background:#a4c0d1;box-shadow:0 4px 12px #7996a730}.welcome .primary-button{min-width:229px;background:#adc9d9;border-color:#8faec2}.stage-overlay{position:absolute;z-index:5;inset:0;background:#fbf6ebeb;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px}.stage-overlay>span{font-family:Georgia,serif;font-size:95px;line-height:1.1;color:var(--caramel)}.stage-overlay h2{font-family:Georgia,serif;font-size:32px;font-weight:400;margin:0 0 24px}.stage-toast{position:absolute;z-index:4;top:68px;left:50%;transform:translateX(-50%);background:#fffcf6ef;color:#775537;padding:10px 18px;border-radius:30px;box-shadow:0 4px 20px #56432412;font-size:12px;white-space:nowrap;pointer-events:none}.game-machine.missed{animation:miss-flash .35s ease}.game-machine.speed-up{animation:speed-flash .5s ease}
.game-bottom{padding:14px 8px 5px}.progress-caption{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#445e6b;margin-bottom:9px}.progress-caption strong{font-size:11px;font-weight:500;font-variant-numeric:tabular-nums}.progress-track{height:4px;background:#94b1c1;border-radius:8px;overflow:hidden}.progress-track>div{width:0;height:100%;background:#fbf8ef;border-radius:8px;transition:width .18s ease}
.controls{display:none}.game-active .controls{display:flex;align-items:center;justify-content:space-between;gap:40px;margin-top:16px;touch-action:none;user-select:none;-webkit-user-select:none}.control-pair{display:flex;gap:8px}.direction-button{background:#ede9e1;border:1px solid #e0d9cb;border-radius:14px;display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;min-width:76px;padding:8px 16px;box-shadow:0 3px 0 #ddd6c863;touch-action:none;-webkit-touch-callout:none}.direction-button>span{font-size:28px;line-height:1;font-family:Arial,sans-serif;font-weight:400}.direction-button kbd{font:11px 'Segoe UI',sans-serif;color:#8a8073}.direction-button[aria-pressed='true']{background:#dce6eb;border-color:#b6ccd8;box-shadow:0 3px 0 #bbd0db60}.direction-button:hover{background:#e2e8e8}

dialog{background:var(--paper);color:var(--ink);border:1px solid #dcd4c5;border-radius:24px;padding:35px;width:min(470px,calc(100% - 28px));max-height:calc(100dvh - 36px);box-shadow:0 24px 100px #26333735;overflow:auto}dialog::backdrop{background:#343d4365;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}dialog h2{font:400 34px/1.15 Georgia,serif;letter-spacing:-.035em;margin:0 0 20px}.dialog-close{position:absolute;right:14px;top:14px;border-color:#ded7c8;padding:0}.dialog-close svg{width:17px;height:17px;stroke-width:1.9}.rules-copy{font-size:13px;line-height:1.7;color:#756c5f;margin:0 0 18px}.rules-prizes{margin:20px 0;border-block:1px solid var(--line)}.rules-prizes>div{display:flex;justify-content:space-between;gap:16px;padding:13px 0;border-bottom:1px solid var(--line);font-size:13px}.rules-prizes>div:last-child{border:0}.rules-prizes dt{color:var(--muted)}.rules-prizes dd{margin:0;font-weight:600}.keyboard-help{font-size:11px;line-height:1.6;color:var(--muted)}
.app-links{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0 0}.app-link{flex:1 1 140px;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 16px;border:1px solid #d8d0c1;border-radius:11px;font-size:13px;font-weight:500;text-decoration:none}.app-link:hover{background:#eee9df}.address-note{background:#eee9df;border-radius:10px;padding:14px 16px;display:flex;flex-direction:column;gap:5px;margin:20px 0 12px}.address-note strong{font-weight:500;font-size:13px}.address-note span{font-size:11px;color:#8c7d69}.demo-note{font-size:10px;line-height:1.65;color:#908677;margin:13px 0}.promo-hint{font-size:11px;line-height:1.6;color:#8c7d69;margin:12px 0 8px}.promo-score{margin:2px 0 0;font-size:13px;color:var(--muted)}.promo .app-links{margin-top:0}.promo .app-link{font-size:12px;min-height:40px}.promo-qr{width:min(190px,64%);margin:16px auto 4px;padding:8px;background:#fff;border-radius:12px;box-shadow:0 2px 10px -6px rgba(74,58,42,.5)}.promo-qr svg{display:block;width:100%;height:auto;stroke:none}.promo-qr svg *{stroke:none}.promo-qr-note{margin:0 0 2px;font-size:11px;color:var(--muted)}.promo-save{margin:14px 0 14px;padding:11px 13px;border-radius:11px;background:#fdeee6;font-size:16px;font-weight:600;line-height:1.4;color:#8a4b3c}.promo>#btn-copy{width:100%}.share-field{display:block;margin:16px 0 12px}.share-field input{width:100%;border:1px solid #dcd4c7;border-radius:9px;padding:12px 11px;background:#fffdf9;color:#5c5245;font-size:12px}#share-dialog .app-links{margin-top:16px}#btn-share-copy{width:100%}.secondary-button{display:flex;align-items:center;justify-content:center;gap:8px;border:1px solid #d8d0c1;background:transparent;min-height:44px;padding:12px 17px;border-radius:11px;font-size:12px}.secondary-button:hover{background:#eee9df}.result-art{height:92px;display:flex;align-items:center;justify-content:center;gap:0;margin:0 0 12px}.result-art .dessert{width:100px;height:100px}.result-score{display:flex;align-items:baseline;justify-content:center;gap:9px;margin:-8px 0 8px}.result-score b{font:400 49px Georgia,serif;color:var(--caramel);letter-spacing:-.03em}.result-score span{font-size:12px;color:var(--muted)}#result-dialog{text-align:center}.result-label{margin:0 0 7px;font-size:12px;color:var(--muted)}.share-status{margin:12px 0 0}#result-dialog h2{margin-bottom:16px}.result-description{font-size:13px;line-height:1.65;color:#857763;margin:0 auto 15px;max-width:32ch}.muted{font-size:12px;color:var(--muted)}.field-row{display:grid;grid-template-columns:1fr 1.15fr;gap:10px;margin:22px 0 13px}.field-row label{display:flex;flex-direction:column;gap:7px;text-align:left;font-size:10px;font-weight:500;color:#837460}.field-row input{width:100%;min-width:0;border:1px solid #dcd4c7;border-radius:9px;padding:12px 11px;background:#fffdf9;color:#463d32;font-size:13px;outline-offset:1px}.field-row input::placeholder{color:#b1a899}.consent{display:flex;align-items:flex-start;gap:7px;font-size:10px;text-align:left;line-height:1.6;color:#8c7c66}.consent input{accent-color:#668da4;margin:1px 0 0;width:15px;height:15px;flex-shrink:0}.inline-link{background:none;border:0;border-bottom:1px solid #91816c;font:inherit;padding:0}#claim-form .primary-button{width:100%;margin-top:18px}.result-actions{display:flex;justify-content:center;gap:20px;margin-top:22px;align-items:center}.inline-error{font-size:11px;line-height:1.6;color:#a45a49;margin:12px 0 0}.promo{border:1px dashed #b8b5a5;border-radius:16px;padding:20px 18px;background:#f6f5e9;margin-top:18px}.promo>strong{display:block;font:400 25px Georgia,serif;margin:10px 0 12px}.promo>code{display:block;user-select:all;-webkit-user-select:all;cursor:pointer;font:600 clamp(15px,4vw,23px) "Consolas",monospace;letter-spacing:.04em;color:#416576;overflow-wrap:anywhere}.promo>.text-button{font-size:11px}.promo>p:not(.demo-note){font-size:10px;color:var(--muted)}.promo .address-note{text-align:left;margin-top:14px}.promo .demo-note{margin-bottom:0}.site-footer{flex:none;width:100%;max-width:760px;margin:14px auto 0;text-align:center}
.site-footer p{margin:0;font-size:12px;color:#9a9186}
.ergart-wrap{position:relative;display:inline-block}
.ergart{font-weight:600;color:#6b6154;text-decoration:none;background-image:linear-gradient(currentColor,currentColor);background-size:0 1px;background-position:0 100%;background-repeat:no-repeat;transition:background-size .25s}
.ergart:hover{background-size:100% 1px}
.cupcake{position:absolute;left:50%;top:-6px;margin-left:-14px;width:28px;height:28px;pointer-events:none;opacity:0;filter:drop-shadow(0 3px 6px rgba(74,58,42,.28))}.cupcake svg{display:block;width:100%;height:100%;fill:none;stroke:none}.cupcake .cup{fill:#dda15e}.cupcake .fold{fill:none;stroke:#c1873f;stroke-width:1;stroke-linecap:round}.cupcake .cream{fill:#fdf4e6}.cupcake .berry{fill:#c8564f}
.noscript{text-align:center;background:#ffe4d7;padding:20px}
@keyframes miss-flash{30%{box-shadow:0 0 0 4px #c7807599;transform:translateX(-2px)}65%{transform:translateX(2px)}}@keyframes speed-flash{50%{box-shadow:0 0 0 4px #b18b6180}}

/* Phones are the primary experience: quick start, then a dedicated game screen. */
@media(max-width:800px), (max-width:1024px) and (max-height:500px){
  body{min-width:280px}
  /* Телефон: страница занимает ровно экран и не прокручивается, а игровое
     поле растягивается на всю высоту, оставшуюся от шапки и полоски прогресса. */
  html,body{overflow:hidden;overscroll-behavior:none}
  .page-shell{width:100%;height:var(--app-height,100dvh);min-height:0;align-items:center;justify-content:flex-start;padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
  .site-header{width:100%;max-width:540px}
  .main-layout{width:100%;max-width:540px;flex:1;min-height:0;display:flex;align-items:stretch}
  .game-area{width:100%;height:100%;display:flex}
  .game-machine{width:100%;min-height:0;display:flex;flex-direction:column;justify-content:center}
  .game-topbar,.game-bottom{flex:none}
  /* На вытянутом экране поле не растягиваем до бесконечности: сцена нарисована
     под почти квадрат, а остаток высоты уходит в рамку автомата. */
  .stage{flex:1;min-height:0;max-height:calc(min(100vw - 44px, 520px) * 1.6)}
  /* Управление — нажатием по нужному углу поля, отдельные кнопки не нужны. */
  .controls{display:none!important}
  .site-header{height:56px;gap:12px;margin-bottom:12px}
  .brand img{width:72px;height:48px}
  .text-button{font-size:12px}
  .rules-button{font-size:13px;padding:0 15px}
  .game-area{width:100%;min-width:0}
  .game-machine{padding:10px;border-radius:24px}
  .game-topbar{padding:0 4px 10px;gap:20px;min-height:54px}
  .score-display output{font-size:31px}
  .lives span{width:21px;height:21px}
  .game-options{gap:5px}
  .stage{border-radius:15px}
  .stage canvas{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto}
  .shop-awning{height:38px;background:repeating-linear-gradient(90deg,#ebe6d9 0 23px,#d8e2e3 23px 46px)}
  .shop-awning:after{background-size:46px 8px}
  .welcome{padding:24px 16px}
  .intro-title{font-size:36px}
  .welcome-copy{margin-bottom:8px}
  .intro-text{font-size:17px}
  .intro-where{font-size:17px}
  .welcome .primary-button{width:min(100%,240px);min-height:54px;font-size:16px;border-radius:14px;padding:13px 20px}
  .game-bottom{padding:14px 5px 5px}
  .progress-caption{font-size:12px;margin-bottom:9px}
  .progress-caption strong{font-size:11px}
  .stage-overlay{padding:18px}
  .stage-overlay>span{font-size:75px}
  .stage-overlay h2{font-size:29px;margin:0 0 20px}
  .stage-overlay .primary-button{min-height:50px;font-size:15px;min-width:210px}
  .stage-toast{top:51px;font-size:12px;padding:10px 15px}

  .game-machine{box-shadow:0 8px 24px -20px #53646b65}
  .keyboard-help{display:none}
  .game-active .site-footer{display:none}

  dialog{position:fixed;inset:auto 0 var(--keyboard-offset,0px);width:100%;max-width:540px;margin:0 auto;max-height:calc(var(--app-height,100dvh) - 12px);border-radius:24px 24px 0 0;padding:26px 24px max(24px,env(safe-area-inset-bottom));overscroll-behavior:contain;scroll-padding-block:18px}
  dialog h2{font-size:29px}
  .dialog-topbar{position:sticky;top:-26px;z-index:3;display:flex;justify-content:flex-end;margin:-26px -24px 8px;padding:8px 12px 2px;background:var(--paper)}
  .dialog-close{position:static;width:44px;height:44px;margin:0;background:var(--paper)}
  .rules-copy{font-size:14px;line-height:1.65}
  .rules-prizes>div{font-size:14px;padding:14px 0}
  .app-link{font-size:14px;min-height:48px}
  .address-note{padding:15px 17px}
  .address-note strong{font-size:14px}
  .address-note span{font-size:12px;line-height:1.5}
  .demo-note{font-size:11px;line-height:1.6}
  .result-art{height:62px;margin:0 0 12px}
  .result-art .dessert{width:78px;height:78px}
  .result-label{font-size:13px}
  #result-dialog h2{margin-bottom:12px}
  .result-score b{font-size:45px}
  .result-description{font-size:14px;margin-bottom:12px}
  #result-dialog:has(#claim-form:not([hidden])) .result-art{height:40px;margin-bottom:8px}
  #result-dialog:has(#claim-form:not([hidden])) .result-art .dessert{width:55px;height:55px}
  .muted{font-size:12px}
  .field-row{grid-template-columns:1fr;gap:13px;margin:20px 0 12px}
  .field-row label{font-size:12px;gap:7px}
  .field-row input{font-size:16px;line-height:1.4;min-height:50px;border-radius:11px;padding:12px 13px}
  .consent{font-size:12px;gap:10px;min-height:44px;align-items:center}
  .consent input{width:22px;height:22px;margin:0}
  .primary-button,.secondary-button{min-height:50px;font-size:14px;border-radius:12px}
  .result-actions{display:grid;grid-template-columns:1fr;gap:10px}
  .promo{padding:20px 18px}
  .promo>code{font-size:clamp(17px,5.3vw,23px)}
  .promo>.text-button{font-size:13px}
  .promo>p:not(.demo-note){font-size:12px}
  .inline-error{font-size:12px}
}
@media(max-width:360px){
  .game-topbar{gap:12px;min-height:52px;padding-bottom:8px}
  .game-options{gap:2px}
  .score-display output{font-size:28px}
  .lives span{width:19px;height:19px}
  .welcome{padding:18px 12px}
  .intro-title{font-size:31px}
  .welcome-copy{margin-bottom:6px}
  .intro-text{font-size:15px;margin-bottom:12px}
  .intro-where{font-size:15px}
  .game-bottom{padding-top:11px}
  dialog{padding-left:19px;padding-right:19px}
  .dialog-topbar{margin-left:-19px;margin-right:-19px}
}
@media(max-width:1024px) and (max-height:500px) and (orientation:landscape){
  .page-shell{height:var(--app-height,100dvh);min-height:0;padding-block:8px;width:min(640px,calc(100% - 24px))}
  .site-header{height:38px;margin-bottom:8px}
  .brand img{width:55px;height:36px}
  .main-layout{flex:1;min-height:0}
  .game-area{height:100%}
  .game-machine{height:100%;min-height:0;display:flex;flex-direction:column;padding:8px}
  .game-topbar{min-height:50px;padding-bottom:6px}
  .stage{flex:1;min-height:0}
  .stage canvas{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto}
  .game-bottom{padding-top:8px}
  .shop-awning{height:24px}
  .stage-toast{top:34px}
  .stage-overlay>span{font-size:50px}
  .stage-overlay h2{font-size:25px;margin:0 0 14px}
  /* В горизонтали высоты мало — оставляем одну строку сути. */
  .welcome{padding:12px 16px}
  .intro-title{font-size:22px;margin-bottom:4px}
  .welcome-copy{margin-bottom:4px}
  .intro-text{font-size:12px;max-width:52ch;margin-bottom:8px}
  .intro-where{font-size:12px;max-width:52ch}
  .welcome .primary-button{width:190px;min-width:0;min-height:46px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* Georgia рисует цифры «старого стиля»: 3,4,5,7,9 свисают ниже строки.
   Просим ровные. Свойство приходится задавать отдельным правилом — краткая
   запись font в объявлениях выше сбрасывает его в исходное. */
.intro-title,.stage-overlay>span,.stage-overlay h2,dialog h2,
.result-score b,.promo>strong,.welcome-copy,.intro-text,.intro-where{
  font-variant-numeric:lining-nums;
}
