@font-face { font-family: "Press Start 2P"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/press-start-2p-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Press Start 2P"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/press-start-2p-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }

/* Витрина. Цвета --bg, --ink, --accent* задаются для каждого сайта в конструкторе. */
:root {
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sky1: #6f9df2; --sky2: #b9d5ff;
  --stone: #6e6e74; --stone-hi: #8d8d94; --stone-lo: #48484d; --stone-dk: #2c2c30;
  --panel: #c6c6c6; --panel-hi: #ffffff; --panel-lo: #555555; --panel-ink: #2b2b2b; --panel-mute: #4a4a4a;
  --gold: #f2c33c; --red: #c23b30; --ok: #2c7a1f; --warn: #a86a00;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink); min-height: 100vh;
  font: 500 17px/1.45 var(--ui);
  background:
    linear-gradient(90deg, rgba(0,0,0,.08) 50%, transparent 50%) 0 0 / 32px 32px,
    linear-gradient(rgba(0,0,0,.08) 50%, transparent 50%) 0 0 / 32px 32px,
    var(--bg);
}
svg.pix { display: block; shape-rendering: crispEdges; image-rendering: pixelated; }
.ic { display: inline-block; vertical-align: middle; }
h1, h2, h3, .px { font-family: "Press Start 2P", monospace; font-weight: 400; }
a { color: var(--gold); }

.bevel { background: var(--panel); color: var(--panel-ink); box-shadow: inset 4px 4px 0 var(--panel-hi), inset -4px -4px 0 var(--panel-lo), 0 0 0 4px var(--stone-dk); }
.slot { background: #8b8b8b; box-shadow: inset 4px 4px 0 #373737, inset -4px -4px 0 #ffffff; }
.banner { background: #ffb648; color: #111; text-align: center; padding: 6px 16px; font-size: 15px; font-weight: 600; }

/* шапка */
.bar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; padding: 10px 16px; flex-wrap: wrap;
  background: var(--stone) linear-gradient(90deg, rgba(255,255,255,.06) 25%, transparent 25% 50%, rgba(0,0,0,.08) 50% 75%, transparent 75%) 0 0 / 24px 24px;
  border-bottom: 4px solid var(--stone-dk); box-shadow: inset 0 -4px 0 var(--stone-lo);
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.logo b { font: 16px/1 "Press Start 2P", monospace; letter-spacing: 1px; text-shadow: 3px 3px 0 #000; }
.logo-img { height: 36px; width: auto; image-rendering: pixelated; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs a { font-weight: 600; color: #e6e6e6; text-decoration: none; padding: 8px 12px; background: var(--stone-lo); box-shadow: inset 3px 3px 0 #5d5d63, inset -3px -3px 0 #2e2e33; }
.tabs a.on { color: var(--accent-ink); background: var(--accent); box-shadow: inset 3px 3px 0 var(--accent-hi), inset -3px -3px 0 var(--accent-lo); }
.cart-btn {
  margin-left: auto; position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px;
  font: inherit; font-weight: 700; color: #fff; cursor: pointer; padding: 6px 14px 6px 10px; border: 0;
  background: #a7824f; box-shadow: inset 3px 3px 0 #c9a46c, inset -3px -3px 0 #7a5c33, 0 0 0 3px var(--stone-dk); text-shadow: 2px 2px 0 rgba(0,0,0,.4);
}
.cart-btn .count { position: absolute; top: -10px; right: -10px; min-width: 24px; height: 24px; padding: 0 4px; display: grid; place-items: center; font: 10px/1 "Press Start 2P", monospace; background: var(--red); color: #fff; box-shadow: 0 0 0 3px var(--stone-dk); }
.cart-btn .count[data-n="0"] { display: none; }
.cart-btn.bump { animation: bump .45s steps(4); }
@keyframes bump { 30% { transform: translateY(-8px); } 60% { transform: translateY(2px); } }

/* небо, лежанка */
.hero { position: relative; overflow: hidden; background: linear-gradient(var(--sky1), var(--sky2)); padding: 40px 16px 0; }
.cloud { position: absolute; width: 16px; height: 16px; background: #fff; opacity: .9; box-shadow: 16px 0 0 #fff, 32px 0 0 #fff, 16px -16px 0 #fff, 48px 0 0 #fff; animation: drift 70s linear infinite; }
.cloud.c1 { top: 40px; }
.cloud.c2 { top: 84px; animation-duration: 95s; animation-delay: -45s; }
@keyframes drift { from { left: -80px; } to { left: 105%; } }
.hero-in { position: relative; max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
.hero h1 { margin: 0 0 14px; font-size: 26px; line-height: 1.35; color: #fff; text-shadow: 4px 4px 0 #2b3f6b; overflow-wrap: anywhere; }
.hero p { margin: 0 0 16px; font-size: 19px; font-weight: 600; color: #fff; text-shadow: 2px 2px 0 #2b3f6b; max-width: 480px; }
.ip { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; margin-bottom: 28px; padding: 8px 12px; cursor: pointer; border: 0; font: inherit; background: rgba(0,0,0,.45); color: #fff; box-shadow: inset 3px 3px 0 rgba(255,255,255,.15), inset -3px -3px 0 rgba(0,0,0,.35); }
.ip code { font: 13px/1 "Press Start 2P", monospace; color: var(--gold); }
.ip span { font-size: 15px; color: #dfe7ff; }
.bed-wrap { position: relative; width: 240px; height: 160px; margin-bottom: -4px; }
.pillow { position: absolute; left: 0; right: 0; bottom: 28px; height: 34px; background: #e8dcc4; box-shadow: inset 0 5px 0 #fff6e6, inset 0 -5px 0 #b9a888, inset 5px 0 0 #f3e9d6, inset -5px 0 0 #cbbb9b, 0 0 0 4px #3b120f; }
.bed { position: absolute; left: 12px; right: 12px; bottom: 0; height: 40px; background: #b8342c; box-shadow: inset 0 6px 0 #e4574b, inset 0 -6px 0 #7e211b, inset 6px 0 0 #cf4337, inset -6px 0 0 #8f2620, 0 0 0 4px #3b120f; }
.bed::after { content: ""; position: absolute; inset: 14px 18px 12px; background: repeating-linear-gradient(90deg, var(--gold) 0 8px, transparent 8px 24px); opacity: .55; }
.sleeper { position: absolute; left: 22px; bottom: 30px; transform-origin: 50% 100%; }
.sleeper.breath { animation: breath 2.4s steps(2) infinite; }
.sleeper.stir { animation: stir .6s steps(3); }
@keyframes breath { 50% { transform: scaleY(1.04); } }
@keyframes stir { 50% { transform: translateY(-3px) scaleY(1.05); } }
.zzz { position: absolute; left: 168px; bottom: 96px; pointer-events: none; }
.zzz i { position: absolute; font: 14px/1 "Press Start 2P", monospace; font-style: normal; color: #fff; text-shadow: 2px 2px 0 #2b3f6b; opacity: 0; animation: zz 3s steps(6) infinite; }
.zzz i:nth-child(2) { animation-delay: 1s; font-size: 18px; }
.zzz i:nth-child(3) { animation-delay: 2s; font-size: 22px; }
@keyframes zz { 0% { opacity: 0; transform: translate(0,0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(26px,-60px); } }
.bed-wrap.empty .sleeper, .bed-wrap.empty .zzz { visibility: hidden; }
.ground { height: 56px; margin: 0 -16px; background: linear-gradient(#7cc44a 0 6px, #5fa834 6px 18px, #3f7a22 18px 22px, transparent 22px), repeating-linear-gradient(90deg, #8a5a33 0 16px, #a46f43 16px 24px, #8a5a33 24px 40px, #6b4325 40px 48px); }

/* контент */
.wrap { max-width: 980px; margin: 0 auto; padding: 32px 16px 56px; display: grid; gap: 28px; }
.wrap.narrow { max-width: 620px; }
.panel { padding: 22px 24px 24px; }
.panel h2 { margin: 0 0 14px; font-size: 14px; line-height: 1.4; color: #3a3a3a; }
.panel .sub { margin: -4px 0 16px; color: var(--panel-mute); font-size: 16px; }
.err { margin: 0; padding: 12px 16px; background: #5c1712; color: #ffd9d5; box-shadow: inset 3px 3px 0 #7d2219, inset -3px -3px 0 #3d0e0a; }
.warn { margin: 0 0 12px; color: var(--warn); font-weight: 700; }
.muted { color: var(--ink); opacity: .7; }

.nick-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nick-row label { font-weight: 700; color: #3a3a3a; }
.field { flex: 1 1 220px; padding: 4px; }
.field input { width: 100%; border: 0; outline: 0; padding: 10px 12px; font: 600 20px/1.2 var(--ui); color: #fff; background: #000; caret-color: #fff; }
.field input::placeholder { color: #8a8a8a; }
.field:focus-within { box-shadow: inset 4px 4px 0 #373737, inset -4px -4px 0 #fff, 0 0 0 3px var(--gold); }
.field.bad { animation: shake .3s steps(4); box-shadow: inset 4px 4px 0 #373737, inset -4px -4px 0 #fff, 0 0 0 3px var(--red); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.nick-row .hint { width: 100%; font-size: 15px; color: var(--panel-mute); }

/* шкала количества */
.meow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; }
.coins { position: relative; width: 72px; height: 110px; }
.coins > div { position: absolute; }
.meow-num { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.meow-num small { font-weight: 700; font-size: 20px; color: var(--panel-mute); }
.num { width: 7.5ch; font: 22px/1 "Press Start 2P", monospace; color: var(--panel-ink); background: transparent; border: 0; padding: 4px 2px; border-bottom: 4px dashed #8b8b8b; outline: 0; -moz-appearance: textfield; appearance: textfield; }
.num::-webkit-outer-spin-button, .num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num:focus { border-bottom-color: var(--accent); }
.range { position: relative; margin: 18px 0 12px; height: 32px; }
.range .track { position: absolute; left: 0; right: 0; top: 10px; height: 12px; background: #3b3b3b; box-shadow: inset 2px 2px 0 #1c1c1c, inset -2px -2px 0 #6b6b6b; }
.range .fill { position: absolute; left: 0; top: 10px; height: 12px; width: var(--p, 0%); background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #d9a520 8px 12px); box-shadow: inset 0 3px 0 #ffe27a, inset 0 -3px 0 #b8861a; }
.range .rng { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.range .thumb { position: absolute; top: 0; left: calc(var(--p, 0%) - var(--t, 0px)); width: 28px; height: 32px; pointer-events: none; background: var(--stone-hi); box-shadow: inset 3px 3px 0 #c9c9cf, inset -3px -3px 0 var(--stone-lo), 0 0 0 3px var(--stone-dk); }
.range .rng:focus-visible ~ .thumb { box-shadow: inset 3px 3px 0 #c9c9cf, inset -3px -3px 0 var(--stone-lo), 0 0 0 3px var(--stone-dk), 0 0 0 7px var(--gold); }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chip { font: 700 16px/1 var(--ui); color: var(--panel-ink); min-height: 44px; min-width: 44px; padding: 8px 14px; border: 0; cursor: pointer; background: #dedede; box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #8b8b8b; }
.chip:hover { background: #ececec; }
.chip:active { box-shadow: inset 3px 3px 0 #8b8b8b, inset -3px -3px 0 #fff; }
.meow-buy { display: grid; gap: 10px; justify-items: end; text-align: right; }
.price { font: 20px/1.2 "Press Start 2P", monospace; color: var(--panel-ink); white-space: nowrap; }
.rate { font-size: 14px; color: var(--panel-mute); }

/* кнопки */
.btn {
  display: inline-block; font: 400 12px/1.3 "Press Start 2P", monospace; letter-spacing: .5px; text-transform: uppercase; color: var(--accent-ink); text-decoration: none; cursor: pointer;
  min-height: 44px; padding: 12px 20px; border: 0; background: var(--accent);
  box-shadow: inset 4px 4px 0 var(--accent-hi), inset -4px -4px 0 var(--accent-lo), 0 0 0 4px var(--stone-dk);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { box-shadow: inset 4px 4px 0 var(--accent-lo), inset -4px -4px 0 var(--accent-hi), 0 0 0 4px var(--stone-dk); transform: translateY(2px); }
.btn:focus-visible, .chip:focus-visible, .cart-btn:focus-visible, .ip:focus-visible, .tabs a:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; }
.btn[disabled] { filter: grayscale(.7) brightness(.85); cursor: default; }
.btn.wide { width: 100%; }

/* товары */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.item { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.item .ico { width: 84px; height: 84px; display: grid; place-items: center; margin-bottom: 6px; }
.item .ico .ic { transition: opacity .2s; }
.item.taken .ico .ic { opacity: .2; }
.item h3 { margin: 0; font-size: 14px; line-height: 1.4; color: var(--panel-ink); }
.item .desc { margin: 0; flex-grow: 1; color: var(--panel-mute); font-size: 16px; }
.item .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.item .cost { font: 15px/1 "Press Start 2P", monospace; color: var(--panel-ink); }
.item .btn { padding: 12px 14px; }
.tag { align-self: flex-start; font: 9px/1 "Press Start 2P", monospace; padding: 5px 7px; background: var(--red); color: #fff; box-shadow: 0 0 0 3px var(--stone-dk); }
.tag-gap { height: 19px; }

.foot { text-align: center; color: var(--ink); opacity: .75; font-size: 15px; padding: 0 16px 40px; }

/* корзина */
.cart-panel { position: fixed; top: 76px; right: 16px; z-index: 50; width: min(380px, calc(100vw - 32px)); padding: 18px; }
.cart-panel[hidden], .cart-back[hidden] { display: none; }
.cart-back { position: fixed; inset: 0; z-index: 48; background: rgba(0,0,0,.45); }
.cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cart-head h2 { margin: 0; font-size: 13px; color: #3a3a3a; }
.cart-empty { margin: 0 0 12px; color: var(--panel-mute); }
.cart-list, .order-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.cart-list li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 4px 4px 4px 10px; }
.order-list { max-height: none; }
.order-list li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.nm { color: #fff; font-weight: 600; flex-grow: 1; min-width: 0; overflow-wrap: anywhere; }
.pr { color: #ffe27a; font-weight: 700; white-space: nowrap; }
.rm { border: 0; background: none; color: #ffd0cb; font: 400 12px/1.3 "Press Start 2P", monospace; letter-spacing: .5px; text-transform: uppercase; cursor: pointer; min-width: 44px; min-height: 44px; }
.st { font-size: 14px; padding: 2px 8px; background: rgba(0,0,0,.35); color: #fff; white-space: nowrap; }
.st-paid { color: #ffe27a; }
.st-delivered { color: #a6f08f; }
.cart-total { display: flex; justify-content: space-between; font: 12px/1.4 "Press Start 2P", monospace; color: var(--panel-ink); margin-bottom: 14px; }

/* кот-курьер */
#catLayer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.walker { position: absolute; left: 0; top: 0; will-change: transform; }
.walker .body { position: relative; }
.walker .body.flip { transform: scaleX(-1); }
.walker .carry { position: absolute; left: 112px; top: 30px; }
.walker .bubble { position: absolute; left: 50px; top: -42px; font: 16px/1 "Press Start 2P", monospace; color: #2b2b2b; padding: 6px 8px; background: #fff; box-shadow: 0 0 0 3px #2b2b2b; animation: pop .25s steps(3); }
@keyframes pop { from { transform: scale(.4); } }
.drop { position: fixed; z-index: 61; pointer-events: none; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; max-width: calc(100vw - 32px); padding: 12px 16px; font-weight: 600; background: #1f1f23; color: #fff; box-shadow: inset 3px 3px 0 #3c3c44, inset -3px -3px 0 #0c0c0f, 0 0 0 3px #000; display: none; }
.toast.show { display: block; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .bar { gap: 8px 10px; padding: 8px 12px; }
  .logo b { font-size: 12px; }
  .logo-img { height: 30px; }
  .tabs { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 2px 3px 6px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; flex: 0 0 auto; font-size: 15px; padding: 9px 14px; }
  /* корзина — плавающая кнопка внизу экрана */
  .cart-btn { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 47; margin: 0; min-height: 52px; padding: 8px 16px 8px 12px; font-size: 16px; }
  .cart-btn .count { top: -12px; right: -8px; }
  .cart-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 88vh; max-height: 88dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: inset 4px 4px 0 var(--panel-hi), inset -4px -4px 0 var(--panel-lo), 0 -4px 0 var(--stone-dk); }
  .cart-list { max-height: none; overflow: visible; }
  body.cart-open { overflow: hidden; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

  .hero { padding: 22px 14px 0; }
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero h1 { font-size: 20px; margin-bottom: 10px; text-shadow: 3px 3px 0 #2b3f6b; }
  .hero p { font-size: 17px; margin-bottom: 12px; text-shadow: 1px 1px 0 #2b3f6b; }
  .ip { margin-bottom: 4px; width: 100%; justify-content: space-between; }
  .ip code { font-size: 12px; }
  .bed-wrap { justify-self: center; transform: scale(.82); transform-origin: 50% 100%; margin-top: -6px; margin-bottom: -4px; }
  .cloud.c2 { display: none; }
  .ground { height: 40px; }

  .wrap { padding: 18px 12px 100px; gap: 18px; }
  .panel { padding: 16px 14px 18px; }
  .panel h2 { font-size: 13px; }
  .nick-row { gap: 8px; }
  .nick-row label { width: 100%; }
  .field { flex-basis: 100%; }
  .field input { font-size: 18px; }

  .meow { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .coins { display: none; }
  .meow-buy { justify-items: stretch; text-align: left; gap: 8px; padding-top: 6px; border-top: 3px dashed #8b8b8b; }
  .meow-buy .btn { width: 100%; }
  .price { font-size: 18px; }
  .num { font-size: 20px; }
  .range { height: 44px; margin: 12px 0 8px; }
  .range .track, .range .fill { top: 16px; }
  .range .thumb { height: 40px; width: 30px; }
  .presets { gap: 8px; }
  .chip { flex: 1 1 0; min-width: 56px; padding: 8px 6px; }

  /* товары — строки: иконка слева, название и описание, снизу цена и кнопка */
  .grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .item { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr); grid-template-areas: "ico name" "ico desc" "row row"; column-gap: 14px; row-gap: 4px; padding: 14px; align-items: start; }
  .item .ico { grid-area: ico; width: 72px; height: 72px; margin: 0; }
  .item h3 { grid-area: name; font-size: 13px; align-self: end; padding-right: 54px; }
  .item .desc { grid-area: desc; font-size: 15px; line-height: 1.35; }
  .item .row { grid-area: row; margin-top: 10px; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 12px; }
  .item .cost { font-size: 15px; white-space: nowrap; }
  .item .btn { width: auto; flex: 1 1 auto; max-width: 170px; text-align: center; }
  .item .tag { position: absolute; top: 10px; right: 10px; }
  .item .tag-gap { display: none; }
  .cart-total { font-size: 11px; }
  .foot { padding-bottom: 80px; }
}
@media (max-width: 380px) {
  .logo b { font-size: 11px; }
  .item .btn { max-width: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  .cloud, .zzz i, .sleeper.breath { animation: none; }
  .zzz i:first-child { opacity: 1; }
}
