/* Наша ёлка: новогодняя игра торгового центра. Тёмный атриум (img/atrium-bg.webp,
   нарисован в ChatGPT), поверх него экраны игры. Заголовки Unbounded, текст Golos.
   Цвет бренда через ?accent=, по умолчанию золото гирлянд. */

@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/fonts/golos-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/fonts/golos-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2122;
}
@font-face {
  font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/fonts/unbounded-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/fonts/unbounded-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2116;
}

:root {
  --accent: #f2c14e;
  --accent-ink: #1c1306;
  --bg: #08131a;
  --panel: rgba(10, 24, 30, .82);
  --panel-2: rgba(255, 255, 255, .07);
  --ink: #f7f0e3;
  --ink-2: rgba(247, 240, 227, .76);
  --ink-3: rgba(247, 240, 227, .48);
  --line: rgba(255, 255, 255, .14);
  --red: #e63946;
  --green: #3ad27a;
  --gold: #ffd37a;
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", "Golos Text", sans-serif;
  --r: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
:root[data-accent="red"] { --accent: #ff4d5e; --accent-ink: #fff; }
:root[data-accent="green"] { --accent: #3ad27a; --accent-ink: #06210f; }
:root[data-accent="blue"] { --accent: #62a8ff; --accent-ink: #061a33; }
:root[data-accent="ink"] { --accent: #f7f0e3; --accent-ink: #1c1306; }

* { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--sans); overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* атриум: картинка на весь экран, затемнение к низу под текст */
.bg { position: fixed; inset: 0; z-index: 0; background: var(--bg) url(img/atrium-bg.webp) center top / cover no-repeat; }
.bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 19, 26, .18), rgba(8, 19, 26, .45) 55%, rgba(8, 19, 26, .88)); }

.app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(8px + var(--sat)) 12px calc(14px + var(--sab)); }
.screen { display: flex; flex-direction: column; flex: 1; min-height: 0; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* шапка бренда */
.top { display: flex; align-items: center; gap: 10px; padding: 4px 2px 8px; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand__mark { width: 34px; height: 34px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 800 15px var(--display); flex: 0 0 auto; }
.brand__name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; line-height: 1.15; }
.brand__sub { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.top__tools { margin-left: auto; display: flex; gap: 2px; }
.icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon:hover { background: var(--panel-2); color: var(--ink); }
.icon[aria-pressed="true"] { color: var(--accent); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; padding: 8px 10px 8px 4px; border-radius: 12px; }
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* заголовки */
.h { margin: 4px 2px 10px; }
.h h1 { margin: 0; font: 800 26px/1.08 var(--display); letter-spacing: -.01em; }
.h h2 { margin: 0; font: 800 21px/1.12 var(--display); letter-spacing: -.01em; }
.h p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.eyebrow { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 6px; font-weight: 600; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 20px; border-radius: 16px; font-weight: 600; font-size: 15px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); transition: transform .15s var(--ease), background .2s; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn--ghost { background: transparent; }
.btn--sm { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.row { display: flex; gap: 10px; margin-top: 12px; }
.row > .btn { flex: 1; }
.row--col { flex-direction: column; }
.btn--pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 60% { box-shadow: 0 0 0 14px transparent; } }

/* ------------------------------------------------------------ ёлка (главный экран) */
.tree { position: relative; flex: 1; min-height: 360px; border-radius: 22px; overflow: hidden; touch-action: manipulation; }
.tree canvas { display: block; width: 100%; height: 100%; }
.tree__count { position: absolute; left: 12px; top: 12px; padding: 10px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tree__count b { display: block; font: 800 24px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tree__count span { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.tree__count em { font-style: normal; color: var(--green); }
.tree__live { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); backdrop-filter: blur(8px); }
.tree__live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(58, 210, 122, .6); animation: live 1.8s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(58, 210, 122, .6); } 100% { box-shadow: 0 0 0 9px transparent; } }
.tree__mine { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); white-space: nowrap; backdrop-filter: blur(8px); }
.tree__mine b { color: var(--gold); }
.tree__tag { position: absolute; transform: translate(-50%, -100%); padding: 5px 9px; border-radius: 10px; background: var(--gold); color: #2a1a00; font: 700 11px/1 var(--sans); white-space: nowrap; pointer-events: none; animation: tagin .5s var(--ease); }
.tree__tag::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; background: var(--gold); transform: translateX(-50%) rotate(45deg); }
@keyframes tagin { from { opacity: 0; transform: translate(-50%, -80%); } to { opacity: 1; transform: translate(-50%, -100%); } }

.cta { margin-top: 12px; }
.cta .btn { width: 100%; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.step { padding: 12px 10px 11px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-height: 86px; }
.step b { display: block; font: 800 12px var(--display); color: var(--accent); margin-bottom: 6px; }
.step span { font-size: 12.5px; color: var(--ink-2); line-height: 1.3; display: block; }
.step.is-done { border-color: color-mix(in srgb, var(--green) 50%, transparent); }
.step.is-done b { color: var(--green); }
.gift-line { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.gift-line b { color: var(--ink); }
.gift-line svg { width: 26px; height: 26px; flex: 0 0 auto; color: var(--gold); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* легенда дня: отсылка, которую знают все; пилюля над ёлкой */
.legend { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin: 0 0 10px; padding: 9px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.legend__ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 211, 122, .12); color: var(--gold); flex: 0 0 auto; }
.legend__ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.legend__t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.legend__k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend__t b { font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend__more { flex: 0 0 auto; font-size: 11.5px; color: var(--gold); padding: 5px 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.legend-card { padding: 14px 16px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); margin-top: 6px; }
.legend-card h3 { margin: 2px 0 6px; font: 800 19px/1.2 var(--display); letter-spacing: -.01em; }
.legend-card p { margin: 6px 0 0; }
.legend-card .quote { font-style: italic; color: var(--gold); font-size: 15px; }
.legend-stamp { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 211, 122, .08); border: 1px dashed color-mix(in srgb, var(--gold) 50%, transparent); }
.legend-stamp canvas { width: 44px; height: 44px; flex: 0 0 auto; }
.legend-stamp b { display: block; font-size: 14px; }
.legend-stamp span { font-size: 13px; color: var(--ink-2); }
.legend-list { display: grid; gap: 4px; margin-top: 6px; }
.legend-list div { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); font-size: 13.5px; }
.legend-list div.is-today { background: color-mix(in srgb, var(--accent) 22%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.legend-list i { font-style: normal; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.legend-list span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-list em { font-style: normal; color: var(--ink-3); font-size: 12px; white-space: nowrap; }

/* подарок дня четырьмя строками */
.gift { display: grid; gap: 6px; margin-top: 10px; }
.gift div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; align-items: start; }
.gift span { color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.gift b { font-weight: 500; color: var(--ink); line-height: 1.35; }
.gift div.is-gold { border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: rgba(255, 211, 122, .1); }
.gift div.is-gold span { color: var(--gold); }
.gift div.is-locked { opacity: .72; border-style: dashed; }
.how { display: grid; gap: 6px; margin-top: 10px; }
.how div { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.how i { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 800 13px var(--display); font-style: normal; }

/* подарки под ёлкой: три коробки по сумме чека */
.boxes { display: block; width: 100%; text-align: left; margin-top: 10px; padding: 10px 12px 11px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.boxes__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.box { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 84px; padding: 6px 4px 7px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); text-align: center; transition: opacity .3s; }
.box img { display: block; margin-bottom: 4px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.box b { font-size: 12px; }
.box span { font-size: 11px; color: var(--ink-3); line-height: 1.2; }
.box.is-open { border-color: color-mix(in srgb, var(--gold) 60%, transparent); background: rgba(255, 211, 122, .14); box-shadow: 0 0 18px -4px var(--gold); }
.box.is-open span { color: var(--gold); }
.box.is-dim { opacity: .5; }
.boxes__t { display: flex; flex-direction: column; margin-top: 8px; }
.boxes__t b { font-size: 13.5px; }
.boxes__t span { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.tiers { display: grid; gap: 6px; margin-top: 10px; }
.tiers > div { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.tiers img { flex: 0 0 auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.tiers b { display: block; font-size: 14px; }
.tiers span { display: block; font-size: 13.5px; color: var(--ink); }
.tiers em { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.sheet__big--pop img { width: 150px; height: 150px; object-fit: contain; animation: slotpop .6s var(--ease); filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .6)); }

/* ------------------------------------------------------------ поиск подарков */
.poisk { position: relative; flex: 1; min-height: 380px; border-radius: 22px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: #0a1a22; }
.poisk canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.poisk__hud { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; align-items: flex-start; gap: 8px; pointer-events: none; }
.poisk__timer { padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font: 700 16px/1 var(--display); font-variant-numeric: tabular-nums; backdrop-filter: blur(8px); }
.poisk__tip { margin-left: auto; max-width: 62%; padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); backdrop-filter: blur(8px); animation: fade .3s; }
.poisk__zoom { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.poisk__zoom .icon { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.poisk__hint { position: absolute; left: 10px; bottom: 10px; }
.poisk__hint .btn { background: var(--panel); backdrop-filter: blur(8px); }
/* карточка находки: факт поверх картины, не двигает холст */
.lore { position: absolute; left: 10px; right: 58px; bottom: 60px; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none; animation: lorein .4s var(--ease); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.lore[hidden] { display: none; }
.lore.is-out { animation: loreout .35s var(--ease) forwards; }
.lore img { width: 44px; height: 44px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
.lore b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.lore b em { font-style: normal; color: var(--gold); font-weight: 500; font-size: 12px; }
.lore span { display: block; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
@keyframes lorein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes loreout { to { opacity: 0; transform: translateY(8px); } }

.tray { display: flex; gap: 8px; margin-top: 10px; }
.tray__slot { flex: 1; aspect-ratio: 1; max-height: 74px; border-radius: 14px; background: var(--panel); border: 1px dashed var(--line); display: grid; place-items: center; position: relative; overflow: hidden; }
.tray__slot img { width: 78%; height: 78%; object-fit: contain; filter: brightness(.25) saturate(0); opacity: .7; transition: filter .4s, opacity .4s, transform .4s var(--ease); }
.tray__slot.is-found { border-style: solid; border-color: color-mix(in srgb, var(--green) 60%, transparent); }
.tray__slot.is-found img { filter: none; opacity: 1; }
.tray__slot.is-pop img { animation: slotpop .5s var(--ease); }
@keyframes slotpop { 0% { transform: scale(1.5); } 100% { transform: none; } }
.tray__slot--gold { border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: linear-gradient(160deg, rgba(255, 211, 122, .14), var(--panel)); }
.tray__slot--gold::after { content: ""; position: absolute; right: 5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.tray__slot--gold.is-found::after { display: none; }
.fly { position: fixed; z-index: 40; pointer-events: none; width: 64px; height: 64px; object-fit: contain; transition: all .75s cubic-bezier(.3, .6, .2, 1); filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .6)); }

/* ------------------------------------------------------------ мастерская */
.master { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.stage { position: relative; flex: 1; min-height: 300px; touch-action: none; user-select: none; -webkit-user-select: none; display: grid; place-items: center; }
.stage canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
.stage__cap { position: absolute; left: 50%; transform: translateX(-50%); width: 44px; pointer-events: none; z-index: 2; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.stage__shadow { position: absolute; left: 50%; width: 180px; height: 26px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); pointer-events: none; }
.stage__hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; text-align: center; color: var(--ink); z-index: 3; }
.stage__hint .finger { width: 54px; height: 54px; margin: 0 auto 8px; animation: finger 1.6s ease-in-out infinite; }
.stage__hint .finger svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .8)); }
.stage__hint p { margin: 0; font-size: 14px; font-weight: 600; text-shadow: 0 2px 10px rgba(0, 0, 0, .9); }
@keyframes finger { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(0, -18px); } }
.stage__speed { position: absolute; right: 8px; top: 8px; z-index: 3; display: flex; gap: 4px; }
.stage__speed .icon { width: 36px; height: 36px; background: var(--panel); border: 1px solid var(--line); }

.tools { display: grid; gap: 8px; padding-top: 8px; }
.swatches { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.swatches::-webkit-scrollbar { display: none; }
.swatch { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 2px 6px rgba(0, 0, 0, .4); position: relative; transition: transform .15s var(--ease); }
.swatch[aria-pressed="true"] { border-color: #fff; transform: scale(1.12); }
.swatch--day::after { content: ""; position: absolute; right: -2px; top: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--bg); }
.swatch--locked { opacity: .35; }
.swatch--lock svg { position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; }
.swatches__label { flex: 0 0 auto; align-self: center; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-right: 2px; width: 46px; }
.toolbar { display: flex; gap: 6px; align-items: center; }
.tool { flex: 1; min-height: 46px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; gap: 2px; padding: 5px 2px; color: var(--ink-2); font-size: 10.5px; line-height: 1; }
.tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tool--icon { flex: 0 0 46px; }
.sizes { display: flex; gap: 6px; }
.size { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; }
.size i { display: block; border-radius: 50%; background: currentColor; }
.size[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.shapes { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.shapes[hidden] { display: none; }
.shape { flex: 0 0 44px; height: 40px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; }
.shape canvas { width: 26px; height: 26px; }
.shape[aria-pressed="true"] { background: var(--accent); border-color: transparent; }
.shape--day { position: relative; border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: rgba(255, 211, 122, .1); }
.shape--day::after { content: ""; position: absolute; right: -2px; top: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--bg); }
.master__actions { display: flex; gap: 8px; margin-top: 8px; }
.master__actions .btn--primary { flex: 1; }

/* ------------------------------------------------------------ лист снизу */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(4, 10, 14, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .25s var(--ease); }
.sheet__in { width: 100%; max-width: 480px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 14px 18px calc(18px + var(--sab)); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); animation: rise .4s var(--ease); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
.sheet__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sheet__head h2 { margin: 0; font: 800 20px/1.15 var(--display); letter-spacing: -.01em; flex: 1; }
.sheet p { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }
.sheet h3 { margin: 16px 0 4px; font: 700 15px/1.3 var(--sans); }
.sheet .row { margin-top: 14px; }
.sheet__big { text-align: center; padding: 6px 0 4px; }
.sheet__big canvas, .sheet__big img { width: 200px; height: 200px; display: block; margin: 0 auto; }
.sheet__big b { display: block; font: 800 22px/1.1 var(--display); margin-top: 6px; }
.sheet__big span { color: var(--ink-3); font-size: 13px; }
.code { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 14px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent); background: rgba(255, 211, 122, .08); font: 800 18px/1 var(--display); letter-spacing: .08em; color: var(--gold); }
.code small { font: 500 11px var(--sans); letter-spacing: 0; color: var(--ink-3); }
.info { display: grid; gap: 10px; margin-top: 8px; }
.info div { padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.info b { display: block; margin-bottom: 4px; font-size: 14.5px; }
.info span { color: var(--ink-2); font-size: 13.5px; line-height: 1.4; }
.share-text { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; white-space: pre-wrap; user-select: all; -webkit-user-select: all; }

/* гирлянда декабря */
.garland { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 12px; }
.bulb { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font: 700 11px var(--sans); color: var(--ink-3); background: var(--panel-2); border: 1px solid var(--line); position: relative; }
.bulb.is-on { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 70%, transparent); }
.bulb.is-today { outline: 2px solid var(--ink); outline-offset: 2px; }
.bulb.is-gold { background: var(--gold); color: #2a1a00; box-shadow: 0 0 14px var(--gold); }
.bulb.is-box::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--bg); }

/* альбом находок: 16 карточек с фактами */
.album { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.card { padding: 10px 10px 11px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.card img { width: 48px; height: 48px; object-fit: contain; display: block; margin-bottom: 6px; filter: brightness(.3) saturate(0); opacity: .6; }
.card b { display: block; font-size: 13.5px; margin-bottom: 3px; color: var(--ink-3); }
.card span { display: block; font-size: 12px; line-height: 1.35; color: var(--ink-3); }
.card.is-got { border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: linear-gradient(160deg, rgba(255, 211, 122, .1), var(--panel-2)); }
.card.is-got img { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); opacity: 1; }
.card.is-got b { color: var(--ink); }
.card.is-got span { color: var(--ink-2); }
.streak { margin-top: 12px; display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 14px; }
.streak b { font: 800 26px/1 var(--display); color: var(--ink); }

/* рейтинг */
.rating { margin-top: 8px; display: grid; gap: 4px; }
.rating div { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.rating div.is-me { background: color-mix(in srgb, var(--accent) 22%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.rating i { font-style: normal; color: var(--ink-3); }

/* всплывашка */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--sab)); transform: translateX(-50%); z-index: 60; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; animation: toast 2.7s var(--ease) forwards; white-space: nowrap; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* перелёт шара на ёлку */
.flyball { position: fixed; z-index: 45; pointer-events: none; border-radius: 50%; }
.burst { position: fixed; z-index: 44; pointer-events: none; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: burst .9s var(--ease) forwards; }
@keyframes burst { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

@media (min-width: 560px) {
  .app { padding-top: 24px; }
  .tree { min-height: 520px; }
}
@media (max-height: 760px) {
  .tree { min-height: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
