/* Diamond Art by Number v2 — tavern-craft kids' art styling. */
:root {
  --void: #030206; --gold: #c4902a; --gold-lt: #e6b040; --gold-dim: #8a6018;
  --parch: #d0bc98; --mist: #9a8fb5; --panel: #120d20;
  --ff-title: 'Cinzel Decorative', serif; --ff-head: 'Cinzel', serif; --ff-body: 'IM Fell English', Georgia, serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--void); color: var(--parch); font-family: var(--ff-body); font-size: 1.05rem; line-height: 1.6; min-height: 100vh; overflow-x: hidden; }

.ka-head {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0.7rem 1rem; background: rgba(3,2,6,0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(196,144,42,0.3);
}
.ka-brand { font-family: var(--ff-title); color: var(--gold-lt); text-decoration: none; font-size: 1rem; }
.ka-nav { display: flex; gap: 8px; }
.ka-nav a {
  color: var(--parch); text-decoration: none; font-family: var(--ff-head); font-weight: 700; font-size: 0.8rem;
  border: 1px solid rgba(196,144,42,0.45); border-radius: 8px; padding: 8px 12px; background: rgba(196,144,42,0.08);
}
.ka-nav a:hover { background: rgba(196,144,42,0.22); }

.da-main { max-width: 1060px; margin: 0 auto; padding: 18px 14px 30px; }
.ka-title { font-family: var(--ff-title); color: var(--gold-lt); font-size: clamp(1.7rem, 6vw, 2.5rem); text-align: center; margin: 8px 0 4px; }
.ka-howto { text-align: center; font-style: italic; color: var(--mist); max-width: 580px; margin: 0 auto 18px; }
.ka-h2 { font-family: var(--ff-head); color: var(--gold-lt); font-size: 1.05rem; letter-spacing: 0.05em; margin: 20px 0 10px; }
.da-cur-title { color: var(--parch); }
.ka-note { text-align: center; color: var(--mist); font-style: italic; margin-top: 22px; font-size: 0.95rem; }
.ka-foot { border-top: 1px solid rgba(196,144,42,0.25); text-align: center; padding: 18px 12px 26px; color: var(--mist); }
.ka-foot a { color: var(--gold-lt); }
.ka-foot-small { font-size: 0.85rem; margin-top: 6px; }

.ka-btn {
  min-height: 48px; padding: 10px 18px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--gold-dim); background: rgba(196,144,42,0.1); color: #e8d9b8;
  font-family: var(--ff-head); font-weight: 700; font-size: 0.92rem;
}
.ka-btn:hover { background: rgba(196,144,42,0.24); }
.ka-btn-main { background: linear-gradient(160deg, #e6b040, #c4902a); color: #241703; border-color: var(--gold-lt); }
.ka-btn:focus-visible, .ka-nav a:focus-visible, .da-pick:focus-visible, .da-color:focus-visible, .ka-zbtn:focus-visible {
  outline: 3px solid #ffd454; outline-offset: 2px;
}

/* picture picker — real art thumbnails */
.da-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.da-pick {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 8px 12px; border-radius: 12px; cursor: pointer; min-height: 92px;
  background: var(--panel); border: 2px solid rgba(196,144,42,0.35); color: var(--parch);
  font-family: var(--ff-body);
}
.da-pick:hover { border-color: var(--gold); }
.da-pick.active { border-color: var(--gold-lt); background: #1d1533; box-shadow: 0 0 0 3px rgba(230,176,64,0.25); }
.da-pick-img { width: 100%; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(196,144,42,0.35); }
.da-pick-name { font-family: var(--ff-head); font-weight: 700; font-size: 0.9rem; text-align: center; }
.da-pick-prog { font-size: 0.82rem; color: var(--mist); font-style: italic; }

/* zoom viewport + world — v3: the board sits in a kit tray: linen-weave
   canvas surround with a poured-glue sheen and a tray lip shadow */
.ka-viewport {
  position: relative; width: min(100%, 92vh); margin: 0 auto; aspect-ratio: 1 / 1;
  overflow: hidden; border-radius: 14px; border: 2px solid rgba(196,144,42,0.5);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,244,214,0.10), rgba(255,244,214,0) 55%),
    repeating-linear-gradient(0deg, rgba(240,228,196,0.05) 0 2px, rgba(0,0,0,0.11) 2px 4px),
    repeating-linear-gradient(90deg, rgba(240,228,196,0.045) 0 2px, rgba(0,0,0,0.10) 2px 4px),
    linear-gradient(160deg, #241a10, #150e07 65%, #100a05);
  box-shadow: inset 0 0 0 6px rgba(16,10,4,0.55), inset 0 2px 20px rgba(0,0,0,0.6), 0 14px 34px rgba(0,0,0,0.5);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.ka-world { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.ka-zoombar { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 auto 10px; }
.ka-zbtn {
  min-width: 50px; min-height: 50px; padding: 6px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--gold-dim); background: rgba(196,144,42,0.12); color: #e8d9b8;
  font-family: var(--ff-head); font-weight: 900; font-size: 1.25rem; line-height: 1;
}
.ka-zbtn:hover { background: rgba(196,144,42,0.26); }
.ka-zoom-level { font-family: var(--ff-head); font-weight: 700; color: var(--gold-lt); min-width: 52px; text-align: center; }
.ka-zoom-hint { color: var(--mist); font-style: italic; font-size: 0.88rem; width: 100%; text-align: center; }
.ka-mode-btn { font-size: 0.95rem; font-weight: 700; }
.ka-mode-btn[aria-pressed="true"] { background: rgba(255,212,84,0.3); border-color: #ffd454; }

/* diamond board (canvas) */
.da-canvas { width: 100%; height: 100%; display: block; cursor: pointer; }
.da-canvas:focus-visible { outline: 3px solid #ffd454; outline-offset: -3px; }
.da-celebrate { border-color: #ffd454; box-shadow: 0 0 26px rgba(255, 212, 84, 0.45); }

.da-progress-wrap { height: 16px; background: #0a0812; border: 1px solid rgba(196,144,42,0.4); border-radius: 8px; margin: 12px auto 0; overflow: hidden; max-width: 640px; }
.da-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #c4902a, #ffd454); transition: width 0.35s ease; }
.da-progress-text { text-align: center; font-family: var(--ff-head); font-weight: 600; margin-top: 7px; min-height: 1.4em; }
.da-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* palette — v3: a real kit LEGEND STRIP. Each chip pairs the faceted drill
   swatch (with its kit number) with the printed-canvas symbol tile. */
.da-palette {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 9px;
  background: linear-gradient(180deg, #251b11, #191008); border: 1px solid rgba(196,144,42,0.5);
  border-radius: 14px; padding: 12px; box-shadow: inset 0 1px 0 rgba(255,226,160,0.14), 0 10px 24px rgba(0,0,0,0.4);
}
.da-color {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 6px; border-radius: 12px; cursor: pointer; min-height: 86px;
  background: var(--panel); border: 2px solid rgba(196,144,42,0.3); color: var(--parch); font-family: var(--ff-body);
}
.da-color:hover { border-color: var(--gold); }
.da-color.selected { border-color: #ffd454; box-shadow: 0 0 0 3px rgba(255,212,84,0.35); background: #1d1533; }
.da-color.done { opacity: 0.45; cursor: default; }
.da-swatch {
  width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-head); font-weight: 900; font-size: 1.15rem; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8); border: 2px solid rgba(255,255,255,0.4);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.16), inset -8px -10px 12px rgba(0,0,0,0.38), inset 6px 8px 10px rgba(255,255,255,0.3), 0 3px 5px rgba(0,0,0,0.5);
}
.da-sym {
  min-width: 30px; height: 26px; padding: 0 5px; display: flex; align-items: center; justify-content: center;
  background: #f3ead8; color: #2a2118; border-radius: 5px; font-weight: 900; font-size: 1rem;
  font-family: Georgia, serif; box-shadow: inset 0 0 0 1px rgba(60,45,20,0.4), inset 0 -3px 5px rgba(120,95,50,0.3);
}
.da-color-name { font-size: 0.88rem; font-weight: 700; font-family: var(--ff-head); text-align: center; }
.da-color-left { font-size: 0.8rem; color: var(--mist); font-style: italic; }

@media (prefers-reduced-motion: reduce) {
  .da-progress-bar { transition: none; }
}
