/* ============================================================================
   Dorfleben Panel - Dark-Glass-Design (angelehnt ans ESC-Menue), Fredoka,
   mobil + desktop, viele Animationen. Echter Browser -> backdrop-filter erlaubt.
   ========================================================================== */
@font-face { font-family: 'Fredoka'; src: url('/static/fonts/Fredoka-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/static/fonts/Fredoka-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --accent: #f1ff00;
  --accent-soft: rgba(241, 255, 0, 0.14);
  --accent-2: #fbd9a1;
  --green: #40741d;
  --green-glow: rgba(64, 116, 29, 0.55);

  --bg-0: #07090d;
  --bg-1: #0d1016;
  --glass: rgba(22, 26, 34, 0.55);
  --glass-2: rgba(30, 35, 45, 0.5);
  --glass-strong: rgba(14, 17, 23, 0.86);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);

  --txt: #eef1f6;
  --txt-dim: #9aa3b2;
  --txt-mute: #6b7280;
  --good: #4ade80;
  --bad: #fb7185;
  --gold: #fbbf24;

  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shell-max: 1180px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-0);
  color: var(--txt);
  font-family: 'Fredoka', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, strong, b { font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }

/* ---------- Animated background ---------- */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(241,255,0,.06), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, var(--green-glow), transparent 55%),
    linear-gradient(160deg, #0d1016 0%, #07090d 70%); }
.bg-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.g1 { width: 460px; height: 460px; background: #40741d; top: -120px; right: -80px; animation: float1 18s ease-in-out infinite; }
.g2 { width: 420px; height: 420px; background: rgba(241,255,0,.5); bottom: -160px; left: -100px; animation: float2 22s ease-in-out infinite; }
.g3 { width: 340px; height: 340px; background: #fbd9a1; top: 40%; left: 55%; opacity: .15; animation: float1 26s ease-in-out infinite reverse; }
.bg-grid { position: absolute; inset: 0; opacity: .04;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 80%); }
@keyframes float1 { 0%,100%{ transform: translate(0,0) scale(1);} 50%{ transform: translate(-40px,40px) scale(1.1);} }
@keyframes float2 { 0%,100%{ transform: translate(0,0) scale(1);} 50%{ transform: translate(50px,-30px) scale(1.08);} }

/* ---------- Boot loader ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-ring { width: 54px; height: 54px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--glass); color: var(--txt); font-size: 15px; font-weight: 700;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: linear-gradient(135deg, #e9f600, #c9d400); color: #14180a; border: none;
  box-shadow: 0 12px 30px -8px rgba(241,255,0,.55); }
.btn.primary:hover { box-shadow: 0 16px 40px -8px rgba(241,255,0,.7); }
.btn.green { background: linear-gradient(135deg, #4f8f23, #3a6a18); color: #fff; border: none; box-shadow: 0 12px 30px -10px var(--green-glow); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; transform: none; cursor: not-allowed; }
input[type=text] { width: 100%; background: rgba(0,0,0,.32); border: 1px solid var(--line-2);
  color: var(--txt); padding: 15px 16px; border-radius: 14px; font-size: 17px; font-family: inherit; outline: none; transition: border .2s; }
input[type=text]:focus { border-color: var(--accent); }

/* ---------- Login / pairing ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 440px; text-align: center; animation: rise .6s cubic-bezier(.2,.9,.3,1.1) both; }
.auth-logo { width: 92px; height: 92px; border-radius: 26px; margin: 0 auto 22px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), rgba(64,116,29,.25)); border: 1px solid var(--line-2);
  font-size: 44px; box-shadow: var(--shadow); animation: bob 4s ease-in-out infinite; }
.auth h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: .3px; }
.auth .lead { color: var(--txt-dim); font-size: 16px; line-height: 1.55; margin: 0 0 26px; }
.auth .err { color: var(--bad); min-height: 20px; margin: 12px 0 0; font-size: 14px; }
.pin { letter-spacing: 8px; text-align: center; text-transform: uppercase; font-weight: 700; font-size: 22px; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-7px);} }
@keyframes rise { from{ opacity:0; transform: translateY(24px);} to{ opacity:1; transform:none;} }

/* ---------- App shell (ESC-Menü-Look: Topbar + Tabs) ---------- */
.topbar { display: flex; align-items: center; gap: 18px; padding: 16px 30px; position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(8,11,15,.72)); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand .mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(64,116,29,.3)); border: 1px solid var(--line-2); }
.brand .name { font-weight: 700; font-size: 18px; line-height: 1; }
.brand .name small { display: block; color: var(--accent-2); font-size: 11px; font-weight: 400; margin-top: 3px; }
.tabbar { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 10px 16px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; color: var(--txt-dim); font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer; transition: all .15s ease; }
.tab .tab-ic { font-size: 17px; }
.tab:hover { color: var(--txt); background: var(--glass); }
.tab.active { color: #14180a; background: var(--accent); border-color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.content { max-width: var(--shell-max); margin: 0 auto; padding: 26px 30px 80px; }

/* Taler-Pille (wie ESC) */
.taler-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); color: var(--gold); font-weight: 700; }
.taler-ic { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe066, #d4a017); flex: 0 0 auto; }
.taler-plus { position: relative; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--gold); cursor: pointer; text-decoration: none; flex: 0 0 auto; transition: transform .12s ease, filter .12s ease; }
.taler-plus:hover { transform: scale(1.12); filter: brightness(1.08); }
.taler-plus::before, .taler-plus::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #2a1d00; border-radius: 1px; }
.taler-plus::before { width: 11px; height: 2.5px; }
.taler-plus::after { width: 2.5px; height: 11px; }

/* "Spiel starten"-Button (Topbar) */
.play-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 12px; font-weight: 800; font-size: 14px; text-decoration: none; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, #4f8f23, #3a6a18); border: 1px solid rgba(120,200,60,.5); box-shadow: 0 0 0 0 rgba(80,150,30,.5); animation: playGlow 2.6s ease-in-out infinite; transition: transform .12s ease, filter .2s ease; }
.play-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
@keyframes playGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(80,150,30,0); } 50% { box-shadow: 0 0 18px 1px rgba(120,200,60,.45); } }
@media (max-width: 860px) { .play-btn { padding: 8px 11px; font-size: 12.5px; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 22px; }
.page-head h2 { font-size: 26px; margin: 0; }
.page-head .sub { color: var(--txt-dim); font-size: 14px; }

/* page transition */
.page { animation: fade .3s ease both; }
@keyframes fade { from{ opacity:0; transform: translateY(10px);} to{ opacity:1; transform:none;} }

/* ---------- Cards ---------- */
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* hero/character header */
.charcard { display: flex; align-items: center; gap: 18px; padding: 22px; position: relative; overflow: hidden; }
.charcard::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: var(--accent-soft); filter: blur(40px); }
.avatar { width: 78px; height: 78px; border-radius: 20px; object-fit: cover; border: 1px solid var(--line-2); background: var(--glass-2); flex: 0 0 auto; }
.avatar.ph { display: grid; place-items: center; font-size: 34px; }
.charcard .who { min-width: 0; }
.charcard .who h3 { font-size: 23px; margin: 0 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--accent-soft); border: 1px solid rgba(241,255,0,.3); color: var(--accent); }
.chip.green { background: rgba(64,116,29,.2); border-color: var(--green); color: #b6e88a; }
.chip.gold { background: rgba(251,191,36,.16); border-color: var(--gold); color: var(--gold); }

/* stat cards */
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat .lab { color: var(--txt-dim); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .val { font-size: 30px; font-weight: 700; margin-top: 8px; letter-spacing: .5px; }
.stat .val.green { color: #bdf08e; } .stat .val.gold { color: var(--gold); }
.stat .spark { position: absolute; right: -20px; bottom: -20px; font-size: 80px; opacity: .06; }

/* ---------- Vehicles ---------- */
.veh { overflow: hidden; transition: transform .15s ease, border-color .2s; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
.veh:hover { transform: translateY(-4px); border-color: var(--line-2); }
.veh .pic { height: 130px; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.06), transparent 70%); display: grid; place-items: center; }
.veh .pic img { max-width: 86%; max-height: 110px; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0,0,0,.5)); }
.veh .body { padding: 13px 15px 15px; }
.veh .plate { display: inline-block; font-weight: 700; letter-spacing: 1px; background: #11151c; border: 1px solid var(--line-2); border-radius: 7px; padding: 2px 9px; font-size: 13px; }
.veh .model { color: var(--txt-dim); font-size: 13px; margin-top: 7px; text-transform: capitalize; }
.veh .meta { display: flex; gap: 12px; margin-top: 10px; font-size: 12.5px; color: var(--txt-dim); }
.bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 4px; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #4ade80, #a3e635); }

/* ---------- generic list ---------- */
.list { padding: 6px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; transition: background .15s; }
.row:hover { background: rgba(255,255,255,.04); }
.row + .row { border-top: 1px solid var(--line); }
.row .ic-img { width: 42px; height: 42px; border-radius: 10px; object-fit: contain; background: rgba(255,255,255,.05); padding: 4px; flex: 0 0 auto; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--txt-dim); font-size: 13px; }
.count-pill { font-weight: 700; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 3px 11px; font-size: 14px; }

/* tabs (sub) */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.subtab { padding: 9px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--txt-dim); font-weight: 700; font-size: 14px; transition: all .15s; }
.subtab.active { background: var(--accent-soft); border-color: rgba(241,255,0,.3); color: var(--accent); }

/* empty + skeleton */
.empty { text-align: center; color: var(--txt-mute); padding: 48px 20px; font-size: 15px; }
.empty .em { font-size: 40px; display: block; margin-bottom: 12px; opacity: .6; }
.sk { background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- PHONE MIRROR ---------- */
.phone-wrap { display: grid; place-items: center; padding: 8px 0 20px; }
.phone { width: 360px; max-width: 100%; height: 720px; max-height: calc(100dvh - 150px); border-radius: 42px; position: relative;
  background: linear-gradient(160deg, #15191f, #0a0d12); border: 1px solid var(--line-2); padding: 14px;
  box-shadow: var(--shadow), inset 0 0 0 6px #05070a; overflow: hidden; }
.phone .notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 130px; height: 26px; background: #05070a; border-radius: 0 0 16px 16px; z-index: 5; }
.scr { position: absolute; inset: 14px; border-radius: 30px; overflow: hidden; background:
  radial-gradient(120% 70% at 50% 0%, rgba(64,116,29,.35), transparent 60%),
  radial-gradient(90% 60% at 50% 100%, rgba(241,255,0,.1), transparent 60%),
  linear-gradient(180deg, #0c1117, #06080c); display: flex; flex-direction: column; }
.statusbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px 6px; font-size: 13px; font-weight: 700; color: #dfe6ee; }
.scr-body { flex: 1; overflow-y: auto; overflow-x: hidden; }
.home-num { text-align: center; color: var(--txt-dim); font-size: 13px; margin: 6px 0 10px; }
.home-num b { color: #fff; font-size: 18px; display: block; }
.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 10px; padding: 14px 18px; }
.appicon { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.appicon .bubble { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 26px;
  border: 1px solid var(--line-2); position: relative; transition: transform .12s; }
.appicon:active .bubble { transform: scale(.9); }
.appicon .lbl { font-size: 11px; color: #d8dee6; }
.appicon .badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.ai-msg { background: linear-gradient(135deg,#34c759,#1ea34a); } .ai-call{ background: linear-gradient(135deg,#34c759,#0a8f3c);} .ai-cont{ background: linear-gradient(135deg,#5ac8fa,#2b8fd6);} .ai-note{ background: linear-gradient(135deg,#ffd60a,#f0a500);} .ai-photo{ background: linear-gradient(135deg,#ff375f,#ff8e3c);} .ai-vm{ background: linear-gradient(135deg,#8e8e93,#5b5b60);} .ai-web{ background: linear-gradient(135deg,#c9d400,#7fa31e);}
.app-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px 10px; position: sticky; top: 0; background: rgba(8,11,15,.7); backdrop-filter: blur(8px); z-index: 3; }
.app-head .back { font-size: 22px; color: var(--accent); width: 30px; }
.app-head .ttl { font-weight: 700; font-size: 17px; }

/* chat bubbles */
.thread { padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.bub { max-width: 78%; padding: 9px 13px; border-radius: 17px; font-size: 14px; line-height: 1.35; word-wrap: break-word; animation: pop .25s ease both; }
.bub.them { align-self: flex-start; background: #2a2f37; border-bottom-left-radius: 5px; }
.bub.me { align-self: flex-end; background: linear-gradient(135deg,#0a84ff,#0060df); color: #fff; border-bottom-right-radius: 5px; }
.bub .time { display: block; font-size: 10px; opacity: .6; margin-top: 3px; }
@keyframes pop { from{ opacity:0; transform: translateY(6px) scale(.97);} to{ opacity:1; transform:none;} }
.chatrow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.chatrow .ava { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg,#3a4150,#262b34); display: grid; place-items: center; font-weight: 700; color: #cfd6df; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.note { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 12px; }
.note .nt { font-weight: 700; margin-bottom: 4px; }
.note .nc { color: var(--txt-dim); font-size: 13px; white-space: pre-wrap; }

/* ---------- bottom nav (mobile) ---------- */
.botnav { display: none; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 200; width: max-content; max-width: 92vw; }
.toast { background: var(--glass-strong); border: 1px solid var(--line-2); color: var(--txt); padding: 13px 18px; border-radius: 14px;
  box-shadow: var(--shadow); backdrop-filter: blur(12px); font-size: 14px; font-weight: 700; animation: toastIn .35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes toastIn { from{ opacity:0; transform: translateY(20px) scale(.95);} to{ opacity:1; transform:none;} }

/* ---------- responsive: mobile ---------- */
@media (max-width: 860px) {
  .topbar { padding: 12px 14px; gap: 10px; }
  .tabbar { display: none; }                 /* Tabs unten als Bottom-Nav */
  .brand .name small { display: none; }
  .content { padding: 16px 14px 96px; }
  .page-head h2 { font-size: 22px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .botnav { display: grid; }
}

/* mobile top bar */
.topbar-m { display: none; align-items: center; justify-content: space-between; padding: 14px 16px; position: sticky; top: 0; z-index: 30;
  background: rgba(8,11,15,.72); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-m .brand { padding: 0; }
.topbar-m .mark { width: 34px; height: 34px; font-size: 18px; }
.topbar-m .name { font-size: 16px; }

.botnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(10,13,18,.9); backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0; color: var(--txt-mute); font-size: 10.5px; font-weight: 700; }
.bn .ic { font-size: 20px; }
.bn.active { color: var(--accent); }

.promo-strip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 18px; border: 1px dashed rgba(241,255,0,.35);
  border-radius: var(--radius); background: linear-gradient(135deg, var(--accent-soft), rgba(64,116,29,.12)); }
.promo-strip .em { font-size: 24px; }
.promo-strip .tx { flex: 1; font-size: 13.5px; color: var(--txt-dim); }
.promo-strip .tx b { color: #fff; }

/* ---------- Avatar-Mugshot-Overlay ---------- */
.chatrow .ava { position: relative; overflow: hidden; }
.ava-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Markt (ESC-Look gespiegelt) ---------- */
.mk-head { margin: 2px 0 16px; }
.mk-brand { display: flex; align-items: center; gap: 14px; }
.mk-bic { width: 52px; height: 52px; display: grid; place-items: center; font-size: 26px; border-radius: 14px; background: var(--accent-soft); border: 1px solid rgba(241,255,0,.3); }
.mk-bt { font-size: 24px; font-weight: 700; line-height: 1.1; }
.mk-bs { font-size: 13px; color: var(--txt-dim); margin-top: 3px; }
.mk-subtabs { display: flex; gap: 8px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px; margin-bottom: 14px; overflow-x: auto; }
.mk-stab { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--txt-dim); border-radius: 10px; padding: 10px 18px; cursor: pointer; transition: all .15s ease; }
.mk-stab:hover { color: var(--txt); background: rgba(255,255,255,.05); }
.mk-stab.active { color: #14180a; background: var(--accent); }
.mk-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 14px; }
.mk-stat { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; text-align: center; }
.mk-stat-ic { position: absolute; top: 9px; right: 11px; font-size: 14px; opacity: .5; }
.mk-stat-l { display: block; font-size: 11px; color: var(--txt-mute); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.mk-stat b { font-size: 22px; }
.mk-list { display: flex; flex-direction: column; gap: 10px; }
.mk-offer { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; transition: border-color .15s ease, transform .12s ease; }
.mk-offer:hover { border-color: var(--line-2); transform: translateY(-2px); }
.mk-itemic { position: relative; overflow: hidden; width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: #0e1116; border: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--txt-dim); }
.mk-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 5px; background: #0e1116; }
.mk-mid { min-width: 0; }
.mk-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-osub { color: var(--txt-dim); font-size: 13px; margin-top: 2px; }
.mk-qty { color: var(--txt-dim); font-size: 14px; font-weight: 700; }
.mk-price { font-weight: 700; font-size: 17px; color: var(--accent); white-space: nowrap; }
.mk-price.ok { color: #bdf08e; }
@media (max-width: 860px) { .mk-offer { gap: 12px; padding: 11px 13px; } .mk-qty { display: none; } }

/* ---------- Serverlogo (gross, transparent, unten rechts) ---------- */
.logo-bg { position: fixed; right: -70px; bottom: -70px; width: 640px; height: 640px; pointer-events: none;
  background: url('/static/logo.png') no-repeat right bottom; background-size: contain; opacity: .055; }
@media (max-width: 860px) { .logo-bg { width: 360px; height: 360px; opacity: .045; right: -40px; bottom: -40px; } }

/* ---------- Persistentes Handy-Dock (unten rechts) ---------- */
.phone-dock { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.phone-fab { width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--line-2); background: linear-gradient(135deg, #e9f600, #c9d400); color: #14180a; font-size: 27px; cursor: pointer; box-shadow: 0 12px 30px -6px rgba(241,255,0,.5); animation: fabPulse 2.6s ease-in-out infinite; }
@keyframes fabPulse { 0%,100% { box-shadow: 0 12px 30px -6px rgba(241,255,0,.3); } 50% { box-shadow: 0 14px 44px 0 rgba(241,255,0,.6); } }
.phone-frame { position: relative; animation: dockIn .35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes dockIn { from { opacity: 0; transform: translateY(22px) scale(.96); } to { opacity: 1; transform: none; } }
.phone-min { position: absolute; top: -10px; left: -10px; z-index: 6; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--glass-strong); color: var(--txt); font-size: 18px; line-height: 1; cursor: pointer; }
.phone-dock.open .phone-fab { display: none; }
.phone-dock:not(.open) .phone-frame { display: none; }
.phone-dock .phone { width: 332px; height: 660px; max-height: calc(100dvh - 64px); margin: 0; }
@media (min-width: 861px) { .phone-min { display: none; } }  /* Desktop: immer offen, kein Minimieren */

/* No-Phone-Zustand im Handy */
.nophone { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 30px; color: var(--txt-dim); }
.nophone .em { font-size: 56px; opacity: .5; }
.nophone .t { font-weight: 700; font-size: 17px; color: var(--txt); }

/* Fraktion */
.fac-hero { display: flex; align-items: center; gap: 16px; padding: 22px; margin-bottom: 16px; position: relative; overflow: hidden; }
.fac-hero .em { width: 64px; height: 64px; flex: 0 0 auto; display: grid; place-items: center; font-size: 32px; border-radius: 18px; background: var(--accent-soft); border: 1px solid rgba(241,255,0,.3); }
.fac-hero h3 { font-size: 24px; margin: 0 0 6px; }
.fac-mem { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px; }
.fac-mem + .fac-mem { border-top: 1px solid var(--line); }
.fac-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--txt-mute); }
.fac-dot.on { background: var(--good); box-shadow: 0 0 8px var(--good); }
.fac-msg { margin-left: auto; border: 1px solid var(--line-2); background: var(--glass); color: var(--txt); border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.fac-msg:hover { border-color: var(--accent-2); color: var(--accent); }
.fac-map-note { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--txt-dim); font-size: 14px; }

/* Fahrzeug-Detail-Modal */
.modal-bg { position: fixed; inset: 0; z-index: 250; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 20px; animation: fade .2s ease; }
.modal { width: 100%; max-width: 460px; padding: 0; overflow: hidden; animation: rise .3s cubic-bezier(.2,.9,.3,1.1) both; }
.modal .m-pic { height: 200px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.08), transparent 70%); }
.modal .m-pic img { max-width: 88%; max-height: 180px; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0,0,0,.55)); }
.modal .m-body { padding: 18px 20px 22px; }
.modal .m-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal .m-title h3 { margin: 0; font-size: 22px; text-transform: capitalize; }
.modal .m-x { border: none; background: transparent; color: var(--txt-dim); font-size: 22px; cursor: pointer; }
.m-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.m-stat { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.m-stat .l { color: var(--txt-dim); font-size: 12px; }
.m-stat .v { font-weight: 700; font-size: 16px; margin-top: 3px; }
@media (max-width: 860px) {
  .phone-dock { right: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .phone-dock .phone { width: calc(100vw - 28px); height: calc(100dvh - 160px); }
}

/* ---------- Schließfach als Kachel-Inventar ---------- */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.inv-tile { position: relative; aspect-ratio: 1; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 10px; transition: transform .12s ease, border-color .2s; }
.inv-tile:hover { transform: translateY(-3px); border-color: var(--accent-2); }
.inv-tile img { width: 58px; height: 58px; object-fit: contain; }
.inv-tile .ph { font-size: 30px; opacity: .7; }
.inv-tile .nm { font-size: 11.5px; color: var(--txt-dim); text-align: center; line-height: 1.2; max-height: 28px; overflow: hidden; }
.inv-tile .ct { position: absolute; top: 6px; right: 7px; background: var(--accent); color: #14180a; font-weight: 700; font-size: 12px; border-radius: 8px; padding: 1px 8px; }

/* ---------- Markt-Kategorien ---------- */
.mk-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.mk-cat { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--txt-dim); font-weight: 700; font-size: 13px; cursor: pointer; transition: all .15s ease; }
.mk-cat:hover { color: var(--txt); }
.mk-cat.active { color: #14180a; background: var(--accent-2); border-color: var(--accent-2); }

/* ---------- Kontakt-Detail ---------- */
.cdetail { padding: 20px; text-align: center; }
.big-ava { width: 100px; height: 100px; border-radius: 50%; margin: 6px auto 14px; position: relative; overflow: hidden; background: linear-gradient(135deg, #3a4150, #262b34); display: grid; place-items: center; font-size: 36px; font-weight: 700; color: #cfd6df; }
.big-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cdetail .cn { font-size: 21px; font-weight: 700; }
.cdetail .cnum { color: var(--txt-dim); margin: 4px 0 18px; font-size: 15px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.9); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: fade .2s ease; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,.7); }

/* ---------- Chat-Composer ---------- */
.composer { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 9px; background: rgba(7,9,13,.92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.composer input { flex: 1; background: rgba(255,255,255,.07); border: 1px solid var(--line-2); border-radius: 18px; padding: 10px 14px; color: var(--txt); font-size: 14px; font-family: inherit; outline: none; text-align: left; letter-spacing: 0; text-transform: none; }
.composer button { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; border: none; background: linear-gradient(135deg, #0a84ff, #0060df); color: #fff; font-size: 17px; cursor: pointer; }
.composer button:disabled { opacity: .5; }
.veh .pic-ph { font-size: 52px; opacity: .5; }

/* Fraktion: Layout + 3D-Live-Karte */
.fac-layout { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .fac-layout { grid-template-columns: 1fr; } }
.fac-live-line { margin: 14px 0; padding: 11px 15px; border-radius: 13px; background: var(--glass); border: 1px solid var(--line); font-size: 14px; color: var(--txt-dim); }
.fac-map-wrap { position: relative; padding: 8px; overflow: hidden; }
.fac-map { width: 100%; height: 540px; border: 0; border-radius: 14px; background: #0a0d12; display: block; }
@media (max-width: 980px) { .fac-map { height: 400px; } }
.fac-map-tag { position: absolute; left: 18px; top: 18px; background: rgba(7,9,13,.82); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 11px; font-size: 12px; color: var(--txt-dim); pointer-events: none; }
.fac-map-wrap { margin-bottom: 4px; }

/* Fraktion: Hero-Chips + Mitglieder-Kacheln */
.fac-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.sec-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-mute); font-weight: 700; margin: 22px 4px 12px; }
.fac-mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 12px; }
.fac-mtile { position: relative; text-align: center; padding: 18px 14px 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(14px); cursor: pointer; transition: transform .12s ease, border-color .2s ease; }
.fac-mtile:hover { transform: translateY(-3px); border-color: var(--accent-2); }
.fac-mdot { position: absolute; top: 12px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--txt-mute); }
.fac-mdot.on { background: var(--good); box-shadow: 0 0 8px var(--good); }
.fac-mava { width: 66px; height: 66px; border-radius: 50%; margin: 2px auto 11px; position: relative; overflow: hidden; background: linear-gradient(135deg, #3a4150, #262b34); display: grid; place-items: center; font-weight: 700; font-size: 21px; color: #cfd6df; border: 2px solid var(--line-2); }
.fac-mava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fac-mtile.on .fac-mava { border-color: var(--good); }
.fac-mname { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fac-mrank { color: var(--txt-dim); font-size: 12px; margin-top: 3px; }
.fac-mbtn { margin-top: 11px; width: 100%; border: 1px solid var(--line-2); background: var(--accent-soft); color: var(--accent); border-radius: 9px; padding: 7px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all .15s ease; }
.fac-mbtn:hover { background: var(--accent); color: #14180a; border-color: var(--accent); }
.fac-map-slot { width: 100%; height: 540px; border-radius: 14px; background: #0a0d12; display: grid; place-items: center; color: var(--txt-mute); }
@media (max-width: 980px) { .fac-map-slot { height: 400px; } }
.fac-map-ph { font-size: 14px; opacity: .7; }
.map-overlay { position: fixed; z-index: 40; border: 0; border-radius: 14px; background: #0a0d12; box-shadow: 0 0 0 1px var(--line); }

/* Dorftaler "+"-Button (Übersicht) */
.dt-plus { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 20px; font-weight: 700; line-height: 1; text-decoration: none; background: rgba(251,191,36,.16); border: 1px solid var(--gold); color: var(--gold); transition: all .15s ease; }
.dt-plus:hover { background: var(--gold); color: #14180a; transform: translateY(-1px); }

/* Dorfladen */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-bottom: 8px; }
.shop-card { padding: 16px 14px; text-align: center; display: flex; flex-direction: column; gap: 7px; }
.shop-img { width: 64px; height: 64px; object-fit: contain; margin: 2px auto; }
.shop-ph { font-size: 34px; opacity: .7; margin: 2px auto; }
.shop-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-price { color: var(--gold); font-weight: 700; font-size: 15px; }
.shop-qrow { display: flex; align-items: center; gap: 6px; justify-content: center; margin: 2px 0; }
.shop-step { width: 30px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--glass); color: var(--txt); font-size: 18px; line-height: 1; cursor: pointer; }
.shop-step:hover { border-color: var(--accent-2); }
.shop-qty { width: 50px !important; text-align: center; padding: 7px 4px !important; font-size: 15px !important; letter-spacing: 0 !important; text-transform: none !important; }
.shop-card .btn { padding: 9px; font-size: 14px; }

/* Bestätigungsdialog */
.modal.confirm { max-width: 400px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-actions .btn { padding: 11px 18px; }
