/* ========================================================================
   Hochzeitsgalerie - Arcade meets Altar
   ===================================================================== */

:root {
  --bg:        #07050e;
  --bg-2:      #0e0a1c;
  --panel:     rgba(24, 16, 42, 0.72);
  --panel-2:   rgba(32, 21, 56, 0.88);
  --line:      rgba(167, 139, 250, 0.22);
  --line-hot:  rgba(255, 95, 169, 0.55);

  --cyan:   #4be3ff;
  --pink:   #ff5fa9;
  --gold:   #ffcf6b;
  --violet: #a78bfa;
  --green:  #6ee7a8;

  --text:   #ece7f8;
  --muted:  #9a90b6;
  --dim:    #8b82a6;   /* 5.4:1 auf dem Seitenhintergrund - AA fuer Text */

  --pixel: "Press Start 2P", ui-monospace, monospace;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r:   14px;
  --r-s: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --hud-h: 62px;
}

* { box-sizing: border-box; }

/* Muss nach allen display-Regeln greifen: sonst ueberstimmt z. B.
   .lightbox { display: flex } das hidden-Attribut. */
[hidden] { display: none !important; }

html {
  background: var(--bg);
}

body {
  /* Muss durchsichtig bleiben: ein deckender body-Hintergrund wird NACH den
     Elementen mit negativem z-index gezeichnet und wuerde .backdrop verdecken. */
  background: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body.locked { overflow: hidden; }

a { color: var(--cyan); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }

::selection { background: var(--pink); color: #17091d; }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--violet) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--pink));
  border-radius: 20px;
  border: 3px solid var(--bg);
}

/* ---------------------------------------------------------------- Hintergrund */

#bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  display: block;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(1100px 700px at 15% -10%, rgba(167, 139, 250, 0.20), transparent 60%),
    radial-gradient(900px 620px at 88% 8%,  rgba(255, 95, 169, 0.16), transparent 62%),
    radial-gradient(1000px 800px at 50% 110%, rgba(75, 227, 255, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 55%);
}

/* Retro-Rasterboden */
.backdrop::after {
  content: "";
  position: absolute;
  inset: 55% 0 0 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.16) 1px, transparent 1px);
  background-size: 58px 58px;
  transform: perspective(340px) rotateX(62deg);
  transform-origin: top center;
  mask-image: linear-gradient(transparent, #000 32%, transparent 92%);
  opacity: 0.55;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

/* ---------------------------------------------------------------- Bausteine */

.pixel { font-family: var(--pixel); letter-spacing: 0.03em; }

.glow-c { color: var(--cyan);   text-shadow: 0 0 12px rgba(75, 227, 255, 0.65); }
.glow-p { color: var(--pink);   text-shadow: 0 0 12px rgba(255, 95, 169, 0.65); }
.glow-g { color: var(--gold);   text-shadow: 0 0 12px rgba(255, 207, 107, 0.55); }

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: var(--shadow);
}

/* HUD-Eckwinkel */
.bracketed::before,
.bracketed::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.bracketed::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
  border-radius: var(--r) 0 0 0;
}
.bracketed::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--pink);
  border-right: 2px solid var(--pink);
  border-radius: 0 0 var(--r) 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(60, 40, 100, 0.55), rgba(30, 19, 54, 0.75));
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.12s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover:not(:disabled) {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(75, 227, 255, 0.25), 0 6px 22px rgba(75, 227, 255, 0.18);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--violet) 55%, var(--cyan));
  color: #14081c;
  font-weight: 700;
  text-shadow: none;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(255, 95, 169, 0.5);
  border-color: transparent;
}
.btn-ghost { background: rgba(255, 255, 255, 0.04); }
.btn-danger:hover:not(:disabled) { border-color: #ff6b6b; box-shadow: 0 0 18px rgba(255, 107, 107, 0.3); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-icon { padding: 9px; width: 38px; height: 38px; }

input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: rgba(10, 6, 22, 0.75);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(75, 227, 255, 0.16);
}
input::placeholder { color: var(--dim); }
select option { background: #150e28; }

.field { display: block; margin-bottom: 16px; text-align: left; }
.field > label {
  display: block;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.1em;
  color: var(--violet);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.field.grow { flex: 1 1 200px; margin-bottom: 0; }

.hint {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 8px 0 0;
}

/* ---------------------------------------------------------------- Login-Gate */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px 44px;
}

.cabinet {
  width: min(460px, 100%);
  padding: 34px 30px 30px;
  text-align: center;
  animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.crest {
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 207, 107, 0.5);
  margin-bottom: 20px;
}

.rings {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 14px rgba(255, 207, 107, 0.55));
  animation: bob 3.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

.names {
  font-family: var(--serif);
  font-size: clamp(38px, 11vw, 58px);
  font-weight: 600;
  line-height: 1.05;
  margin: 6px 0 4px;
  background: linear-gradient(100deg, var(--cyan), #fff 32%, var(--pink) 62%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 95, 169, 0.3));
}
.names .amp {
  display: block;
  font-size: 0.44em;
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  margin: 2px 0;
  opacity: 0.9;
}

.subline {
  font-family: var(--pixel);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 26px;
}

.hpbar {
  height: 9px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 0 0 26px;
}
.hpbar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--cyan));
  box-shadow: 0 0 16px rgba(75, 227, 255, 0.6);
  animation: fill 1.5s 0.25s cubic-bezier(0.3, 1, 0.4, 1) forwards;
}
@keyframes fill { to { width: 100%; } }

.press-start {
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--cyan);
  margin-top: 22px;
  animation: blink 1.4s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0.15; } }

.gate-error {
  min-height: 20px;
  font-size: 13px;
  color: #ff7b7b;
  margin-top: 12px;
  font-weight: 500;
}

.gate-hint {
  font-size: 12px;
  color: var(--dim);
  margin-top: 18px;
  line-height: 1.6;
}

/* ---------------------------------------------------------------- HUD */

.hud {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--hud-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(12px, 3vw, 26px);
  background: linear-gradient(180deg, rgba(10, 6, 20, 0.94), rgba(10, 6, 20, 0.7));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hud-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.hud-brand .hb-names {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  white-space: nowrap;
  background: linear-gradient(95deg, var(--cyan), var(--pink) 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hud-brand .hb-tag {
  font-family: var(--pixel);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: var(--dim);
  white-space: nowrap;
}

.hud-spacer { flex: 1; }

.player-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 8px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s;
}
.player-chip:hover { border-color: var(--cyan); }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  color: #150a1f;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  flex: none;
}
.player-chip .pc-meta { line-height: 1.15; text-align: left; }
.player-chip .pc-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-chip .pc-role {
  font-family: var(--pixel);
  font-size: 6.5px;
  letter-spacing: 0.12em;
  color: var(--gold);
}

/* ---------------------------------------------------------------- Tabs */

.tabs {
  position: sticky;
  top: var(--hud-h);
  z-index: 55;
  display: flex;
  gap: 6px;
  padding: 10px clamp(12px, 3vw, 26px);
  background: linear-gradient(180deg, rgba(10, 6, 20, 0.86), rgba(10, 6, 20, 0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 11px 16px;
  border-radius: var(--r-s);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.tab.active {
  color: #14081c;
  background: linear-gradient(135deg, var(--cyan), var(--violet) 60%, var(--pink));
  box-shadow: 0 6px 24px rgba(167, 139, 250, 0.35);
}
.tab .badge {
  margin-left: 7px;
  font-size: 8px;
  color: var(--dim);
}
.tab.active .badge { color: #14081c; opacity: 0.75; }

/* ---------------------------------------------------------------- Layout */

main {
  padding: 8px clamp(12px, 3vw, 26px) 90px;
  max-width: 1680px;
  margin: 0 auto;
}

.view { display: none; animation: fade 0.3s ease both; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 14px;
}
.section-head h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.01em;
}
.section-head .sub {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--dim);
}

/* ---------------------------------------------------------------- Filter */

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.chips { display: flex; gap: 7px; flex-wrap: wrap; }

.chip {
  padding: 7px 13px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--violet); }
.chip.active {
  color: #14081c;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  border-color: transparent;
  font-weight: 700;
}
/* Kein opacity auf Text: das druecken der Deckkraft senkt den Kontrast
   unter den Mindestwert. Zurueckhaltung stattdessen ueber Farbe und Groesse. */
.chip .n { color: var(--dim); margin-left: 5px; font-size: 11px; font-weight: 500; }
.chip.active .n { color: #14081c; opacity: 0.8; font-weight: 600; }

.select-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-select {
  width: auto;
  padding: 7px 11px;
  font-size: 12.5px;
  border-radius: 20px;
}

/* ---------------------------------------------------------------- Statistik */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.stat {
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--panel);
}
.stat .k {
  font-family: var(--pixel);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 7px;
}
.stat .v {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}

/* ---------------------------------------------------------------- Galerie */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.grid.big { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-s);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.25s, border-color 0.2s;
  contain: content;
}
.card:hover {
  transform: translateY(-4px) scale(1.012);
  border-color: var(--cyan);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(75, 227, 255, 0.3);
  z-index: 2;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s;
}
.card img.loaded { opacity: 1; }

.card .shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, transparent 32%, transparent 55%, rgba(0,0,0,0.72));
  opacity: 0;
  transition: opacity 0.22s;
  pointer-events: none;
}
.card:hover .shade, .card.selected .shade { opacity: 1; }

.card .who {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.22s;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card:hover .who { opacity: 1; transform: none; }

.card .tagline {
  position: absolute;
  top: 7px;
  left: 7px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.pill {
  font-family: var(--pixel);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(8, 4, 16, 0.78);
  border: 1px solid var(--line);
  color: var(--muted);
  backdrop-filter: blur(6px);
}
.pill.cam  { color: var(--gold);  border-color: rgba(255, 207, 107, 0.45); }
.pill.vid  { color: var(--cyan);  border-color: rgba(75, 227, 255, 0.45); }
.pill.wait { color: var(--pink);  border-color: var(--line-hot); }

.card .heart {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: none;
  background: rgba(8, 4, 16, 0.7);
  backdrop-filter: blur(6px);
  cursor: pointer;
  font-size: 14px;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.2s;
  color: #fff;
}
.card:hover .heart, .card .heart.on { opacity: 1; transform: none; }
.card .heart.on { color: var(--pink); text-shadow: 0 0 10px var(--pink); }
.card .heart:hover { background: rgba(255, 95, 169, 0.3); }
.card .heart .cnt { font-size: 10px; margin-left: 2px; font-family: var(--sans); font-weight: 700; }

.card .playicon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.card .playicon i {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(8, 4, 16, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
  font-style: normal;
  font-size: 15px;
  padding-left: 3px;
  color: #fff;
  transition: transform 0.2s, background 0.2s;
}
.card:hover .playicon i { transform: scale(1.12); background: rgba(255, 95, 169, 0.55); }

.card .dur {
  position: absolute;
  right: 7px;
  bottom: 7px;
  font-family: var(--pixel);
  font-size: 7px;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(8, 4, 16, 0.8);
  color: var(--cyan);
}
.card:hover .dur { opacity: 0; }

.card .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
  color: var(--dim);
  font-size: 11px;
  background: linear-gradient(135deg, rgba(167,139,250,0.10), rgba(255,95,169,0.06));
}

.card .checkbox {
  position: absolute;
  left: 7px;
  bottom: 7px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.7);
  background: rgba(8,4,16,0.6);
  display: none;
  place-items: center;
  font-size: 13px;
  color: #14081c;
  backdrop-filter: blur(6px);
}
body.selecting .card .checkbox { display: grid; }
body.selecting .card .heart { display: none; }
.card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.card.selected .checkbox { background: var(--gold); border-color: var(--gold); }

/* Datums-Trenner */
.daymark {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 4px;
}
.daymark h2 {
  font-family: var(--pixel);
  font-size: 8.5px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.14em;
  color: var(--gold);
  white-space: nowrap;
  margin: 0;
}
.daymark::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-hot), transparent);
}

/* ---------------------------------------------------------------- Stream */

.stream { display: grid; gap: 18px; max-width: 820px; margin: 0 auto; }

.post { overflow: hidden; padding: 0; }
.post-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
}
.post-head .pmeta { min-width: 0; flex: 1; }
.post-head .pname { font-weight: 600; font-size: 14px; }
.post-head .ptime { font-size: 11.5px; color: var(--dim); }
.post-media { background: #000; position: relative; }
.post-media img, .post-media video { width: 100%; max-height: 78vh; object-fit: contain; }
.post-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- Upload */

.upload-wrap { max-width: 900px; margin: 0 auto; }

.dropzone {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: var(--r);
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 20px;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--cyan);
  background: rgba(75, 227, 255, 0.06);
  box-shadow: inset 0 0 60px rgba(75, 227, 255, 0.08);
}
.dropzone.over { transform: scale(1.008); }
.dropzone .dz-icon { font-size: 40px; margin-bottom: 12px; filter: drop-shadow(0 0 16px rgba(75,227,255,0.5)); }
.dropzone .dz-main { font-family: var(--pixel); font-size: 11px; letter-spacing: 0.1em; color: var(--cyan); margin-bottom: 10px; }
.dropzone .dz-sub { font-size: 13px; color: var(--muted); }

.queue { display: grid; gap: 9px; margin-top: 6px; padding: 0; list-style: none; }

.qitem {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 13px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.qitem .qthumb {
  width: 46px;
  height: 46px;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
  display: grid;
  place-items: center;
  font-size: 18px;
  overflow: hidden;
}
.qitem .qname {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}
.qitem .qsub { font-size: 11px; color: var(--dim); margin-top: 5px; font-variant-numeric: tabular-nums; }
.qitem .qstate { font-family: var(--pixel); font-size: 8px; letter-spacing: 0.1em; }
.qitem.done  .qstate { color: var(--green); }
.qitem.error .qstate { color: #ff7b7b; }
.qitem.up    .qstate { color: var(--cyan); }
.qitem.wait  .qstate { color: var(--dim); }

.xpbar {
  height: 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.xpbar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink));
  transition: width 0.25s;
  box-shadow: 0 0 10px rgba(75, 227, 255, 0.5);
}
.qitem.done .xpbar > i { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.qitem.error .xpbar > i { background: #ff6b6b; }

.bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--panel);
  margin-top: 18px;
}

/* ---------------------------------------------------------------- Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 2, 10, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  animation: fade 0.2s ease both;
}

.lb-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px clamp(10px, 2.5vw, 20px);
  flex: none;
}
.lb-top .lb-title { flex: 1; min-width: 0; }
.lb-top .lb-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-top .lb-meta { font-size: 11.5px; color: var(--dim); }

.lb-stage {
  flex: 1;
  position: relative;
  min-height: 0;
}
/* absolut positioniert -> die Hoehe ist eindeutig, erst dadurch wirkt
   max-height:100% an Bild und Video und die Fussleiste bleibt sichtbar. */
#lbHolder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(8px, 6vw, 84px);
}
.lb-stage img, .lb-stage video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.lb-stage .spinner-wrap { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(16, 9, 30, 0.66);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
  z-index: 3;
}
.lb-nav:hover { background: rgba(255, 95, 169, 0.4); border-color: var(--pink); }
.lb-nav.prev { left: clamp(6px, 1.5vw, 22px); }
.lb-nav.next { right: clamp(6px, 1.5vw, 22px); }
.lb-nav[hidden] { display: none; }

.lb-bottom {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 12px clamp(10px, 2.5vw, 20px) calc(12px + env(safe-area-inset-bottom));
}

.lb-counter {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--dim);
  padding: 0 8px;
}

/* ---------------------------------------------------------------- Diverses */

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sentinel {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 34px 0 10px;
}

.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}
.empty .e-icon { font-size: 46px; margin-bottom: 14px; opacity: 0.7; }
.empty .e-title { font-family: var(--serif); font-size: 25px; font-weight: 600; color: var(--text); margin-bottom: 8px; }

#toasts {
  /* Am Rand, damit Meldungen die Warteschlange nicht verdecken.
     Auf schmalen Geraeten weiter mittig - siehe Mobilblock. */
  position: fixed;
  right: 22px;
  bottom: 22px;
  justify-items: end;
  z-index: 500;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
  width: min(92vw, 460px);
}
.toast {
  padding: 11px 17px;
  border-radius: 30px;
  background: rgba(18, 10, 34, 0.95);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 500;
  animation: pop 0.28s cubic-bezier(0.2, 1.2, 0.4, 1) both;
  backdrop-filter: blur(14px);
  text-align: center;
}
.toast.ok    { border-color: rgba(110, 231, 168, 0.6); }
.toast.err   { border-color: rgba(255, 107, 107, 0.6); }
.toast.achv  {
  border-color: var(--gold);
  background: linear-gradient(120deg, rgba(58, 38, 12, 0.96), rgba(24, 14, 40, 0.96));
}
.toast.achv .a-k { font-family: var(--pixel); font-size: 7.5px; letter-spacing: 0.14em; color: var(--gold); display: block; margin-bottom: 3px; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.95); } to { opacity: 1; transform: none; } }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 2, 10, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade 0.2s both;
}
.sheet {
  width: min(430px, 100%);
  padding: 24px;
}
.sheet h3 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 0 0 16px;
}

.row { display: flex; gap: 9px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.mt { margin-top: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.tiny { font-size: 11.5px; color: var(--dim); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- Mobil */

@media (max-width: 720px) {
  :root { --hud-h: 56px; }

  /* Filter duerfen den halben Bildschirm nicht mit Umbruechen fuellen:
     beide Zeilen scrollen waagerecht statt umzubrechen. */
  .filters { display: block; margin-bottom: 14px; }
  .filters > .hud-spacer { display: none; }
  .chips, .select-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar, .select-row::-webkit-scrollbar { display: none; }
  .chips { padding-bottom: 8px; }
  .chip, .mini-select { flex: none; }
  .section-head { gap: 8px; }
  .section-head .btn { flex: 1; }

  /* Alle vier Reiter muessen ohne Scrollen sichtbar sein */
  .tabs { gap: 2px; padding: 8px 8px; }
  .tab { font-size: 7px; padding: 11px 8px; letter-spacing: 0.02em; }
  .tab .badge { display: none; }
  .hud-brand .hb-tag { display: none; }
  .hud-brand .hb-names { font-size: 21px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
  .grid.big { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .section-head h2 { font-size: 25px; }
  .lb-nav { width: 44px; height: 44px; }
  .player-chip .pc-name { max-width: 78px; }
  main { padding-bottom: 70px; }
  .stat .v { font-size: 22px; }
  .dropzone { padding: 34px 16px; }
  #toasts {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    justify-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =======================================================================
   Barrierefreiheit, Fußzeile und Feinschliff für Touchgeräte
   Bewusst ans Dateiende gestellt: überschreibt frühere Regeln gleicher
   Spezifität, ohne sie umschreiben zu müssen.
   ==================================================================== */

/* ---------------------------------------------------- Nur für Screenreader */

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 10000;
  padding: 12px 20px;
  border-radius: 0 0 var(--r-s) var(--r-s);
  background: var(--gold);
  color: #17091d;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.18s;
}
.skip-link:focus { top: 0; }

/* ---------------------------------------------------- Sichtbarer Fokus
   Ohne das ist die Seite mit der Tastatur praktisch unbenutzbar. */

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible,
.chip:focus-visible,
.tab:focus-visible,
.card:focus-visible,
.player-chip:focus-visible,
.lb-nav:focus-visible,
.dropzone:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}
main:focus { outline: none; }

/* Kein Fokusring bei reiner Mausbedienung */
:focus:not(:focus-visible) { outline: none; }

/* ---------------------------------------------------- Fußzeile */

.site-footer {
  padding: 26px 20px calc(26px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer .herz {
  color: var(--pink);
  font-size: 15px;
  text-shadow: 0 0 10px rgba(255, 95, 169, 0.7);
}
.site-footer a {
  display: inline-block;
  padding: 5px 4px;          /* auf >= 24px Zielgroesse gebracht (WCAG 2.5.8) */
  color: var(--cyan);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  border-radius: 4px;
}
.site-footer a:hover {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 207, 107, 0.5);
}

.gate-inner { width: min(460px, 100%); }
.gate-intro {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 22px;
}

/* ---------------------------------------------------- Neue Bausteine */

.btn-block { width: 100%; padding: 15px; font-size: 15px; }

.formbox { padding: 18px; margin-bottom: 18px; }
.formbox .row { align-items: flex-start; gap: 14px; }

.select-wrap { display: inline-flex; }

.block { padding: 20px; margin-bottom: 16px; }
.block h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  margin: 0 0 10px;
}
.block .muted { margin: 0 0 14px; }

.stat-row { margin: 0 0 20px; }
.stat dt, .stat dd { margin: 0; }

.dropzone {
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: center;
}
.dropzone .dz-icon,
.dropzone .dz-main,
.dropzone .dz-sub { display: block; }

.qitem { list-style: none; }

.lb-counter { margin: 0; }
.lb-name, .lb-meta, .hud-brand { margin: 0; }
.section-head .sub { margin: 0; }

#lbLikeCount { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------- Karten als Schalter */

.card {
  display: block;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

/* =======================================================================
   Touchgeräte: alles, was bisher nur beim Überfahren mit der Maus
   erschien, ist auf dem Handy sonst schlicht unerreichbar.
   ==================================================================== */

@media (hover: none), (pointer: coarse) {
  .card .heart,
  .card .who {
    opacity: 1;
    transform: none;
  }
  .card .shade { opacity: 1; }
  .card .heart {
    width: 44px;
    height: 44px;
    top: 4px;
    right: 4px;
  }
  .card .dur { opacity: 1; }
  .card:hover { transform: none; }

  /* Fingerfreundliche Mindestgrößen */
  .btn { min-height: 44px; padding: 11px 16px; }
  .btn-sm { min-height: 40px; padding: 9px 14px; font-size: 13.5px; }
  .btn-icon { width: 44px; height: 44px; }
  .chip { min-height: 40px; padding: 10px 15px; display: inline-flex; align-items: center; }
  .mini-select { min-height: 40px; }
  .tab { min-height: 44px; display: inline-flex; align-items: center; }
  .lb-nav { width: 48px; height: 48px; }
  .card .checkbox { width: 30px; height: 30px; font-size: 16px; }
}

@media (max-width: 720px) {
  /* Randbereiche moderner Telefone (Notch, Home-Balken) aussparen */
  .hud { padding-left: max(12px, env(safe-area-inset-left));
         padding-right: max(12px, env(safe-area-inset-right)); }
  main  { padding-left: max(12px, env(safe-area-inset-left));
          padding-right: max(12px, env(safe-area-inset-right)); }

  .site-footer { padding-top: 8px; font-size: 12.5px; }

  /* Volle Breite fuer das Bild - die Pfeile liegen darueber, wie ueblich */
  #lbHolder { padding: 0; }
  .lb-top { padding: 10px 12px; gap: 8px; }
  .lb-name { font-size: 13px; }
  .lb-meta { font-size: 11px; }
  .lb-stage img, .lb-stage video { border-radius: 0; }
  .formbox .row { flex-direction: column; }
  .formbox .field.grow { width: 100%; flex: none; margin-bottom: 12px; }
  .bar { gap: 10px; }
  .bar .btn { flex: 1; }
  .lb-bottom { gap: 6px; }
  .lb-bottom .btn { font-size: 12.5px; padding: 9px 11px; }
  .gate-intro { font-size: 13.5px; }
}

/* Text darf beim Vergrößern nicht abgeschnitten werden */
@media (max-width: 380px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ---------------------------------------------------- Hoher Kontrast */

@media (prefers-contrast: more) {
  :root {
    --muted: #d6cfe8;
    --dim:   #bfb6d4;
    --line:  rgba(200, 180, 255, 0.5);
  }
  .card { border-width: 2px; }
  .pill { background: #05030a; }
}

/* Öffnender Schalter deckt die Karte ab; das Herz liegt darüber.
   So bleibt gültiges HTML (kein Button im Button) und beides ist mit
   der Tastatur einzeln erreichbar. */
.card-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: inherit;
}
.card .heart { z-index: 2; }
.card .checkbox { z-index: 2; }
.card-open:focus-visible { outline-offset: -3px; }
.card:focus-within {
  border-color: var(--gold);
  transform: translateY(-4px) scale(1.012);
}
#lbLike.liked .lb-heart { color: var(--pink); }
