/* Prompt Sammlung — Design. Handy-first, Hell/Dunkel ueber [data-theme] am <html>. Dunkelgruen. */
:root {
  --bg: #0a1310; --bg2: #0e1a15; --surface: #12201a; --surface2: #1b2d25; --surface3: #24382f;
  --text: #eef4f0; --muted: #93a89c; --line: rgba(255,255,255,.085); --line2: rgba(255,255,255,.14);
  --accent: #2fd08f; --accent2: #12a884; --accent-soft: rgba(47,208,143,.15); --accent-ink: #04231a;
  --danger: #ff6b6b;
  --shadow: 0 16px 44px rgba(0,0,0,.5);
  --radius: 20px; --radius-sm: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="light"] {
  --bg: #eef3f0; --bg2: #ffffff; --surface: #ffffff; --surface2: #e7efe9; --surface3: #dae7df;
  --text: #0d1a14; --muted: #566b60; --line: rgba(13,26,20,.10); --line2: rgba(13,26,20,.16);
  --accent: #0f9c6c; --accent2: #0b8a72; --accent-soft: rgba(15,156,108,.12); --accent-ink: #ffffff;
  --danger: #d64545;
  --shadow: 0 14px 32px rgba(20,40,30,.14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  color: var(--text);
  background:
    radial-gradient(1200px 520px at 50% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; }

#app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(30px + var(--safe-b)); }

/* ---- Topbar ---- */
.topbar { display: flex; align-items: center; gap: 8px; padding: calc(14px + var(--safe-t)) 2px 10px; }
.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }
.brand-logo { display: grid; place-items: center; filter: drop-shadow(0 5px 14px color-mix(in srgb, var(--accent) 55%, transparent)); }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.brand-name b { color: var(--accent); font-weight: 800; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); flex: 0 0 auto;
}
.icon-btn:active { transform: scale(.93); }
.icon-btn.accent { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.icon-btn.on-admin { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* ---- Suche ---- */
.search-wrap { position: relative; margin: 4px 0 12px; }
.search {
  width: 100%; height: 52px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); padding: 0 44px 0 47px; outline: none;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search::placeholder { color: var(--muted); }
.search-ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--muted); }

/* ---- Chips (umgebrochen, alle sichtbar) ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.chip .ic { color: var(--muted); }
.chip.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.chip.active .ic { color: var(--accent-ink); }
.chip:active { transform: scale(.96); }

/* ---- Listenkopf ---- */
.list-head { display: flex; align-items: baseline; gap: 8px; margin: 4px 2px 12px; }
.list-head strong { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.list-head span { color: var(--muted); font-size: 14px; font-weight: 600; }

/* ---- Grid + Karten ---- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.card:active { transform: scale(.975); }
.cover { position: relative; aspect-ratio: 4 / 5; background: var(--surface2); }
.cover-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 40px 60px -30px rgba(0,0,0,.35), inset 0 -50px 60px -30px rgba(0,0,0,.5);
  background: linear-gradient(180deg, rgba(255,255,255,.05), transparent 30%); }
.card-body { padding: 11px 12px 13px; }
.card-cat { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.card-cat .ic { color: var(--accent); }
.card-cat.light { color: rgba(255,255,255,.92); }
.card-cat.light .ic { color: #fff; }
.card-title { margin: 5px 0 8px; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface2); border-radius: 7px; padding: 3px 7px; white-space: nowrap; }

.badge-img { position: absolute; top: 8px; left: 8px; z-index: 3; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 8px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(8,14,11,.5); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.16); }

.fav-btn {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; color: #fff; z-index: 3;
  background: rgba(8,14,11,.4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.16);
}
.fav-btn.on { color: var(--accent); }
.fav-btn:active { transform: scale(.9); }

/* ---- Empty ---- */
.empty { text-align: center; color: var(--muted); padding: 46px 20px; display: grid; gap: 6px; justify-items: center; }
.empty .ic { color: var(--accent); margin-bottom: 6px; }
.empty p { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.empty span { font-size: 13.5px; max-width: 260px; }

.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 24px 0 6px; }
.credit { display: inline-flex; align-items: center; gap: 5px; }
.credit .ic { color: var(--accent); }

/* ---- Detail ---- */
.detail { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.detail-hero { position: relative; margin: 0 -16px; aspect-ratio: 1 / 1; max-height: 50vh; overflow: hidden; }
.detail-hero .cover { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; width: 100%; }
.detail-hero::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(to top, rgba(4,10,7,.82) 2%, rgba(4,10,7,.1) 44%, rgba(4,10,7,.3) 100%); }
.hero-btn { position: absolute; top: calc(12px + var(--safe-t)); z-index: 4; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: rgba(8,14,11,.46); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.18); color: #fff; }
.hero-back { left: 14px; }
.hero-fav { right: 14px; }
.hero-edit { right: 66px; }
.hero-fav.on { color: var(--accent); }
.hero-cap { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 3; color: #fff; }
.hero-cap h1 { margin: 8px 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.14; }
.hero-cap p { margin: 0; font-size: 14.5px; color: rgba(255,255,255,.85); }

.detail-body { padding: 16px 0 26px; }
.models-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 14px; }
.model { font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 999px; padding: 5px 11px; }

.gallery { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 14px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 auto; width: 128px; height: 160px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

.prompt-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.prompt-box-top { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.prompt-box-top > span { display: inline-flex; align-items: center; gap: 6px; }
.prompt-box-top .ic { color: var(--accent); }
.mini-copy { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 700; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.mini-copy:active { transform: scale(.94); }
.prompt-text { margin: 0; padding: 14px 13px; font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }

.tip { display: flex; gap: 10px; margin: 14px 0; padding: 13px 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: var(--radius-sm); }
.tip .ic { color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.tip strong { display: block; font-size: 13px; margin-bottom: 2px; }
.tip span { font-size: 13.5px; color: var(--muted); }

.detail-tags { margin: 14px 0 20px; }
.actions { display: flex; gap: 10px; margin-bottom: 26px; }
.btn-primary { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 54px; border-radius: 15px; font-size: 16px; font-weight: 800; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 34%, transparent); }
.btn-primary:active { transform: scale(.985); }
.btn-primary.done { filter: brightness(1.05); }
.btn-ghost { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.btn-ghost:active { transform: scale(.95); }

.sim-head { font-size: 16px; font-weight: 800; margin: 8px 2px 12px; letter-spacing: -.01em; }

/* ---- Editor / Verwalten ---- */
.editor { animation: fade .18s ease; padding-bottom: 30px; }
.editor-top { display: flex; align-items: center; gap: 10px; padding: calc(14px + var(--safe-t)) 2px 12px; }
.editor-top h1 { font-size: 20px; font-weight: 800; margin: 0; margin-right: auto; }
.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 2px 7px; }
.field input[type="text"], .field textarea, .field select {
  width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 13px; padding: 13px 14px; outline: none;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: 12px; color: var(--muted); margin: 6px 2px 0; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { height: 36px; padding: 0 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.opt.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-ink); border-color: transparent; }

.uploader { border: 1.5px dashed var(--line2); border-radius: 14px; padding: 16px; text-align: center; color: var(--muted); background: var(--surface); }
.uploader .ic { color: var(--accent); }
.uploader b { color: var(--text); }
.upload-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; height: 42px; padding: 0 16px; border-radius: 12px; font-weight: 700; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.img-cell { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.img-cell img { width: 100%; height: 100%; object-fit: cover; }
.img-cell .rm { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(8,14,11,.6); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.img-cell .cover-flag { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 700; color: var(--accent-ink); background: var(--accent); padding: 2px 6px; border-radius: 6px; }

.editor-actions { display: flex; gap: 10px; margin-top: 22px; }
.btn-save { flex: 1; height: 52px; border-radius: 15px; font-size: 16px; font-weight: 800; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 32%, transparent); }
.btn-save:active { transform: scale(.985); }
.btn-danger { width: 54px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--surface); border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); }

/* ---- Toast ---- */
.toast { position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--surface3); color: var(--text); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: all .22s ease; z-index: 50; border: 1px solid var(--line2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); } }
