/* ============================ Schwebende Pill-Tabbar ============================ */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--safe-bottom));
  transform: translateX(-50%);
  width: auto;
  max-width: calc(100% - 28px);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  z-index: 50;
  transition: transform var(--dur-slow) var(--ease);
}
.tabbar.is-hidden { transform: translate(-50%, 200%); }

.tab {
  display: flex;
  align-items: center;
  gap: 0;
  border: none;
  background: none;
  color: var(--text-faint);
  padding: 12px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), padding var(--dur) var(--ease-spring);
}
.tab svg { width: 24px; height: 24px; flex: none; transition: transform var(--dur) var(--ease-spring); }
.tab:hover { color: var(--text-soft); }
.tab .tab-label {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  font-size: var(--fs-sm);
  transition: max-width var(--dur-slow) var(--ease-spring), opacity var(--dur) var(--ease), margin var(--dur) var(--ease);
}
.tab.active {
  background: linear-gradient(160deg, var(--accent), var(--accent-700));
  color: #fff;
  padding: 12px 18px;
  box-shadow: 0 6px 16px -4px var(--accent);
}
.tab.active svg { transform: scale(1.06); }
.tab.active .tab-label { max-width: 120px; opacity: 1; margin-left: 9px; }

/* ============================ Wine Card (Kachel) ============================ */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 4px 18px 8px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  width: 100%;
  cursor: pointer;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card:active { transform: translateY(-1px) scale(0.99); }

.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--surface-2), #fff);
  overflow: hidden;
}
.card-media img { height: 86%; width: auto; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0,0,0,.16)); transition: transform var(--dur-slow) var(--ease); }
.card:hover .card-media img { transform: translateY(-3px) scale(1.03); }
.card-fav {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  color: var(--accent);
}
.card-body { padding: 11px 12px 13px; }
.card-name { font-weight: 800; font-size: var(--fs-sm); line-height: 1.25; }
.card-winery { color: var(--accent); font-size: var(--fs-xs); font-weight: 700; margin-top: 2px; }
.card-meta { color: var(--text-faint); font-size: var(--fs-xs); margin-top: 4px; }

/* ============================ Chips ============================ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: var(--accent-100);
  color: var(--accent-700);
  font-size: var(--fs-sm); font-weight: 700;
}
.chip svg { width: 15px; height: 15px; }

/* Filter-Pills */
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 18px 12px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.pill {
  white-space: nowrap;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: 700;
  transition: all var(--dur) var(--ease);
}
.pill.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* Suche */
.search {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 18px 4px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 11px 16px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-100); }
.search svg { width: 20px; height: 20px; color: var(--text-faint); }
.search input { border: none; outline: none; background: none; flex: 1; }

/* ============================ Wine Detail ============================ */
.detail-hero {
  position: relative;
  height: 300px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}
.detail-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,.12) 45%, rgba(0,0,0,.18) 100%);
}
.detail-hero.no-img { background: linear-gradient(150deg, var(--hero-tint, var(--accent)), var(--accent-700)); }
.detail-hero .hero-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: 16px 16px 0;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
  z-index: 2;
}
.icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.9);
  color: var(--text);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease), background var(--dur) var(--ease);
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.fav-on { background: var(--accent); color: #fff; }

.detail-body { padding: 20px 18px; margin-top: -22px; position: relative; background: var(--bg); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.detail-winery { color: var(--accent); font-weight: 800; font-size: var(--fs-sm); }
.detail-title { font-size: var(--fs-2xl); margin: 6px 0 14px; }
.detail-desc { color: var(--text-soft); line-height: 1.7; margin-top: 6px; }

/* ============================ Rating Glasses ============================ */
.rating { display: flex; gap: 12px; margin: 6px 0; justify-content: center; }
.glass {
  width: 40px; height: 46px;
  background: none; border: none; padding: 0;
  color: var(--border);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.glass svg { width: 100%; height: 100%; }
.glass.filled { color: var(--accent); }
.glass:active { transform: scale(0.85); }
.glass.pop { animation: glass-pop var(--dur-slow) var(--ease); }
.rating-label { font-weight: 800; text-align: center; font-size: var(--fs-lg); margin-bottom: 4px; min-height: 1.4em; }
.rating-avg { color: var(--text-faint); font-size: var(--fs-sm); text-align: center; margin-top: 8px; }

/* ============================ Feed (Home) ============================ */
.hero {
  position: relative; overflow: hidden;
  margin: 14px 18px 4px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--accent), var(--accent-700));
  color: #fff;
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -50px;
  width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), transparent 70%);
}
.hero-eyebrow { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .8; margin-bottom: 6px; }
.hero h2 { font-size: var(--fs-xl); line-height: 1.15; position: relative; z-index: 1; }
.hero p { opacity: .9; margin-top: 8px; position: relative; z-index: 1; }

/* Abschnittstitel mit Akzent-Strich */
.section-title { position: relative; }

.hscroll { display: flex; gap: 14px; overflow-x: auto; padding: 4px 18px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .card { min-width: 150px; max-width: 150px; scroll-snap-align: start; }

/* ============================ Toast ============================ */
.toast-wrap { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 22px); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--text); color: #fff;
  padding: 12px 18px; border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur) var(--ease);
}
.toast.out { animation: toast-out var(--dur) var(--ease) forwards; }
.toast.success { background: #1f7a4d; }
.toast.error { background: #b3261e; }

/* ============================ Skeleton ============================ */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #e9e9ee 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
.sk-card { aspect-ratio: 1/1; border-radius: var(--radius); }

/* ============================ Empty State ============================ */
.empty { text-align: center; padding: 60px 24px; color: var(--text-soft); }
.empty svg { width: 56px; height: 56px; color: var(--accent-200); margin-bottom: 12px; }
.empty h3 { font-size: var(--fs-lg); margin-bottom: 6px; color: var(--text); }

/* ============================ Profile / Settings ============================ */
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.tile-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.tile-head svg { width: 20px; height: 20px; color: var(--accent); }
.tile-head b { font-weight: 800; font-size: var(--fs-md); }

/* Gradient-Header */
.profile-hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  background: linear-gradient(150deg, var(--accent), var(--accent-700));
  color: #fff;
  box-shadow: var(--shadow);
}
.profile-hero::after {
  content: ""; position: absolute; right: -50px; top: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.profile-hero::before {
  content: ""; position: absolute; left: -30px; bottom: -50px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.ph-top { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.ph-avatar {
  width: 62px; height: 62px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  display: grid; place-items: center;
  font-size: var(--fs-xl); font-weight: 800;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35);
  animation: pop-in var(--dur-slow) var(--ease-spring) both;
}
.ph-name { font-size: var(--fs-lg); font-weight: 800; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-mail { opacity: 0.85; font-size: var(--fs-sm); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-namerow { display: flex; align-items: center; gap: 8px; }
.ph-edit, .ph-iconbtn {
  border: none; background: rgba(255,255,255,0.18); color: #fff;
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.ph-edit svg, .ph-iconbtn svg { width: 16px; height: 16px; }
.ph-edit:hover, .ph-iconbtn:hover { background: rgba(255,255,255,0.3); }
.ph-edit:active, .ph-iconbtn:active { transform: scale(0.88); }
.ph-name-input {
  flex: 1; min-width: 0; border: none; outline: none;
  background: rgba(255,255,255,0.2); color: #fff;
  border-radius: 10px; padding: 7px 11px;
  font-size: var(--fs-md); font-weight: 700;
}
.ph-name-input::placeholder { color: rgba(255,255,255,0.6); }
.ph-stats { display: flex; gap: 10px; margin-top: 20px; position: relative; z-index: 1; }
.ph-stat {
  flex: 1; text-align: center;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius); padding: 12px 6px;
}
.ph-stat b { display: block; font-size: var(--fs-xl); font-weight: 800; line-height: 1; }
.ph-stat span { font-size: var(--fs-xs); opacity: 0.9; }

/* Farb-Swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.swatch {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--border), var(--shadow-sm);
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease);
}
.swatch:hover { transform: scale(1.1); }
.swatch:active { transform: scale(0.9); }
.swatch.active { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); transform: scale(1.06); }
.swatch .check { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: 0; transform: scale(0.4); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-spring); }
.swatch .check svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.swatch.active .check { opacity: 1; transform: scale(1); }

/* ============================ Auth Screen ============================ */
.auth-wrap { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 440px; margin: 0 auto; }
.auth-logo { width: 72px; height: 72px; border-radius: 22px; background: linear-gradient(145deg, var(--accent), var(--accent-700)); display: grid; place-items: center; margin: 0 auto 18px; box-shadow: var(--shadow); color: #fff; }
.auth-logo svg { width: 38px; height: 38px; }
.auth-logo-img { width: 78%; height: 78%; object-fit: contain; }
.auth-card { background: var(--surface); border-radius: var(--radius-lg); padding: 26px 22px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: var(--radius-pill); padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: none; background: none; padding: 10px; border-radius: var(--radius-pill); font-weight: 700; color: var(--text-soft); transition: all var(--dur) var(--ease); }
.auth-tabs button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.auth-error { color: #b3261e; font-size: var(--fs-sm); font-weight: 600; min-height: 1.2em; margin-bottom: 8px; }
