@font-face { font-family: 'Mountains of Christmas'; src: url(fonts/mountains-of-christmas-bold.woff2) format('woff2'); font-weight: 700; font-display: block; }
@font-face { font-family: 'Nunito'; src: url(fonts/nunito.woff2) format('woff2'); font-weight: 200 1000; font-display: block; }

:root {
  --cranberry: #9e2a2b; --cranberry-d: #7a1d1f; --pine: #2f5d3a; --pine-d: #1f4228;
  --cream: #f6ead2; --cream-2: #efe0c0; --honey: #d9a441; --honey-l: #f2c766; --cocoa: #3b2414; --cocoa-l: #5a3a22;
  --wall: #2a1a12;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--wall); color: var(--cocoa);
  font: 600 15px/1.3 Nunito, system-ui, sans-serif;
  overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 3px solid var(--honey-l); outline-offset: 2px; }
img { -webkit-user-drag: none; user-select: none; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 700; }
.screen { position: fixed; inset: 0; }
gh-feedback { font-family: Nunito, system-ui, sans-serif; }

/* Buttons */
.btn-big {
  background: linear-gradient(#b8383a, var(--cranberry)); color: #fff7e6; border: 3px solid var(--cocoa);
  border-radius: 16px; padding: 12px 26px; font-weight: 900; font-size: 19px; min-height: 52px;
  box-shadow: 0 4px 0 var(--cocoa), inset 0 2px 0 #ffffff40; text-shadow: 0 2px 0 #0004;
}
.btn-big:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cocoa); }
.btn-quiet {
  background: var(--cream); border: 2px solid var(--cocoa); border-radius: 14px; padding: 10px 20px;
  font-weight: 800; min-height: 46px; box-shadow: 0 3px 0 var(--cocoa);
}
.btn-quiet:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cocoa); }
.btn-quiet.danger { color: var(--cranberry-d); }
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--cream); color: var(--cocoa);
  border: 2px solid var(--cocoa); display: grid; place-items: center; padding: 0; flex: none;
  box-shadow: 0 2px 0 #0006;
}
.round-btn svg { width: 22px; height: 22px; }

/* Title */
#title { transition: opacity .45s; background: #0d1830; }
#title.loading { opacity: 0; }
#title { display: flex; flex-direction: column; align-items: center; justify-content: space-between; overflow: hidden; }
.title-art { position: absolute; inset: 0; background: #0d1830 url(assets/bg/title-art.webp) center / cover no-repeat; }
@media (orientation: portrait) { .title-art { background-image: url(assets/bg/title-art-phone.webp); } }
.title-text { position: relative; text-align: center; padding: calc(4vh + var(--sat)) 16px 0; }
.title-text h1 {
  font: 700 clamp(46px, 9vmin, 104px)/1 'Mountains of Christmas', serif; color: #ffe9b0;
  text-shadow: 0 3px 0 var(--cranberry-d), 0 6px 0 #0007, 0 0 30px #ffcf6a66; text-wrap: balance;
}
.subtitle { margin: 6px 0 0; color: #fff3da; font-weight: 800; font-size: clamp(16px, 2.6vmin, 22px); text-shadow: 0 2px 4px #000c; }
.title-buttons { position: relative; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 0 16px calc(6vh + var(--sab)); }
.title-buttons .btn-big { min-width: 240px; font-size: 22px; }
.title-buttons .btn-quiet { min-width: 180px; }
.title-link { position: absolute; bottom: calc(10px + var(--sab)); font: 800 14px Nunito, sans-serif; color: #5a4a3acc; text-decoration: none; padding: 6px 8px; z-index: 1; }
.title-link:hover { color: var(--cranberry); text-decoration: underline; }
.title-link.left { left: calc(10px + var(--sal)); }
.title-link.right { right: calc(10px + var(--sar)); }
@media (max-width: 500px) { .title-link { font-size: 12px; bottom: calc(4px + var(--sab)); } }

/* How to play */
#howto { background: var(--wall) url(assets/bg/workshop-bg.webp) center / cover; display: grid; place-items: center; overflow: auto; padding: calc(12px + var(--sat)) 12px calc(12px + var(--sab)); }
.howto-box { background: var(--cream); border: 3px solid var(--cocoa); border-radius: 22px; padding: 18px; max-width: 900px; width: 100%; text-align: center; box-shadow: 0 8px 30px #000a; }
.howto-box h2 { font: 700 34px/1 'Mountains of Christmas', serif; color: var(--cranberry); margin-bottom: 12px; }
.howto-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.howto-card { margin: 0; background: #fff8ea; border: 2px solid var(--cocoa-l); border-radius: 14px; padding: 10px; }
.howto-card figcaption { font-size: 15px; text-wrap: balance; }
.howto-pic { position: relative; height: 120px; margin-bottom: 8px; border-radius: 10px; background: radial-gradient(circle at 50% 60%, #f2d79b, #e8c98a 70%); overflow: hidden; }
.howto-pic img { position: absolute; }
.hp-pip { height: 118%; left: 4%; bottom: -16%; }
.hp-toy { height: 52%; right: 12%; bottom: 10%; }
.hp-cookie { height: 46%; left: 8%; top: 12%; }
.hp-elf { height: 92%; left: 34%; bottom: 0; }
.hp-ham { height: 56%; right: 6%; bottom: 10%; transform: rotate(25deg); }
.hp-cheer { height: 50%; left: 12%; top: 22%; }
.hp-santa { height: 100%; right: 8%; bottom: 0; }
.howto-keys { font-size: 14px; color: var(--cocoa-l); margin: 12px 0; }
#btn-howto-back { margin-top: 14px; }
@media (max-width: 640px) {
  .howto-cards { grid-template-columns: 1fr; }
  .howto-card { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; text-align: left; }
  .howto-pic { height: 84px; margin: 0; }
  .hp-pip { height: 114%; left: -6%; bottom: -14%; }
  .hp-toy { height: 48%; right: 4%; bottom: 8%; }
  .hp-elf { left: 40%; }
  .hp-ham { right: 2%; }
  .howto-box h2 { font-size: 30px; }
}
@media (pointer: coarse) { .howto-keys { display: none; } }

/* The workshop */
#game {
  display: grid; background: var(--cream-2);
  padding: var(--sat) var(--sar) 0 var(--sal);
  grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "stage" "panel" "tabs";
}
.topbar { grid-area: top; background: linear-gradient(#4a2d1a, #3b2414); color: #fff3da; padding: 6px 10px 8px; border-bottom: 3px solid var(--honey); }
.rank-row { display: flex; align-items: center; gap: 8px; }
.rank-title { flex: 1; min-width: 0; font: 700 26px/1.05 'Mountains of Christmas', serif; color: #ffe7a8; text-shadow: 0 2px 0 #0008; white-space: nowrap; overflow: hidden; }
.top-buttons { display: flex; gap: 8px; }
.stat-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-weight: 900; }
.ico { width: 28px; height: 28px; flex: none; }
.cookies { display: flex; align-items: center; gap: 4px; font-size: 18px; min-width: 76px; font-variant-numeric: tabular-nums; }
.cheer-bar { flex: 1; display: flex; align-items: center; gap: 4px; position: relative; min-width: 0; }
.cheer-ico { width: 26px; height: 26px; }
.cheer-track { flex: 1; height: 16px; border-radius: 9px; background: #1d120a; border: 2px solid #c9a35a; overflow: hidden; }
.cheer-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #3e7d4b, #6aa358 60%, var(--honey-l)); transition: width .25s; }
.cheer-label { position: absolute; left: 34px; right: 4px; text-align: center; font-size: 11px; line-height: 16px; top: 50%; transform: translateY(-50%); color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; overflow: hidden; pointer-events: none; }
.cheer-bar.top .cheer-fill { background: linear-gradient(90deg, var(--honey), var(--honey-l)); }
.rates { font-size: 13px; opacity: .92; white-space: nowrap; font-variant-numeric: tabular-nums; }

.stage-col { grid-area: stage; display: flex; justify-content: center; align-items: center; background: var(--wall); min-height: 0; min-width: 0; }
.stage-wrap { width: 100%; display: flex; flex-direction: column; }
.stage { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #2a1a12; cursor: pointer; touch-action: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.toy-strip { background: var(--cream); border-top: 2px solid var(--honey); display: flex; align-items: center; gap: 10px; padding: 4px 10px 6px; }
.toy-name { font: 700 20px/1 'Mountains of Christmas', serif; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.work-bar { flex: 1; height: 16px; border: 2px solid var(--cocoa); border-radius: 9px; background: #fff; overflow: hidden; min-width: 80px; }
.work-fill { height: 100%; width: 0; background: repeating-linear-gradient(-45deg, #c8302f 0 8px, #fff 8px 14px); border-right: 2px solid #c8302f; }
.work-bar.gold { border-color: #a8771a; box-shadow: 0 0 10px #f2c766; animation: goldpulse 1s infinite alternate; }
.work-bar.gold .work-fill { background: repeating-linear-gradient(-45deg, #e3a72a 0 8px, #fff2c4 8px 14px); border-right-color: #e3a72a; }
@keyframes goldpulse { to { box-shadow: 0 0 18px #ffd36a; } }

.banner {
  position: absolute; left: 50%; top: 3%; transform: translateX(-50%); max-width: 92%;
  background: var(--cream); border: 2px solid var(--cocoa); border-radius: 14px; padding: 5px 14px;
  font-weight: 900; font-size: clamp(12px, 2.6cqw, 18px); text-align: center; box-shadow: 0 3px 0 #0006; pointer-events: none; text-wrap: balance;
}
.banner.gold { background: linear-gradient(#fff2c4, #f2c766); }
.stage { container-type: inline-size; }
.tap-hint { position: absolute; left: 50%; top: 31%; display: flex; align-items: center; gap: 4px; pointer-events: none; animation: bob .9s ease-in-out infinite; }
.tap-hint span { background: var(--cream); border: 2px solid var(--cocoa); border-radius: 14px; padding: 4px 12px; font-weight: 900; font-size: clamp(13px, 3cqw, 18px); box-shadow: 0 3px 0 #0006; white-space: nowrap; }
.tap-hint .hand { width: clamp(28px, 7cqw, 44px); height: clamp(28px, 7cqw, 44px); transform: rotate(180deg); filter: drop-shadow(0 2px 0 #0006); }
@keyframes bob { 50% { transform: translateY(8px); } }
.rush-ring { position: absolute; right: 2%; top: 3%; width: clamp(40px, 9cqw, 60px); height: clamp(40px, 9cqw, 60px); pointer-events: none; }
.rush-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rr-bg { fill: #3b2414cc; stroke: #0005; stroke-width: 5; }
.rr-fg { fill: none; stroke: #ffd65a; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 100.5; }
.rush-ring span { position: absolute; inset: 0; display: grid; place-items: center; color: #ffe58a; font-weight: 1000; font-size: clamp(12px, 2.6cqw, 17px); }

/* Shelf and shop */
.shelf, .shop { grid-area: panel; overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 8px; background: var(--cream-2); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; align-content: start; }
.toy-card {
  position: relative; background: var(--cream); border: 2px solid var(--cocoa); border-radius: 12px; padding: 6px 6px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 3px; height: 150px; box-shadow: 0 2px 0 #0003;
}
.toy-card img.toy { width: 72px; height: 72px; object-fit: contain; }
.toy-card .tname { font-size: 12px; font-weight: 800; line-height: 1.1; text-align: center; min-height: 2.2em; display: flex; align-items: center; justify-content: center; text-wrap: balance; }
.toy-card .tprog { width: 86%; height: 5px; background: #0002; border-radius: 3px; overflow: hidden; }
.toy-card .tprog i { display: block; height: 100%; width: 0; background: #c8302f; }
.toy-card .plate { background: linear-gradient(#e9c46a, #b98a2c); border: 1.5px solid #6d4a12; border-radius: 6px; padding: 1px 8px; font: 800 13px/1.3 Nunito; letter-spacing: 1px; color: #3b2414; font-variant-numeric: tabular-nums; }
.toy-card .plate.gold { background: linear-gradient(#fff2b0, #f2c33e); box-shadow: 0 0 8px #ffd65a; }
.toy-card.sel { border-color: var(--pine); box-shadow: 0 0 0 3px var(--pine), 0 2px 0 #0003; }
.toy-card .key { position: absolute; left: 6px; top: 4px; font-size: 11px; font-weight: 900; color: #3b241480; }
.toy-card.locked img.toy { filter: brightness(0) opacity(.18); }
.toy-card.locked .lock { position: absolute; width: 44px; height: 44px; top: 20px; left: 50%; margin-left: -22px; }
.toy-card .lock { display: none; }
.toy-card.locked .lock { display: block; }
.toy-card.locked .tname { color: #3b241499; }
.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-5px) rotate(-3deg); } 40% { transform: translateX(5px) rotate(3deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

.shop-sec h3 { font: 700 24px/1.1 'Mountains of Christmas', serif; margin: 4px 2px 6px; color: var(--cocoa); }
.shop-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.item {
  position: relative; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; text-align: left;
  background: var(--cream); border: 2px solid var(--cocoa); border-radius: 12px; padding: 6px 8px; min-height: 68px; box-shadow: 0 2px 0 #0003; width: 100%;
}
.item::after { content: ''; position: absolute; right: -2px; top: -2px; width: 18px; height: 18px; background: linear-gradient(225deg, var(--cranberry) 50%, transparent 50%); border-top-right-radius: 11px; }
.item img { width: 56px; height: 56px; object-fit: contain; }
.item .iname { font-weight: 900; font-size: 15px; line-height: 1.15; display: block; }
.item .ieff { font-size: 12.5px; color: var(--cocoa-l); display: block; line-height: 1.2; text-wrap: balance; }
.item .iname { text-wrap: balance; }
.item .price {
  display: flex; align-items: center; gap: 4px; justify-content: center; min-width: 74px; padding: 6px 8px; border-radius: 10px;
  background: linear-gradient(#7a4c2a, #5a3a22); color: #fff3da; font-weight: 900; border: 2px solid var(--cocoa); font-variant-numeric: tabular-nums;
}
.item .price img { width: 18px; height: 18px; }
.item .price svg { width: 20px; height: 20px; }
.item.cant .price { background: linear-gradient(#b9a68b, #9c8a70); color: #fff8; }
.item.ok .price { background: linear-gradient(#3e7d4b, var(--pine)); }
.item.owned .price { background: var(--cream-2); color: var(--pine); }
.item.locked { opacity: .65; }
.item.locked img { filter: brightness(0) opacity(.25); }
.item.locked .price { background: #cdbd9f; color: #5a3a22; font-size: 13px; }
.item.flash { animation: flash .45s; }
@keyframes flash { 0% { background: #fff6b0; transform: scale(1.03); } }
.item.glow, .tabbar button.glow { box-shadow: 0 0 0 3px var(--honey-l), 0 0 16px 4px #ffd65a; animation: glowp 1s infinite alternate; }
@keyframes glowp { to { box-shadow: 0 0 0 3px var(--honey-l), 0 0 6px 1px #ffd65a; } }
.item .callout { position: absolute; right: 26px; top: -12px; z-index: 1; background: var(--honey-l); border: 2px solid var(--cocoa); border-radius: 10px; font-size: 12px; font-weight: 900; padding: 1px 8px; white-space: nowrap; }
.item.best { border-color: #a8771a; box-shadow: 0 0 0 2px var(--honey-l), 0 2px 0 #0003; }
.item .tag { font-size: 11px; font-weight: 900; color: var(--pine); }

.tabbar { grid-area: tabs; display: flex; background: #3b2414; padding: 0 var(--sar) var(--sab) var(--sal); gap: 2px; }
.tabbar button { flex: 1; min-height: 64px; background: #5a3a22; color: #f6ead2; border: 0; border-top: 3px solid transparent; font-weight: 900; font-size: 15px; position: relative; }
.tabbar button.on { background: var(--cream-2); color: var(--cocoa); border-top-color: var(--cranberry); }
.tabbar button.dot::after { content: ''; position: absolute; top: 10px; right: 14%; width: 11px; height: 11px; border-radius: 50%; background: #e0393a; border: 2px solid #fff; }

/* Portrait phones: one panel at a time */
#game:not([data-tab="toys"]) .shelf { display: none; }
#game[data-tab="toys"] .shop { display: none; }
#game[data-tab="hammers"] .shop-sec:not([data-sec="hammers"]),
#game[data-tab="helpers"] .shop-sec:not([data-sec="helpers"]),
#game[data-tab="upgrades"] .shop-sec:not([data-sec="upgrades"]) { display: none; }
@media (max-width: 899px) {
  .shop-sec h3 { display: none; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}
@media (max-width: 380px) {
  .rank-title { font-size: 22px; }
  .stat-row { gap: 6px; }
  .rates { font-size: 12px; }
  .cookies { min-width: 64px; font-size: 16px; }
  .toy-card { height: 140px; }
  .toy-card img.toy { width: 62px; height: 62px; }
}

/* Desktop: three columns */
@media (min-width: 900px) and (min-height: 501px) {
  #game { grid-template-columns: minmax(230px, 270px) minmax(0, 1fr) minmax(290px, 340px); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top top" "shelf stage shop"; }
  .topbar .rank-row { display: contents; }
  .topbar { display: flex; align-items: center; gap: 16px; padding: 8px 14px; }
  .rank-title { flex: 0 1 auto; font-size: 30px; max-width: 34%; }
  .stat-row { flex: 1; margin: 0; }
  .top-buttons { order: 3; }
  .shelf { grid-area: shelf; display: grid !important; grid-template-columns: 1fr 1fr; border-right: 3px solid var(--cocoa); }
  .toy-card { height: 134px; }
  .toy-card img.toy { width: 64px; height: 64px; }
  .shop { grid-area: shop; display: block !important; border-left: 3px solid var(--cocoa); }
  .shop-sec { display: block !important; }
  .tabbar { display: none; }
  .stage-col { padding: 16px; }
  .stage-wrap { border: 3px solid var(--honey); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px #000a; }
}

/* Short landscape phones: stage left, column right */
@media (orientation: landscape) and (max-height: 500px), (orientation: landscape) and (max-width: 899px) {
  #game {
    grid-template-columns: var(--stage-w, 60vw) minmax(240px, 1fr); grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "stage top" "stage tabs" "stage panel"; padding-bottom: var(--sab);
  }
  .stage-col { align-items: center; }
  .topbar { padding: 4px 8px 5px; }
  .rank-title { font-size: 18px; white-space: normal; line-height: 1; text-wrap: balance; }
  .top-buttons .round-btn { width: 34px; height: 34px; }
  .top-buttons .round-btn svg { width: 19px; height: 19px; }
  .stat-row { flex-wrap: wrap; gap: 2px 8px; margin-top: 2px; }
  .cookies { font-size: 15px; min-width: 0; }
  .ico { width: 22px; height: 22px; }
  .cheer-bar { flex-basis: 100%; order: 3; }
  .rates { font-size: 12px; }
  .tabbar { padding: 0; }
  .tabbar button { min-height: 48px; font-size: 12.5px; padding: 0 4px; }
  .tabbar button.dot::after { top: 3px; right: 3px; width: 8px; height: 8px; border-width: 1.5px; }
  .toy-strip { height: 28px; padding: 2px 8px; }
  .toy-name { font-size: 16px; }
  .work-bar { height: 12px; }
  .shop-sec h3 { display: none; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .toy-card { height: 132px; }
  .toy-card img.toy { width: 56px; height: 56px; }
  .item { min-height: 58px; grid-template-columns: 38px 1fr auto; gap: 6px; padding: 5px 6px; }
  .item img { width: 38px; height: 38px; }
  .item .price { min-width: 52px; padding: 5px 6px; font-size: 13px; }
  .item .iname { font-size: 13.5px; }
  .item .ieff { font-size: 11.5px; }
  .item .callout { font-size: 11px; right: 18px; }
  body > .toasts { left: calc(var(--sal) + var(--stage-w, 60vw) / 2); top: calc(var(--sat) + 18px); max-width: calc(var(--stage-w, 60vw) - 20px); }
}

/* Toasts */
.toasts { position: fixed; left: 50%; top: calc(var(--sat) + 96px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 30; pointer-events: none; width: max-content; max-width: 90vw; }
.toast { background: var(--cream); border: 2px solid var(--cocoa); border-radius: 12px; padding: 6px 14px; font-weight: 900; box-shadow: 0 4px 0 #0006; text-align: center; animation: toastin .25s ease-out; }
.toast.out { opacity: 0; transition: opacity .4s; }
@keyframes toastin { from { transform: translateY(-10px); opacity: 0; } }

/* Overlays and cards */
.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #1a0f0acc; padding: calc(10px + var(--sat)) 12px calc(10px + var(--sab)); overflow: auto; }
.card {
  position: relative; background: var(--cream); border: 3px solid var(--cocoa); border-radius: 20px; width: min(460px, 100%);
  padding: 20px 20px 18px; text-align: center; box-shadow: 0 10px 40px #000c; animation: cardin .35s cubic-bezier(.2,1.4,.5,1);
}
@keyframes cardin { from { transform: translateY(40px) scale(.9); opacity: 0; } }
.ribbon { position: absolute; right: -3px; top: -3px; width: 54px; height: 54px; background: linear-gradient(225deg, var(--cranberry) 50%, transparent 50%); border-top-right-radius: 18px; pointer-events: none; }
.card h2 { font: 700 32px/1.05 'Mountains of Christmas', serif; color: var(--cranberry); text-wrap: balance; }
.card .say { display: flex; gap: 12px; align-items: center; text-align: left; margin-bottom: 10px; }
.card .say img { width: 96px; height: 96px; flex: none; }
.card .say p { margin: 0; background: #fff; border: 2px solid var(--cocoa-l); border-radius: 14px; padding: 8px 12px; font-weight: 800; position: relative; }
.card .newtitle { font: 700 38px/1 'Mountains of Christmas', serif; color: var(--pine); margin: 6px 0 10px; text-wrap: balance; }
.card .unlocks { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.card .unlocks figure { margin: 0; width: 90px; font-size: 12.5px; font-weight: 800; line-height: 1.15; }
.card .unlocks img { width: 64px; height: 64px; object-fit: contain; display: block; margin: 0 auto 2px; }
.card .now { font-weight: 900; margin: 4px 0 14px; }
.card-btn { min-width: 220px; }
.card-btn.guard { opacity: .55; }
.card .away-toy { width: 110px; height: 110px; }
.card p { text-wrap: pretty; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pause-card h2 { margin-bottom: 12px; }
.settings { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.toggle { min-width: 130px; min-height: 46px; border-radius: 12px; border: 2px solid var(--cocoa); background: var(--pine); color: #fff; font-weight: 900; }
.toggle[aria-pressed="false"] { background: #cdbd9f; color: var(--cocoa); }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; text-align: left; margin: 0 auto 14px; max-width: 300px; font-size: 14px; }
.stats dt { color: var(--cocoa-l); } .stats dd { margin: 0; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }
.pause-buttons { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.pause-buttons button { min-width: 230px; }
.keys-note { font-size: 12.5px; color: var(--cocoa-l); margin: 12px 0 0; }
@media (pointer: coarse) { .keys-note { display: none; } }
.credits { position: absolute; inset: 0; background: var(--cream); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; justify-content: center; gap: 4px; font-size: 14.5px; }
.credits p { margin: 0 0 8px; }
.credits h2 { margin-bottom: 10px; }
.credits button { align-self: center; }

/* Christmas Eve */
.eve { background: transparent; pointer-events: auto; }
.eve .card { pointer-events: auto; }
.eve-card .stats { margin-top: 10px; }
.eve-card .credit-line { font-size: 13px; color: var(--cocoa-l); }

/* Short landscape phones: compact cards that fit */
@media (orientation: landscape) and (max-height: 500px), (orientation: landscape) and (max-width: 899px) {
  .overlay { padding: 6px 12px; }
  .card { width: min(640px, 100%); padding: 10px 16px 10px; }
  .card h2 { font-size: 22px; }
  .card .say { margin-bottom: 4px; }
  .card .say img { width: 60px; height: 60px; }
  .card .say p { padding: 5px 10px; font-size: 13.5px; }
  .card .newtitle { font-size: 26px; margin: 2px 0 4px; }
  .card .unlocks { margin: 2px 0 4px; gap: 6px; }
  .card .unlocks figure { width: 76px; font-size: 11.5px; }
  .card .unlocks img { width: 40px; height: 40px; }
  .card .now { margin: 2px 0 6px; }
  .card .away-toy { width: 64px; height: 64px; }
  .card p { margin: 4px 0; }
  .btn-big { min-height: 44px; padding: 8px 22px; font-size: 17px; }
  .pause-card h2 { margin-bottom: 6px; }
  .settings { margin-bottom: 6px; }
  .stats { font-size: 12.5px; margin-bottom: 6px; }
  .pause-buttons { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .pause-buttons button { min-width: 0; }
  .eve-card .stats { margin-top: 4px; }
}

/* Christmas Eve: everything but the stage steps back */
#game .topbar, #game .shelf, #game .shop, #game .tabbar, #game .toy-strip { transition: filter .8s; }
#game.eve-on .topbar, #game.eve-on .shelf, #game.eve-on .shop, #game.eve-on .tabbar, #game.eve-on .toy-strip { filter: brightness(.3) saturate(.6); pointer-events: none; }
#game.eve-on .stage-col { background: #0b0a14; }
.card .say p, .card p { text-wrap: pretty; }
.pause-note { margin: -6px 0 10px; font-size: 13px; color: var(--cocoa-l); }
