/* «Прикрасити» (decorate.md): префікс .dc-. Місця на вулиці — у town-street.css.
   Токени: surface #fffaf1, surface-glass rgba(255,250,241,.94), text #3b2a1e, text-muted #7a6553,
   success-strong #2d6b46, yellow #f2b632, shadow.card / soft / raised / edge. */
.dc-fab, .dc-bar, .dc-tray { --dc-text: #3b2a1e; --dc-muted: #7a6553; --dc-ok: #2d6b46; --dc-yellow: #f2b632; --dc-surface: #fffaf1;
  --dc-glass: rgba(255, 250, 241, .94); --dc-edge: inset 0 0 0 1.5px rgba(90, 60, 30, .14);
  --dc-card: inset 0 0 0 1.5px rgba(90, 60, 30, .14), 0 3px 0 rgba(90, 60, 30, .10), 0 14px 30px rgba(90, 60, 30, .10);
  --dc-soft: inset 0 0 0 1.5px rgba(90, 60, 30, .14), 0 2px 0 rgba(90, 60, 30, .08);
  --dc-raised: inset 0 0 0 1.5px rgba(90, 60, 30, .14), 0 18px 40px rgba(90, 60, 30, .18);
  font-family: var(--font-round, inherit); color: var(--dc-text);
}

/* ---------- кругла кнопка «Прикрасити» (§2.1), дзеркально до «Справ» ---------- */
.dc-fab {
  position: fixed; z-index: 25; left: calc(16px + env(safe-area-inset-left, 0px)); bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; margin: 0; border: 0; background: none;
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
@media (min-width: 701px) { .dc-fab { left: calc(116px + 16px + env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); } }
@media (min-width: 1101px) { .dc-fab { left: 132px; bottom: 16px; } }
.dc-fab-c { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--dc-surface); box-shadow: var(--dc-card); color: var(--dc-text); }
.dc-fab-c > svg { width: 24px; height: 24px; }
.dc-fab-gift {
  position: absolute; right: -4px; top: -4px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--dc-yellow); color: var(--dc-text); box-shadow: 0 0 0 2px #fff;
}
.dc-fab-gift svg { width: 16px; height: 16px; }
.dc-fab-lbl { font-size: 12px; font-weight: 800; line-height: 18px; padding: 0 8px; border-radius: 999px; background: var(--dc-surface); box-shadow: var(--dc-edge); }
.dc-fab:focus-visible { outline: none; }
.dc-fab:focus-visible .dc-fab-c { outline: 3px solid var(--dc-text); outline-offset: 3px; }
.dc-fab.dc-bounce .dc-fab-c { animation: ts-bounce .9s var(--ease, ease) 1; }
body:has(.tour) .dc-fab, html.dc-on .dc-fab { display: none; }

/* ---------- смуга режиму (§3.1) — на місці .ts-top ---------- */
.dc-bar {
  position: fixed; z-index: 30; top: calc(10px + env(safe-area-inset-top, 0px)); left: 10px; right: 10px; height: 52px; box-sizing: border-box;
  display: flex; align-items: center; gap: 8px; padding: 0 4px 0 16px; border-radius: 999px;
  background: var(--dc-glass); box-shadow: var(--dc-card);
}
@media (min-width: 701px) {
  .dc-bar { top: calc(16px + env(safe-area-inset-top, 0px)); left: calc(116px + env(safe-area-inset-left, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); height: 56px; }
}
@media (min-width: 1101px) { .dc-bar { top: 16px; left: 116px; right: 372px; } }
.dc-bar h2 {
  flex: 1; min-width: 0; margin: 0; display: flex; align-items: center; gap: 8px; outline: none;
  font-size: 16px; font-weight: 800; color: var(--dc-text); white-space: nowrap;
}
.dc-bar h2 svg { width: 20px; height: 20px; flex: none; }
.dc-bar h2 span { overflow: hidden; text-overflow: ellipsis; }
.dc-bar h2:focus-visible { outline: 3px solid var(--dc-text); outline-offset: 3px; border-radius: 8px; }
.dc-t-short { display: none; }
.dc-acorns { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 16px; font-weight: 800; }
.dc-acorns svg { width: 20px; height: 20px; }
.dc-acorns.dc-bump b { display: inline-block; animation: dc-bump .25s var(--ease, ease) 1; }
@media (min-width: 1101px) { .dc-acorns { display: none; } }
.btn.dc-done {
  flex: none; height: 48px; min-height: 48px; padding: 0 18px; margin: 0; border: 0; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px; background: var(--dc-ok); color: #fff; font: inherit; font-size: 16px; font-weight: 800;
  box-shadow: none; cursor: pointer;
}
.btn.dc-done svg { width: 18px; height: 18px; }
.btn.dc-done:focus-visible { outline: 3px solid var(--dc-text); outline-offset: 3px; }
html[data-theme="town"] .btn.dc-done { background: var(--dc-ok); color: #fff; box-shadow: none; }
@media (max-width: 400px) {
  .dc-t-long { display: none; } .dc-t-short { display: inline; }
  .dc-bar { gap: 6px; padding-left: 14px; } .dc-bar h2 { gap: 6px; } .btn.dc-done { padding: 0 14px; }
}

/* ---------- лоток (§5) ---------- */
.dc-tray {
  position: fixed; z-index: 30; left: calc(8px + env(safe-area-inset-left, 0px)); right: calc(8px + env(safe-area-inset-right, 0px));
  bottom: calc(8px + env(safe-area-inset-bottom, 0px)); height: 212px; box-sizing: border-box; padding: 12px 0;
  display: flex; flex-direction: column; gap: 8px; border-radius: 26px; background: var(--dc-glass); box-shadow: var(--dc-raised);
}
@media (min-width: 701px) {
  .dc-tray:not(.dc-in-aside) { left: calc(116px + (100% - 116px - 16px - 560px) / 2); right: auto; width: 560px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
.dc-tray.fresh:not(.dc-in-aside) { animation: dc-up .25s var(--ease, ease) both; }
.dc-tray.out { animation: dc-down .25s var(--ease, ease) both; pointer-events: none; }
.dc-tray-row { min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 12px; flex: none; }
.dc-hint { flex: 1; min-width: 0; margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; line-height: 1.25; color: var(--dc-text); }
.dc-hint svg { width: 18px; height: 18px; flex: none; }
.dc-actions { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.dc-act-art { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--dc-surface); box-shadow: var(--dc-edge); display: grid; place-items: center; }
.dc-act-art svg { width: 40px; height: 40px; }
.dc-act-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-act-btns { display: flex; gap: 8px; flex: none; }
.btn.ghost.dc-act {
  min-height: 48px; height: 48px; padding: 0 12px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; font: inherit; font-size: 14px; font-weight: 800; color: var(--dc-text); white-space: nowrap; flex: none;
}
html[data-theme="town"] .btn.ghost.dc-act { color: var(--dc-text); }
.btn.ghost.dc-act svg { width: 18px; height: 18px; flex: none; }
.dc-plusn { display: inline-flex; align-items: center; gap: 2px; color: var(--dc-ok); font-weight: 800; }
.dc-plusn svg { width: 14px; height: 14px; }
.btn.ghost.dc-act:focus-visible { outline: 3px solid var(--dc-text); outline-offset: 3px; }
@media (max-width: 400px) {
  .dc-act-art, .dc-act-name { display: none; }
  .dc-act-btns { flex: 1; }
  .dc-act-btns .dc-act { flex: 1; padding: 0 8px; min-width: 0; }
}

.dc-items {
  display: flex; gap: 8px; padding: 4px 12px 4px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none;
  flex: 1; min-height: 0; align-items: flex-start;
}
.dc-items::-webkit-scrollbar { display: none; }
.dc-items::after { content: ""; flex: none; width: 4px; }
.dc-item {
  position: relative; flex: none; width: 96px; height: 132px; box-sizing: border-box; padding: 8px 6px; margin: 0; border: 0; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; scroll-snap-align: start;
  background: var(--dc-surface); box-shadow: var(--dc-soft); color: var(--dc-text); font: inherit; cursor: pointer;
  transition: transform .12s; -webkit-tap-highlight-color: transparent;
}
.dc-item.dc-gap { margin-left: 8px; }
.dc-item-art { width: 56px; height: 56px; flex: none; display: grid; place-items: center; }
.dc-item-art svg { width: 56px; height: 56px; display: block; overflow: visible; }
.dc-item-name {
  font-size: 13px; font-weight: 800; line-height: 1.15; text-align: center; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 30px;
}
.dc-item-foot { margin-top: auto; min-height: 24px; display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 14px; font-weight: 800; line-height: 1.1; text-align: center; }
.dc-item-foot svg { width: 16px; height: 16px; flex: none; }
.dc-item.short .dc-item-foot { font-size: 13px; color: var(--dc-muted); }
.dc-item.short .dc-item-foot svg { width: 14px; height: 14px; }
.dc-item.short .dc-item-art, .dc-item.off .dc-item-art { opacity: .5; }
.dc-item.stage .dc-item-art, .dc-item.gift-locked .dc-item-art { filter: brightness(0); opacity: .18; }
.dc-item.stage .dc-item-foot, .dc-item.gift-locked .dc-item-foot, .dc-item.orphan .dc-item-foot { font-size: 11px; color: var(--dc-muted); }
.dc-item.gift-ok .dc-item-foot { font-size: 12px; color: var(--dc-ok); }
.dc-item.gift-ok .dc-item-foot svg { width: 14px; height: 14px; }
.dc-item.gift-placed .dc-item-art { opacity: .45; }
.dc-item.gift-placed .dc-item-foot { font-size: 12px; color: var(--dc-muted); }
.dc-item.gift-placed .dc-item-foot svg { width: 14px; height: 14px; }
.dc-item.off { opacity: .5; cursor: default; }
.dc-item-badge {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--dc-surface); box-shadow: var(--dc-edge);
}
.dc-item-badge.gift { left: 4px; right: auto; width: 22px; height: 22px; background: var(--dc-yellow); box-shadow: none; }
.dc-item-badge.gift svg { width: 14px; height: 14px; }
.dc-item-badge.orphan { width: 22px; height: 22px; }
.dc-item-badge.orphan svg { width: 16px; height: 16px; }
.dc-item-badge.who { width: 28px; height: 28px; }
.dc-item-badge.who svg { width: 30px; height: 38px; margin-top: 12px; }
.dc-item-badge.who svg.sf { width: 16px; height: 16px; margin: 0; }
.dc-item.armed { transform: translateY(-4px); box-shadow: var(--dc-soft), 0 0 0 3px var(--dc-text); }
.dc-item:focus-visible { outline: 3px solid var(--dc-text); outline-offset: 3px; }
.dc-item:not(.off):active { transform: translateY(1px); }

/* Права панель (≥ 1101, §5.6): тіло — «Прикраси», сітка 3 колонки */
.dc-tray.dc-in-aside { position: static; height: auto; padding: 0; background: none; box-shadow: none; border-radius: 0; gap: 10px; }
.dc-tray-title { margin: 4px 0 0; font-size: 15px; font-weight: 800; color: var(--dc-muted); }
.dc-in-aside .dc-tray-row { padding: 0; align-items: flex-start; }
.dc-in-aside .dc-actions { flex-wrap: wrap; }
.dc-in-aside .dc-act-btns { flex: 1 0 100%; flex-direction: column; }
.dc-in-aside .dc-act-btns .dc-act { width: 100%; }
.dc-in-aside .dc-items { display: grid; grid-template-columns: repeat(3, 96px); gap: 10px; padding: 4px 2px; overflow: visible; justify-content: space-between; }
.dc-in-aside .dc-items::after { display: none; }
.dc-in-aside .dc-item.dc-gap { margin-left: 0; }
html.dc-on .layout.tf .aside.tf-aside { height: calc(100dvh - var(--gap, 16px) * 2); }
html.dc-on .tf-aside-toggle { visibility: hidden; }

/* ---------- спливне «+n» (§6.6) і прихований живий рядок ---------- */
.dc-float {
  position: absolute; z-index: 7; width: 64px; height: 64px; display: flex; align-items: flex-start; justify-content: center; pointer-events: none;
  animation: dc-float .6s ease-out both;
}
.dc-float b {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 999px; background: #fffaf1;
  color: #2d6b46; font-size: 14px; font-weight: 800; box-shadow: inset 0 0 0 1.5px rgba(90, 60, 30, .14);
}
.dc-float svg { width: 16px; height: 16px; }
.dc-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes dc-up { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dc-down { from { transform: none; opacity: 1; } to { transform: translateY(100%); opacity: 0; } }
@keyframes dc-float { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-24px); opacity: 0; } }
@keyframes dc-bump { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .dc-tray.fresh:not(.dc-in-aside), .dc-tray.out, .dc-acorns.dc-bump b, .dc-fab.dc-bounce .dc-fab-c { animation: none; }
  .dc-tray.out, .dc-float { display: none; }
  .dc-item { transition: none; }
}
html.no-motion .dc-tray.fresh:not(.dc-in-aside), html.no-motion .dc-acorns.dc-bump b, html.no-motion .dc-fab.dc-bounce .dc-fab-c { animation: none; }
html.no-motion .dc-tray.out, html.no-motion .dc-float { display: none; }
html.no-motion .dc-item { transition: none; }
