/* Blink – Styles */

/* ================= Designs (Themes) ================= */
:root, [data-theme="mitternacht"] {
  --bg: #0A0A0F; --bg-2: #13131B; --bg-3: #1C1C27; --line: #2A2A38;
  --text: #F4F4F8; --muted: #9A9AAE;
  --accent: #8B5CF6; --accent-2: #EC4899;
  --page: radial-gradient(1200px 600px at 20% 10%, #1d1233 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #2a0f22 0%, transparent 60%), #050507;
  --nav-bg: rgba(20,20,28,.78); --bubble: rgba(10,10,15,.72);
  color-scheme: dark;
}
[data-theme="hell"] {
  --bg: #F6F6FA; --bg-2: #FFFFFF; --bg-3: #ECECF3; --line: #DEDEE8;
  --text: #14141C; --muted: #6B6B80;
  --accent: #7C3AED; --accent-2: #DB2777;
  --page: radial-gradient(1000px 600px at 20% 10%, #e9e1ff 0%, transparent 60%), #E9E9F1;
  --nav-bg: rgba(255,255,255,.85); --bubble: rgba(255,255,255,.82);
  color-scheme: light;
}
[data-theme="amoled"] {
  --bg: #000000; --bg-2: #0B0B0B; --bg-3: #171717; --line: #232323;
  --text: #FFFFFF; --muted: #8F8F8F;
  --accent: #A78BFA; --accent-2: #60A5FA;
  --page: #000; --nav-bg: rgba(18,18,18,.85); --bubble: rgba(0,0,0,.7);
  color-scheme: dark;
}
[data-theme="ozean"] {
  --bg: #06141F; --bg-2: #0B2030; --bg-3: #12304A; --line: #1B3D57;
  --text: #EAF6FF; --muted: #8FB3CC;
  --accent: #06B6D4; --accent-2: #3B82F6;
  --page: radial-gradient(1000px 600px at 20% 10%, #0b3550 0%, transparent 60%), #030B12;
  --nav-bg: rgba(11,32,48,.82); --bubble: rgba(6,20,31,.72);
  color-scheme: dark;
}
[data-theme="sonnenuntergang"] {
  --bg: #1A0D14; --bg-2: #26131D; --bg-3: #33192A; --line: #4A2238;
  --text: #FFF1EA; --muted: #C99AA9;
  --accent: #F97316; --accent-2: #EC4899;
  --page: radial-gradient(1000px 600px at 20% 10%, #4a1a1a 0%, transparent 60%), #0E0609;
  --nav-bg: rgba(38,19,29,.82); --bubble: rgba(26,13,20,.72);
  color-scheme: dark;
}
[data-theme="wald"] {
  --bg: #0B140F; --bg-2: #122019; --bg-3: #1A2E23; --line: #24402F;
  --text: #ECF7EF; --muted: #93B39D;
  --accent: #22C55E; --accent-2: #84CC16;
  --page: radial-gradient(1000px 600px at 20% 10%, #12321f 0%, transparent 60%), #050A07;
  --nav-bg: rgba(18,32,25,.82); --bubble: rgba(11,20,15,.72);
  color-scheme: dark;
}
[data-theme="bonbon"] {
  --bg: #FFF1F7; --bg-2: #FFFFFF; --bg-3: #FFE1EE; --line: #F9CDE0;
  --text: #3B0D24; --muted: #9C5878;
  --accent: #EC4899; --accent-2: #A855F7;
  --page: radial-gradient(1000px 600px at 20% 10%, #ffd6ea 0%, transparent 60%), #FBE4EF;
  --nav-bg: rgba(255,255,255,.85); --bubble: rgba(255,255,255,.82);
  color-scheme: light;
}
[data-theme="retro"] {
  --bg: #F4ECD8; --bg-2: #FFF8E7; --bg-3: #EADFC4; --line: #D9CBA7;
  --text: #3A2E1F; --muted: #7A6A50;
  --accent: #D97706; --accent-2: #B45309;
  --page: #E8DCC0; --nav-bg: rgba(255,248,231,.88); --bubble: rgba(255,248,231,.85);
  color-scheme: light;
}

:root {
  --accent-grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --snap: #FF3D71; --chat: #3DA5FF; --ok: #22C55E; --fire: #FF7A1A;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overscroll-behavior: none; }
body { display: flex; justify-content: center; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg.i { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }

#app { position: relative; width: 100%; max-width: 480px; height: 100dvh; overflow: hidden; overflow: clip; background: var(--bg); isolation: isolate; }
@media (min-width: 560px) {
  body { align-items: center; background: var(--page); }
  #app { height: min(100dvh - 32px, 900px); border-radius: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px var(--line); }
}

/* ---------- Avatare ---------- */
.av {
  --c: var(--accent);
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--c); color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.02em;
  background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 55%);
  text-transform: uppercase; user-select: none;
}
.av.lg { width: 96px; height: 96px; font-size: 38px; }
.av.xl { width: 128px; height: 128px; font-size: 52px; }
.av.sm { width: 32px; height: 32px; font-size: 13px; }
.ring { padding: 3px; border-radius: 50%; background: var(--accent-grad); flex: none; }
.ring.seen { background: var(--line); }
.ring > .av { box-shadow: 0 0 0 3px var(--bg); }
.dot-online { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Auth ---------- */
#auth { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px calc(32px + var(--safe-bottom));
  background: radial-gradient(500px 320px at 50% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%), var(--bg); }
.logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.logo-mark { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-grad); display: grid; place-items: center; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent); }
.logo-mark svg { width: 30px; height: 30px; }
.logo h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; font-weight: 800; }
.auth-sub { color: var(--muted); margin: -16px 0 28px; }
.tabs { display: flex; background: var(--bg-2); border-radius: 14px; padding: 4px; margin-bottom: 18px; border: 1px solid var(--line); }
.tabs button { flex: 1; padding: 10px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--bg-3); color: var(--text); }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px 4px; }
.field input, .input, .field textarea { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); outline: none; }
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .input:focus, .field textarea:focus { border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 20px; border-radius: 999px; font-weight: 700; }
.btn-primary { background: var(--accent-grad); color: #fff; width: 100%; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:disabled { opacity: .5; }
.btn-ghost { background: var(--bg-3); }
.btn-danger { background: rgba(255,61,113,.12); color: var(--snap); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-xs { padding: 6px 10px; font-size: 12.5px; border-radius: 10px; }
.err { color: var(--snap); min-height: 22px; font-size: 14px; margin: 4px 4px 10px; }

/* ---------- Layout ---------- */
#main { position: absolute; inset: 0; overflow: hidden; overflow: clip; }
#panes { position: absolute; inset: 0; display: flex; width: 300%; transition: transform .32s cubic-bezier(.2,.8,.2,1); will-change: transform; }
#panes.dragging { transition: none; }
.pane { width: calc(100% / 3); height: 100%; position: relative; overflow: hidden; background: var(--bg); }

.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-top)) 14px 12px; }
.topbar h2 { flex: 1; margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.03em; text-align: center; }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); flex: none; color: var(--text); }
.icon-btn.glass { background: rgba(0,0,0,.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; }
.icon-btn.plain { background: none; }
.badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--snap); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.list-pane { padding-top: calc(64px + var(--safe-top)); padding-bottom: calc(84px + var(--safe-bottom)); height: 100%; overflow-y: auto; }

#nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; align-items: center; padding: 10px 24px calc(10px + var(--safe-bottom)); pointer-events: none; }
#nav button { pointer-events: auto; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: var(--text); position: relative; transition: transform .15s, background .2s; }
#nav button.nav-side { background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 0 0 1px var(--line); }
#nav.on-cam button.nav-side { background: rgba(20,20,28,.6); color: #fff; box-shadow: none; }
#nav button.on.nav-side[data-go="0"] { color: var(--chat); }
#nav button.on.nav-side[data-go="2"] { color: var(--accent-2); }
#nav .nav-cam { width: 46px; height: 46px; background: var(--nav-bg); backdrop-filter: blur(12px); box-shadow: 0 0 0 1px var(--line); }
#nav.on-cam .nav-cam { opacity: 0; pointer-events: none; }
#nav button:active { transform: scale(.92); }

/* ---------- Chat-Liste ---------- */
.row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; position: relative; width: 100%; text-align: left; }
.row:active { background: var(--bg-2); }
.row .meta { flex: 1; min-width: 0; }
.row .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.row .name .nm { overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.row .sub b { font-weight: 700; }
.row .sub.snap b, .row .sub.snap .stico { color: var(--snap); }
.row .sub.chat b, .row .sub.chat .stico { color: var(--chat); }
.row .av-wrap { position: relative; }
.row .chat-btn { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; flex: none; }
.row .chat-btn:active { background: var(--bg-3); }
.stico { width: 13px; height: 13px; flex: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; fill: none; }
.stico.filled { fill: currentColor; }
.sep { color: var(--muted); opacity: .6; }
.streak { font-size: 13px; font-weight: 800; color: var(--fire); white-space: nowrap; flex: none; }
.streak.exp { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.empty { text-align: center; color: var(--muted); padding: 60px 32px; line-height: 1.5; }
.empty .big { font-size: 44px; margin-bottom: 10px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 18px 16px 6px; }

/* ---------- Kamera ---------- */
#cam-pane { background: #000; }
#viewfinder { position: absolute; inset: 0; transform-origin: 50% 50%; }
#viewfinder video, #viewfinder canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: transparent; }
#viewfinder video { background: #000; }
#lens-canvas { pointer-events: none; }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 40px; color: #ccc; line-height: 1.5; z-index: 2; }
.cam-msg .btn { margin-top: 14px; }
.cam-top-right { position: absolute; right: 14px; top: calc(64px + var(--safe-top)); display: flex; flex-direction: column; gap: 12px; z-index: 5; }
.cam-top-right .on { background: #fff; color: #000; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: calc(92px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; gap: 14px; z-index: 5; }
#shutter { width: 82px; height: 82px; border-radius: 50%; border: 6px solid #fff; background: rgba(255,255,255,.08); transition: transform .12s; box-shadow: 0 4px 20px rgba(0,0,0,.35); touch-action: none; }
#shutter:active { transform: scale(.9); background: rgba(255,255,255,.35); }
#zoom-pill { padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; font-weight: 800; font-size: 13px; backdrop-filter: blur(8px); min-width: 48px; }
#flashfx { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 30; transition: opacity .25s; }
#flashfx.on { opacity: 1; transition: none; }
.flash-on { color: #FDE68A !important; }
.lens-bar { display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px; max-width: 100%; scrollbar-width: none; }
.lens-bar::-webkit-scrollbar { display: none; }
.lens-bar button { width: 54px; height: 54px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 26px; background: rgba(0,0,0,.4); border: 3px solid rgba(255,255,255,.4); backdrop-filter: blur(6px); transition: transform .15s; color: #fff; }
.lens-bar button.on { border-color: #fff; transform: scale(1.12); background: rgba(255,255,255,.2); }
.lens-status { color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.6); min-height: 16px; }

/* ---------- Overlays ---------- */
.overlay { position: absolute; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; animation: slideUp .26s cubic-bezier(.2,.8,.2,1); }
.overlay.from-right { animation-name: slideLeft; }
.overlay.fade { animation-name: fadeIn; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideLeft { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.ov-head { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-top)) 12px 10px; border-bottom: 1px solid var(--line); flex: none; background: var(--bg); position: relative; z-index: 2; }
.ov-head h3 { margin: 0; font-size: 18px; flex: 1; font-weight: 800; letter-spacing: -.02em; min-width: 0; }
.ov-head h3 .nm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-body { flex: 1; overflow-y: auto; }

/* ---------- Editor ---------- */
#editor { background: #000; color: #fff; }
.stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.stage-inner { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 100%; width: min(100%, calc(100dvh * 9 / 16)); }
@media (min-width: 560px) { .stage-inner { width: min(100%, calc(min(100dvh - 32px, 900px) * 9 / 16)); } }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#draw-canvas { touch-action: none; }
.filter-name { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: 28px; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 2px 14px rgba(0,0,0,.6); pointer-events: none; opacity: 0; transition: opacity .3s; white-space: nowrap; }
.filter-name.show { opacity: 1; transition: none; }
.caption { position: absolute; left: 0; right: 0; background: rgba(0,0,0,.55); padding: 8px 12px; touch-action: none; cursor: grab; z-index: 3; }
.caption input { width: 100%; background: none; border: 0; outline: none; text-align: center; color: #fff; font-size: 17px; font-weight: 500; }
.sticker { position: absolute; left: 0; top: 0; font-size: 64px; line-height: 1; transform-origin: 50% 50%; user-select: none; touch-action: none; cursor: grab; z-index: 2; }
.trash-zone { position: absolute; left: 50%; bottom: calc(80px + var(--safe-bottom)); transform: translateX(-50%); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.5); color: #fff; z-index: 6; transition: transform .15s, background .15s; }
.trash-zone.hot { transform: translateX(-50%) scale(1.25); background: var(--snap); }
.ed-tools { position: absolute; right: 12px; top: calc(14px + var(--safe-top)); display: flex; flex-direction: column; gap: 12px; z-index: 5; align-items: center; }
.ed-tools .icon-btn.active { background: #fff; color: #000; }
.ed-close { position: absolute; left: 12px; top: calc(14px + var(--safe-top)); z-index: 5; }
.timer-lbl { font-size: 12px; font-weight: 800; }
.palette { width: 14px; height: 180px; border-radius: 8px; border: 2px solid #fff; touch-action: none;
  background: linear-gradient(to bottom, #fff 0%, #ff3d71 10%, #ff9f1c 25%, #ffe14d 38%, #2ee59d 52%, #3da5ff 66%, #8b5cf6 80%, #ec4899 90%, #000 100%); }
.palette-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cur-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; }
.ed-bottom { position: absolute; left: 0; right: 0; bottom: calc(16px + var(--safe-bottom)); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; z-index: 5; }
.send-btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: 999px; background: var(--accent-grad); color: #fff; font-weight: 800; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent); }
.send-btn:disabled { opacity: .45; }
.filter-dots { display: flex; gap: 4px; flex-wrap: wrap; max-width: 55%; }
.filter-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.35); }
.filter-dots i.on { background: #fff; }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 0 12px 8px; }
.emoji-grid button { font-size: 32px; padding: 6px 0; border-radius: 12px; }
.emoji-grid button:active { background: var(--bg-3); }

/* ---------- Senden ---------- */
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; flex: none; transition: all .15s; }
.on > .check, .check.on { background: var(--accent); border-color: var(--accent); }
.check svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3.5; opacity: 0; }
.on > .check svg, .check.on svg { opacity: 1; }
.send-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + var(--safe-bottom)); background: var(--bg-2); border-top: 1px solid var(--line); }
.send-bar .names { flex: 1; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send-bar .names b { color: var(--text); }
.story-row .av-story { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-grad); color: #fff; }
.search-wrap { padding: 10px 16px; }

/* ---------- Betrachter ---------- */
.viewer { background: #000; color: #fff; }
.viewer img.full { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.viewer .v-head { position: absolute; left: 0; right: 0; top: 0; padding: calc(10px + var(--safe-top)) 12px 30px; display: flex; align-items: center; gap: 10px; z-index: 3; background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); }
.viewer .v-head .who { flex: 1; min-width: 0; }
.viewer .v-head .who b { display: block; font-size: 15px; }
.viewer .v-head .who span { font-size: 12px; color: rgba(255,255,255,.75); }
.progress { position: absolute; top: calc(6px + var(--safe-top)); left: 8px; right: 8px; display: flex; gap: 4px; z-index: 4; }
.progress i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); overflow: hidden; }
.progress i b { display: block; height: 100%; width: 0; background: #fff; }
.timer-ring { width: 36px; height: 36px; flex: none; }
.timer-ring circle { fill: none; stroke-width: 4; }
.spinner { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px; border-radius: 50%; border: 4px solid rgba(128,128,128,.25); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.viewer .spinner { border-top-color: #fff; }
.spinner.inline { position: static; margin: 20px auto; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.v-foot { position: absolute; bottom: calc(18px + var(--safe-bottom)); left: 0; right: 0; display: flex; justify-content: center; gap: 10px; z-index: 3; flex-wrap: wrap; padding: 0 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: rgba(0,0,0,.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 14px; font-weight: 600; color: #fff; }
.pill svg.i { width: 18px; height: 18px; }

/* ---------- Storys ---------- */
.my-story { display: flex; align-items: center; gap: 14px; padding: 12px 16px; width: 100%; text-align: left; }
.my-story .thumb { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg); box-shadow: 0 0 0 3px var(--accent); background: var(--bg-3); }
.my-story .add { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); border: 2px dashed var(--muted); color: var(--muted); }
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 8px; padding: 8px 12px; }
.story-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.story-tile .av { width: 74px; height: 74px; font-size: 28px; }
.story-tile .nm { font-size: 13px; font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-tile .tm { font-size: 11px; color: var(--muted); margin-top: -6px; }
.games-card { margin: 18px 12px 0; padding: 14px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); display: flex; align-items: center; gap: 12px; width: calc(100% - 24px); text-align: left; }
.games-card .gi { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-grad); display: grid; place-items: center; font-size: 26px; flex: none; }

/* ---------- Chat ---------- */
#chat-body { position: relative; background-size: cover; background-position: center; }
#chat-list { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 2px; min-height: 100%; }
.msg-group { border-left: 3px solid var(--c, var(--accent)); padding: 2px 0 2px 10px; margin: 8px 0 2px; }
.has-bg .msg-group { background: var(--bubble); border-radius: 0 12px 12px 0; padding: 6px 10px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.msg-group .who { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--c, var(--accent)); margin-bottom: 2px; }
.msg { position: relative; padding: 2px 6px; margin: 0 -6px; border-radius: 8px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.msg.saved { background: color-mix(in srgb, var(--text) 9%, transparent); }
.msg.pressing { background: color-mix(in srgb, var(--text) 14%, transparent); }
.msg .txt { white-space: pre-wrap; word-wrap: break-word; line-height: 1.4; font-size: 15.5px; }
.msg .rx { display: inline-flex; gap: 3px; margin-top: 2px; background: var(--bg-3); border-radius: 999px; padding: 1px 7px; font-size: 13px; border: 1px solid var(--line); }
.msg .saved-tag { font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: .03em; }
.day-sep { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0 4px; font-weight: 600; }
.has-bg .day-sep, .has-bg .read-info, .has-bg .ttl-note { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.read-info { font-size: 11px; color: var(--muted); margin: 4px 0 0 13px; }
.sys-line { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0; }
.chat-input { flex: none; display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--bg); position: relative; }
.chat-input textarea { flex: 1; resize: none; max-height: 120px; min-height: 44px; padding: 11px 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg-2); outline: none; line-height: 1.35; }
.chat-input textarea:focus { border-color: var(--chat); }
.round-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); flex: none; color: var(--text); }
.chat-send { background: var(--chat); color: #fff; }
.chat-send:disabled { opacity: .4; }
.mic-btn { touch-action: none; }
.mic-btn.rec { background: var(--snap); color: #fff; transform: scale(1.15); }
.rec-bar { position: absolute; inset: 0; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--bg); font-weight: 700; z-index: 2; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--snap); animation: pulse 1s infinite; }
.rec-bar .hint { flex: 1; color: var(--muted); font-weight: 500; font-size: 13px; text-align: right; }
.ttl-note { text-align: center; color: var(--muted); font-size: 12px; padding: 6px 20px 0; }
.snap-thumb { display: block; width: 140px; height: 248px; object-fit: cover; border-radius: 12px; margin: 4px 0; background: var(--bg-3); cursor: zoom-in; }
.audio-msg { display: flex; align-items: center; gap: 10px; padding: 6px 0; min-width: 200px; max-width: 260px; }
.audio-msg .play { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--accent)); color: #fff; flex: none; }
.audio-msg .wave { flex: 1; height: 28px; display: flex; align-items: center; gap: 2px; }
.audio-msg .wave i { flex: 1; background: color-mix(in srgb, var(--text) 30%, transparent); border-radius: 2px; }
.audio-msg .wave i.on { background: var(--c, var(--accent)); }
.audio-msg .dur { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; }
.card-msg { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 4px 0; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); max-width: 300px; text-align: left; width: 100%; }
.card-msg .ci { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--bg-3); flex: none; }
.card-msg b { display: block; font-size: 14px; }
.card-msg span { font-size: 12.5px; color: var(--muted); }
.card-msg .go { margin-left: auto; color: var(--accent); font-weight: 800; font-size: 13px; }
.card-msg.missed .ci { color: var(--snap); }

.rx-row { display: flex; justify-content: space-around; padding: 4px 12px 12px; }
.rx-row button { font-size: 30px; width: 50px; height: 50px; border-radius: 50%; transition: transform .1s; }
.rx-row button.on { background: var(--bg-3); }
.rx-row button:active { transform: scale(1.25); }
.menu-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 20px; font-weight: 600; text-align: left; }
.menu-list button:active { background: var(--bg-3); }
.menu-list button.danger { color: var(--snap); }

.bg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 16px 10px; }
.bg-grid button { aspect-ratio: 9 / 14; border-radius: 12px; border: 3px solid transparent; position: relative; overflow: hidden; font-size: 11px; font-weight: 700; color: #fff; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; text-shadow: 0 1px 4px rgba(0,0,0,.8); background-size: cover; }
.bg-grid button.on { border-color: var(--accent); }
.bg-standard { background: var(--bg) !important; }
.bg-nacht { background: linear-gradient(180deg, #0f0c29, #302b63 60%, #24243e) !important; }
.bg-aurora { background: radial-gradient(80% 50% at 20% 20%, rgba(34,197,94,.55), transparent), radial-gradient(70% 50% at 80% 40%, rgba(139,92,246,.6), transparent), radial-gradient(60% 40% at 40% 90%, rgba(14,165,233,.5), transparent), #050816 !important; }
.bg-sunset { background: linear-gradient(180deg, #2b1055 0%, #d53369 55%, #fcb045 100%) !important; }
.bg-ozean { background: linear-gradient(180deg, #0f2027, #203a43 50%, #2c5364) !important; }
.bg-wald { background: linear-gradient(180deg, #0b3d2e, #134e5e 50%, #71b280) !important; }
.bg-bonbon { background: linear-gradient(160deg, #f9a8d4, #c4b5fd 55%, #a5f3fc) !important; }
.bg-punkte { background: radial-gradient(color-mix(in srgb, var(--accent) 45%, transparent) 1.5px, transparent 1.6px) 0 0 / 18px 18px, var(--bg-2) !important; }
.bg-sterne { background: radial-gradient(1px 1px at 20px 30px, #fff, transparent), radial-gradient(1.5px 1.5px at 80px 120px, #fff, transparent), radial-gradient(1px 1px at 150px 60px, #ddd, transparent), radial-gradient(2px 2px at 120px 200px, #fff, transparent), radial-gradient(1px 1px at 40px 170px, #bbb, transparent), #070718 !important; background-size: 200px 220px !important; }
.bg-papier { background: repeating-linear-gradient(180deg, transparent 0 27px, rgba(70,110,200,.18) 27px 28px), #f7f1e3 !important; }

/* ---------- Profil ---------- */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px 10px; }
.profile-head h4 { margin: 6px 0 0; font-size: 22px; }
.profile-head .handle { color: var(--muted); }
.colors { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 6px 16px 14px; }
.colors button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.colors button.on { border-color: var(--text); }
.card { margin: 10px 16px; padding: 16px; background: var(--bg-2); border-radius: var(--radius); border: 1px solid var(--line); }
.card h5 { margin: 0 0 12px; font-size: 15px; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.theme-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; }
.theme-grid .sw { width: 100%; aspect-ratio: 1; border-radius: 14px; border: 3px solid transparent; position: relative; overflow: hidden; }
.theme-grid .sw::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 18%; height: 22%; border-radius: 999px; background: var(--g); }
.theme-grid button.on .sw { border-color: var(--accent); }
.menu-card { margin: 10px 16px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.menu-card button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--line); }
.menu-card button:last-child { border-bottom: 0; }
.menu-card button .chev { margin-left: auto; color: var(--muted); }

/* ---------- Sheets & Toast ---------- */
#toast { position: fixed; left: 50%; top: calc(16px + var(--safe-top)); transform: translate(-50%, -30px); z-index: 1000; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; opacity: 0; transition: all .25s; pointer-events: none; max-width: 90%; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--snap); color: #fff; }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); z-index: 60; display: flex; align-items: flex-end; animation: fadeIn .2s; }
.sheet { width: 100%; max-height: 80%; background: var(--bg-2); color: var(--text); border-radius: 22px 22px 0 0; padding: 8px 0 calc(16px + var(--safe-bottom)); overflow-y: auto; animation: slideUp .25s; }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet h4 { margin: 4px 16px 10px; display: flex; align-items: center; gap: 8px; }
.sheet .pad { padding: 0 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); z-index: 70; display: grid; place-items: center; padding: 24px; animation: fadeIn .2s; }
.modal { width: 100%; background: var(--bg-2); color: var(--text); border-radius: 24px; padding: 24px; text-align: center; animation: slideUp .25s; border: 1px solid var(--line); }
.modal .mi { font-size: 40px; margin-bottom: 6px; }
.modal h3 { margin: 0 0 8px; font-size: 20px; }
.modal p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; white-space: pre-wrap; }

/* ---------- Spiele ---------- */
.game-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 16px; }
.vs { display: flex; align-items: center; gap: 14px; font-weight: 700; }
.vs .p { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; padding: 8px; border-radius: 14px; border: 2px solid transparent; min-width: 90px; }
.vs .p.turn { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.vs .mark { font-size: 18px; font-weight: 900; }
.game-status { font-size: 18px; font-weight: 800; text-align: center; min-height: 26px; }
.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(320px, 86vw); aspect-ratio: 1; }
.ttt button { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; font-size: 52px; font-weight: 900; display: grid; place-items: center; }
.ttt button.win { background: color-mix(in srgb, var(--accent) 25%, var(--bg-2)); }
.mark-a { color: var(--accent); } .mark-b { color: var(--accent-2); }
.c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: min(360px, 92vw); padding: 10px; background: #1d4ed8; border-radius: 18px; box-shadow: inset 0 -6px 0 rgba(0,0,0,.25); }
.c4 button { aspect-ratio: 1; border-radius: 50%; background: var(--bg); box-shadow: inset 0 3px 6px rgba(0,0,0,.35); }
.c4 button.a { background: #FACC15; } .c4 button.b { background: #EF4444; }
.c4 button.win { outline: 3px solid #fff; outline-offset: -3px; }
.c4 button.drop { animation: drop .35s cubic-bezier(.3,.9,.4,1.2); }
@keyframes drop { from { transform: translateY(-260%); } to { transform: none; } }
.rps { display: flex; gap: 14px; }
.rps button { width: 90px; height: 90px; border-radius: 22px; background: var(--bg-2); border: 2px solid var(--line); font-size: 46px; transition: transform .15s; }
.rps button.on { border-color: var(--accent); transform: scale(1.08); }
.rps-reveal { display: flex; align-items: center; gap: 24px; font-size: 64px; }
.rps-reveal small { display: block; font-size: 12px; color: var(--muted); text-align: center; font-weight: 700; }
.game-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; text-align: left; }
.game-list .gi { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--bg-3); flex: none; }
.game-list b { display: block; } .game-list span { font-size: 13px; color: var(--muted); }
#flug-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.lb-row .rk { width: 24px; font-weight: 800; color: var(--muted); text-align: center; }
.lb-row.me { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.lb-row .sc { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Anrufe ---------- */
#call { background: #0b0b12; color: #fff; z-index: 90; }
#call video.remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
#call video.local { position: absolute; right: 14px; top: calc(70px + var(--safe-top)); width: 104px; height: 156px; object-fit: cover; border-radius: 16px; z-index: 3; background: #222; box-shadow: 0 6px 20px rgba(0,0,0,.5); transform: scaleX(-1); }
#call video.local.back { transform: none; }
.call-info { position: absolute; left: 0; right: 0; top: calc(60px + var(--safe-top)); display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 2; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.call-info h3 { margin: 6px 0 0; font-size: 26px; }
.call-info .st { color: rgba(255,255,255,.8); font-variant-numeric: tabular-nums; }
.call-info.small { top: calc(14px + var(--safe-top)); flex-direction: row; justify-content: flex-start; padding: 0 16px; }
.call-info.small h3 { font-size: 16px; margin: 0; }
.call-bg { position: absolute; inset: 0; background: radial-gradient(600px 400px at 50% 30%, color-mix(in srgb, var(--c) 55%, transparent), transparent 70%), #0b0b12; }
.call-ctrls { position: absolute; left: 0; right: 0; bottom: calc(36px + var(--safe-bottom)); display: flex; justify-content: center; gap: 18px; z-index: 3; }
.call-ctrls button { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); backdrop-filter: blur(10px); color: #fff; }
.call-ctrls button.off { background: #fff; color: #000; }
.call-ctrls .hang { background: #EF4444; }
.call-ctrls .accept { background: #22C55E; }
.call-ctrls .hang svg { transform: rotate(135deg); }
.ringing .av { animation: ring 1.4s ease-in-out infinite; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); } 50% { box-shadow: 0 0 0 22px rgba(255,255,255,0); } }

/* ---------- Admin ---------- */
.adm-tabs { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; flex: none; border-bottom: 1px solid var(--line); }
.adm-tabs button { padding: 8px 14px; border-radius: 999px; background: var(--bg-3); font-weight: 700; font-size: 14px; white-space: nowrap; position: relative; }
.adm-tabs button.on { background: var(--accent-grad); color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 16px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; padding: 6px 0 0; }
.bars i { flex: 1; background: var(--accent-grad); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars-lbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.adm-user { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.adm-user .top { display: flex; align-items: center; gap: 12px; }
.adm-user .meta { flex: 1; min-width: 0; }
.adm-user .meta b { display: flex; align-items: center; gap: 6px; }
.adm-user .meta span { font-size: 12.5px; color: var(--muted); }
.adm-user .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.tag.admin { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.tag.banned { background: rgba(255,61,113,.15); color: var(--snap); }
.tag.online { background: rgba(34,197,94,.15); color: var(--ok); }
.report { margin: 10px 16px; padding: 14px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.report .rh { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.report .reason { margin: 8px 0; font-weight: 600; }
.report blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); white-space: pre-wrap; }
.report img { max-width: 140px; border-radius: 10px; display: block; margin: 8px 0; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(20px); }
