@font-face { font-family: "Golos"; src: url(fonts/GolosText.ttf) format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Yanone"; src: url(fonts/YanoneKaffeesatz.ttf) format("truetype"); font-weight: 200 700; font-display: swap; }
:root { --paper: #efe6d6; --paper2: #e6dac4; --ink: #1f2a22; --spruce: #1d3b2f; --muted: #6e6a5e; --line: #d5c8ae; --red: #a8302a; --gold: #c4953a; --card: #fbf7ef; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: "Golos", system-ui, sans-serif; color: var(--ink); background: var(--paper); display: flex; flex-direction: column; font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
.top { display: flex; align-items: center; gap: 2rem; padding: .7rem 1.4rem; border-bottom: 1px solid var(--line); background: var(--paper); }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: .6rem; white-space: nowrap; }
.brand b { font-family: "Yanone"; font-weight: 700; font-size: 1.7rem; color: var(--red); letter-spacing: .01em; }
.brand span { font-family: "Yanone"; font-size: 1.45rem; font-weight: 400; color: var(--spruce); }
.kinds { display: flex; gap: .25rem; overflow-x: auto; }
.kinds button { display: flex; align-items: center; gap: .4rem; background: none; border: 1px solid transparent; border-radius: 999px; padding: .4rem .9rem .4rem .6rem; cursor: pointer; color: var(--spruce); white-space: nowrap; }
.kinds button:hover { border-color: var(--line); }
.kinds button.on { background: var(--spruce); color: var(--paper); }
.kinds svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.kinds svg path:first-child { fill: none; }
.work { flex: 1; display: grid; grid-template-columns: 390px 1fr; min-height: 0; }
.panel { border-right: 1px solid var(--line); overflow-y: auto; padding: 1rem 1.2rem 0; display: flex; flex-direction: column; background: var(--paper); }
.note { margin: 0 0 1rem; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.row { display: block; margin-bottom: 1rem; }
.lab { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; gap: .6rem; }
.lab output { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.lab b { font-weight: 500; color: var(--ink); font-size: .8rem; text-align: right; }
small { display: block; color: var(--muted); font-size: .78rem; margin-top: .25rem; }
input[type=range] { width: 100%; accent-color: var(--red); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chips button { border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: .32rem .7rem; cursor: pointer; font-size: .9rem; }
.chips button:hover { border-color: var(--spruce); }
.chips button.on { background: var(--spruce); border-color: var(--spruce); color: var(--paper); }
textarea, select, input[type=number] { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: .45rem .6rem; }
textarea { resize: vertical; font-size: 1.05rem; }
textarea:focus, select:focus, input:focus { outline: 2px solid var(--spruce); outline-offset: -1px; }
.upl { cursor: pointer; text-decoration: underline; } .upl input { display: none; }
.tog { display: flex; align-items: center; gap: .5rem; cursor: pointer; } .tog input { accent-color: var(--red); width: 18px; height: 18px; }
.seed { display: flex; gap: .4rem; } .seed input { width: 7rem; } .seed button { border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 0 .8rem; cursor: pointer; }
.pgt { display: flex; flex-wrap: wrap; gap: .15rem .7rem; margin-bottom: .45rem; }
.pgt button { background: none; border: 0; padding: .1rem 0; cursor: pointer; font-size: .8rem; color: var(--muted); border-bottom: 1px solid transparent; }
.pgt button.on { color: var(--ink); border-color: var(--red); }
.pal { display: flex; flex-wrap: wrap; gap: 6px; }
.spool { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); padding: 0; cursor: pointer; background: var(--c); position: relative; }
.spool i { position: absolute; inset: 9px; border-radius: 50%; background: var(--paper); opacity: .9; }
.spool.t-silk, .spool.t-dual, .spool.t-grad { box-shadow: inset -3px -4px 6px rgba(0,0,0,.25), inset 3px 3px 5px rgba(255,255,255,.45); }
.spool.t-galaxy, .spool.t-sparkle { background-image: radial-gradient(circle at 30% 30%, #fff 0 1px, transparent 1.5px), radial-gradient(circle at 70% 60%, #fff 0 1px, transparent 1.5px), var(--c); }
.spool.on { outline: 2px solid var(--red); outline-offset: 2px; }
.err { background: #f3d6cf; color: var(--red); padding: .5rem .7rem; border-radius: 6px; font-size: .9rem; }
.actions { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); margin: auto -1.2rem 0; padding: .8rem 1.2rem 1rem; }
.aux { display: flex; gap: 1rem; margin-bottom: .6rem; }
.aux button { background: none; border: 0; padding: 0; text-decoration: underline; color: var(--spruce); cursor: pointer; font-size: .9rem; }
.dl { display: flex; gap: .5rem; }
.dl button { border: 1px solid var(--spruce); background: var(--card); color: var(--spruce); border-radius: 6px; padding: .7rem 1rem; cursor: pointer; font-weight: 600; }
.dl .primary { flex: 1; background: var(--red); border-color: var(--red); color: #fff; font-size: 1.02rem; }
.dl .primary:hover { background: #8e2620; }
.tiny { font-size: .75rem; color: var(--muted); margin: .6rem 0 0; line-height: 1.35; }
.stage { position: relative; min-height: 0; background: radial-gradient(ellipse at 50% 38%, #fbf6ec 0%, #efe4d0 55%, #dccdb1 100%); overflow: hidden; }
#view { position: absolute; inset: 0; cursor: grab; } #view:active { cursor: grabbing; } #view canvas { display: block; width: 100%; height: 100%; }
.card { position: absolute; left: 1rem; bottom: 1rem; max-width: min(560px, calc(100% - 2rem)); background: rgba(251,247,239,.92); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; font-size: .84rem; backdrop-filter: blur(4px); }
.card table { border-collapse: collapse; width: 100%; } .card td { padding: .15rem .8rem .15rem 0; white-space: nowrap; } .card td:last-child { padding-right: 0; text-align: right; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .45rem; vertical-align: -1px; border: 1px solid rgba(0,0,0,.2); }
.how { margin: .5rem 0 0; padding: 0; list-style: none; color: var(--muted); line-height: 1.35; } .how li + li { margin-top: .2rem; } .how b { color: var(--ink); font-weight: 600; }
.warn { margin: .5rem 0 0; color: var(--red); line-height: 1.35; }
.order { position: absolute; right: 1rem; top: 1rem; color: var(--spruce); font-size: .88rem; text-decoration: none; border-bottom: 1px solid currentColor; }
@media (max-width: 860px) {
  body { height: auto; }
  .top { flex-direction: column; align-items: stretch; gap: .4rem; padding: .6rem .8rem; }
  .work { grid-template-columns: 1fr; }
  .stage { height: 58vh; order: -1; }
  .panel { border-right: 0; padding: 1rem .9rem 0; }
  .actions { margin: 0 -.9rem; padding: .7rem .9rem .9rem; }
  .card { position: static; max-width: none; margin: 0; border-radius: 0; border-width: 1px 0 0; }
  .stage { display: flex; flex-direction: column; } #view { position: relative; flex: 1; }
  .order { top: .6rem; right: .8rem; font-size: .8rem; }
}
.upbtn { display: inline-block; border: 1px dashed var(--spruce); border-radius: 6px; padding: .5rem .9rem; cursor: pointer; color: var(--spruce); background: var(--card); font-size: .9rem; }
.upbtn:hover { border-style: solid; } .upbtn input { display: none; }
.imgrow { display: flex; gap: .7rem; align-items: center; margin-bottom: .5rem; }
.imgrow img { width: 64px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.imgrow .tog { font-size: .85rem; margin-bottom: .3rem; }
.lnk { background: none; border: 0; padding: 0; text-decoration: underline; color: var(--red); cursor: pointer; font-size: .85rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: .35rem; }
.tiles button { display: flex; flex-direction: column; align-items: center; gap: .15rem; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: .4rem .2rem .35rem; cursor: pointer; font-size: .75rem; line-height: 1.1; color: var(--ink); }
.tiles button:hover { border-color: var(--spruce); }
.tiles button.on { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); background: #fff; }
.tiles svg { width: 34px; height: 36px; }
.tiles svg path { fill: var(--spruce); opacity: .85; } .tiles svg rect { fill: var(--gold); }
.tiles button.on svg path { fill: var(--red); opacity: 1; }

.modes { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--spruce); border-radius: 8px; overflow: hidden; margin-bottom: .8rem; }
.modes button { border: 0; background: var(--card); padding: .45rem; cursor: pointer; font-size: .9rem; color: var(--spruce); }
.modes button.on { background: var(--spruce); color: var(--paper); font-weight: 600; }
.more { display: block; width: 100%; margin: -.2rem 0 1rem; background: none; border: 1px dashed var(--line); border-radius: 6px; padding: .5rem; color: var(--spruce); cursor: pointer; font-size: .85rem; }
.more:hover { border-color: var(--spruce); }
.panel > * { flex-shrink: 0; } /* иначе переключатель режима сжимается в полоску, когда панель длинная */

.buy { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.price span, .qty span { display: block; font-size: .78rem; color: var(--muted); }
.price output { font-size: 1.6rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.price small { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }
.qty input { width: 5.5rem; text-align: center; font-size: 1.05rem; }
#order { width: 100%; background: var(--red); border: 1px solid var(--red); color: #fff; border-radius: 6px; padding: .8rem 1rem; cursor: pointer; font-weight: 700; font-size: 1.08rem; }
#order:hover { background: #8e2620; } #order:disabled { opacity: .7; cursor: progress; }
.done { position: absolute; right: 1rem; top: 3rem; width: min(360px, calc(100% - 2rem)); background: var(--card); border: 1px solid var(--spruce); border-radius: 10px; padding: 1rem 1.1rem; box-shadow: 0 10px 30px rgba(30,40,30,.18); z-index: 5; }
.done b { font-size: 1.05rem; color: var(--spruce); } .done p { margin: .4rem 0 .8rem; font-size: .9rem; line-height: 1.35; }
.done div { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.done a, .done button { border: 1px solid var(--spruce); background: var(--card); color: var(--spruce); border-radius: 6px; padding: .5rem .8rem; text-decoration: none; cursor: pointer; font-size: .9rem; }
.done a.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.order[hidden], .done[hidden] { display: none; }

.sect { margin: 0 0 .45rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; margin-bottom: 1rem; }
.cats button { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .2rem; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: .45rem .15rem .4rem; cursor: pointer; font-size: .7rem; line-height: 1.12; color: var(--ink); text-align: center; min-height: 4.1rem; }
.cats button:hover { border-color: var(--spruce); }
.cats button.on { background: var(--spruce); border-color: var(--spruce); color: var(--paper); }
.cats svg { width: 24px; height: 24px; flex: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; fill: none; }
@media (max-width: 860px) { .cats { grid-template-columns: repeat(4, 1fr); } .cats button { font-size: .68rem; } }
.note2 { margin: .5rem 0 0; color: var(--muted); line-height: 1.35; }
