@font-face {
  font-family: Rubik;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/rubik-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Rubik;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/rubik-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Shantell Sans';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('assets/fonts/shantell-sans-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Shantell Sans';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('assets/fonts/shantell-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root{font-family:Rubik,Arial,sans-serif;color:#244b56;background:#e9f4ef;color-scheme:light}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at top,#fff8e9,#e0f0ed);min-height:100dvh}button{font:inherit;cursor:pointer;touch-action:manipulation;color:inherit;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:4px solid #247d9c;outline-offset:4px}[hidden]{display:none!important}h1,h2,p{margin:0}h1,h2{font-family:'Shantell Sans',sans-serif}button:disabled{cursor:default}.toolbar{position:absolute;z-index:10;top:16px;left:20px;right:20px;display:flex;gap:12px;align-items:center}.toolbar button{min-height:48px;min-width:48px;padding:10px 16px;border:2px solid white;border-radius:17px;background:#fffffff0;box-shadow:0 3px 0 #aac9c7;font-size:17px}.toolbar #home{font-size:23px;padding:5px 12px}#sound{margin-left:auto}.screen{min-height:100dvh}.cover{height:100dvh;position:relative;isolation:isolate;overflow:hidden}.cover picture{position:absolute;inset:0;z-index:-2}.cover picture img{width:100%;height:100%;object-fit:cover}.cover:after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#f4fbf8a0,transparent 65%)}.cover-copy{position:absolute;left:5%;top:17%;width:44%;text-align:center;text-shadow:0 2px 1px #fff9}.cover h1{font-size:clamp(34px,4.2vw,66px);line-height:1.18;color:#1c5b64}.brand{font-size:17px;font-weight:600;margin-bottom:20px}.cover-buttons{position:absolute;left:5%;width:44%;bottom:14%;display:flex;align-items:center;flex-direction:column;gap:12px}.primary{background:linear-gradient(#ffdf8c,#ffcb55);border:3px solid #fff2b9;border-radius:24px;box-shadow:0 5px 0 #d2a13d;color:#533d15;min-height:66px;padding:14px 34px;font-size:25px;font-weight:700}.secondary{background:#ffffffeb;border:2px solid white;border-radius:20px;min-height:52px;padding:10px 28px;font-size:19px;box-shadow:0 3px 0 #aacaca}.text-button{border:0;border-radius:12px;min-height:44px;padding:8px 22px;background:#ffffffc9;font-size:18px}.praise{font-family:'Shantell Sans';font-size:clamp(20px,2.3vw,34px);font-weight:600;line-height:1.4;margin-top:15px}#finish .cover-copy{top:12%}#finish .cover-buttons{bottom:8%}#finish h1{font-size:clamp(36px,4.8vw,72px)}#levels{padding:95px 30px 35px;text-align:center}#levels h1{font-size:clamp(30px,4vw,52px)}.intro{font-size:20px;line-height:1.5;margin:20px auto 30px}.levels-grid{max-width:1150px;margin:auto;display:grid;grid-template-columns:repeat(3,1fr);gap:28px}.levels-grid button{padding:0 0 20px;background:#fff;border:4px solid white;border-radius:26px;overflow:hidden;box-shadow:0 6px 0 #aec7bc}.levels-grid img{width:100%;height:280px;object-fit:cover;object-position:50% 30%;display:block}.levels-grid b{font-family:'Shantell Sans';font-size:32px;display:block;margin:18px 0 8px}.levels-grid span{display:block;font-size:16px}#game{padding:78px 24px 16px;max-width:1600px;margin:auto;height:100dvh;display:flex;flex-direction:column}#game header{flex:none;display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:10px}#game header h1{font-size:clamp(25px,2.7vw,42px)}.progress{display:flex;flex-direction:column;gap:5px;font-size:16px;white-space:nowrap}.play-layout{flex:1;min-height:0;display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:center}.tree-area{height:100%;min-height:0;display:flex;flex-direction:column;align-items:center;gap:7px}.tree-area h2{font-size:25px;flex:none}.tree-stage{position:relative;flex:1;min-height:0;aspect-ratio:4/5;max-width:100%;border-radius:28px;overflow:hidden;isolation:isolate;box-shadow:0 7px 30px #2a5f6025}.tree-stage>#tree-bg{display:block;height:100%;width:100%;object-fit:cover;position:absolute;inset:0;z-index:-1}.ornament-slot{position:absolute;width:28%;aspect-ratio:6/7;transform:translate(-50%,-50%);border-radius:24px;background:#fffcf3ef;box-shadow:0 3px 8px #103b2c2b;display:flex;align-items:center;justify-content:center}.ornament-slot img{width:100%;height:100%;object-fit:contain}.sample{left:29%}.target{left:71%;background:#fff9d044;border:3px dashed #fff4c9}.ornament-slot[data-row="0"]{top:28%}.ornament-slot[data-row="1"]{top:51%}.ornament-slot[data-row="2"]{top:74%}.sample.active{outline:4px solid #ffcf60;outline-offset:3px;background:#fffdf2}.target.waiting{border-color:#ffdf75;background:#fff4bb66}.target.filled{background:#fffcf3ef;border:0;animation:twinkle .8s ease-out}.options-area{align-self:center;width:100%;min-width:0}#feedback{font-family:'Shantell Sans';font-size:clamp(21px,2vw,30px);font-weight:600;text-align:center;min-height:2.6em;display:flex;align-items:center;justify-content:center;margin-bottom:16px}#options{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:16px}.option{grid-column:span 2;min-width:0;aspect-ratio:6/7;background:#fffdf8;border:3px solid white;box-shadow:0 5px 0 #b4cfc5,0 7px 17px #335d5220;border-radius:24px;padding:4px}.option:nth-child(4){grid-column:2/span 2}.option img{height:100%;width:100%;object-fit:contain;display:block;pointer-events:none}.option.chosen{border-color:#e8ba45;box-shadow:0 0 0 4px #ffdc7a}.option:active:not(:disabled){transform:translateY(2px)}.flying{position:fixed;z-index:30;pointer-events:none;transform-origin:top left;filter:drop-shadow(0 10px 8px #735a2944)}.sway{animation:sway .5s ease-out}.garland{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .6s;box-shadow:inset 0 0 65px 25px #ffdf7f80}.lit .garland{opacity:1;background:radial-gradient(circle at 20% 35%,#ffe49788 0,transparent 9%),radial-gradient(circle at 82% 60%,#fff3ae88 0,transparent 10%)}@keyframes sway{25%{transform:rotate(-3deg)}65%{transform:rotate(3deg)}}@keyframes twinkle{50%{box-shadow:0 0 22px 7px #ffe990}}
@media(max-width:900px){#game{padding:75px 16px 18px;height:auto;min-height:100dvh}#game header{flex-direction:column;gap:9px;text-align:center}#game header h1{font-size:28px}.progress{flex-direction:row;gap:20px;font-size:14px}.play-layout{display:flex;flex-direction:column;gap:14px}.tree-area{width:100%}.tree-area h2{font-size:22px}.tree-stage{flex:none;width:min(100%,380px);height:auto;aspect-ratio:4/5}.options-area{max-width:620px}.levels-grid{gap:15px}.levels-grid img{height:220px}.levels-grid b{font-size:26px}.levels-grid span{font-size:13px}.intro{font-size:17px}#feedback{font-size:21px;min-height:2em;margin-bottom:12px}}
@media(max-width:600px){.toolbar{top:10px;left:12px;right:12px;gap:9px}.toolbar button{min-height:44px;padding:8px 12px;font-size:14px;border-radius:14px}.toolbar #home{min-width:44px}#sound span{display:none}#sound{font-size:23px;padding:4px 12px}#levels{padding:76px 15px 30px}#levels .brand{font-size:13px;margin-bottom:12px}#levels h1{font-size:30px}.intro{margin:15px 0 22px;font-size:16px}.levels-grid{grid-template-columns:1fr;max-width:370px;gap:17px}.levels-grid button{display:grid;grid-template-columns:100px 1fr;grid-template-rows:auto auto;padding:0 10px 0 0;text-align:center;min-height:125px;border-radius:21px}.levels-grid img{grid-row:1/3;height:125px;width:100px}.levels-grid b{margin:22px 0 0;font-size:27px}.levels-grid span{margin:0 0 17px;font-size:12px}#game{padding:66px 10px 18px}#game header h1{font-size:24px}.progress{font-size:12px;gap:20px}.tree-stage{width:min(100%,calc((100dvh - 395px) * .8));min-width:285px;min-height:356px}.tree-area h2{font-size:19px}.play-layout{gap:12px}#feedback{font-size:18px;min-height:2em;margin-bottom:8px}#options{gap:10px}.option{border-radius:18px;padding:3px}.options-area{max-width:400px}.ornament-slot{border-radius:17px;width:29%}}
@media(max-aspect-ratio:4/5){.cover-copy{left:5%;top:8%;width:90%}.cover h1{font-size:clamp(29px,8vw,45px);line-height:1.18}.brand{font-size:13px;margin-bottom:12px}.cover-buttons{left:5%;width:90%;bottom:7%}.cover:after{background:linear-gradient(#effaf970,transparent 40%,transparent 80%,#effaf940)}.primary{min-height:60px;font-size:22px;padding:12px 26px}.secondary{font-size:16px;min-height:47px;padding:9px 23px}.text-button{font-size:16px}#finish .cover-copy{top:6%}#finish .cover-buttons{bottom:4%;gap:9px}.praise{font-size:21px;margin-top:12px}#finish h1{font-size:39px}}
@media(orientation:landscape) and (max-height:560px){#game{height:auto;min-height:100dvh;padding-top:65px}.play-layout{display:grid;grid-template-columns:1fr 1fr;gap:16px}#game header{flex-direction:row}.tree-stage{width:240px;height:300px}.options-area{max-width:380px}#feedback{font-size:19px}.cover-copy{top:15%}.cover h1{font-size:32px}.cover-buttons{bottom:12%}.primary{min-height:52px;font-size:20px}.brand{font-size:13px;margin-bottom:10px}#finish .cover-copy{top:13%}#finish .cover-buttons{bottom:7%;gap:6px}.praise{font-size:19px}#finish h1{font-size:32px}.secondary{font-size:14px;min-height:42px;padding:8px 20px}.text-button{font-size:14px;min-height:40px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Між зразками є проміжок навіть з активною обводкою. */
.ornament-slot{width:26%}
.ornament-slot[data-row="0"]{top:25%}
.ornament-slot[data-row="1"]{top:51%}
.ornament-slot[data-row="2"]{top:77%}
@media(max-width:600px){
 .tree-stage{width:clamp(285px,calc(80dvh - 160px - 62.222vw),380px)}
 .ornament-slot{width:26%}
 #game header{margin-bottom:6px}
 .tree-area{gap:4px}.play-layout{gap:8px}
 #feedback{min-height:1.6em;margin-bottom:6px}
}

.cover-buttons button{max-width:100%}
@media(max-width:600px) and (orientation:portrait){
 #finish .brand{display:none}#finish .cover-copy{top:3.5%}
 #finish h1{font-size:34px;line-height:1.15}
 #finish .praise{font-size:18px;line-height:1.3;margin-top:7px}
 #finish .cover-buttons{gap:7px;bottom:4%}
 #finish .primary{font-size:18px;min-height:54px;padding:10px 18px}
}

@media(orientation:landscape) and (max-height:560px){.secondary,.text-button{min-height:44px}}

@media(min-width:601px) and (max-width:900px) and (orientation:portrait){
 .options-area{max-width:100%}#options{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
 .option,.option:nth-child(4){grid-column:auto}
}

@media(min-width:390px) and (max-width:600px) and (orientation:portrait){#game{padding-bottom:max(6px,env(safe-area-inset-bottom))}}

/* v2: прозорі художні іграшки висять на гілках без карток під ними. */
.sample,.target,.sample.active,.target.waiting,.target.filled{
 background:transparent;border:0;outline:0;box-shadow:none;border-radius:0;
}
.ornament-slot{overflow:visible}
.ornament-slot img{position:relative;z-index:1;filter:drop-shadow(0 3px 2px #102d2866)}
.ornament-slot:before{content:'';position:absolute;left:calc(50% - 1px);top:-9px;width:2px;height:27px;background:linear-gradient(#aecb7e,#e4c16d);border-radius:2px;z-index:0}
.sample.active img{filter:drop-shadow(0 0 5px #ffe996) drop-shadow(0 3px 2px #173b2c66)}
.target:empty:before{display:none}
.target:empty:after{content:'';width:66%;height:67%;border:1px dashed #ffe6a86b;border-radius:50%;background:radial-gradient(ellipse,#ffe49b13,transparent 72%);opacity:.35}
.target.waiting:empty:after{opacity:1;border-color:#ffeaa6b3;background:radial-gradient(ellipse,#ffe49b42,transparent 72%);box-shadow:0 0 17px #ffe29b44}
.target.filled{animation:hanging-arrival .75s ease-out}
@keyframes hanging-arrival{50%{filter:drop-shadow(0 0 9px #ffedb0)}}
@media(prefers-reduced-motion:reduce){.target.filled{animation:none}}

.ornament-slot:before{left:calc(var(--hanger-x,50%) - 1px)}

/* Верхня пара ближче до стовбура: кріплення потрапляють на вузькі верхні гілки. */
.sample[data-row="0"]{left:38%}.target[data-row="0"]{left:62%}
.sample[data-row="2"]{left:25%}.target[data-row="2"]{left:75%}
.target.waiting:empty:after{border:2px solid #ffe7a6bf;box-shadow:0 0 19px #ffdc7e66;background:radial-gradient(ellipse,#ffe49b38,transparent 73%)}
