@font-face {
  font-family: 'ChakraPetch';
  src: url('ChakraPetch-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ChakraPetch';
  src: url('ChakraPetch-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --surface:    rgba(2, 5, 22, 0.65);
  --surface-2:  rgba(18, 30, 58, 0.8);
  --border:     rgba(107, 185, 223, 0.15);
  --text:       #ddeef8;
  --text-muted: rgba(221, 238, 248, 0.45);
  --blue:       #cfe7f3;
  --blue-light: #a8d8f0;
  --violet:     #8b9de0;
  --cyan:       #38b4d4;
  --overlay:    rgba(6, 8, 22, 0.92);

  --radius:     10px;
  --shadow:     0 2px 16px rgba(0,0,0,0.35);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);

  --fs-xs:   0.8rem;
  --fs-sm:   0.9rem;
  --fs-base: 0.8rem;
  --fs-md:   1.1rem;
  --fs-lg:   clamp(1.4rem, 3vw, 2rem);
  --fs-xl:   1.4rem;
}

html, body {
  background: linear-gradient(145deg, #08102a 0%, #1f2b4a 50%, #160d2e 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'ChakraPetch', 'Courier New', monospace;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 3rem;
  overflow-x: hidden;
}

/* Atmosphärische Glows */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 10% 5%,  rgba(107,185,223,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 45% 55% at 88% 92%,  rgba(139,157,224,0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

a {
  color: var(--blue);
  text-decoration: underline !important;
}

a:hover {
  text-decoration: underline;
}

/* ── Header ── */
header {
  padding: 2.5rem 2.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
  box-shadow: 0 4px 32px rgba(0,0,0,0.3);
  background: var(--surface);
  backdrop-filter: blur(16px);
}

.header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6em;
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.logo-flower {
  height: 4em;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(107,185,223,0.4));
}

header h1 {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--blue-light) 0%, var(--blue) 50%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header h1 a {
  text-decoration: none !important;
}

.tagline {
  font-size: var(--fs-md);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-top: -10px;
}

#status-line {
  font-size: var(--fs-md);
  color: var(--text-muted);
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  line-height: 1.4;
}

#status-line > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3em;
}

#status-line span[id^="count-"] {
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

#status-line .digit-slot {
  vertical-align: middle;
}

/* ── Kategoriefilter ── */
#filter-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 2.5rem 0;
  flex-wrap: wrap;
}

#filter-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.filter-badge {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3em 0.9em;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.filter-badge:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
}

.filter-badge.active {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
  box-shadow: 0 3px 14px rgba(139,157,224,0.35);
}


/* ── Dots ── */
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.4em;
  vertical-align: middle;
  flex-shrink: 0;
}

.dot-available {
  background: var(--text-muted);
  transition: background 0.3s;
}

.dot-available.live {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan), 0 0 16px rgba(56,180,212,0.4);
  animation: blink 2s ease-in-out infinite;
}

.dot-pending {
  background: var(--blue);
  box-shadow: 0 0 8px var(--blue), 0 0 16px rgba(107,185,223,0.4);
  animation: blink 3s ease-in-out infinite;
}

.dot-consumed {
  background: var(--violet);
  opacity: 0.7;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Main Layout ── */
main {
  padding: 0 0 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 1.5rem 2.5rem;
}

/* ── Card – verfügbar ── */
.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  padding: 1.5rem;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 140px;
}

.card:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(107,185,223,0.4);
  transform: translateY(-3px);
  border-color: rgba(107,185,223,0.4);
}

.card-category {
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--blue);
  line-height: 1.35;
  transition: color 0.2s;
  letter-spacing: 0.01em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card:hover .card-title {
  color: var(--blue-light);
}

.card-seq {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.08em;
}

.card.consumed .card-seq {
  color: rgba(255,255,255,0.12);
  opacity: 1;
}

.card-hint {
  margin-top: auto;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s;
}

.card:hover .card-hint {
  opacity: 1;
}

/* ── Card – claiming ── */
.card.claiming {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Card – gerade konsumiert (5s Abschied) ── */
.card.just-consumed {
  background: rgba(6, 8, 22, 0.8);
  border-color: rgba(255,255,255,0.04);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.card.just-consumed .card-category {
  color: rgba(255,255,255,0.2);
}

.card.just-consumed .card-title {
  text-decoration: line-through;
  color: rgba(255,255,255,0.2);
}

.card.just-consumed .card-seq {
  color: rgba(255,255,255,0.12);
  opacity: 1;
}

.card.just-consumed.fading {
  opacity: 0;
}

/* ── Card – konsumiert ── */
.card.consumed {
  background: rgba(6, 8, 22, 0.8);
  border-color: rgba(255,255,255,0.04);
  box-shadow: none;
  cursor: default;
}

.card.consumed .card-category {
  color: rgba(255,255,255,0.2);
}

.card.consumed .card-title {
  text-decoration: line-through;
  color: rgba(255,255,255,0.2);
}

.card.consumed:hover {
  background: rgba(6, 8, 22, 0.8);
  transform: none;
  box-shadow: none;
  border-color: rgba(255,255,255,0.04);
}

.card-consumed-at {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.15);
  margin-top: auto;
}

/* ── Leerer Zustand ── */
.empty-state {
  grid-column: 1 / -1;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-base);
  line-height: 2;
}

/* ── Abschnitt-Trenner ── */
.section-label {
  grid-column: 1 / -1;
  padding: 2rem 0 1rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  text-align: center;
  color: rgba(221, 238, 248, 0.07);
  user-select: none;
  cursor: default;
}
.label-word {
  display: inline-block;
  overflow: hidden;
  height: 1em;
  line-height: 1;
  position: relative;
  vertical-align: top;
}
.lw-default,
.lw-hover {
  display: block;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.lw-hover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(calc(100% + 0.3em));
}
.section-label:hover .lw-default {
  transform: translateY(-100%);
}
.section-label:hover .lw-hover {
  transform: translateY(0);
}

/* ── Modal ── */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(10px);
  z-index: 100;
  overflow-y: auto;
  padding: 2rem;
}

#modal-overlay.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#modal {
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  width: 100%;
  margin: auto;
  padding: 2.5rem;
  position: relative;
}

#modal-category {
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

#modal-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2rem;
  line-height: 1.35;
}

#modal-content {
  color: var(--text);
  line-height: 1.9;
  user-select: none;
}

#modal-content p {
  margin-bottom: 1.2em;
}

#modal-content pre {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: var(--fs-base);
  line-height: 1.6;
  margin-bottom: 1.2em;
}

#modal-content strong {
  color: var(--blue);
}

#modal-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

#modal-warning {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-style: italic;
}

#modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--fs-sm);
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: color 0.2s, border-color 0.2s;
}

#modal-close:hover {
  color: var(--blue);
  border-color: var(--blue);
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%) translateY(2rem);
  background: var(--surface-2);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 100px;
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: var(--fs-sm);
  padding: 0.6rem 1.5rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 200;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Footer ── */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.4);
  padding: 0.75rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  z-index: 50;
  overflow: hidden;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.footer-nav a {
  color: var(--blue);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.footer-nav:last-child a {
  font-size: 0.65rem;
  font-weight: 300;
  color: var(--text-muted);
  opacity: 0.6;
}

.footer-nav a:hover {
  color: var(--blue-light);
}

/* ── Statische Seiten ── */
.static-main {
  padding: 3rem 2.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.static-main h2 {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.static-main h3 {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.static-main p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1.2em;
}

.static-main ul, .static-main ol {
  color: var(--text);
  line-height: 1.8;
  padding-left: 1.5rem;
  margin-bottom: 1.2em;
}

.static-main li {
  margin-bottom: 0.4em;
}

.static-main code {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
  color: var(--blue-light);
}

.static-main pre {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  overflow-x: auto;
  font-size: var(--fs-base);
  line-height: 1.7;
  margin-bottom: 1.5em;
  color: var(--text);
}

.static-main pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 1em;
  color: inherit;
}

.static-main .label {
  display: inline-block;
  background: rgba(107,185,223,0.1);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--blue);
  font-size: var(--fs-xs);
  padding: 0.2em 0.6em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
}

.static-main .hint {
  color: var(--text-muted);
  font-size: var(--fs-base);
  font-style: italic;
  margin-bottom: 1.2em;
  line-height: 1.6;
}

.static-main table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: var(--fs-base);
}

.static-main th {
  text-align: left;
  color: var(--text-muted);
  font-weight: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: var(--fs-xs);
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.static-main td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(107,185,223,0.07);
  color: var(--text);
  vertical-align: top;
}

.static-main td code {
  white-space: nowrap;
}

/* ── Pagination ── */
.pagination {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem 0 0.75rem;
}

.pag-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  padding: 0.4em 1.2em;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.pag-btn:hover:not(:disabled) {
  color: var(--blue);
  border-color: var(--blue);
}

.pag-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.pag-info {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  min-width: 4em;
  text-align: center;
}

/* ── Consumed Overflow ── */
.consumed-overflow {
  grid-column: 1 / -1;
  text-align: center;
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  color: rgba(221, 238, 248, 0.07);
  letter-spacing: 0.06em;
  padding: 2.5rem 0 4rem;
  pointer-events: none;
  user-select: none;
}

/* ── Odometer-Animation ── */
.stat-num {
  display: inline-block;
  vertical-align: top;
  line-height: 1;
}

.digit-slot {
  display: inline-block;
  overflow: hidden;
  height: 1em;
  position: relative;
  vertical-align: top;
}

.digit-slot .d-old,
.digit-slot .d-new,
.digit-slot .d-static {
  display: block;
  line-height: 1;
}

.digit-slot .d-old {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.digit-slot .d-new {
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── Content-Seite: Live-Statistik ── */
.content-page {
  max-width: 860px;
}

#content-stats {
  display: flex;
  justify-content: center;
  gap: clamp(2rem, 8vw, 6rem);
  padding: 3rem 0 3.5rem;
  text-align: center;
}

.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.stat-num {
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-available {
  color: var(--cyan);
}

.stat-pending {
  color: var(--violet);
}

.stat-consumed {
  color: rgba(221, 238, 248, 0.25);
}

.stat-dot {
  width: 8px;
  height: 8px;
}

.stat-label {
  font-size: var(--fs-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.content-credit {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.content-intro {
  text-align: center;
  color: var(--text-muted) !important;
  font-style: italic;
  font-size: var(--fs-sm) !important;
  line-height: 1.9 !important;
  margin-bottom: 3rem !important;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  header { padding: 1.5rem 1.2rem 1rem; }
  .header-left { flex-direction: column; align-items: flex-start; }
  #status-line {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 0.4rem 1.2rem;
    width: 100%;
  }
  #status-line > div { justify-content: center; }
  main   { padding: 0; }
  #filter-bar { padding: 1rem 1.2rem 0; }
  .grid  { padding: 1rem 1.2rem; gap: 10px; }
  #modal-overlay { padding: 0; }
  #modal { padding: 1.5rem; min-height: 100vh; border-radius: 0; }
  footer { padding: 0.75rem 1.2rem; }
  .footer-nav { gap: 1rem; }
  .static-main { padding: 1.5rem 1.2rem; }
}
