* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 32px;
  font-family: Arial, sans-serif;
  background: #39ff14;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5' fill='%23ff1fd0' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 12 12, auto !important;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

header h1 {
  margin: 0;
}

header a {
  position: relative;

  padding: 12px 22px;

  background: #ff1fd0;
  color: black;

  border: 2px solid black;
  border-radius: 999px;

  box-shadow: 7px 7px 0 black;

  font-family: inherit;
  font-size: 16px;
  font-weight: 800;

  text-decoration: none;
  text-transform: uppercase;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M4 3 L4 23 L10 17 L14 26 L18 24 L14 15 L23 15 Z' fill='%23ff1fd0' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 4 3, pointer !important;
}

header a:hover {
  background: #ff1fd0;
  color: black;

  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 black;
}

header a:active {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 black;
}

#alphabetArchive {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.archiveLetter {
  position: relative;
  aspect-ratio: 1 / 1;
  background: white;
  border: 2px solid black;
  box-shadow: 8px 8px 0 black;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow: visible;
}

.archiveLetter img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.archiveLetterLabel {
  position: absolute;
  top: 8px;
  left: 10px;

  font-size: 18px;
  font-weight: bold;
  z-index: 2;
}

.archiveLetter.empty {
  opacity: 0.25;
}

.distributionBadge {
  position: absolute;

  left: 50%;
  top: -18px;

  transform: translateX(-50%);

  padding: 7px 12px;

  background: #ff1fd0;
  color: black;

  border: 2px solid black;
  box-shadow: 5px 5px 0 black;

  font-family: monospace;
  font-size: 13px;
  font-weight: 700;

  white-space: nowrap;

  opacity: 0;
  visibility: hidden;

  pointer-events: none;

  z-index: 20;

  transition:
    opacity 0.18s ease,
    visibility 0.18s ease,
    transform 0.18s ease;
}

.archiveLetter:hover .distributionBadge {
  opacity: 1;
  visibility: visible;

  transform: translateX(-50%) translateY(-4px);
}

.downloadLetterButton {
  position: absolute;

  right: 10px;
  bottom: 10px;

  padding: 7px 10px;

  background: white;
  color: black;

  border: 2px solid black;
  box-shadow: 4px 4px 0 black;

  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;

  cursor: pointer;

  opacity: 0;
  visibility: hidden;

  z-index: 20;

  transition:
    opacity 0.18s ease,
    visibility 0.18s ease,
    transform 0.18s ease;
}

.archiveLetter:hover .downloadLetterButton {
  opacity: 1;
  visibility: visible;
}

.downloadLetterButton:hover {
  background: #ff1fd0;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 black;
}

/* ===== Neue Archivkarten-Optik ===== */

.archiveLetter {
  position: relative;
  overflow: hidden;

  background: white;
  border: 2px solid black;
  box-shadow: 8px 8px 0 black;

  transition:
    transform 0.28s cubic-bezier(0.16, 0.84, 0.24, 1),
    box-shadow 0.28s ease,
    filter 0.28s ease;

  transform-origin: center;
}

.archiveLetter:hover {
  transform: scale(1.055);

  box-shadow:
    11px 11px 0 black,
    0 0 22px rgba(255, 31, 208, 0.55);

  filter: brightness(1.08) contrast(1.04);

  z-index: 10;
}

.archiveLetter::after {
  content: "";
  position: absolute;

  inset: 0;

  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.12) 45%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0.12) 55%,
    transparent 62%,
    transparent 100%
  );

  background-size: 240% 100%;
  background-position: -150% 0;

  opacity: 0;

  pointer-events: none;
  z-index: 5;
}

.archiveLetter:hover::after {
  animation: archiveCardShine 0.9s ease-out both;
}

@keyframes archiveCardShine {
  0% {
    background-position: -150% 0;
    opacity: 0;
  }

  18% {
    opacity: 1;
  }

  75% {
    opacity: 1;
  }

  100% {
    background-position: 160% 0;
    opacity: 0;
  }
}

.archiveLetter img {
  width: 82%;
  height: 76%;

  object-fit: contain;
  display: block;

  transform: translateY(-8px);

  position: relative;
  z-index: 2;
}

.distributionBadge {
  position: absolute;

  left: 50%;
  bottom: 10px;
  top: auto;

  transform: translateX(-50%);

  width: calc(100% - 20px);

  padding: 0;

  background: transparent;
  color: black;

  border: none;
  box-shadow: none;

  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;

  text-align: center;
  white-space: nowrap;

  opacity: 1;
  visibility: visible;

  pointer-events: none;

  z-index: 8;
}

.archiveLetter:hover .distributionBadge {
  opacity: 1;
  visibility: visible;

  transform: translateX(-50%);
}

.downloadLetterButton {
  position: absolute;

  top: 9px;
  right: 9px;
  bottom: auto;

  width: 31px;
  height: 31px;

  padding: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  background: white;
  color: black;

  border: 2px solid black;
  box-shadow: 4px 4px 0 black;

  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;

  cursor: pointer;

  opacity: 0;
  visibility: hidden;

  z-index: 12;

  transition:
    opacity 0.18s ease,
    visibility 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.archiveLetter:hover .downloadLetterButton {
  opacity: 1;
  visibility: visible;
}

.downloadLetterButton:hover {
  background: #ff1fd0;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 black;
}

.archiveLetter.empty:hover {
  transform: none;
  box-shadow: 8px 8px 0 black;
  filter: none;
}

.archiveLetter.empty:hover::after {
  animation: none;
  opacity: 0;
}

/* ===== Korrektur Archivkarten ===== */

/* keinen verschwommenen pinken Schatten */
.archiveLetter:hover {
  transform: scale(1.055);

  box-shadow: 11px 11px 0 black !important;

  filter: brightness(1.04) contrast(1.02);
  z-index: 10;
}

/* Downloadbutton als Kreis oben rechts im Kästchen */
.downloadLetterButton {
  top: 10px !important;
  right: 10px !important;
  bottom: auto !important;

  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;

  padding: 0 !important;

  border-radius: 50% !important;

  display: flex !important;
  justify-content: center !important;
  align-items: center !important;

  background: white !important;
  color: black !important;

  border: 2px solid black !important;
  box-shadow: 4px 4px 0 black !important;

  font-size: 21px !important;
  font-weight: 900 !important;
  line-height: 1 !important;

  transform: none !important;
}

/* Hover vom runden Button */
.downloadLetterButton:hover {
  background: #ff1fd0 !important;
  color: black !important;

  transform: translate(-1px, -1px) !important;
  box-shadow: 5px 5px 0 black !important;
}

/* ===== Alle Archiv-Kästen gleich sichtbar ===== */

.archiveLetter,
.archiveLetter.empty {
  opacity: 1 !important;
  background: white !important;
  border: 2px solid black !important;
  box-shadow: 8px 8px 0 black !important;
}

/* ===== Archiv-Alphabet-Navigation ===== */

#archiveAlphabetNavigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;

  margin: -12px 0 28px 0;
}

#archiveAlphabetCounter {
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

#archivePrevAlphabet,
#archiveNextAlphabet {
  width: 46px;
  height: 46px;

  display: flex;
  justify-content: center;
  align-items: center;

  background: #ff1fd0;
  color: black;

  border: 2px solid black;
  border-radius: 50%;

  box-shadow: 5px 5px 0 black;

  font-size: 26px;
  font-weight: 900;
  line-height: 1;

  cursor: pointer;

  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M4 3 L4 23 L10 17 L14 26 L18 24 L14 15 L23 15 Z' fill='%23ff1fd0' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 4 3, pointer !important;
}

#archivePrevAlphabet:hover,
#archiveNextAlphabet:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 black;
}

#archivePrevAlphabet:active,
#archiveNextAlphabet:active {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 black;
}

.archiveHeaderActions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.archiveExportCard {
  background: #ff1fd0;
  border: 2px solid black;
  box-shadow: 8px 8px 0 black;

  display: flex;
  justify-content: center;
  align-items: center;
}

#exportArchiveButton {
  position: static;

  width: auto;
  height: auto;

  padding: 14px 22px;

  background: white;
  color: black;

  border: 2px solid black;
  border-radius: 999px;

  box-shadow: 5px 5px 0 black;

  font-family: inherit;
  font-size: 15px;
  font-weight: 900;

  text-transform: uppercase;
  letter-spacing: 0.04em;

  cursor: pointer;
}

#exportArchiveButton:hover {
  background: black;
  color: white;

  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 black;
}