/* ═══════════════════════════════════════════════════
   GYMBUDDY – Style Sheet
   Dark Mode · Apple-Aesthetic · Neon Lime Accent
═══════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────── */
:root {
  --bg:          #000000;
  --s1:          #121212;
  --s2:          #1C1C1E;
  --s3:          #2C2C2E;
  --border:      rgba(255,255,255,0.06);
  --border-md:   rgba(255,255,255,0.12);
  --accent:      #C8FF57;
  --accent-glow: rgba(200,255,87,0.18);
  --accent-dim:  rgba(200,255,87,0.10);
  --t1:          #FFFFFF;
  --t2:          rgba(255,255,255,0.55);
  --t3:          rgba(255,255,255,0.28);
  --red:         #FF453A;
  --green:       #30D158;
  --blue:        #0A84FF;
  --r-sm:        12px;
  --r-md:        16px;
  --r-lg:        20px;
  --r-xl:        24px;
  --nav-h:       80px;
  --safe-bot:    env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 20px);
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-user-select: none;
  user-select: none;
}
html {
  min-height: 100%;
  min-height: -webkit-fill-available;
}
html, body {
  height: 100%; width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--t1);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}
#app-shell {
  min-height: 0;
  min-height: -webkit-fill-available;
}
.app-main, .screen {
  min-height: 0;
}
/* Scrollbars global ausblenden (Scrollen bleibt aktiv) */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
input, button { font-family: inherit; outline: none; border: none; background: none; }
button { cursor: pointer; }

/* ══════════════════════════════════════════════════
   SPLASH SCREEN
══════════════════════════════════════════════════ */
.splash-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), 
              visibility 0.7s, 
              filter 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transform: scale(1);
  filter: blur(0);
}
.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  filter: blur(10px);
  transform: scale(1.05);
}
.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: smoothReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.splash-logo { margin-bottom: 16px; }
.splash-logo svg { overflow: visible; }

.lightning-path {
  stroke-dasharray: 75;
  stroke-dashoffset: 75;
  fill: transparent;
  animation: drawLightning 1.6s cubic-bezier(0.65, 0, 0.35, 1) forwards,
             fillLightning 0.5s 1.5s ease-out forwards;
}
input, textarea, [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}


.splash-brand {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--t1);
}
.splash-loader {
  width: 140px; height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px; margin-top: 32px; overflow: hidden; position: relative;
}
.splash-loader-bar {
  position: absolute; top: 0; left: 0; height: 100%; width: 30%;
  background: var(--accent); border-radius: 2px; box-shadow: 0 0 8px var(--accent);
  animation: smoothLoader 1.4s cubic-bezier(0.77, 0, 0.17, 1) infinite;
}

/* ══════════════════════════════════════════════════
   SCREEN SYSTEM
══════════════════════════════════════════════════ */
.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .22s ease, transform .22s ease;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.screen-scroll {
  position: absolute;
  inset: 0;
  bottom: calc(var(--nav-h) + var(--safe-bot));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 0 16px;
  scrollbar-width: none;
}
.screen-scroll::-webkit-scrollbar { display: none; }

#app-shell {
  position: fixed; inset: 0; display: flex; flex-direction: row;
}
#app-shell.hidden { display: none; }

/* ── Discord Style Sidebar ─────────────────────── */
.group-sidebar {
  width: 76px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0; gap: 12px;
  overflow-y: auto; flex-shrink: 0; z-index: 50;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.group-sidebar::-webkit-scrollbar { display: none; }
.sidebar-item-wrap { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; }
.sidebar-pill {
  position: absolute; left: 0; width: 4px; height: 8px;
  background: var(--t1); border-radius: 0 4px 4px 0;
  transition: height .2s ease, background .2s ease; opacity: 0;
}
.sidebar-pill.active { height: 40px; opacity: 1; }
.sidebar-item-wrap:hover .sidebar-pill:not(.active) { height: 20px; opacity: 1; background: var(--t3); }

.sidebar-btn {
  width: 48px; height: 48px; border-radius: 24px;
  background: var(--s2); color: var(--accent); border: 1px solid var(--border-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; overflow: hidden;
  transition: all .2s cubic-bezier(0.25, 1, 0.5, 1); cursor: pointer;
}
.sidebar-btn img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-btn:hover { border-radius: 16px; background: var(--accent); color: var(--accent-text, #000); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.sidebar-btn.active { border-radius: 16px; background: var(--accent); color: var(--accent-text, #000); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.sidebar-btn-add { background: transparent; color: var(--accent); border-color: var(--accent-dim); border-style: dashed; }
.sidebar-btn-add:hover { background: var(--accent) !important; color: var(--accent-text, #000) !important; border-color: var(--accent) !important; border-style: solid; box-shadow: 0 0 0 2px var(--accent) !important; }

.app-main { flex: 1; position: relative; overflow: hidden; background: var(--bg); }

/* ── Mobile Sidebar Overrides ───────────────────── */
.sidebar-overlay { display: none; }
.hamburger-btn {
  display: none;
  background: transparent; color: var(--t1);
  border: none; padding: 4px; margin-left: -4px; margin-right: 12px;
  cursor: pointer;
}
.screen-header-left {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

@media (max-width: 768px) {
  .sidebar-overlay {
    display: block;
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    z-index: 45; opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .sidebar-overlay.active { opacity: 1; pointer-events: all; }
  
  .group-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 50; box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .group-sidebar.open { transform: translateX(0); }
  .hamburger-btn {
    display: flex; align-items: center; justify-content: center;
  }
}

/* ── Screen Header ──────────────────────────────── */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  margin: 0 -16px 16px -16px;
  padding: calc(var(--safe-top) + 16px) 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.screen-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════════ */
#screen-login {
  opacity: 1;
  pointer-events: all;
  transform: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--bg);
}
#screen-login.active { opacity: 1; transform: none; }

.login-wrap {
  width: 100%;
  max-width: 420px;
  padding: 0 24px calc(var(--safe-bot) + 32px);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100dvh;
  justify-content: center;
}

.login-brand {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeUp .5s ease;
}
.login-logo {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 28px rgba(200,255,87,0.5));
}
.login-title {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 40%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-sub {
  font-size: 14px;
  color: var(--t3);
  font-weight: 400;
  margin-top: 6px;
  letter-spacing: 0.3px;
}

.login-section { animation: fadeUp .3s ease; }
.login-section.hidden { display: none; }

/* Auth Enhancements */
.auth-box {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.btn-google {
  background: #fff;
  color: #000;
  border: none;
  gap: 10px;
}
.btn-google:active { background: #f1f1f1; }
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--t3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border-md); }
.auth-divider span { padding: 0 10px; }

.login-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.action-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--s1);
  border: 1px solid var(--border);
  text-align: left;
}
.action-card:active { transform: scale(0.98); }
.action-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
}
.action-sub {
  font-size: 12px;
  color: var(--t2);
  line-height: 1.35;
}
.helper-text {
  font-size: 12px;
  color: var(--t3);
  margin: 10px 0 14px;
  line-height: 1.4;
}

.group-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.group-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--s1);
  color: var(--t1);
  text-align: left;
}
.group-item.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.group-item-main { flex: 1; min-width: 0; }
.group-item-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-item-sub {
  font-size: 12px;
  color: var(--t3);
  margin-top: 1px;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 12px;
}

/* User Grid */
.user-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.user-grid-loading { color: var(--t3); font-size: 14px; grid-column: 1/-1; text-align: center; padding: 20px; }
.user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: transform .15s ease, border-color .15s ease;
}
.user-card:active { transform: scale(0.96); }
.user-card .avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--s3); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--accent); }
.user-card .user-card-name { font-size: 13px; font-weight: 600; color: var(--t1); text-align: center; }

/* PIN */
.pin-dots {
  display: flex; gap: 16px; justify-content: center;
  margin: 24px 0 8px;
}
.pin-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-md);
  background: transparent;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}
.pin-dot.error {
  background: var(--red);
  border-color: var(--red);
  animation: shake .3s ease;
}
.pin-error { text-align: center; color: var(--red); font-size: 13px; margin-bottom: 8px; }

/* Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.key {
  height: 68px;
  border-radius: var(--r-md);
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--t1);
  font-size: 24px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  transition: background .1s ease, transform .1s ease;
}
.key:active { background: var(--s3); transform: scale(0.95); }
.key-ghost { background: transparent; border-color: transparent; font-size: 22px; color: var(--t2); }
.key-ghost:active { background: var(--s1); transform: scale(0.95); }
.key-empty { background: transparent; border-color: transparent; pointer-events: none; }

/* ══════════════════════════════════════════════════
   HOME SCREEN ELEMENTS
══════════════════════════════════════════════════ */
.greeting-time { font-size: 13px; color: var(--t3); font-weight: 500; }
.greeting-name { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }

.streak-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
}
.streak-label { color: var(--t2); font-weight: 400; }

/* Match Banner */
.match-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(200,255,87,0.3);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
  overflow: hidden;
}
.match-banner.hidden { display: none; }
.match-pulse {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 0% 50%, var(--accent-dim) 0%, transparent 70%);
  animation: pulseGlow 2.5s ease-in-out infinite;
}
.match-icon { font-size: 28px; position: relative; }
.match-body { display: flex; flex-direction: column; position: relative; }
.match-title { font-size: 15px; font-weight: 700; color: var(--accent); }
.match-desc { font-size: 13px; color: var(--t2); margin-top: 2px; line-height: 1.4; }

/* ══════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════ */
.card {
  background: var(--s1);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-bottom: 16px;
}
.card-flat { padding: 0; overflow: hidden; }
.card-flat .card-header {
  padding: 18px 18px 0;
  margin-bottom: 8px;
}
#rank-catalog-card.card-flat {
  overflow: visible;
}
.rank-catalog-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  margin: 0;
}
.rank-catalog-toggle .card-label {
  line-height: 1.1;
}
.card-flat .rank-catalog-toggle {
  padding: 16px 18px !important;
  margin-bottom: 0 !important;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-label { font-size: 12px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--t3); }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  background: var(--s3);
  color: var(--t2);
  letter-spacing: 0.2px;
}
.chip-green { background: rgba(48,209,88,0.15); color: var(--green); }
.chip-gray { background: var(--s2); color: var(--t3); border: 1px dashed var(--border-md); }
.chip-accent { background: var(--accent-dim); color: var(--accent); }
.chip.rank-rookie { background: rgba(130,95,60,0.2); color: #C9A37D; border: 1px solid rgba(201,163,125,0.45); }
.chip.rank-bronze { background: rgba(146,95,47,0.2); color: #CD7F32; border: 1px solid rgba(205,127,50,0.45); }
.chip.rank-silver { background: rgba(173,180,189,0.2); color: #C0C0C0; border: 1px solid rgba(192,192,192,0.45); }
.chip.rank-gold { background: rgba(255,215,0,0.18); color: #FFD700; border: 1px solid rgba(255,215,0,0.5); }
.chip.rank-mint-machine { background: rgba(110,231,183,0.18); color: #6EE7B7; border: 1px solid rgba(110,231,183,0.5); }
.chip.rank-aqua-athlete { background: rgba(34,211,238,0.18); color: #22D3EE; border: 1px solid rgba(34,211,238,0.5); }
.chip.rank-pink-panther { background: rgba(255,79,163,0.18); color: #FF4FA3; border: 1px solid rgba(255,79,163,0.5); }
.chip.rank-ruby-rhino { background: rgba(224,17,95,0.18); color: #E0115F; border: 1px solid rgba(224,17,95,0.5); }
.chip.rank-emerald-elite { background: rgba(0,194,110,0.18); color: #00C26E; border: 1px solid rgba(0,194,110,0.5); }
.chip.rank-sapphire-spartan { background: rgba(15,82,186,0.2); color: #4E8DF5; border: 1px solid rgba(78,141,245,0.5); }
.chip.rank-obsidian-ox { background: rgba(58,58,70,0.35); color: #D0D3DF; border: 1px solid rgba(208,211,223,0.35); }
.chip.rank-diamond-demigod { background: rgba(185,242,255,0.18); color: #B9F2FF; border: 1px solid rgba(185,242,255,0.5); }
.chip.rank-cosmic-champion { background: linear-gradient(135deg, rgba(62,25,98,0.35), rgba(20,64,124,0.35)); color: #D7C2FF; border: 1px solid rgba(215,194,255,0.5); }

/* Status Card */
.status-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.input-group { display: flex; flex-direction: column; gap: 4px; }
.input-group.flex-grow { flex: 1; min-width: 140px; }
.input-micro-label { font-size: 11px; color: var(--t3); font-weight: 500; }
.input-inline {
  background: var(--s2);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--t1);
  font-size: 15px;
  font-family: 'Outfit', sans-serif;
  width: 100%;
  transition: border-color .15s ease;
}
.input-inline:focus { border-color: var(--accent); }

.status-display-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.status-time-big { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); cursor: pointer; transition: opacity .2s ease; }
.status-time-big:not(.skipped):active { opacity: 0.7; }
.status-time-big.skipped { color: var(--t3); text-decoration: line-through; font-size: 28px; }
.status-loc { font-size: 14px; color: var(--t2); }

/* Today Workout */
.workout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.workout-row:last-child { border-bottom: none; }
.exercise-card {
  padding: 14px 18px; margin-bottom: 10px; border-radius: var(--r-md); background: var(--s2);
  border: 1px solid var(--border-md); cursor: pointer; transition: all 0.15s ease;
}
.exercise-card:active { transform: scale(0.98); background: var(--s3); }
.exercise-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.exercise-card-pr { font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-dim); padding: 2px 8px; border-radius: 6px; }
.exercise-actions-row { margin-top: 8px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.strength-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.strength-dormant { color: #8b939e; background: rgba(100,110,120,0.18); border-color: rgba(120,130,140,0.4); }
.strength-ember { color: #c5ccd6; background: rgba(180,100,60,0.12); border-color: rgba(200,120,80,0.35); }
.strength-novice { color: #d6dde6; background: rgba(154,166,179,0.16); border-color: rgba(154,166,179,0.45); }
.strength-builder { color: #9ad8ff; background: rgba(45,143,255,0.16); border-color: rgba(45,143,255,0.45); }
.strength-athlete { color: #80f0b4; background: rgba(48,209,88,0.16); border-color: rgba(48,209,88,0.45); }
.strength-beast { color: #ffd77a; background: rgba(255,159,10,0.17); border-color: rgba(255,159,10,0.5); box-shadow: 0 0 0 1px rgba(255,159,10,0.22) inset; }
.strength-elite { color: #ff84c5; background: rgba(255,79,163,0.2); border-color: rgba(255,79,163,0.58); box-shadow: 0 0 12px rgba(255,79,163,0.25); }
.strength-master { color: #d7b3ff; background: rgba(191,90,242,0.2); border-color: rgba(191,90,242,0.55); box-shadow: 0 0 12px rgba(191,90,242,0.24); }
.strength-legend { color: #ffe6a3; background: rgba(255,214,102,0.22); border-color: rgba(255,214,102,0.6); box-shadow: 0 0 14px rgba(255,214,102,0.28); }
/* Stärke-Rang Singularität: vollständiges Styling unten bei .strength-badge.strength-singularity + .rank-singularity-cosmic */
.strength-mythic { color: #b9f2ff; background: rgba(137,247,254,0.22); border-color: rgba(137,247,254,0.62); box-shadow: 0 0 14px rgba(137,247,254,0.3); }

.muscle-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--t1);
  border: 1px solid var(--border-md);
  margin: 6px 0 8px;
}

.workout-name { font-size: 16px; font-weight: 600; }
.workout-muscles { font-size: 12px; color: var(--t2); margin-top: 2px; }
.workout-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.workout-dur { font-size: 12px; color: var(--t3); font-weight: 500; }
.workout-dur-accent { color: var(--accent); font-weight: 700; font-size: 13px; }

.empty-state-sm { color: var(--t3); font-size: 14px; text-align: center; padding: 12px 0; }
.rest-day { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 20px 0; color: var(--t2); font-size: 15px; font-weight: 500; }

/* ══════════════════════════════════════════════════
   PLAN SCREEN
══════════════════════════════════════════════════ */
.routine-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .15s ease;
}
.routine-card:active { transform: scale(0.98); }
.routine-card-press { animation: routinePressFlash .16s ease; }
.routine-card-removing {
  opacity: 0;
  transform: translateX(20px) scale(0.98);
  transition: opacity .14s ease, transform .14s ease;
}
.routine-color-bar {
  width: 3px;
  height: 44px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}
.routine-info { flex: 1; min-width: 0; }
.routine-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.routine-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px;
  border-radius: 50px;
  background: var(--s3);
  color: var(--t2);
}
.tag-day { background: var(--accent-dim); color: var(--accent); }
.routine-meta { font-size: 12px; color: var(--t3); margin-top: 4px; }

.routine-actions {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.btn-icon-sm {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--t2);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
.btn-icon-sm:active { background: var(--s3); }
.btn-icon-sm.danger:active { background: rgba(255,69,58,0.15); color: var(--red); }
.btn-icon-sm.busy {
  opacity: 0.65;
  pointer-events: none;
  transform: scale(0.95);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--t3);
  font-size: 14px;
  padding: 48px 20px;
}

/* Fake Search Bar Button */
.search-bar-btn {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--t3);
  font-size: 15px;
  margin-bottom: 16px;
  transition: background 0.15s ease;
}
.search-bar-btn:active {
  background: rgba(255,255,255,0.1);
}

/* ══════════════════════════════════════════════════
   BUDDIES SCREEN
══════════════════════════════════════════════════ */
.buddy-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.buddy-row:last-child {
  border-bottom: none;
}
.avatar-sm {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--s3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-sm img,
.avatar-lg img,
.group-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.avatar-wrap { position: relative; display: inline-block; flex-shrink: 0; }
.online-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 14px; height: 14px; background: var(--green);
  border: 2px solid var(--bg); border-radius: 50%; z-index: 2;
}
.group-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--s3);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.buddy-row-info {
  flex: 1;
  min-width: 0;
}
.buddy-row-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buddy-row-workout {
  font-size: 13px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buddy-row-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--s2);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  min-width: 52px;
}
.buddy-row-count {
  font-size: 16px;
  font-weight: 800;
  color: var(--t1);
  line-height: 1;
}
.buddy-row-lbl {
  font-size: 10px;
  color: var(--t3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Pinned Carousel Absolute Crossfade System */
#chat-pinned-carousel { position: relative; width: 100%; display: block; min-height: 20px; }
.pinned-item { position: absolute; top: 0; left: 0; width: 100%; opacity: 0; visibility: hidden; transition: opacity 0.3s ease; pointer-events: none; }
.pinned-item.active { position: relative; opacity: 1; visibility: visible; pointer-events: auto; z-index: 2; }
#pinned-progress-circle.running { animation: pinned-progress-fill 10s linear forwards; }
@keyframes pinned-progress-fill {
  from { stroke-dashoffset: 62.83; }
  to { stroke-dashoffset: 0; }
}
.pinned-item-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px;
  color: var(--t1); font-size: 13px; line-height: 1.4; transition: white-space 0s;
}

.online-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  background: rgba(48,209,88,0.12);
  color: var(--green);
}
.admin-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  text-transform: uppercase;
}

.buddy-admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-md);
}
.btn-action-sub {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
  background: var(--s2);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  transition: all .15s ease;
}
.btn-action-sub:active { background: var(--s3); transform: scale(0.97); }
.btn-action-sub.danger { color: var(--red); background: rgba(255,69,58,0.05); border-color: rgba(255,69,58,0.2); }
.btn-action-sub.danger:active { background: rgba(255,69,58,0.15); }
.btn-action-sub.primary { color: var(--accent); background: var(--accent-dim); border-color: var(--accent); }

/* —— Social-Links (Markenfarben, Buddy-Modal & Profil) —— */
.social-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  min-height: 48px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
}
.social-pill:hover { filter: brightness(1.06); }
.social-pill:active { transform: scale(0.97); }
.social-pill .social-pill-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.social-pill .social-pill-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}

.social-pill-instagram {
  color: #fff;
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border: none;
  /* Eine Linie statt hellem Rand auf dem Verlauf: dezenter Außenschatten */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.14),
    0 4px 18px rgba(0, 0, 0, 0.22);
}
.social-pill-instagram:hover { color: #fff; }

.social-pill-tiktok {
  color: #fff;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 0 rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.4);
}
.social-pill-tiktok:hover { color: #fff; }

/* Snapchat-Pille: gelb, Schriftzug = gleiches warmes Off-White wie das Icon */
.social-pill-snapchat {
  color: rgba(255, 250, 242, 0.92);
  background: linear-gradient(180deg, #f7e14a 0%, #e6c619 100%);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 1px 2px rgba(0,0,0,0.1);
}
.social-pill-snapchat:hover {
  color: rgba(255, 250, 242, 0.92);
  filter: brightness(1.04);
}
.social-pill-snapchat .social-pill-ico {
  color: rgba(255, 250, 242, 0.92);
  width: 22px;
  height: 22px;
}
.social-pill-snapchat .social-pill-ico svg {
  width: 18px;
  height: 18px;
  transform: none;
  transform-origin: center center;
  opacity: 0.95;
}

.social-label-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.social-label-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.social-label-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}
.social-label-ico--instagram {
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  border: none;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.2);
}
.social-label-ico--tiktok {
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
/* Snapchat: Gelb, Icon + nebenstehender Schriftzug in warmem Off-White */
.social-label-wrap:has(> .social-label-ico--snapchat) {
  color: rgba(255, 250, 242, 0.92);
}
.social-label-ico--snapchat {
  background: linear-gradient(180deg, #f7e14a 0%, #e6c619 100%);
  color: rgba(255, 250, 242, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 2px 6px rgba(0,0,0,0.2);
}
.social-label-ico--snapchat svg {
  width: 18px;
  height: 18px;
  display: block;
  transform: none;
  filter: none;
  opacity: 0.95;
}

/* Profil: Geschlecht — gleiche Außenränder wie .settings-row; Segment muss .seg-ctrl überschreiben (steht unten) */
.settings-gender-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 4px 18px 16px;
  margin: 0;
  background: var(--s1);
  border: none;
}
.settings-gender-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-gender-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--t1);
  letter-spacing: 0.02em;
}
.settings-gender-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--t3);
  font-weight: 500;
}
/* Zwei Klassen: überschreibt späteres, generisches .seg-ctrl */
.seg-ctrl.seg-ctrl--profile-gender {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 0;
  margin: 0;
  background: var(--s2) !important;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm) !important;
  padding: 3px;
  gap: 2px;
  box-shadow: none;
}
.seg-ctrl.seg-ctrl--profile-gender .seg-btn {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  min-height: 40px;
  height: auto;
  max-height: none;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--t2);
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  transition: all 0.15s ease;
}
.seg-ctrl.seg-ctrl--profile-gender .seg-btn.active {
  background: var(--s3) !important;
  color: var(--t1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
@media (max-width: 380px) {
  .seg-ctrl.seg-ctrl--profile-gender .seg-btn {
    font-size: 11px;
    padding: 6px 2px;
  }
}

.favorite-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-md);
  background: var(--s2);
  color: var(--t2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.favorite-btn span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.favorite-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.favorite-btn:active {
  transform: scale(0.95);
}

.favorite-btn.active {
  color: #111;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* ══════════════════════════════════════════════════
   CHAT (iMessage Style)
══════════════════════════════════════════════════ */
.chat-switcher {
  display: flex; gap: 14px; padding: 12px 16px;
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.5);
  flex-shrink: 0;
  align-items: center;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}
.chat-switcher::-webkit-scrollbar { display: none; }
.chat-switch-separator {
  width: 1px;
  height: 42px;
  flex: 0 0 1px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.55) 0 4px,
    transparent 4px 8px
  );
  opacity: 0.6;
  margin: 0 2px;
}
.chat-switch-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; outline: none; cursor: pointer;
  opacity: 0.5; transition: opacity 0.2s, transform 0.2s;
  min-width: 50px;
}
.chat-switch-btn.active { opacity: 1; transform: scale(1.05); }
.chat-switch-btn-group .chat-switch-avatar { box-shadow: 0 0 0 1px var(--accent) inset; }
.chat-switch-btn-private .chat-switch-avatar { box-shadow: 0 0 0 1px var(--border-md) inset; }
.chat-switch-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--s3); display: flex; align-items: center; justify-content: center;
  border: 2px solid transparent; overflow: hidden;
  font-size: 18px; font-weight: 700; color: var(--t1);
}
.chat-switch-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-switch-btn.active .chat-switch-avatar { border-color: var(--accent); }
.chat-switch-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--t1);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-private-dot { color: var(--t3); margin-left: 4px; font-size: 10px; }

.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

.chat-typing-indicator {
  font-size: 12px; color: var(--t2); font-style: italic;
  padding: 4px 16px 8px; background: var(--bg);
}
.chat-read-receipt {
  font-size: 10px; color: var(--t3); text-align: right;
  margin-top: 2px; padding-right: 4px;
}

.avatar-xs {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--s3);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-xs img { width: 100%; height: 100%; object-fit: cover; }

.chat-row { display: flex; gap: 8px; margin-bottom: 2px; }
.chat-row.new-sender { margin-top: 14px; }
.chat-row.mine { justify-content: flex-end; }

.chat-avatar-container { width: 28px; flex-shrink: 0; display: flex; align-items: flex-start; margin-top: 2px; }

.chat-msg-content { max-width: 85%; display: flex; flex-direction: column; }
.chat-row.mine .chat-msg-content { align-items: flex-end; }
.chat-row.other .chat-msg-content { align-items: flex-start; }

.chat-sender { font-size: 11px; font-weight: 600; color: var(--t3); margin-bottom: 4px; margin-left: 12px; }
.chat-date-header { text-align: center; font-size: 11px; font-weight: 600; color: var(--t3); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.5px; }

.chat-bubble {
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.4;
  border-radius: 18px;
  word-break: break-word;
  color: #ffffff; /* Angenehmes Weiß für alle Nachrichten */
}

.chat-row.mine .chat-bubble { background: #2A2A2D; border: 1px solid var(--border-md); border-radius: 18px 4px 4px 18px; }
.chat-row.mine.new-sender .chat-bubble { border-top-right-radius: 18px; }
.chat-row.mine.last-in-cluster .chat-bubble { border-bottom-right-radius: 18px; }

.chat-row.other .chat-bubble { background: #161618; border: 1px solid var(--border-md); border-radius: 4px 18px 18px 4px; }
.chat-row.other.new-sender .chat-bubble { border-top-left-radius: 18px; }
.chat-row.other.last-in-cluster .chat-bubble { border-bottom-left-radius: 18px; }

.chat-bubble.media-only {
  padding: 0;
  overflow: hidden;
}
.chat-bubble.media-only .chat-media-grid {
  border-radius: 0;
  margin-bottom: 0;
}

.chat-bubble-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
}
.chat-reactions {
  display: inline-flex;
  align-self: flex-end;
  gap: 4px;
  background: var(--s2);
  border: 1px solid var(--border-md);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  margin-top: -12px;
  margin-right: 12px;
  z-index: 5;
}
.chat-row.mine .chat-reactions {
  align-self: flex-start;
  margin-right: 0;
  margin-left: 12px;
}

.chat-meta { font-size: 11px; color: var(--t3); margin-top: 4px; padding: 0 4px; }

.chat-media-wrap { position: relative; display: inline-block; }
.chat-media-grid { display: grid; gap: 4px; margin-bottom: 6px; border-radius: 12px; overflow: hidden; width: 100%; min-width: 220px; max-width: 280px; }
.chat-media-grid[data-count="1"] { grid-template-columns: 1fr; }
.chat-media-grid[data-count="2"], .chat-media-grid[data-count="3"], .chat-media-grid[data-count="4"] { grid-template-columns: 1fr 1fr; }
.chat-media-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--s2);
  border-radius: 8px;
  overflow: hidden;
}
.chat-media {
  width: 100%;
  height: auto;
  min-height: 180px;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.chat-media-link-fallback {
  display: block;
  padding: 6px;
  text-align: center;
  font-size: 11px;
  color: var(--t2);
  background: var(--s3);
  text-decoration: none;
  border-top: 1px solid var(--border-md);
}
.btn-chat-options {
  background: transparent;
  color: var(--t3);
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
}
.btn-chat-options:active {
  color: var(--t1);
  transform: scale(0.9);
}
.chat-text { word-break: break-word; font-size: 15px; }
.chat-link { color: var(--accent); text-decoration: none; font-weight: 600; }

.chat-link-preview {
  display: flex; gap: 10px; align-items: center;
  background: rgba(0,0,0,0.3);
  padding: 10px 12px; border-radius: 10px;
  margin-top: 8px; text-decoration: none; border: 1px solid var(--border-md);
}
.clp-icon { color: var(--accent); display: flex; align-items: center; justify-content: center; }
.clp-details { display: flex; flex-direction: column; overflow: hidden; }
.clp-domain { font-size: 13px; font-weight: 700; color: #fff; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.clp-url { font-size: 11px; color: var(--t2); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin-top: 2px; }

.chat-preview-item { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.chat-preview-item img, .chat-preview-item video { width: 100%; height: 100%; object-fit: cover; }
.chat-preview-rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; backdrop-filter: blur(4px); }

/* ══════════════════════════════════════════════════
   PINNED BANNER (EXPANDER)
══════════════════════════════════════════════════ */
#chat-pinned-banner {
  max-height: 54px;
  transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1), padding 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
#chat-pinned-banner.expanded {
  max-height: 400px;
  padding-bottom: 16px;
}
#chat-pinned-banner.expanded .pinned-item-text {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 15;
  -webkit-box-orient: vertical;
}
.pinned-item-jump {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
}
#chat-pinned-banner.expanded .pinned-item-jump {
  opacity: 1;
  max-height: 20px;
  margin-top: 8px;
}

/* ══════════════════════════════════════════════════
   PROFILE SCREEN
══════════════════════════════════════════════════ */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 28px;
}
.profile-hero .profile-hero-rank {
  margin-top: 10px;
  max-width: min(100%, 340px);
  justify-content: center;
  text-align: center;
}
/* Singularität-Theme: leicht kühlerer Hintergrund, damit Wechsel zu Neon/Standard sichtbar ist */
html[data-gb-theme="singularity_strength"] {
  --s1: #0a0b10;
  --s2: #12141c;
}
.avatar-lg {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--s3), var(--s2));
  border: 2px solid var(--border-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 800;
  color: var(--accent);
  margin-bottom: 14px;
  overflow: hidden;
}
.profile-name { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.profile-sub { font-size: 13px; color: var(--t3); margin-top: 4px; }
.profile-badge-title {
  display: inline-block; margin-top: 8px; padding: 4px 10px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  border-radius: 6px; background: rgba(255,255,255,0.08); color: var(--accent);
  border: 1px solid var(--border-md);
}
.profile-badge-title.rank-rookie { background: rgba(130,95,60,0.2); color: #C9A37D; border-color: rgba(201,163,125,0.45); }
.profile-badge-title.rank-bronze { background: rgba(146,95,47,0.2); color: #CD7F32; border-color: rgba(205,127,50,0.45); }
.profile-badge-title.rank-silver { background: rgba(173,180,189,0.2); color: #C0C0C0; border-color: rgba(192,192,192,0.45); }
.profile-badge-title.rank-gold { background: rgba(255,215,0,0.18); color: #FFD700; border-color: rgba(255,215,0,0.5); }
.profile-badge-title.rank-mint-machine { background: rgba(110,231,183,0.18); color: #6EE7B7; border-color: rgba(110,231,183,0.5); }
.profile-badge-title.rank-aqua-athlete { background: rgba(34,211,238,0.18); color: #22D3EE; border-color: rgba(34,211,238,0.5); }
.profile-badge-title.rank-pink-panther { background: rgba(255,79,163,0.18); color: #FF4FA3; border-color: rgba(255,79,163,0.5); }
.profile-badge-title.rank-ruby-rhino { background: rgba(224,17,95,0.18); color: #E0115F; border-color: rgba(224,17,95,0.5); }
.profile-badge-title.rank-emerald-elite { background: rgba(0,194,110,0.18); color: #00C26E; border-color: rgba(0,194,110,0.5); }
.profile-badge-title.rank-sapphire-spartan { background: rgba(15,82,186,0.2); color: #4E8DF5; border-color: rgba(78,141,245,0.5); }
.profile-badge-title.rank-obsidian-ox { background: rgba(58,58,70,0.35); color: #D0D3DF; border-color: rgba(208,211,223,0.35); }
.profile-badge-title.rank-diamond-demigod { background: rgba(185,242,255,0.18); color: #B9F2FF; border-color: rgba(185,242,255,0.5); }
.profile-badge-title.rank-cosmic-champion { background: linear-gradient(135deg, rgba(62,25,98,0.35), rgba(20,64,124,0.35)); color: #D7C2FF; border-color: rgba(215,194,255,0.5); }

.rank-inventory-hint {
  margin: 0;
  padding: 0 18px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--t3);
  font-weight: 500;
}
.rank-inventory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 16px;
}
.rank-inventory-chip {
  cursor: pointer;
  border: 1px solid var(--border-md) !important;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.rank-inventory-chip:hover {
  border-color: var(--t2) !important;
}
.rank-inventory-chip:active {
  transform: scale(0.98);
}
.rank-inventory-chip.rank-inventory-chip--active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: rgba(200, 255, 100, 0.35) !important;
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.rank-inventory-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: auto;
  padding: 4px 10px;
  border-radius: 50px;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-inventory-chip.strength-badge {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
}
.rank-inventory-chip.chip {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 4px 10px;
  border-radius: 50px;
}

/* Singularität — „Endgame“-Badge: Glass, kühler Stahl, Gold-/Iris-Accent, harte Kanten (ohne weichen Glow-Brei) */
@supports (backdrop-filter: blur(1px)) {
  .profile-badge-title.rank-singularity-cosmic,
  .chip.rank-singularity-cosmic,
  .reward-singularity-chip,
  .strength-badge.strength-singularity {
    backdrop-filter: blur(10px) saturate(1.2);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
  }
}
.profile-badge-title.rank-singularity-cosmic,
.chip.rank-singularity-cosmic,
.reward-singularity-chip,
.strength-badge.strength-singularity {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  padding: 4px 13px 4px 10px;
  min-height: 28px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f4f7ff;
  border: 1px solid rgba(114, 142, 222, 0.65);
  background:
    linear-gradient(180deg, rgba(28, 47, 108, 0.34) 0%, rgba(28, 47, 108, 0.12) 18%, transparent 36%),
    linear-gradient(145deg, #090f25 0%, #091739 46%, #0a1030 100%);
  box-shadow:
    inset 0 0 0 1px rgba(170, 198, 255, 0.16),
    inset 0 -1px 0 rgba(20, 42, 96, 0.85),
    0 0 0 1px rgba(25, 37, 82, 0.9),
    0 0 14px rgba(64, 110, 225, 0.22);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.profile-badge-title.rank-singularity-cosmic::after,
.chip.rank-singularity-cosmic::after,
.reward-singularity-chip::after,
.strength-badge.strength-singularity::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  border: 1px solid rgba(129, 156, 235, 0.42);
  pointer-events: none;
  z-index: 0;
}
.profile-badge-title.rank-singularity-cosmic { margin-top: 8px; font-size: 10px; }
.chip.rank-singularity-cosmic { line-height: 1.2; }
.profile-badge-title.rank-singularity-cosmic::before,
.chip.rank-singularity-cosmic::before,
.reward-singularity-chip::before,
.strength-badge.strength-singularity::before {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 1;
  position: relative;
  background: radial-gradient(circle at 32% 28%, #f6ffff 0%, #b9f1ff 34%, #5ecbff 65%, #1f4e8a 100%);
  box-shadow: 0 0 0 1px rgba(8, 25, 58, 0.9), 0 0 10px rgba(93, 203, 255, 0.45);
}
.strength-badge.strength-singularity,
.chip.rank-singularity-cosmic,
.profile-badge-title.rank-singularity-cosmic {
  isolation: isolate;
  color: #eef3ff;
}
.rank-inventory-chip.strength-badge.strength-singularity,
.rank-inventory-chip.chip.rank-singularity-cosmic {
  color: #eef3ff !important;
  background:
    linear-gradient(180deg, rgba(28, 47, 108, 0.34) 0%, rgba(28, 47, 108, 0.12) 18%, transparent 36%),
    linear-gradient(145deg, #090f25 0%, #091739 46%, #0a1030 100%) !important;
}
.rank-inventory-chip.strength-badge.strength-singularity { border-radius: 999px; }
.rank-inventory-chip.chip.rank-singularity-cosmic.rank-inventory-chip--active,
.rank-inventory-chip.strength-badge.strength-singularity.rank-inventory-chip--active {
  outline: 2px solid rgba(146, 191, 255, 0.95);
  outline-offset: 1px;
}

.photo-preview-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}

.photo-preview-circle {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--s3), var(--s2));
  border: 1px solid var(--border-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  overflow: hidden;
}

.photo-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-card-accent { border-color: rgba(200,255,87,0.2); background: var(--accent-dim); }
.stat-num { font-size: 40px; font-weight: 900; letter-spacing: -2px; color: var(--t1); line-height: 1; }
.stat-card-accent .stat-num { color: var(--accent); }
.stat-lbl { font-size: 12px; color: var(--t2); font-weight: 500; }

/* Settings rows */
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  width: 100%;
  background: var(--s1);
  color: var(--t1);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  transition: background .12s ease;
}
.settings-row:active { background: var(--s2); }
.settings-row-icon { font-size: 18px; }
.settings-sep { height: 1px; background: var(--border); margin: 0 18px; }
.chevron { margin-left: auto; color: var(--t3); font-size: 20px; font-weight: 300; }
.text-red { color: var(--red); }

.group-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.group-code-label {
  font-size: 12px;
  color: var(--t3);
  margin-bottom: 3px;
}
.group-code-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  line-height: 1;
}

/* Color Swatches (Theme) */
.color-swatch {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; cursor: pointer; transition: all .2s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.2);
}
.color-swatch.active {
  transform: scale(1.08);
  outline: 2px solid var(--t1);
  outline-offset: 2px;
}
.color-swatch:active { transform: scale(0.96); filter: none; }
.color-swatch.locked { opacity: 0.35; cursor: not-allowed; }
.color-swatch.locked::after { content: "🔒"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; z-index: 2; }
/* Singularität-Swatch: rund wie die anderen, Look angelehnt ans Badge */
.color-swatch.color-swatch--singularity {
  position: relative;
  overflow: hidden;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 35% 32%, rgba(245, 255, 255, 0.95) 0%, rgba(141, 226, 255, 0.85) 20%, rgba(67, 162, 255, 0.68) 38%, transparent 39%),
    linear-gradient(160deg, #0a1230 0%, #071838 52%, #09122f 100%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(161, 187, 255, 0.52),
    inset 0 0 0 4px rgba(13, 27, 66, 0.88),
    0 0 0 1px rgba(18, 35, 86, 0.95),
    0 0 12px rgba(69, 112, 228, 0.24);
}
.color-swatch.color-swatch--singularity::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(132, 164, 243, 0.45);
}
.color-swatch.color-swatch--singularity.active {
  transform: scale(1.08);
  outline-offset: 2px;
}
.color-swatch.color-swatch--singularity.locked { opacity: 0.4; }
#theme-picker:active { background: transparent !important; }

/* Toggle Switch */
.toggle { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--s3); transition: .2s; border-radius: 26px; border: 1px solid var(--border-md); }
.toggle-slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 2px; bottom: 2px; background-color: var(--t2); transition: .2s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.toggle input:checked + .toggle-slider { background-color: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); background-color: #000; }

/* ══════════════════════════════════════════════════
   CONTEXT MENUS (Rechtsklick & Long Press)
══════════════════════════════════════════════════ */
.chat-context-menu {
  position: fixed;
  background: rgba(28, 28, 30, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-md);
  border-radius: 16px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 9999;
  transform-origin: top left;
  animation: popIn 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}
.ctx-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  color: var(--t1);
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.ctx-btn:active { background: var(--s3); }
.ctx-sep { height: 1px; background: var(--border-md); margin: 4px; }
.ctx-btn.text-red { color: var(--red); }

.ctx-reactions {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  gap: 8px;
}
.ctx-reaction-btn {
  font-size: 22px;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 10px;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ctx-reaction-btn:active { transform: scale(1.3); }
.ctx-reaction-btn.active {
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.22) inset;
}

/* ══════════════════════════════════════════════════
   BOTTOM NAV
══════════════════════════════════════════════════ */
.bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--t3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: color .15s ease, opacity .15s ease;
  padding-top: 4px;
}
.nav-btn.active { color: var(--accent); }
.nav-btn:active { opacity: 0.7; }
.nav-icon {
  width: 24px; height: 24px;
  stroke: currentColor;
  transition: transform .2s ease;
}

/* ══════════════════════════════════════════════════
   MODAL / BOTTOM SHEET
══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
}
.modal-overlay.hidden { display: none; }
.modal-sheet {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  background: var(--s1);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border: 1px solid var(--border-md);
  border-bottom: none;
  padding: 12px 20px calc(var(--safe-bot) + 20px);
  max-height: 90dvh;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  animation: slideUp .3s cubic-bezier(0.25, 1, 0.5, 1);
}
.modal-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--s3);
  margin: 0 auto 20px;
}
.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal-actions > button {
  flex: 1;
}

/* Form Elements */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--t3);
  margin: 16px 0 8px;
}
.form-label:first-of-type { margin-top: 0; }
.input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--t1);
  font-size: 15px;
  font-family: 'Outfit', sans-serif;
  transition: all .2s ease;
}
.input-field:focus { 
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent); 
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.input-field::placeholder { color: var(--t3); }
.input-inline.subtle-input {
  flex: 1 1 0%;
  min-width: 120px;
  width: calc(100% - 8px);
  text-align: right; border: none; background: transparent;
  padding: 0 6px 0 0; height: auto; color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.input-inline.subtle-input::placeholder { color: var(--t3); }
.input-lg { font-size: 18px; padding: 14px 16px; font-weight: 600; }
.input-num { width: 100%; text-align: center; }

.reward-catalog-wrap {
  overflow: hidden;
  transition: max-height .3s ease, opacity .25s ease;
}
.reward-catalog-wrap.collapsed {
  max-height: 0;
  opacity: 0;
}
.reward-catalog-wrap.open {
  max-height: 2600px;
  opacity: 1;
  overflow: visible;
}
.reward-catalog-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 16px;
}
.reward-catalog-section-title {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--t3);
  margin: 2px 2px 4px;
}
.reward-catalog-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-md);
  border-radius: 14px;
  background: radial-gradient(120% 120% at 100% 0%, rgba(255,255,255,0.08), rgba(255,255,255,0.01) 55%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  min-height: 98px;
}
.reward-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.reward-catalog-head--streak {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.reward-catalog-head--streak .chip {
  justify-self: start;
  min-width: 0;
}
.reward-catalog-head--strength {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.reward-catalog-tier-rule {
  color: var(--t2);
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 600;
  font-size: 11px;
  text-align: right;
}
.strength-rank-order {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--t1);
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--s2);
  border: 1px solid var(--border-md);
}
.reward-catalog-head--strength .strength-badge {
  justify-self: start;
  min-width: 0;
}
.reward-catalog-req {
  font-size: 12px;
  color: var(--t2);
  line-height: 1.35;
}
.reward-catalog-state {
  font-size: 11px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
}
.reward-catalog-state.ok {
  color: var(--green);
}
@media (max-width: 520px) {
  .reward-catalog-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.lb-disabled-control {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.chat-poll-wrap {
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 240px;
}
.chat-poll-question {
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
}
.chat-poll-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.poll-option-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-md);
  background: var(--s2);
  color: var(--t1);
}
.poll-option-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent-dim), rgba(255,255,255,0.02));
  pointer-events: none;
}
.poll-option-label,
.poll-option-stat {
  position: relative;
  z-index: 1;
}
.poll-option-label { font-weight: 600; }
.poll-option-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim) inset;
}
.poll-option-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  filter: grayscale(0.2);
}
.chat-poll-meta {
  font-size: 11px;
  color: var(--t3);
}

.chat-share-card {
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-md);
  background: var(--s2);
}
.chat-share-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--t3);
  margin-bottom: 6px;
}
.chat-share-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
}
.chat-share-meta {
  font-size: 12px;
  color: var(--t2);
  margin: 4px 0 10px;
}

.pinned-poll-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.pinned-poll-option {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-md);
  background: rgba(255,255,255,0.04);
  color: var(--t1);
  font-size: 11px;
}
.pinned-poll-option.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.pinned-poll-option:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.poll-modal-sheet {
  max-width: 430px;
}
.poll-options-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.poll-option-row {
  display: flex;
  gap: 8px;
}
.poll-option-row .input-field {
  margin: 0;
}
.poll-option-remove {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-md);
  color: var(--t2);
  background: var(--s2);
}

.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.no-spinner {
  -moz-appearance: textfield;
  appearance: textfield;
}

.custom-muscle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.custom-muscle-btn {
  border: 1px solid var(--border-md);
  background: linear-gradient(160deg, var(--s2), rgba(255,255,255,0.04));
  color: var(--t2);
  border-radius: 12px;
  min-height: 44px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: all .16s ease;
}

.custom-muscle-btn:active {
  transform: scale(0.98);
}

.custom-muscle-btn.selected {
  background: linear-gradient(160deg, var(--accent-dim), rgba(255,255,255,0.1));
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.2) inset;
}

.custom-ex-desc {
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}

/* Expandable Filter Panel */
.filter-panel {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
  max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.3s ease, opacity 0.3s ease;
}
.filter-panel.open { max-height: 400px; opacity: 1; padding-bottom: 8px; }

.exercise-filter-panel {
  display: block;
}

.exercise-filter-panel.open {
  max-height: 34vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.exercise-sort-wrap {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s ease;
}

.exercise-sort-wrap.open {
  max-height: 180px;
  opacity: 1;
  margin-top: 10px;
  margin-bottom: 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#leaderboard-content {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
}

#chat-messages {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  min-height: 0;
}

.lb-controls-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

/* Leaderboard Cards */
.lb-group { background: linear-gradient(170deg, var(--s2), rgba(255,255,255,0.02)); border: 1px solid var(--border-md); border-radius: var(--r-md); margin-bottom: 10px; overflow: hidden; }
.lb-group-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; }
.lb-ex-name { font-weight: 700; font-size: 15px; color: var(--t1); }
.lb-ex-max { font-weight: 800; font-size: 16px; color: var(--accent); }
.lb-ex-topline { margin-top: 4px; font-size: 12px; color: var(--t2); }
.lb-rank-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.lb-rank-row:last-child { border-bottom: none; }
.lb-rank-left { display: flex; align-items: center; gap: 12px; }
.lb-rank-pos { width: 24px; font-weight: 800; font-size: 15px; color: var(--t3); text-align: center; }
.lb-rank-pos.gold { color: #FFD700; font-size: 18px; }
.lb-rank-pos.silver { color: #C0C0C0; }
.lb-rank-pos.bronze { color: #CD7F32; }
.lb-rank-name { font-size: 14px; font-weight: 600; color: var(--t1); }
.lb-rank-weight { font-weight: 700; font-size: 15px; color: var(--accent); }

.lb-top3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 12px;
}

.lb-top3-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  min-height: 74px;
}

.lb-top3-head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--t3);
}

.lb-top3-item.gold .lb-top3-head { color: #FFD700; }
.lb-top3-item.silver .lb-top3-head { color: #C0C0C0; }
.lb-top3-item.bronze .lb-top3-head { color: #CD7F32; }

.lb-top3-item.gold {
  background: linear-gradient(160deg, rgba(255,215,0,0.15), rgba(255,255,255,0.04));
  border-color: rgba(255,215,0,0.45);
  box-shadow: 0 0 0 1px rgba(255,215,0,0.2) inset;
}

.lb-top3-item.silver {
  background: linear-gradient(160deg, rgba(192,192,192,0.14), rgba(255,255,255,0.03));
  border-color: rgba(192,192,192,0.35);
}

.lb-top3-item.bronze {
  background: linear-gradient(160deg, rgba(205,127,50,0.14), rgba(255,255,255,0.03));
  border-color: rgba(205,127,50,0.35);
}

.lb-top3-name {
  margin-top: 5px;
  font-size: 12px;
  color: var(--t1);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-top3-weight {
  margin-top: 3px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

.lb-entry-sub {
  margin-top: 4px;
  font-size: 10px;
  color: var(--t3);
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.lb-rank-list {
  border-top: 1px solid var(--border-md);
  background: rgba(0,0,0,0.22);
}

.lb-more-label {
  padding: 8px 16px;
  font-size: 11px;
  letter-spacing: 0.3px;
  color: var(--t3);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

/* Chip Grid (muscle selection) */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-select {
  padding: 7px 14px;
  border-radius: 50px;
  border: 1px solid var(--border-md);
  background: var(--s2);
  color: var(--t2);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all .15s ease;
}
.chip-select.selected {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* Day Strip */
.day-strip { display: flex; gap: 7px; }
.day-btn {
  flex: 1;
  height: 42px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-md);
  background: var(--s2);
  color: var(--t2);
  font-size: 12px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  transition: all .15s ease;
}
.day-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text, #000);
}

/* Segmented Control */
.seg-ctrl {
  display: flex;
  background: var(--s2);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  color: var(--t2);
  transition: all .15s ease;
}
.seg-btn.active {
  background: var(--s3);
  color: var(--t1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Duration Row */
.dur-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dur-group { display: flex; flex-direction: column; }

/* ══════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════ */
.btn-accent {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-text, #000);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border-radius: 16px;
  height: 52px;
  padding: 0 24px;
  transition: transform .15s ease, opacity .15s ease;
}
.btn-accent:active { transform: scale(0.97); opacity: 0.88; }
.btn-accent.btn-full { width: 100%; flex: none; }
.btn-accent.btn-sm { height: 42px; padding: 0 16px; font-size: 13px; border-radius: 12px; }
.btn-ghost {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--s2);
  border: 1px solid var(--border-md);
  color: var(--t1);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border-radius: 16px;
  height: 52px;
  padding: 0 24px;
  transition: background .15s ease, transform .15s ease;
}
.btn-ghost:active { background: var(--s3); transform: scale(0.97); }
.btn-ghost.btn-full { width: 100%; flex: none; }
.btn-ghost.btn-sm { height: 42px; padding: 0 16px; font-size: 13px; border-radius: 12px; }
.btn-text {
  display: block;
  width: 100%;
  text-align: center;
  color: var(--t3);
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  padding: 12px;
  transition: color .15s ease;
}
.btn-text:active { color: var(--t1); }
.btn-icon-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text, #000);
  font-size: 22px;
  font-weight: 400;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.btn-icon-circle:active { transform: scale(0.92); }

/* ══════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bot) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--s3);
  border: 1px solid var(--border-md);
  color: var(--t1);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 50px;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
}

.dialog-card {
  width: 100%;
  max-width: 420px;
  background: var(--s1);
  border: 1px solid var(--border-md);
  border-radius: var(--r-lg);
  padding: 18px;
}

.dialog-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.dialog-message {
  font-size: 14px;
  color: var(--t2);
  margin-top: 6px;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* Samsung Style Wheel Picker */
.wheel-picker-container { position: relative; height: 180px; display: flex; background: var(--bg); margin: 0; }
.wheel-highlight { position: absolute; top: 70px; left: 0; right: 0; height: 40px; background: rgba(255,255,255,0.08); border-top: 1px solid var(--border-md); border-bottom: 1px solid var(--border-md); pointer-events: none; z-index: 1; }
.wheel-column { flex: 1; height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; padding: 70px 0; z-index: 2; }
.wheel-column::-webkit-scrollbar { display: none; }
.wheel-item { height: 40px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--t3); scroll-snap-align: center; transition: all .2s; font-variant-numeric: tabular-nums; cursor: pointer; }
.wheel-item.selected { font-size: 26px; font-weight: 800; color: var(--accent); }
.wheel-sep { display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: var(--t1); z-index: 2; margin-top: -2px; }

/* Lightbox */
#lightbox-img {
  box-shadow: 0 12px 48px rgba(0,0,0,0.8);
}

/* Cropper Circular Mask */
.cropper-view-box,
.cropper-face {
  border-radius: 50%;
}

/* ══════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
}
@keyframes smoothReveal {
  0%   { opacity: 0; transform: scale(1.1); filter: blur(12px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes smoothLoader {
  0%   { transform: translateX(-150%); }
  100% { transform: translateX(450%); }
}
@keyframes drawLightning {
  0%   { stroke-dashoffset: 75; }
  100% { stroke-dashoffset: 0; }
}
@keyframes fillLightning {
  0%   { fill: transparent; filter: drop-shadow(0 0 0 rgba(200,255,87,0)); }
  100% { fill: var(--accent-dim); filter: drop-shadow(0 0 24px rgba(200,255,87,0.4)); }
}
@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}
@keyframes popIn {
  0%   { transform: scale(0.85); opacity: 0; }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.pop-in { animation: popIn .3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes routinePressFlash {
  0% { box-shadow: 0 0 0 0 rgba(200,255,87,0.35); }
  100% { box-shadow: 0 0 0 10px rgba(200,255,87,0); }
}

/* Neuer Rang — Modal (einmalig pro Rang) */
.modal-rank-unlock {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.modal-rank-unlock:not(.hidden) {
  pointer-events: auto;
}
.modal-rank-unlock__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.modal-rank-unlock--visible .modal-rank-unlock__backdrop {
  opacity: 1;
}
.modal-rank-unlock__panel {
  position: relative;
  width: 100%;
  max-width: 360px;
  border-radius: 20px;
  padding: 28px 24px 22px;
  background: linear-gradient(165deg, #141418 0%, #0a0a0c 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  transform: scale(0.9) translateY(16px);
  opacity: 0;
  filter: blur(4px);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, filter 0.45s ease;
  z-index: 1;
}
.modal-rank-unlock--visible .modal-rank-unlock__panel {
  transform: scale(1) translateY(0);
  opacity: 1;
  filter: blur(0);
}
.modal-rank-unlock__spark {
  position: absolute;
  top: -40px;
  left: 50%;
  width: 120px;
  height: 120px;
  margin-left: -60px;
  background: radial-gradient(circle, rgba(200, 255, 100, 0.28) 0%, transparent 70%);
  pointer-events: none;
  animation: rankUnlockPulse 2.2s ease-in-out infinite;
}
.modal-rank-unlock__title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--t1);
}
.modal-rank-unlock__sub {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--t2);
  font-weight: 500;
}
.modal-rank-unlock__preview {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.rank-unlock-preview-chip {
  font-size: 12px;
  max-width: 100%;
  justify-content: center;
}
.strength-badge.rank-unlock-preview-chip,
.chip.rank-unlock-preview-chip {
  transform: none;
  animation: rankUnlockBadge 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
@keyframes rankUnlockBadge {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes rankUnlockPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 0.9; transform: scale(1.02); }
}

/* ── Utilities ──────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
