/* Chat Overlay – https://chat.snukz.de – © 2026 snukz. All rights reserved. */

:root {
  --bg: #f6f5fa;
  --panel: #ffffff;
  --ink: #1c1830;
  --muted: #6a6383;
  --line: #e2dfec;
  --field: #ffffff;
  --accent: #7c3aed;
  --accent-ink: #ffffff;
  --accent-soft: #efe8fd;
  --good: #15803d;
  --bad: #c2410c;
  --shadow: 0 1px 2px rgba(28, 24, 48, .06), 0 6px 24px rgba(28, 24, 48, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12101a;
    --panel: #1b1826;
    --ink: #ece9f5;
    --muted: #a39cb8;
    --line: #2e2a3d;
    --field: #14121d;
    --accent: #a78bfa;
    --accent-ink: #16121f;
    --accent-soft: #2a2340;
    --good: #4ade80;
    --bad: #fb923c;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12101a; --panel: #1b1826; --ink: #ece9f5; --muted: #a39cb8; --line: #2e2a3d; --field: #14121d;
  --accent: #a78bfa; --accent-ink: #16121f; --accent-soft: #2a2340; --good: #4ade80; --bad: #fb923c;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- header / footer ---------- */
.top { border-bottom: 1px solid var(--line); background: var(--panel); }
.top-in { display: flex; align-items: center; gap: 8px; height: 52px; }
.brand { font-weight: 800; letter-spacing: -.02em; text-decoration: none; color: var(--ink); }
.crumb { color: var(--muted); }
.product { font-weight: 600; }
.foot { margin-top: 48px; padding: 20px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot .sep { margin: 0 6px; }

.intro { padding: 28px 0 8px; max-width: 680px; }
.intro h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 32px); letter-spacing: -.02em; line-height: 1.2; }
.intro p { margin: 0; color: var(--muted); }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 24px;
  align-items: start;
  margin-top: 20px;
}
.side { position: sticky; top: 16px; display: grid; gap: 14px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .stage { height: 420px; }
}

/* ---------- settings ---------- */
.settings { display: grid; gap: 14px; min-width: 0; }
.settings > .field, .themes, .group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.settings > .field.channel { padding: 16px; }
.channel label { font-weight: 700; font-size: 16px; }
.channel input { font-size: 17px; padding: 11px 12px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-weight: 600; font-size: 14px; }
.f-checkbox > label { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; cursor: pointer; }
.f-checkbox input { margin: 3px 0 0; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }

input[type="text"], input[type="number"], select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.note { margin: 0; min-height: 1.4em; font-size: 13px; color: var(--muted); }
.note.good { color: var(--good); }
.note.bad { color: var(--bad); }

.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] {
  width: 44px; height: 34px; padding: 2px; flex: none;
  border: 1px solid var(--line); border-radius: 8px; background: var(--field); cursor: pointer;
}
.color-row .alpha { flex: 1; min-width: 0; accent-color: var(--accent); }
.alpha-out { width: 3.2em; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- designs ---------- */
.themes { margin: 0; padding: 14px 16px 16px; min-width: 0; }
.themes legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; font-weight: 700; font-size: 16px; }
.theme-grid { clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.theme {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  text-align: left;
  cursor: pointer;
}
.theme:hover { border-color: var(--accent); }
.theme.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.swatch { grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(0,0,0,.12); }
.t-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.t-desc { font-size: 12px; color: var(--muted); line-height: 1.3; }
.t-clean .swatch    { background: #fff; box-shadow: inset 0 -8px 0 #9146ff; }
.t-neon .swatch     { background: #0d0820; box-shadow: inset 0 0 0 2px #ff2e97, 0 0 8px #ff2e97; }
.t-glass .swatch    { background: linear-gradient(135deg, rgba(126,224,255,.7), rgba(255,255,255,.25)); }
.t-retro .swatch    { background: #1b1030; box-shadow: inset 0 0 0 3px #ffcc00; border-radius: 2px; }
.t-minimal .swatch  { background: #3b3550; box-shadow: inset 0 0 0 9px #3b3550, inset 0 0 0 30px #fff; }
.t-bubbles .swatch  { background: #181428; border-radius: 50% 50% 50% 6px; box-shadow: inset 0 0 0 2px #9146ff; }
.t-phone .swatch    { background: #d9fdd3; border-radius: 10px 10px 3px 10px; }
.t-terminal .swatch { background: #080c0a; box-shadow: inset 0 0 0 2px #39ff6a; border-radius: 4px; }
.t-rpg .swatch      { background: #1d2b8f; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px #ffd34d; border-radius: 3px; }

/* ---------- groups ---------- */
.group summary {
  padding: 13px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: "+"; font-weight: 400; color: var(--muted); font-size: 20px; line-height: 1; }
.group[open] summary::after { content: "–"; }
.group-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px 18px;
  padding: 2px 16px 18px;
}
.group-body .f-text, .group-body .f-googleFont { grid-column: 1 / -1; }

.link-btn { justify-self: start; padding: 4px 0; border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }

/* ---------- preview ---------- */
.preview-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

.stage {
  position: relative;
  height: min(600px, 70vh);
  min-height: 320px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  resize: vertical;
}
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: normal; }
.bg-game {
  background:
    radial-gradient(circle at 75% 20%, rgba(255, 200, 120, .35), transparent 40%),
    linear-gradient(160deg, #2a3a5a 0%, #4d2f5c 55%, #1f4a4a 100%);
}
.bg-dark { background: #18181b; }
.bg-light { background: #f1f1f4; }
.stage-note {
  position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.bg-light .stage-note { color: #1c1830; text-shadow: none; }

/* ---------- output ---------- */
.output {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.output > label { font-weight: 700; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font-size: 13px; font-family: ui-monospace, Consolas, monospace; }
.primary {
  flex: none;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}
.primary:disabled { opacity: .45; cursor: not-allowed; }
.steps { margin: 4px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; display: grid; gap: 3px; }
.steps b { color: var(--ink); font-weight: 600; }
