:root {
  --bg: #FBF6EE;
  --card: #FFFFFF;
  --ink: #1F2A44;
  --muted: #6B7280;
  --line: #ECE4D6;
  --accent: #E4572E;
  --accent-ink: #FFFFFF;
  --sun: #F3B61F;
  --sky: #DCEBFA;
  --leaf: #E5F3E0;
  --radius: 18px;
  --shadow: 0 1px 0 rgba(31,42,68,.04), 0 8px 24px -12px rgba(31,42,68,.18);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent) url("icon-mark.svg") center/80% no-repeat; }
.bar-actions { display: flex; gap: 4px; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); text-decoration: none; }
.icon-btn:active { background: var(--line); }

main { max-width: 560px; margin: 0 auto; padding: 4px 16px 40px; outline: none; }
h1 { font-size: 27px; line-height: 1.15; margin: 10px 0 6px; letter-spacing: -.02em; }
h2 { font-size: 19px; margin: 0 0 8px; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
p { margin: 0 0 10px; }
.lead { color: var(--muted); margin-bottom: 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 14px; }
.card.tight { padding: 12px 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }

.setup { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.setup a { text-decoration: none; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: block; min-height: 86px; }
.setup .k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.setup .v { font-weight: 700; margin-top: 4px; }
.setup .todo .v { color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: #3FA34D; }
.todo .dot { background: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 800; font-size: 17px;
  background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; width: 100%;
  min-height: 52px; transition: transform .08s ease;
}
.btn:active { transform: scale(.98); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.small { min-height: 40px; padding: 8px 12px; font-size: 15px; border-radius: 12px; width: auto; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: grid; gap: 10px; }
.btns.two { grid-template-columns: 1fr 1fr; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 0; background: #F3EDE3; border-radius: 999px; padding: 9px 14px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chip.static { cursor: default; background: var(--sky); }
.chip.leaf { background: var(--leaf); }
.chip.has-img { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; }
.chip.has-img img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #fff; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; font-size: 16px;
}
.input:focus { outline: none; border-color: var(--ink); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* fotografije */
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.shot { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #eee; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot button { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-weight: 800; }
.add-shot { aspect-ratio: 1; border-radius: 12px; border: 2px dashed #CFC4B1; display: grid; place-items: center; text-align: center; font-weight: 700; color: var(--muted); cursor: pointer; padding: 6px; font-size: 14px; }
.tips { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.tips li + li { margin-top: 4px; }

/* inventar */
.inv-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.inv-row:last-child { border-bottom: 0; }
.inv-name { font-weight: 700; }
.inv-cols { font-size: 13px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: 0; background: #F3EDE3; font-size: 20px; font-weight: 800; }
.stepper output { min-width: 34px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* ideja */
.spark { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.spark .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; font-weight: 700; }
.spark h1 { color: #fff; margin: 4px 0 8px; }
.spark p { font-size: 19px; line-height: 1.4; margin: 0; }
.buildbox { text-align: center; }
.buildbox .art { background: linear-gradient(180deg, #FFFDF8, #F6EFE3); border-radius: 14px; padding: 12px; }
.buildbox .art { min-height: 120px; display: grid; place-items: center; }
.buildbox .art svg, .buildbox .art canvas { width: 100%; max-height: 260px; height: auto; display: block; margin: 0 auto; object-fit: contain; }
.buildbox .name { font-weight: 800; font-size: 18px; margin-top: 10px; }
.steps { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; margin-top: 10px; scroll-snap-type: x mandatory; }
.step { flex: 0 0 31%; scroll-snap-align: start; background: #FBF7F0; border-radius: 12px; padding: 6px; border: 0; cursor: pointer; }
.step-art { height: 80px; display: grid; place-items: center; }
.step svg, .step canvas { width: 100%; height: 80px; display: block; object-fit: contain; }
.step span { font-size: 12px; font-weight: 700; color: var(--muted); }
.step[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.say { border-left: 4px solid var(--sun); padding: 4px 0 4px 12px; font-size: 18px; font-weight: 700; }
ol.play { margin: 0; padding: 0; list-style: none; counter-reset: s; }
ol.play li { counter-increment: s; position: relative; padding: 6px 0 6px 40px; }
ol.play li::before { content: counter(s); position: absolute; left: 0; top: 4px; width: 28px; height: 28px; border-radius: 50%; background: var(--sun); color: var(--ink); font-weight: 800; display: grid; place-items: center; font-size: 15px; }
.next { background: var(--leaf); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--sun); color: var(--ink); vertical-align: 2px; }
.badge.demo { background: #FDE2D8; color: #9A2F12; }

/* zgodovina */
.world { display: block; text-decoration: none; }
.world .t { font-weight: 800; }
.world .s { color: var(--muted); font-size: 14px; }

/* nalaganje */
.loading { text-align: center; padding: 40px 10px; }
.bricks-loader { display: inline-flex; gap: 6px; margin-bottom: 14px; }
.bricks-loader i { width: 22px; height: 16px; border-radius: 4px; background: var(--accent); animation: hop .9s ease-in-out infinite; }
.bricks-loader i:nth-child(2) { background: var(--sun); animation-delay: .15s; }
.bricks-loader i:nth-child(3) { background: #1E6FC7; animation-delay: .3s; }
@keyframes hop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .bricks-loader i { animation: none; } }

#toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(120px); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 700; max-width: calc(100% - 32px); transition: transform .25s ease; z-index: 20; }
#toast.on { transform: translateX(-50%) translateY(0); }
.err { background: #FDECE7; color: #8A2A10; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; }
.sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.center { text-align: center; }
