:root {
  --bg: #f6f4f0; --card: #ffffff; --card2: #f0ede7; --line: #e4dfd6; --text: #1c1a17; --muted: #6f6a62;
  --accent: #f0a33a; --accent-ink: #1c1206; --shadow: 0 1px 2px rgba(30, 25, 15, .06), 0 8px 24px rgba(30, 25, 15, .06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111317; --card: #1a1d23; --card2: #23272f; --line: #2b3039; --text: #ecedf0; --muted: #959ba6;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif; min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Kopfzeile */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-in { height: 60px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.mark { width: 30px; height: 30px; border-radius: 9px; background: url(favicon.svg) center/cover; flex: none; }
.mark.big { width: 64px; height: 64px; border-radius: 16px; display: block; margin: 0 auto 14px; }
.ghost { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: 14px; }
.ghost:hover { background: var(--card2); color: var(--text); }

/* Begruessung */
.hero { padding: 34px 0 10px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(26px, 5vw, 34px); letter-spacing: -.5px; }
.hero p { margin: 0; color: var(--muted); max-width: 620px; }

/* Kacheln */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; padding: 22px 0 60px; }
.t-card { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s; outline: none; }
.t-card:hover, .t-card:focus-visible { transform: translateY(-2px); }
.t-card:focus-visible { border-color: var(--accent); }
.t-icon { flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 2px 6px rgba(0,0,0,.12); }
.t-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-icon span { line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.t-body { flex: 1; min-width: 0; }
.t-name { font-weight: 650; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-badge { display: inline-block; vertical-align: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.t-get { flex: none; padding: 7px 16px; border-radius: 99px; background: var(--card2); color: var(--accent); font-weight: 700; font-size: 14px; }
.t-get:hover { background: color-mix(in srgb, var(--accent) 16%, var(--card2)); }
.empty { color: var(--muted); padding: 30px 0; }

/* Anmeldung */
.login { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; }
.login-card { width: min(420px, 100%); text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 30px 24px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.login-card p { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
#codeForm { display: flex; flex-direction: column; gap: 10px; }
#codeForm input { height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 0 14px; text-align: center; }
#codeForm input:focus { outline: none; border-color: var(--accent); }
.primary { height: 48px; padding: 0 22px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.primary:active { transform: scale(.98); }
.err { color: #d4473d; min-height: 1.2em; margin: 10px 0 0 !important; font-size: 14px; }

/* Detailansicht */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(10, 10, 12, .45); animation: fade .2s; }
.sheet-card { position: relative; width: min(680px, 100%); max-height: min(88vh, 900px); overflow-y: auto; background: var(--card);
  border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: up .25s cubic-bezier(.2,.9,.3,1); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@media (max-width: 640px) {
  .sheet { align-items: flex-end; }
  .sheet-card { border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
}
.d-head { display: flex; gap: 18px; align-items: center; padding: 24px 24px 18px; }
.d-head h2 { margin: 0; font-size: 24px; letter-spacing: -.3px; }
.d-head .t-sub { -webkit-line-clamp: 3; }
.d-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: var(--card2); color: var(--muted); font-size: 18px; }
.d-actions { padding: 0 24px 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.d-actions .primary { flex: 1; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; min-width: 200px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { padding: 12px 6px; text-align: center; }
.facts div + div { border-left: 1px solid var(--line); }
.facts small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; }
.facts b { font-size: 15px; }
.shots { display: flex; gap: 10px; overflow-x: auto; padding: 18px 24px 4px; scroll-snap-type: x mandatory; }
.shots img { height: 300px; border-radius: 14px; border: 1px solid var(--line); scroll-snap-align: start; flex: none; }
.d-sec { padding: 16px 24px 0; }
.d-sec h3 { margin: 0 0 6px; font-size: 16px; }
.d-sec p, .d-sec li { color: var(--muted); font-size: 15px; white-space: pre-line; }
.d-sec p { margin: 0; }
.d-sec ol { margin: 6px 0 0; padding-left: 20px; }
.d-sec:last-child { padding-bottom: 26px; }
.copy { display: flex; gap: 8px; margin-top: 8px; }
.copy input { flex: 1; min-width: 0; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 0 10px; font: 13px ui-monospace, monospace; }
.copy button { padding: 0 14px; border-radius: 10px; background: var(--card2); font-weight: 600; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 30;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 14.5px; transition: all .2s; max-width: 90vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
