/* =========================================================================
   JGA — Trashy Neon Sci-Fi Theme
   Jedi-Tempel x schlechte Geocities-Seite x Las Vegas x Kirmes.
   Kein Framework - bewusst schlanke, handgeschriebene Utility-Klassen,
   damit das Bundle klein bleibt und der Trash-Look voll kontrollierbar ist.
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Bangers&family=Orbitron:wght@500;700;900&display=swap");

:root {
  --c-black: #05040a;
  --c-dark-blue: #0a0e2a;
  --c-cyan: #00fff2;
  --c-pink: #ff2ee0;
  --c-yellow: #ffe600;
  --c-purple: #9b30ff;

  --font-pixel: "Press Start 2P", "Courier New", monospace;
  --font-display: "Orbitron", "Bangers", sans-serif;
  --font-comic: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  --font-body: "Orbitron", system-ui, sans-serif;

  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(ellipse at top, var(--c-dark-blue), var(--c-black) 70%);
  color: #eaf6ff;
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

/* Diese App wird fast ausschliesslich auf dem Handy benutzt - Mobile ist
   hier die Haupt-Zielplattform, Desktop nur ein Bonus-Fallback. */
a, button {
  touch-action: manipulation;
}

/* ---------------------------------------------------------------- starfield */
#starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* --------------------------------------------------------------- utilities */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.app-main {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-1 {
  gap: 0.5rem;
}
.gap-2 {
  gap: 1rem;
}
.gap-3 {
  gap: 1.5rem;
}
.wrap {
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 1.25rem;
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.grid-photos {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.text-center {
  text-align: center;
}
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.75rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.75rem; }
.small {
  font-size: 0.8rem;
  opacity: 0.8;
}

.pixel {
  font-family: var(--font-pixel);
}
.comic {
  font-family: var(--font-comic);
}

/* ------------------------------------------------------------------- glow */
.glow-cyan {
  color: var(--c-cyan);
  text-shadow: 0 0 6px var(--c-cyan), 0 0 18px var(--c-cyan), 0 0 32px rgba(0, 255, 242, 0.5);
}
.glow-pink {
  color: var(--c-pink);
  text-shadow: 0 0 6px var(--c-pink), 0 0 18px var(--c-pink), 0 0 32px rgba(255, 46, 224, 0.5);
}
.glow-yellow {
  color: var(--c-yellow);
  text-shadow: 0 0 6px var(--c-yellow), 0 0 18px var(--c-yellow), 0 0 32px rgba(255, 230, 0, 0.5);
}
.glow-purple {
  color: var(--c-purple);
  text-shadow: 0 0 6px var(--c-purple), 0 0 18px var(--c-purple), 0 0 32px rgba(155, 48, 255, 0.5);
}

.border-glow-cyan {
  border: 2px solid var(--c-cyan);
  box-shadow: 0 0 10px var(--c-cyan), inset 0 0 10px rgba(0, 255, 242, 0.25);
}
.border-glow-pink {
  border: 2px solid var(--c-pink);
  box-shadow: 0 0 10px var(--c-pink), inset 0 0 10px rgba(255, 46, 224, 0.25);
}

/* -------------------------------------------------------------- holo panel */
.holo-panel {
  position: relative;
  background: linear-gradient(135deg, rgba(0, 255, 242, 0.08), rgba(155, 48, 255, 0.12) 50%, rgba(255, 46, 224, 0.08));
  border: 1px solid rgba(0, 255, 242, 0.4);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 24px rgba(0, 255, 242, 0.15), 0 0 60px rgba(155, 48, 255, 0.1);
}
.holo-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
}

/* --------------------------------------------------------------- card */
.card {
  background: rgba(10, 14, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--c-cyan);
  box-shadow: 0 8px 28px rgba(0, 255, 242, 0.25);
}
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  padding: 0.7rem 1.4rem;
  min-height: 44px;
  border-radius: 999px;
  border: 2px solid var(--c-cyan);
  background: rgba(0, 255, 242, 0.08);
  color: var(--c-cyan);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 16px var(--c-cyan);
}
.btn-pink {
  border-color: var(--c-pink);
  color: var(--c-pink);
  background: rgba(255, 46, 224, 0.08);
}
.btn-pink:hover {
  box-shadow: 0 0 16px var(--c-pink);
}
.btn-yellow {
  border-color: var(--c-yellow);
  color: var(--c-yellow);
  background: rgba(255, 230, 0, 0.08);
}
.btn-yellow:hover {
  box-shadow: 0 0 16px var(--c-yellow);
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-blink {
  animation: blink-glow 1.1s infinite;
}
@keyframes blink-glow {
  0%, 100% { box-shadow: 0 0 6px var(--c-yellow); opacity: 1; }
  50% { box-shadow: 0 0 26px var(--c-yellow); opacity: 0.75; }
}

/* -------------------------------------------------------------- forms */
label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  color: var(--c-cyan);
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 242, 0.4);
  border-radius: 8px;
  color: #eaf6ff;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  /* 16px Minimum, sonst zoomt iOS Safari beim Fokussieren automatisch rein -
     bei einer Handy-only-App waere das staendige Genervt-Sein vorprogrammiert. */
  font-size: 16px;
  min-height: 44px;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--c-pink);
  box-shadow: 0 0 10px rgba(255, 46, 224, 0.5);
}
.field {
  margin-bottom: 1rem;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--c-pink);
  min-height: 44px;
}

/* -------------------------------------------------------------- navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(5, 4, 10, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 255, 242, 0.35);
  box-shadow: 0 0 20px rgba(0, 255, 242, 0.15);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  max-width: 1080px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.navbar-brand {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--c-yellow);
  text-shadow: 0 0 8px var(--c-yellow);
  text-decoration: none;
  white-space: nowrap;
}
.navbar-links {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.navbar-links a {
  color: #cfeeff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.navbar-links a:hover,
.navbar-links a.active {
  color: var(--c-cyan);
  border-color: var(--c-cyan);
  text-shadow: 0 0 8px var(--c-cyan);
}
.navbar-user {
  font-size: 0.8rem;
  color: var(--c-pink);
  white-space: nowrap;
}

/* ---------------------------------------------------------- bottom nav ---
   Primaernavigation auf dem Handy (das eigentliche Zielgeraet dieser App).
   Der Top-Navbar-Linkbereich wird darunter per Media Query ausgeblendet,
   damit es keine doppelte Navigation gibt. */
.bottom-nav {
  display: none;
}

@media (max-width: 780px) {
  .navbar-links {
    display: none;
  }
  .navbar-inner {
    padding: 0.6rem 1rem;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(5, 4, 10, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 255, 242, 0.35);
    box-shadow: 0 -4px 20px rgba(0, 255, 242, 0.15);
    padding: 0.3rem 0.2rem calc(0.3rem + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    color: #cfeeff;
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.15s ease, background 0.15s ease;
  }
  .bottom-nav a .bn-icon {
    font-size: 1.3rem;
    line-height: 1;
  }
  .bottom-nav a .bn-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }
  .bottom-nav a.active {
    color: var(--c-cyan);
    background: rgba(0, 255, 242, 0.1);
    text-shadow: 0 0 8px var(--c-cyan);
  }

  .app-main {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom)) !important;
  }
}

/* -------------------------------------------------------------- footer */
footer {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
  font-size: 0.75rem;
  opacity: 0.6;
}
footer a {
  color: var(--c-purple);
}

/* --------------------------------------------------------------- flash */
.flash-wrap {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
}
.flash {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  animation: flash-in 0.25s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.flash-success {
  background: rgba(0, 255, 150, 0.15);
  border: 1px solid #00ff96;
  color: #b6ffe0;
}
.flash-error {
  background: rgba(255, 46, 90, 0.15);
  border: 1px solid #ff2e5a;
  color: #ffc4d0;
}
.flash-info {
  background: rgba(0, 255, 242, 0.12);
  border: 1px solid var(--c-cyan);
  color: #d6fbff;
}
@keyframes flash-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (max-width: 640px) {
  .flash-wrap {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem;
    max-width: none;
  }
}

/* ----------------------------------------------------------- table-scroll
   Tabellen (Verlaufs-Historien, Admin-Listen) scrollen horizontal statt den
   Handy-Bildschirm zu sprengen. */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  min-width: 420px;
}

/* -------------------------------------------------------------- btn-stack
   Button-Gruppen (z.B. "wer hat gewonnen?"), die auf dem Handy lieber
   volle Breite und untereinander stehen als winzig nebeneinander - leichter
   zu treffen, auch wenn schon das ein oder andere Bier floss. */
@media (max-width: 480px) {
  .btn-stack {
    flex-direction: column;
  }
  .btn-stack .btn {
    width: 100%;
  }
}

/* ------------------------------------------------------------- admin-nav */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
@media (max-width: 640px) {
  .admin-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }
  .admin-nav .btn {
    flex-shrink: 0;
  }
}

/* ------------------------------------------------------------------ hero */
.hero {
  text-align: center;
  padding: 3.5rem 1rem 2rem;
  position: relative;
}
.hero h1 {
  font-family: var(--font-pixel);
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  line-height: 1.5;
  margin: 0 0 1rem;
}

/* -------------------------------------------------------- hero photo (Braeutigam) */
.hero-photo-frame {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--c-cyan);
  box-shadow: 0 0 18px var(--c-cyan), 0 0 40px rgba(255, 46, 224, 0.4);
  animation: hero-photo-glow 3s ease-in-out infinite;
}
@keyframes hero-photo-glow {
  0%, 100% { box-shadow: 0 0 18px var(--c-cyan), 0 0 40px rgba(255, 46, 224, 0.4); }
  50% { box-shadow: 0 0 26px var(--c-pink), 0 0 55px rgba(0, 255, 242, 0.5); }
}
.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: rgba(0, 0, 0, 0.4);
}
.hero p {
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
  opacity: 0.9;
}
.laser-line {
  height: 3px;
  width: 60%;
  margin: 1.5rem auto;
  background: linear-gradient(90deg, transparent, var(--c-pink), var(--c-cyan), transparent);
  box-shadow: 0 0 12px var(--c-pink);
  animation: laser-sweep 2.4s linear infinite;
  background-size: 200% 100%;
}
@keyframes laser-sweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* -------------------------------------------------------------- countdown */
.countdown {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}
.countdown-box {
  min-width: 76px;
  padding: 0.9rem 0.5rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--c-purple);
  box-shadow: 0 0 14px rgba(155, 48, 255, 0.5);
}
.countdown-box .num {
  font-family: var(--font-pixel);
  font-size: 1.4rem;
  color: var(--c-purple);
  text-shadow: 0 0 10px var(--c-purple);
  display: block;
}
.countdown-box .unit {
  font-size: 0.65rem;
  text-transform: uppercase;
  opacity: 0.8;
}
@media (max-width: 380px) {
  .countdown {
    gap: 0.4rem;
  }
  .countdown-box {
    min-width: 62px;
    padding: 0.6rem 0.3rem;
  }
  .countdown-box .num {
    font-size: 1.1rem;
  }
}

/* -------------------------------------------------------------- progress */
.progress-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 242, 0.3);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-pink), var(--c-cyan));
  box-shadow: 0 0 10px var(--c-cyan);
  transition: width 0.4s ease;
}

/* ------------------------------------------------------------- scorecard */
.scorecard {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
}
.scorecard .points {
  font-family: var(--font-pixel);
  font-size: 2rem;
}

/* ------------------------------------------------------------------ badge */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid currentColor;
}

/* -------------------------------------------------------------- surprise */
.surprise {
  text-align: center;
  padding: 2rem 1rem;
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--c-yellow);
  animation: pulse-surprise 1.6s ease-in-out infinite;
}
@keyframes pulse-surprise {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ---------------------------------------------------------------- table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
th, td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}
th {
  color: var(--c-cyan);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------- leaderboard rows */
.lb-row {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 0.5rem;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.lb-row.rank-1 { border: 1px solid var(--c-yellow); box-shadow: 0 0 14px rgba(255, 230, 0, 0.4); }
.lb-row.rank-2 { border: 1px solid var(--c-cyan); }
.lb-row.rank-3 { border: 1px solid var(--c-pink); }
.lb-row.moved {
  animation: rank-pop 0.6s ease;
}
@keyframes rank-pop {
  0% { transform: scale(1.04); box-shadow: 0 0 24px var(--c-cyan); }
  100% { transform: scale(1); }
}
.lb-rank {
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  text-align: center;
}
.lb-points {
  font-family: var(--font-pixel);
  color: var(--c-yellow);
}

/* --------------------------------------------------------------- gallery */
.photo-tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.photo-tile:hover img {
  transform: scale(1.08);
}
.photo-tile.starwars img {
  filter: hue-rotate(180deg) saturate(1.6) contrast(1.1);
}
.photo-tile.starwars::after {
  content: "⚔️";
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px var(--c-cyan));
}
.photo-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px var(--c-yellow));
}
.photo-credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 0.5rem 0.35rem;
  font-size: 0.65rem;
  color: #fff;
  text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  pointer-events: none;
}

/* ---------------------------------------------------------- groom wall */
.groom-wall {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}
.groom-wall .photo-tile {
  flex: 0 0 150px;
  width: 150px;
  scroll-snap-align: start;
  border: 2px solid var(--c-yellow);
  box-shadow: 0 0 14px rgba(255, 230, 0, 0.35);
}

/* ------------------------------------------------------------------- chip */
.chip {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 242, 0.4);
  background: transparent;
  color: #cfeeff;
  cursor: pointer;
}
.chip.active {
  border-color: var(--c-cyan);
  color: var(--c-cyan);
  background: rgba(0, 255, 242, 0.1);
  box-shadow: 0 0 10px rgba(0, 255, 242, 0.35);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 2rem;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 0 40px var(--c-cyan);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.8rem;
  color: var(--c-pink);
  cursor: pointer;
  background: none;
  border: none;
}

/* ------------------------------------------------------------ placeholder */
.coming-soon {
  text-align: center;
  padding: 2.5rem 1rem;
}
.coming-soon .emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

/* ------------------------------------------------------------------ misc */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 242, 0.5), transparent);
  margin: 2rem 0;
}

@media (max-width: 640px) {
  .hero {
    padding: 2.25rem 1rem 1.5rem;
  }
  .container {
    padding: 0 1rem;
  }
  footer {
    padding: 1.5rem 1rem 2rem;
  }
}
