/* ============================================================
   STEMPELKARTE POPUP – FachTap
   ============================================================ */

/* ── Floating Button ── */
#stempelkarteBtn {
  position: fixed;
  bottom: 72px;
  left: 16px;
  z-index: 9990;
  display: none; /* shown via JS when logged in */
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: visible;
  background: rgba(10, 8, 4, 0.82);
  border: 1px solid rgba(212, 160, 23, 0.35);
  color: goldenrod;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,.45), 0 0 0 0 rgba(212,160,23,0);
  transition: background .2s, transform .2s, box-shadow .2s;
  -webkit-tap-highlight-color: rgba(212,160,23,.15);
}
#stempelkarteBtn.visible { display: flex; }
#stempelkarteBtn:hover {
  background: rgba(212, 160, 23, 0.16);
  transform: scale(1.08);
}
#stempelkarteBtn:active { transform: scale(.94); }

/* Badge (Anzahl Stempel gesamt) */
#stempelkarteBadge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: linear-gradient(135deg, #D4A017, #b8860b);
  color: #0a0800;
  font-size: 9px; font-weight: 800;
  border-radius: 999px;
  display: none;
  align-items: center; justify-content: center;
  line-height: 1;
}
#stempelkarteBadge.visible { display: flex; }

/* ── Backdrop ── */
#stempelkarteOverlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
#stempelkarteOverlay.open {
  opacity: 1;
  pointer-events: auto;
}
#stempelkarteOverlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── Sheet ── */
.sk-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: linear-gradient(160deg, #111009 0%, #161410 100%);
  border: 1px solid rgba(212,160,23,.18);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  padding: 0 0 env(safe-area-inset-bottom);
  box-shadow: 0 -20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(212,160,23,.1);
  display: flex;
  flex-direction: column;
  transform: translateY(40px);
  transition: transform .35s cubic-bezier(.34,1.2,.64,1);
  overflow: hidden;
}
#stempelkarteOverlay.open .sk-sheet {
  transform: translateY(0);
}

/* On wider screens: centered card instead of sheet */
@media (min-width: 540px) {
  #stempelkarteOverlay {
    align-items: center;
    padding: 20px;
  }
  .sk-sheet {
    border-bottom: 1px solid rgba(212,160,23,.18);
    border-radius: 28px;
    max-width: 420px;
    transform: scale(.94) translateY(12px);
  }
  #stempelkarteOverlay.open .sk-sheet {
    transform: scale(1) translateY(0);
  }
}

/* ── Header ── */
.sk-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(212,160,23,.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.sk-drag-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  margin: 0 auto 16px;
  display: block;
}
@media (min-width: 540px) { .sk-drag-handle { display: none; } }

.sk-title-wrap { display: flex; flex-direction: column; gap: 2px; }
.sk-eyebrow {
  font-size: .6rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(212,160,23,.5);
}
.sk-title {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 1.3rem; font-weight: 700;
  background: linear-gradient(135deg, #f5e6b8, #D4A017);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sk-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(212,160,23,.08); border: 1px solid rgba(212,160,23,.2);
  color: rgba(212,160,23,.6); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s, transform .2s;
  flex-shrink: 0;
}
.sk-close:hover { background: rgba(212,160,23,.18); color: goldenrod; transform: rotate(90deg); }

/* ── Body ── */
.sk-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,160,23,.15) transparent;
}
.sk-body::-webkit-scrollbar { width: 4px; }
.sk-body::-webkit-scrollbar-thumb { background: rgba(212,160,23,.2); border-radius: 4px; }

/* ── Loading / Empty ── */
.sk-loading, .sk-empty {
  text-align: center;
  padding: 32px 16px;
  color: rgba(255,255,255,.3);
  font-size: .85rem;
}
.sk-loading-spinner {
  width: 28px; height: 28px;
  border: 2px solid rgba(212,160,23,.15);
  border-top-color: #D4A017;
  border-radius: 50%;
  animation: sk-spin .8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes sk-spin { to { transform: rotate(360deg); } }

/* ── Karte ── */
.sk-card {
  background: rgba(212,160,23,.04);
  border: 1px solid rgba(212,160,23,.14);
  border-radius: 18px;
  padding: 16px 16px 18px;
  transition: border-color .2s;
}
.sk-card:hover { border-color: rgba(212,160,23,.3); }

.sk-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.sk-card-name {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 1.05rem; font-weight: 700; color: #f5e6b8;
  line-height: 1.2;
}
.sk-card-owner {
  font-size: .72rem; color: rgba(255,255,255,.35);
  margin-top: 2px;
}
.sk-card-count {
  font-size: .7rem; font-weight: 700;
  color: #D4A017; white-space: nowrap;
  background: rgba(212,160,23,.1);
  border: 1px solid rgba(212,160,23,.25);
  padding: 3px 10px; border-radius: 999px;
  flex-shrink: 0;
}

/* ── Stamps grid ── */
.sk-stamps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.sk-stamp {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(212,160,23,.2);
  background: rgba(212,160,23,.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
.sk-stamp.filled {
  background: linear-gradient(135deg, #D4A017, #f0c040);
  border-color: #D4A017;
  box-shadow: 0 2px 12px rgba(212,160,23,.45);
  font-size: 18px;
}
.sk-stamp.empty::after {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(212,160,23,.2);
}

/* ── Progress bar ── */
.sk-progress-wrap {
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 5px;
}
.sk-progress-track {
  height: 4px;
  background: rgba(255,255,255,.07);
  border-radius: 999px;
  overflow: hidden;
}
.sk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, goldenrod, gold);
  border-radius: 999px;
  transition: width .8s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 0 6px rgba(212,160,23,.4);
}
.sk-progress-label {
  font-size: .68rem; color: rgba(255,255,255,.3);
}

/* ── Reward badge ── */
.sk-reward {
  margin-top: 10px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(212,160,23,.08);
  border: 1px solid rgba(212,160,23,.25);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: .78rem; font-weight: 600;
  color: #f5e6b8;
}
.sk-reward-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── Login hint ── */
.sk-login-hint {
  text-align: center;
  padding: 32px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.sk-login-icon { font-size: 2.5rem; }
.sk-login-text { font-size: .85rem; color: rgba(255,255,255,.4); line-height: 1.6; }
.sk-login-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 999px;
  background: linear-gradient(135deg, #D4A017, #b8860b);
  color: #0a0800; font-size: .82rem; font-weight: 700;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(212,160,23,.3);
  transition: opacity .2s, transform .15s;
}
.sk-login-btn:hover { opacity: .88; transform: translateY(-1px); }

@media (max-width: 380px) {
  .sk-stamps { gap: 6px; }
  .sk-stamp { font-size: 14px; }
  .sk-stamp.filled { font-size: 16px; }
}
