/* ============================================================
   style.css – Challenges App
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --orange:      #FC4C02;
  --orange-dark: #d93e00;
  --bg:          #f5f5f5;
  --surface:     #ffffff;
  --border:      #e0e0e0;
  --text:        #1a1a1a;
  --muted:       #666;
  --success-bg:  #d1fae5;
  --success-fg:  #065f46;
  --error-bg:    #fee2e2;
  --error-fg:    #991b1b;
  --info-bg:     #dbeafe;
  --info-fg:     #1e40af;
  --warn-bg:     #fef3c7;
  --warn-fg:     #92400e;
  --radius:      6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Nav ─────────────────────────────────────────────────── */
nav {
  background: var(--text);
  color: #fff;
  padding: 0;
}

nav .nav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  height: 52px;
}

nav .nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--orange);
  text-decoration: none;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

nav .nav-links {
  display: flex;
  list-style: none;
  height: 100%;
  margin-left: auto;
}

nav .nav-links a {
  color: #ccc;
  text-decoration: none;
  padding: 0 16px;
  display: flex;
  align-items: center;
  height: 100%;
  font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}

nav .nav-links a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

nav .nav-links a.active {
  color: var(--orange);
}

/* ── Page ────────────────────────────────────────────────── */
.page {
  padding: 32px 16px 60px;
  max-width: 900px;
  margin: 0 auto;
}

.page-narrow {
  max-width: 480px;
  margin: 40px auto;
  padding: 0 16px 60px;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

/* ── Flash Messages ──────────────────────────────────────── */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
}
.flash-success { background: var(--success-bg); color: var(--success-fg); }
.flash-error   { background: var(--error-bg);   color: var(--error-fg); }
.flash-info    { background: var(--info-bg);     color: var(--info-fg); }
.flash-warning { background: var(--warn-bg);     color: var(--warn-fg); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="url"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(252,76,2,0.12);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.form-error {
  font-size: 0.82rem;
  color: var(--error-fg);
  margin-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

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

.btn-primary {
  background: var(--orange);
  color: #fff;
}
.btn-primary:hover { background: var(--orange-dark); }

.btn-secondary {
  background: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: #d0d0d0; }

.btn-strava {
  background: var(--orange);
  color: #fff;
  font-size: 0.85rem;
}
.btn-strava:hover { background: var(--orange-dark); }

.btn-small {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--orange);
  color: var(--orange);
}
.btn-outline:hover { background: rgba(252,76,2,0.06); }

/* ── Strava-fetch Row ────────────────────────────────────── */
.strava-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.strava-row input {
  flex: 1;
}

#strava-status {
  margin-top: 8px;
  font-size: 0.85rem;
  min-height: 20px;
  color: var(--muted);
}

#strava-status.ok    { color: var(--success-fg); }
#strava-status.error { color: var(--error-fg); }

/* ── Strava Badge ────────────────────────────────────────── */
.strava-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.strava-badge.connected {
  background: var(--success-bg);
  color: var(--success-fg);
}

.strava-badge.disconnected {
  background: var(--error-bg);
  color: var(--error-fg);
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafafa; }

.rank {
  font-weight: 700;
  color: var(--muted);
  width: 36px;
}

.rank-1 { color: #d97706; }
.rank-2 { color: #64748b; }
.rank-3 { color: #92400e; }

.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-unverified {
  display: inline-flex;
  align-items: center;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.proof-link {
  color: var(--orange);
  text-decoration: none;
  font-size: 0.85rem;
}
.proof-link:hover { text-decoration: underline; }

/* ── Challenge Info Banner ───────────────────────────────── */
.challenge-banner {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  color: #fff;
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.challenge-banner .cb-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--orange);
}

.challenge-banner .cb-dates {
  font-size: 0.88rem;
  color: #aaa;
  margin-top: 2px;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state .es-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* ── Utility ─────────────────────────────────────────────── */
.text-muted { color: var(--muted); }
.text-small { font-size: 0.85rem; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex  { display: flex; }
.gap-8 { gap: 8px; }
.align-center { align-items: center; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  h1 { font-size: 1.3rem; }
  .card { padding: 16px; }
  nav .nav-brand { padding: 0 12px; }
  nav .nav-links a { padding: 0 10px; font-size: 0.82rem; }
  .challenge-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.tab:hover { border-color: var(--orange); color: var(--orange); }
.tab.active { background: var(--orange); color: #fff; border-color: var(--orange); }
.tab-count {
  background: rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.76rem;
}
.tab.active .tab-count { background: rgba(255,255,255,0.25); }

/* ── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat-card .stat-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stat-card .stat-val small { font-size: 0.8rem; font-weight: 400; color: var(--muted); }

/* ── Category Badge ──────────────────────────────────────── */
.cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.cat-kids   { background: #fef3c7; color: #92400e; }
.cat-damen  { background: #fce7f3; color: #9d174d; }
.cat-herren { background: #dbeafe; color: #1e40af; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.page-btn:hover { border-color: var(--orange); color: var(--orange); }
.page-btn.active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* ── Danger Button ───────────────────────────────────────── */
.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.btn-danger:hover { background: #fca5a5; }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  background: var(--text);
  color: #aaa;
  margin-top: 60px;
  padding: 28px 0;
  font-size: 0.85rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand { color: var(--orange); font-weight: 700; font-size: 1rem; }
.footer-links { display: flex; gap: 16px; margin-left: auto; }
.footer-links a { color: #aaa; text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: #fff; }
.footer-copy { color: #666; font-size: 0.8rem; }
@media(max-width:600px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-links { margin-left: 0; }
}

/* ── Events Grid ─────────────────────────────────────────── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}
.event-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.event-logo {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: #f0f0f0;
}
.event-logo img { width: 100%; height: 100%; object-fit: cover; }
.event-logo-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #1a1a1a, #333);
}

.event-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.event-title { font-size: 1.1rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.event-date { font-size: 0.85rem; color: var(--muted); }
.event-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.5; flex: 1; }
.event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}
.event-rsvp-count { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.event-admin-bar {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  background: #fafafa;
  border-top: 1px solid var(--border);
}

/* ── Event Detail ────────────────────────────────────────── */
.event-detail-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 4px;
}
.event-detail-logo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.event-detail-logo-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a1a1a, #333);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  flex-shrink: 0;
}
.event-detail-meta { flex: 1; }
.event-detail-meta h1 { margin-bottom: 8px; font-size: 1.8rem; }
.event-full-description { line-height: 1.8; white-space: pre-wrap; }
@media(max-width:560px) {
  .event-detail-header { flex-direction: column; }
  .event-detail-logo, .event-detail-logo-placeholder { width: 100%; height: 200px; }
}

/* ── Form label optional ─────────────────────────────────── */
.label-opt { font-weight: 400; color: var(--muted); font-size: 0.85em; }

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { margin: 0; }

/* ── Event Card: Joined State ────────────────────────────── */
.event-card-joined {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255,107,0,0.15);
}
.event-joined-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--orange);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}
.event-card { position: relative; }
.event-meta-row {
  display: flex;
  gap: 16px;
  font-size: 0.84rem;
  color: var(--muted);
  padding: 6px 0;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ── RSVP Cancel Button ──────────────────────────────────── */
.btn-rsvp-cancel {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.btn-rsvp-cancel:hover { background: #fca5a5; }

/* ── Locked Hint ─────────────────────────────────────────── */
.locked-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  margin-top: 16px;
  font-size: 0.92rem;
  flex-wrap: wrap;
}
.lock-icon { font-size: 1.2rem; }

/* ── Event Stats Row ─────────────────────────────────────── */
.event-stats-row {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── Entry Event Context Banner ──────────────────────────── */
.entry-event-context {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.entry-event-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.entry-event-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
}
.entry-event-logo {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
}

/* ── My Events Bar ───────────────────────────────────────── */
.my-events-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.my-events-label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.my-event-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: rgba(255,107,0,0.1);
  color: var(--orange);
  border: 1px solid rgba(255,107,0,0.3);
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.my-event-chip:hover { background: var(--orange); color: #fff; }
.my-event-chip-add {
  padding: 4px 10px;
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

/* ── Event Link Small ────────────────────────────────────── */
.event-link-small {
  font-size: 0.82rem;
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
}
.event-link-small:hover { text-decoration: underline; }

/* ── Legal Pages (Impressum / Datenschutz) ───────────────── */
.legal-hero {
  text-align: center;
  padding: 40px 0 28px;
}
.legal-hero-icon { font-size: 2.8rem; margin-bottom: 8px; }
.legal-hero-title { font-size: 2rem; margin: 0 0 4px; }
.legal-hero-sub { color: var(--muted); font-size: 0.92rem; margin: 0; }

.legal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}
@media(max-width:640px) { .legal-grid { grid-template-columns: 1fr; } }

.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.legal-card-full { grid-column: 1 / -1; }
.legal-card-icon { font-size: 1.6rem; flex-shrink: 0; margin-top: 2px; }
.legal-card-body { flex: 1; }
.legal-card-body h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.legal-card-body h3 { font-size: 0.9rem; font-weight: 600; margin: 0 0 6px; }
.legal-card-body p { font-size: 0.88rem; color: var(--muted); line-height: 1.65; margin: 0 0 8px; }
.legal-card-body address { font-style: normal; font-size: 0.9rem; line-height: 1.8; color: var(--text); }

.legal-table { border-collapse: collapse; font-size: 0.88rem; width: 100%; }
.legal-table td { padding: 4px 12px 4px 0; vertical-align: top; }
.legal-table td:first-child { color: var(--muted); white-space: nowrap; font-weight: 500; }
.legal-table a { color: var(--orange); }

/* ── Double-Opt-In Notice ────────────────────────────────── */
.doi-notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #1e40af;
  margin-bottom: 20px;
}

/* ── Export Row ──────────────────────────────────────────── */
.export-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  flex-wrap: wrap;
}

/* ── Passwort Toggle ─────────────────────────────────────── */
.pw-wrapper {
  position: relative;
}
.pw-wrapper input { padding-right: 44px; }
.pw-toggle {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: color 0.15s;
}
.pw-toggle:hover { color: var(--orange); }

/* ── Event Zeitraum CSS ──────────────────────────────────── */
.timerange-box {
  background: #f8f9ff;
  border: 1px solid #dde3f5;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.timerange-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.timerange-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
.timerange-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.timerange-arrow { font-size: 1.5rem; color: var(--muted); text-align: center; padding-top: 28px; }
.label-sm { font-size: 0.82rem; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; }
@media(max-width:500px) {
  .timerange-grid { grid-template-columns: 1fr; }
  .timerange-arrow { display: none; }
}

/* Event Status Badges */
.ev-status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.ev-status-upcoming { background: #fef3c7; color: #92400e; }
.ev-status-active   { background: #d1fae5; color: #065f46; }
.ev-status-ended    { background: #f3f4f6; color: #6b7280; }

/* Timerange Badge in Entry Context */
.timerange-badge { font-size: 0.8rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.timerange-badge-upcoming { background: #fef3c7; color: #92400e; }
.timerange-badge-active   { background: #d1fae5; color: #065f46; }
.timerange-badge-ended    { background: #f3f4f6; color: #6b7280; }

/* ── Countdown / Timer Widget ────────────────────────────── */
.cd-widget {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid transparent;
  min-width: 160px;
  text-align: center;
  transition: border-color 0.4s, background 0.4s;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.cd-widget.cd-upcoming {
  background: #fffbeb;
  border-color: #f59e0b;
}
.cd-widget.cd-active {
  background: #ecfdf5;
  border-color: #10b981;
}
.cd-widget.cd-ended {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.cd-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 2px;
}
.cd-widget.cd-upcoming .cd-label { color: #d97706; }
.cd-widget.cd-active   .cd-label { color: #059669; }

.cd-time {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.15;
  color: #111;
  font-variant-numeric: tabular-nums;
}
.cd-widget.cd-upcoming .cd-time { color: #b45309; }
.cd-widget.cd-active   .cd-time { color: #047857; }
.cd-widget.cd-ended    .cd-time { color: #9ca3af; }

.cd-sub {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 3px;
  white-space: nowrap;
}

/* Große Version für Event-Detail */
.cd-widget-lg {
  padding: 16px 28px;
  min-width: 220px;
  border-radius: 14px;
  border-width: 2px;
}
.cd-widget-lg .cd-time { font-size: 2.2rem; }
.cd-widget-lg .cd-label { font-size: 0.75rem; }
.cd-widget-lg .cd-sub  { font-size: 0.75rem; }

/* ── Großer Digit-Countdown (Event-Detail) ───────────────── */
.cd-full {
  display: inline-block;
  padding: 20px 28px 16px;
  border-radius: 16px;
  border: 2px solid transparent;
  text-align: center;
  margin-bottom: 4px;
  transition: border-color 0.4s, background 0.4s;
}
.cd-full.cd-upcoming { background: #fffbeb; border-color: #f59e0b; }
.cd-full.cd-active   { background: #ecfdf5; border-color: #10b981; }
.cd-full.cd-ended    { background: #f3f4f6; border-color: #d1d5db; }

.cd-full-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  color: #6b7280;
}
.cd-full.cd-upcoming .cd-full-label { color: #d97706; }
.cd-full.cd-active   .cd-full-label { color: #059669; }

.cd-digits {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cd-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 62px;
}
.cd-num {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #111;
}
.cd-full.cd-upcoming .cd-num { color: #b45309; }
.cd-full.cd-active   .cd-num { color: #047857; }
.cd-full.cd-ended    .cd-num { color: #9ca3af; }

.cd-unit {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  margin-top: 4px;
}
.cd-sep {
  font-size: 2.2rem;
  font-weight: 900;
  color: #d1d5db;
  margin-bottom: 16px;
  line-height: 1;
}
.cd-full.cd-upcoming .cd-sep { color: #fcd34d; }
.cd-full.cd-active   .cd-sep { color: #6ee7b7; }

@media(max-width:480px) {
  .cd-box { min-width: 48px; }
  .cd-num { font-size: 1.9rem; }
  .cd-sep { font-size: 1.6rem; }
  .cd-full { padding: 16px 14px 12px; }
}

/* ── Kompakter Countdown (Event-Karten) ──────────────────── */
.cd-widget {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px solid transparent;
  text-align: center;
  transition: border-color 0.4s, background 0.4s;
}
.cd-widget.cd-upcoming { background: #fffbeb; border-color: #f59e0b; }
.cd-widget.cd-active   { background: #ecfdf5; border-color: #10b981; }
.cd-widget.cd-ended    { background: #f3f4f6; border-color: #d1d5db; }

.cd-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 2px;
}
.cd-widget.cd-upcoming .cd-label { color: #d97706; }
.cd-widget.cd-active   .cd-label { color: #059669; }

.cd-compact {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #111;
  line-height: 1.2;
}
.cd-widget.cd-upcoming .cd-compact { color: #b45309; }
.cd-widget.cd-active   .cd-compact { color: #047857; }
.cd-widget.cd-ended    .cd-compact { color: #9ca3af; }
