/* nakis.letsgoo.io — Studio-Theme */

@font-face { font-family: 'Archivo'; src: url('fonts/archivo-400-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-400-latin-ext.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-500-latin.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-500-latin-ext.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-600-latin.woff2') format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-600-latin-ext.woff2') format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-700-latin.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-700-latin-ext.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }

:root {
  --bg: #131419;
  --panel: #1b1d24;
  --card: #22252e;
  --card-hover: #272b35;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef0f4;
  --muted: #98a0ae;
  --accent: #e9b84f;
  --accent-ink: #201703;
  --good: #6fce8f;
  --bad: #e5697a;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; }
::selection { background: rgba(233, 184, 79, 0.35); }

/* ---------- Header ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(19, 20, 25, 0.9);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: 0.2px; }
.brand-tag { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar .spacer { flex: 1; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.lang-switch button {
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.lang-switch button.active { background: var(--accent); color: var(--accent-ink); }
.btn-ghost {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--text); white-space: nowrap;
}
.btn-ghost:hover { background: var(--card); }

/* ---------- Upload-Screen ---------- */
.upload-view {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 20px 60px; text-align: center;
}
.upload-view h1 { font-size: clamp(26px, 4.5vw, 40px); font-weight: 700; letter-spacing: -0.5px; max-width: 640px; }
.upload-view .sub { color: var(--muted); max-width: 560px; margin: 14px auto 34px; font-size: 15.5px; line-height: 1.55; }
.dropzone {
  width: min(620px, 100%);
  border: 2px dashed rgba(233, 184, 79, 0.45);
  border-radius: 18px;
  padding: 52px 24px;
  background: linear-gradient(180deg, rgba(233, 184, 79, 0.05), rgba(233, 184, 79, 0.015));
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(233, 184, 79, 0.09); }
.dropzone.drag { transform: scale(1.01); }
.dropzone .dz-icon { width: 44px; height: 44px; margin: 0 auto 16px; color: var(--accent); }
.dropzone .dz-hint { font-size: 16.5px; font-weight: 600; }
.dropzone .dz-formats { color: var(--muted); font-size: 13px; margin-top: 8px; }
.dropzone.busy { pointer-events: none; border-style: solid; }
.dz-progress { display: none; align-items: center; justify-content: center; gap: 12px; font-weight: 600; font-size: 15.5px; }
.dropzone.busy .dz-progress { display: flex; }
.dropzone.busy .dz-idle { display: none; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2.5px solid rgba(233, 184, 79, 0.25); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.upload-error {
  display: none; margin-top: 18px; color: var(--bad); font-size: 14.5px;
  background: rgba(229, 105, 122, 0.1); border: 1px solid rgba(229, 105, 122, 0.3);
  padding: 12px 18px; border-radius: 10px; max-width: 620px;
}
.upload-error.show { display: block; }
.steps { display: flex; gap: 34px; margin-top: 44px; color: var(--muted); flex-wrap: wrap; justify-content: center; }
.step { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.step .n {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--accent); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}

/* ---------- Studio ---------- */
.studio { flex: 1; display: grid; grid-template-columns: 1fr 380px; min-height: 0; }
.stage-wrap { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#stage { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#stage.panning { cursor: grabbing; }
.stage-canvas { flex: 1; position: relative; min-height: 0; background: radial-gradient(1200px 700px at 50% 30%, #191b22, var(--bg)); }
.stage-canvas canvas { position: absolute; inset: 0; }

.stage-toolbar {
  position: absolute; top: 14px; left: 14px; right: 14px;
  display: flex; gap: 10px; align-items: center; pointer-events: none; flex-wrap: wrap;
}
.stage-toolbar > * { pointer-events: auto; }
.seg {
  display: flex; background: rgba(27, 29, 36, 0.92); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; backdrop-filter: blur(8px);
}
.seg button { padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--accent); color: var(--accent-ink); }
.fabric-row { display: flex; align-items: center; gap: 8px; background: rgba(27,29,36,0.92); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; backdrop-filter: blur(8px); }
.fabric-row .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.fabric-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.fabric-dot.active { border-color: var(--accent); }
.icon-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: rgba(27,29,36,0.92); border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted); backdrop-filter: blur(8px);
}
.icon-btn:hover { color: var(--text); }
.stage-badge {
  position: absolute; bottom: 88px; left: 16px; font-size: 12px; color: var(--muted);
  background: rgba(27,29,36,0.85); padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line);
}

/* Simulation */
.simbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-top: 1px solid var(--line); background: var(--panel);
}
.simbar .play {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
}
.simbar .play svg { width: 17px; height: 17px; }
.sim-track { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sim-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.sim-meta .cur { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; }
input[type='range']::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: var(--card); border: 1px solid var(--line); }
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent); margin-top: -7px; border: 2.5px solid #131419;
  box-shadow: 0 1px 5px rgba(0,0,0,0.5);
}
input[type='range']::-moz-range-track { height: 5px; border-radius: 3px; background: var(--card); border: 1px solid var(--line); }
input[type='range']::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: 2.5px solid #131419; }

/* ---------- Panel ---------- */
.panel {
  border-left: 1px solid var(--line); background: var(--panel);
  overflow-y: auto; padding: 18px 18px 30px; display: flex; flex-direction: column; gap: 16px;
}
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.pcard h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.pcard h3 .right { margin-left: auto; text-transform: none; letter-spacing: 0; }
.hint-banner {
  font-size: 13px; color: #d9c288; background: rgba(233, 184, 79, 0.08);
  border: 1px solid rgba(233, 184, 79, 0.25); border-radius: 10px; padding: 10px 14px;
  line-height: 1.45;
}

/* Größe */
.size-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field input, .field select {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.lock-btn { width: 36px; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; }
.lock-btn.on { color: var(--accent); border-color: rgba(233, 184, 79, 0.5); }
.presets { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 99px;
}
.chip:hover { color: var(--text); border-color: var(--accent); }

/* Layer-Karten */
.layers-hint { font-size: 12px; color: var(--muted); margin: -6px 0 12px; line-height: 1.45; }
.layer { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--panel); overflow: hidden; }
.layer.skipped { opacity: 0.55; }
.layer-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.layer-head:hover { background: var(--card-hover); }
.color-chip { width: 26px; height: 26px; border-radius: 8px; flex: none; border: 1px solid rgba(255,255,255,0.2); box-shadow: inset 0 0 0 2px rgba(0,0,0,0.15); }
.layer-title { flex: 1; min-width: 0; }
.layer-name { font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.badge-bg { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; }
.layer-sub { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.layer-actions { display: flex; align-items: center; gap: 2px; }
.mini-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 7px; }
.mini-btn:hover { color: var(--text); background: var(--card); }
.mini-btn:disabled { opacity: 0.3; pointer-events: none; }
.layer-body { display: none; padding: 4px 14px 16px; border-top: 1px solid var(--line); }
.layer.open .layer-body { display: block; }
.layer.open .chev { transform: rotate(180deg); }
.chev { transition: transform 0.15s; }

.ctl { margin-top: 14px; }
.ctl-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ctl-row label { font-size: 13px; font-weight: 500; }
.ctl-row .val { font-size: 12.5px; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.ctl .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.seg-sm { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-sm button { flex: 1; padding: 8px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg-sm button.active { background: var(--accent); color: var(--accent-ink); }
.switch-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.switch-row label { font-size: 13px; font-weight: 500; }
.switch { position: relative; width: 40px; height: 23px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); transition: background 0.15s; }
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .track { background: rgba(233, 184, 79, 0.3); border-color: rgba(233, 184, 79, 0.5); }
.switch input:checked + .track::after { transform: translateX(17px); background: var(--accent); }

/* Statistik */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.stat .k { font-size: 11.5px; color: var(--muted); }
.stat .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stats-computing { display: none; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.pcard.busy .stats-computing { display: flex; }

/* Export */
.btn-primary {
  width: 100%; padding: 14px; border-radius: 10px; background: var(--accent);
  color: var(--accent-ink); font-weight: 700; font-size: 15.5px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: filter 0.15s, transform 0.08s;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.5; pointer-events: none; }
.export-row { display: flex; gap: 10px; margin-top: 10px; }
.export-row > * { flex: 1; }
.btn-sec {
  padding: 11px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--text); text-align: center;
  background: var(--panel);
}
.btn-sec:hover { border-color: var(--accent); }
select.btn-sec { -webkit-appearance: none; appearance: none; cursor: pointer; text-align: center; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 12px 20px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow);
  transition: transform 0.25s; z-index: 100; max-width: min(480px, 90vw);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(229, 105, 122, 0.5); }

/* Modal (Zugangscode) */
.modal-back {
  position: fixed; inset: 0; background: rgba(10, 11, 14, 0.75); z-index: 90;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(6px);
}
.modal-back.show { display: flex; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; width: min(400px, 100%); box-shadow: var(--shadow); }
.modal h2 { font-size: 19px; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.modal .err { color: var(--bad); font-size: 13px; margin-top: 10px; display: none; }
.modal .err.show { display: block; }

/* Footer */
.footer { display: flex; gap: 18px; justify-content: center; padding: 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }
.studio-mode .footer { display: none; }

/* ---------- Print: Farbfolge-Blatt ---------- */
.sheet { display: none; }
@media print {
  body > *:not(.sheet) { display: none !important; }
  body { background: #fff; color: #111; display: block; }
  .sheet { display: block; padding: 10mm; font-family: 'Archivo', sans-serif; }
  .sheet h1 { font-size: 22pt; margin-bottom: 2mm; }
  .sheet .meta { color: #555; font-size: 10pt; margin-bottom: 8mm; }
  .sheet img { max-width: 80mm; max-height: 60mm; border: 1px solid #ddd; border-radius: 3mm; margin-bottom: 8mm; }
  .sheet table { width: 100%; border-collapse: collapse; font-size: 11pt; }
  .sheet th, .sheet td { text-align: left; padding: 3mm 4mm; border-bottom: 1px solid #ccc; }
  .sheet th { font-size: 9pt; text-transform: uppercase; letter-spacing: 0.5pt; color: #666; }
  .sheet .swatch { width: 10mm; height: 6mm; border-radius: 1.5mm; border: 1px solid rgba(0,0,0,0.25); display: inline-block; vertical-align: middle; }
  .sheet .totals { margin-top: 8mm; font-size: 11pt; display: flex; gap: 12mm; }
  .sheet .note { margin-top: 10mm; font-size: 10pt; color: #555; border-top: 1px solid #ccc; padding-top: 4mm; }
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .stage-wrap { position: sticky; top: var(--topbar-h, 57px); z-index: 30; height: 52vh; border-bottom: 1px solid var(--line); background: var(--bg); }
  .panel { border-left: none; }
  .brand-tag { display: none; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .stage-toolbar { top: 10px; left: 10px; right: 10px; gap: 8px; }
  .seg button { padding: 7px 11px; font-size: 12px; }
  .simbar { padding: 10px 14px; }
  .stage-badge { display: none; }
}
@media (max-width: 480px) {
  .brand-name { font-size: 15px; }
  .brand svg { width: 24px; height: 24px; }
  .lang-switch button { padding: 5px 8px; font-size: 11.5px; }
  .btn-ghost { padding: 6px 10px; font-size: 12.5px; }
  .topbar { gap: 8px; }
}
