@font-face { font-family: 'Null'; src: url('/null.otf') format('opentype'); font-display: swap; }
:root {
  --bg: #171616; --panel: #221f1e; --panel2: #2a2624; --line: rgba(255,255,255,.09); --text: #f6efed;
  --muted: rgba(246,239,237,.62); --accent: #c9ae98; --ink: #171616; --mint: #2fb67c; --red: #e5484d; --amber: #f0b44c;
  --bronze1: #8a5a3c; --bronze2: #3b261b; --silber1: #b9bec6; --silber2: #4a4e55; --gold1: #e3c06b; --gold2: #6b4f17;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
main { max-width: 560px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
.center { min-height: 80vh; display: grid; place-items: center; }
.center-text { text-align: center; }
.brand { font-family: 'Null', sans-serif; font-size: 44px; line-height: 1; letter-spacing: -.01em; }
.small-brand { font-size: 28px; }
h2 { font-size: 22px; margin: 22px 0 12px; } h3 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.gap { margin-top: 14px; display: block; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.error { color: var(--red); font-weight: 600; }

/* Anmelden */
.auth { width: 100%; max-width: 380px; display: grid; gap: 14px; text-align: left; }
.auth .brand { text-align: center; } .auth > .muted { text-align: center; margin: 0; }
.stack { display: grid; gap: 10px; }
.sent { display: grid; gap: 2px; padding: 14px; border-radius: 16px; background: rgba(47,182,124,.12); border: 1px solid rgba(47,182,124,.35); }
input, select { width: 100%; font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: none; }
input:focus, select:focus { border-color: var(--accent); }
#code { font-family: ui-monospace, Menlo, monospace; font-size: 26px; letter-spacing: .3em; text-align: center; }

.btn { border: 0; border-radius: 999px; padding: 14px 20px; font: inherit; font-weight: 700; width: 100%; cursor: pointer; transition: transform .12s ease, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); margin-top: 14px; }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.wallet { background: #000; color: #fff; border: 1px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0 8px; }
.wallet-icon { width: 26px; height: 19px; border-radius: 4px; background: linear-gradient(180deg, #2d9bf0 0 25%, #f5b62c 25% 50%, #fb5e46 50% 75%, #3bc275 75%); }

/* Kopf und Karte */
.top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.member { position: relative; border-radius: 26px; padding: 20px; overflow: hidden; color: #fff;
  background: linear-gradient(145deg, var(--c1, #3a332f), var(--c2, #1d1a19)); box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.member::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 60% at 0% 0%, rgba(255,255,255,.18), transparent 60%); pointer-events: none; }
.member.bronze { --c1: var(--bronze1); --c2: var(--bronze2); }
.member.silber { --c1: var(--silber1); --c2: var(--silber2); }
.member.gold { --c1: var(--gold1); --c2: var(--gold2); }
.member .label { color: rgba(255,255,255,.72); }
.member-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: relative; z-index: 1; }
.member-row.foot { align-items: flex-end; }
.right { text-align: right; }
.m-name { font-size: 20px; font-weight: 700; }
.m-points { font-family: 'Null', sans-serif; font-size: 40px; line-height: 1; }
.tier-badge { font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.28); backdrop-filter: blur(6px); }
.qr-wrap { position: relative; z-index: 1; margin: 16px auto; width: min(72vw, 260px); aspect-ratio: 1; background: #fff; border-radius: 18px; display: grid; place-items: center; padding: 10px; }
.qr-wrap img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.qr-fallback { color: #171616; font: 700 20px ui-monospace, Menlo, monospace; text-align: center; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px; margin-top: 14px; }
.progress { height: 8px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; margin: 10px 0 14px; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width .6s ease; }

.list { display: grid; gap: 10px; }
.list.cards > .item { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.row { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row small, .item small { display: block; color: var(--muted); }
.item a, .row a { color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; }
.item-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.plus { color: var(--mint); font-weight: 700; } .minus { color: var(--red); font-weight: 700; }

.coupon { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 2px dashed var(--accent); border-radius: 16px; padding: 12px 14px; }
.coupon .code { font: 800 22px ui-monospace, Menlo, monospace; letter-spacing: .06em; }
.coupon .val { font-weight: 800; font-size: 20px; color: var(--accent); }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.tier { border-radius: 14px; padding: 10px; text-align: center; background: var(--panel2); border: 1px solid var(--line); opacity: .55; }
.tier.on { opacity: 1; border-color: var(--accent); }
.tier strong, .tier small { display: block; } .tier small { color: var(--muted); font-size: 12px; }

.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--panel2); }
.chip.ok { background: rgba(47,182,124,.18); color: #7be0b0; } .chip.warn { background: rgba(240,180,76,.16); color: var(--amber); }
.chip.off { background: rgba(255,255,255,.06); color: var(--muted); }
.timeline { list-style: none; margin: 12px 0 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.timeline li { position: relative; } .timeline li::before { content: ''; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline li.last::before { background: var(--mint); box-shadow: 0 0 0 4px rgba(47,182,124,.25); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button, .slots button { flex: 0 0 auto; font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; cursor: pointer; }
.chips button small { display: block; color: var(--muted); font-size: 11px; }
.chips button.on, .slots button.on { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.chips button.on small { color: rgba(23,22,22,.7); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin: 6px 0 4px; }
#book .btn { margin-top: 14px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv span { color: var(--muted); }
#pr-save { margin-top: 16px; }

/* Untere Leiste */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); width: min(528px, calc(100% - 24px));
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; border-radius: 26px;
  background: rgba(34,31,30,.78); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.45); z-index: 10; }
.tabs button { font: 600 12px -apple-system, system-ui, sans-serif; color: var(--muted); background: none; border: 0; padding: 8px 4px; border-radius: 20px; display: grid; gap: 3px; justify-items: center; cursor: pointer; }
.tabs button.active { color: var(--text); background: rgba(255,255,255,.08); }
.ti { width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ti-card { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm2 3v2h14V9z'/%3E%3C/svg%3E"); }
.ti-bag { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7V6a5 5 0 0 1 10 0v1h3l-1 14H5L4 7zm2 0h6V6a3 3 0 0 0-6 0z'/%3E%3C/svg%3E"); }
.ti-tool { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.7 6.3a6 6 0 0 1-8 7.4L6.4 21a2 2 0 0 1-2.8-2.8l7.3-7.3a6 6 0 0 1 7.4-8L15 6.2 17.8 9z'/%3E%3C/svg%3E"); }
.ti-user { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0 2c-5 0-9 2.5-9 6v2h18v-2c0-3.5-4-6-9-6z'/%3E%3C/svg%3E"); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); background: var(--text); color: var(--ink);
  padding: 11px 18px; border-radius: 99px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 20; width: max-content; max-width: calc(100% - 32px); text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--muted); padding: 6px 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
