:root {
  --bg: #15141b;
  --bg2: #1d1c25;
  --card: #23222d;
  --line: #34323f;
  --text: #ece6da;
  --muted: #a39d92;
  --gold: #e0a84a;
  --gold2: #f3c46e;
  --danger: #e0644a;
  --ok: #6ab06a;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --display: 'Cinzel', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--text); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 80% -10%, #2c2638 0%, transparent 60%), var(--bg);
}
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); letter-spacing: 0.02em; line-height: 1.2; margin: 0.2em 0 0.5em; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h2 { font-size: 1.5rem; margin-top: 1.4em; }
h3 { font-size: 1.08rem; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.lead { font-size: 1.12rem; color: #d6cfc2; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; font-weight: 600; margin: 0; }
kbd { background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 0.8em; }

button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; padding: 0.55em 1em; border: 1px solid var(--line);
  background: var(--card); color: var(--text); display: inline-flex; align-items: center; gap: 0.4em; justify-content: center; text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
button:hover, .button:hover { border-color: #55506a; }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: default; }
.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #241a08; border-color: #c08a30; }
.primary:hover { background: linear-gradient(180deg, #ffd488, var(--gold2)); border-color: #c08a30; }
.ghost { background: transparent; }
.big { padding: 0.8em 1.4em; font-size: 1.02rem; }
.icon { padding: 0.3em 0.6em; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 0.55em 0.7em; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #e0a84a66; border-color: var(--gold); }
.field { display: flex; flex-direction: column; gap: 0.3em; margin-bottom: 0.8em; }
.field > span { font-size: 0.85rem; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1em; }
.row { display: flex; gap: 0.6em; flex-wrap: wrap; align-items: center; margin: 0.6em 0; }
.row.center, .center { justify-content: center; text-align: center; }
.row > select { width: auto; flex: 1; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.5rem; padding: 0.7rem 1.5rem;
  background: #15141bdd; backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.logo { font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--text); text-decoration: none !important; white-space: nowrap; }
.logo-hex { color: var(--gold); }
.nav { display: flex; gap: 0.2rem; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 0.4em 0.8em; border-radius: 8px; text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.active { color: var(--text); background: var(--card); }
.header-right { display: flex; gap: 0.8rem; align-items: center; }
.cart-link { position: relative; font-size: 1.3rem; text-decoration: none !important; padding: 0.2em 0.4em; }
.cart-count { position: absolute; top: -4px; right: -8px; background: var(--gold); color: #241a08; font-size: 0.72rem; font-weight: 700; border-radius: 99px; padding: 0 6px; min-width: 18px; text-align: center; }

.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 0.35em 0.8em; border-radius: 7px; color: var(--muted); font-size: 0.9rem; }
.seg button.active { background: var(--gold); color: #241a08; }

main { flex: 1; }
.page { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.page.narrow { max-width: 760px; }
body.wide .site-footer { display: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.card.warn, p.warn { border-color: #6a3a2a; background: #2e1f1c; color: #f0b8a0; }
.grid { display: grid; gap: 1.1rem; }
.grid.tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.packages { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.themes { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 1rem 0; }
.chip { border: 1px solid var(--line); background: var(--bg2); color: var(--muted); border-radius: 99px; padding: 0.3em 0.9em; font-size: 0.9rem; font-weight: 500; text-decoration: none !important; cursor: pointer; }
.chip.active, .chip:hover { color: var(--text); border-color: var(--gold); }
.badge { font-size: 0.72rem; border: 1px solid var(--line); border-radius: 99px; padding: 0.1em 0.6em; color: var(--muted); white-space: nowrap; font-family: var(--font); letter-spacing: 0; font-weight: 600; }
.tier-detail { color: #9ac0f0; border-color: #3a4a6a; }
.tier-held { color: var(--gold2); border-color: #6a5030; }
.st-betaald, .st-afgerond, .st-opgelost { color: #9ad09a; border-color: #3a5a3a; }
.st-in_productie, .st-open { color: #9ac0f0; border-color: #3a4a6a; }
.st-verzonden, .st-wacht_op_klant { color: var(--gold2); border-color: #6a5030; }
.st-geannuleerd { color: #f0a090; border-color: #6a3a2a; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(320px, 1fr) 1.2fr; gap: 1rem; max-width: 1300px; margin: 0 auto; padding: 2rem 1.5rem 0; align-items: center; min-height: 560px; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
.hero-view { position: relative; height: 560px; }
.hero-view canvas, .detail-view canvas, .hextory-view canvas, .viewport canvas { display: block; width: 100% !important; height: 100% !important; }
.theme-switch { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 2; background: #15141bcc; border: 1px solid var(--line); border-radius: 99px; padding: 4px; }
.theme-switch button { white-space: nowrap; border: 0; background: transparent; border-radius: 99px; padding: 0.3em 0.9em; font-size: 0.85rem; color: var(--muted); }
.theme-switch button.active { background: var(--gold); color: #241a08; }
.cta { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 1.4rem 0; }
.hero-facts { display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; }
.hero-facts span::first-letter { color: var(--gold); }

/* cards */
.tile-card { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.9rem; }
.tile-card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: radial-gradient(circle at 50% 60%, #2e2c3a, transparent 70%); border-radius: 10px; }
.tile-meta { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.tile-meta h3, .tile-meta h2, .tile-meta h1 { margin: 0.2em 0; }
.buy { display: flex; align-items: center; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; }
.buy b { font-size: 1.1rem; white-space: nowrap; }
.buy button { white-space: nowrap; }
.buy input { width: 4.2em; padding: 0.45em; }
.buy button { margin-left: auto; }
.package-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.pkg-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); background: linear-gradient(135deg, color-mix(in srgb, var(--theme) 35%, transparent), transparent); padding: 0.8rem; }
.pkg-thumbs img { width: 100%; }
.pkg-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.pkg-body h3 a { color: var(--text); }
.theme-card { color: var(--text); text-decoration: none !important; background: linear-gradient(160deg, color-mix(in srgb, var(--theme) 30%, var(--card)), var(--card) 60%); transition: transform 0.15s, border-color 0.15s; }
.theme-card:hover { transform: translateY(-3px); border-color: var(--theme); }
.theme-thumbs { display: flex; margin-bottom: 0.4rem; }
.theme-thumbs img { width: 33%; margin-right: -4%; }
.step .num { font-family: var(--display); font-size: 2rem; color: var(--gold); }
.callout { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.callout h3 { margin: 0; }

/* hextory */
.hextory-card { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; align-items: center; background: linear-gradient(120deg, #2a2434, var(--card)); padding: 1.8rem; }
.hextory-card h2 { margin-top: 0.3em; }
.hextory-view { height: 340px; }

/* detail */
.detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; margin-top: 1rem; }
.detail-view { height: 520px; padding: 0; overflow: hidden; background: radial-gradient(circle at 50% 40%, #2c2a38, var(--card)); }
.price-big { font-size: 1.5rem; margin: 0.6rem 0; }
.bom { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.5rem 0; }
.bom-head { display: flex; justify-content: space-between; margin-bottom: 0.3rem; }
.bom-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 0.6rem; align-items: center; font-size: 0.92rem; }
.bom-row img { width: 36px; }

/* composer */
.composer { display: grid; grid-template-columns: 250px 1fr 300px; height: calc(100vh - 58px); }
.palette { border-right: 1px solid var(--line); padding: 0.8rem; overflow-y: auto; display: flex; flex-direction: column; }
.palette .chips { margin: 0 0 0.8rem; }
.palette .chip { font-size: 0.8rem; padding: 0.2em 0.7em; }
.palette-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.pal-tile { flex-direction: column; padding: 0.4rem; gap: 0; font-weight: 500; font-size: 0.8rem; background: var(--bg2); }
.pal-tile img { width: 100%; }
.pal-tile small { color: var(--muted); }
.pal-tile.active { border-color: var(--gold); background: #2e2818; box-shadow: 0 0 0 1px var(--gold); }
.palette-help { margin-top: auto; padding-top: 1rem; display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; color: var(--muted); }
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; }
.toolbar { display: flex; gap: 0.5rem; align-items: center; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line); background: var(--bg2); }
.toolbar .spacer { flex: 1; }
.viewport { flex: 1; min-height: 0; cursor: crosshair; }
.summary { border-radius: 0; border-width: 0 0 0 1px; overflow-y: auto; display: flex; flex-direction: column; }
.summary .bom { flex: 0 0 auto; max-height: 32vh; overflow-y: auto; }
.price-box { border-top: 1px solid var(--line); margin-top: 0.6rem; padding-top: 0.6rem; }
.line { display: flex; justify-content: space-between; gap: 1rem; padding: 0.15rem 0; }
.line.total { font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: 0.4rem; padding-top: 0.5rem; }
.summary .primary { width: 100%; margin: 0.4rem 0; }
.summary .row button, .summary .row .button { flex: 1; font-size: 0.85rem; padding: 0.45em 0.6em; }

/* cart */
.cart-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; align-items: start; }
.cart-line { display: grid; grid-template-columns: 56px 1fr auto auto auto; gap: 0.8rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line img { width: 56px; }
.qty { display: flex; align-items: center; gap: 0.3rem; }
.qty button { padding: 0.15em 0.6em; }
.line-total { min-width: 5em; text-align: right; }
.checkout h2 { margin-top: 0; }
.checkout .primary { width: 100%; margin-top: 0.8rem; }
.totals { margin: 0.8rem 0; }
.empty { text-align: center; padding: 3rem; }
.big-check { font-size: 4rem; color: var(--gold); }

/* tracking & support */
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.8rem; align-items: end; }
.inline-form .field { margin: 0; }
.order-view { margin-top: 1.2rem; }
.progress { display: flex; list-style: none; padding: 0; margin: 1rem 0; counter-reset: s; }
.progress li { flex: 1; text-align: center; font-size: 0.82rem; color: var(--muted); position: relative; padding-top: 1.8rem; }
.progress li::before { content: '⬢'; position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: 1.3rem; color: var(--line); }
.progress li.done { color: var(--text); }
.progress li.done::before { color: var(--gold); }
.timeline { padding-left: 1.2rem; }
.timeline li { margin-bottom: 0.5rem; }
.support-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; align-items: start; }
.support-grid > div > h2:first-child { margin-top: 0; }
.faq { margin-bottom: 0.6rem; padding: 0.8rem 1rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.thread { display: flex; flex-direction: column; gap: 0.8rem; margin: 1rem 0; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 1rem; max-width: 85%; }
.msg.support, .msg.klant.mine { align-self: flex-end; background: #2a2618; border-color: #5a4a2a; }

.site-footer { border-top: 1px solid var(--line); padding: 1.2rem 1.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--muted); font-size: 0.88rem; }

.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #2e2c3a; border: 1px solid var(--gold); border-radius: 10px; padding: 0.7rem 1rem; box-shadow: 0 8px 30px #0008; display: flex; gap: 1rem; align-items: center; transition: opacity 0.4s, transform 0.4s; max-width: 380px; }
.toast.out { opacity: 0; transform: translateY(10px); }

@media (max-width: 1000px) {
  .hero, .detail-grid, .cart-grid, .support-grid, .hextory-card { grid-template-columns: 1fr; }
  .hero-view { height: 380px; }
  .composer { grid-template-columns: 1fr; height: auto; }
  .stage { height: 70vh; order: -1; }
  .palette { border-right: 0; }
  .palette-grid { grid-template-columns: repeat(4, 1fr); }
  .summary { border-width: 1px 0 0; }
  .site-header { flex-wrap: wrap; gap: 0.6rem; }
  .nav { order: 3; width: 100%; }
  .inline-form, .two { grid-template-columns: 1fr; }
}
input[type=checkbox] { width: auto; }

/* Hexstory */
.hero-img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); box-shadow: 0 20px 60px #0008; }
.hextory-img { width: 100%; border-radius: 10px; }
.theme-card.soon { opacity: 0.6; }
.card.note { border-color: #6a5030; background: #2a2418; }
.conflicts .card { padding: 0.7rem 0.9rem; margin-bottom: 0.6rem; }
.conflicts p { margin: 0.3rem 0; }
.narrow-col { max-width: 760px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; margin-top: 2rem; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; border-radius: 10px; display: block; }
.gallery figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 0.4rem; }
.viewport { position: relative; }
.viewport .loading { position: absolute; inset: 0; display: grid; place-items: center; }
a.bom-row { color: var(--text); text-decoration: none; }
.tile-card h3 a { color: var(--text); }
