/* ==== Grundlayout ==== */

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

body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at center, #070b12, #020307);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #f5f5f5;
  overflow-x: hidden;
}

.game-main {
  min-height: 100vh;
  padding-top: 70px;
  padding-bottom: 40px;
}

/* Container-Hintergrund für das Spiel */
.game-container {
  background: radial-gradient(circle at center, #070b12, #020307);
}

/* Kopfbereich Spiel */
.game-header-bar {
  max-width: 1400px;
  margin: 90px auto 20px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d0e0ff;
}
.game-title {
  font-weight: 600;
}
.game-countdown span {
  font-weight: 700;
}

/* ==== Header / Navigation ==== */

.bm-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  display: flex;
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.35);
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.35s ease;
}

.bm-header.hide { transform: translateY(-100%); }

.bm-header-inner {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.bm-logo {
  letter-spacing: 0.25em;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
}

.bm-nav a {
  margin-left: 2rem;
  color: #ddd;
  text-decoration: none;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.8rem;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.bm-nav a:hover,
.bm-nav a.active {
  color: #fff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
}

/* ==== Spielfeld ==== */

.game-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 22px;
  width: 100%;
  max-width: 1250px;
  padding: 0 20px;
  margin: 0 auto;
}

/* Karte allgemein */

.card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.5;
  max-width: 180px;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  background: #05070b;
  box-shadow:
    0 0 18px rgba(0, 0, 0, 0.8),
    0 0 10px rgba(0, 80, 160, 0.4);
  transform: translateY(0);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 25px rgba(0, 0, 0, 0.95),
    0 0 16px rgba(0, 120, 220, 0.6);
}

/* Vorder- und Rückseite */

.card-back,
.card-front {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 80%;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Rückseite: Deckblatt */
.card-back {
  background-image: url("../assets/img/card-back.png");
  background-size: cover;
  opacity: 1;
  transform: scale(1);
}

/* Vorderseite: Symbol */
.card-front {
  opacity: 0;
  transform: scale(0.7);
}

/* Sichtbare Karte (umgedreht) */
.card.visible .card-back {
  opacity: 0;
  transform: scale(1.05);
}

.card.visible .card-front {
  opacity: 1;
  transform: scale(1);
}

/* Gefundene Karte */
.card.matched {
  visibility: hidden;
}

/* Buchstaben-Reveal auf den Karten */
.reveal-letter {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 80%;
  width: auto;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2) rotateY(-180deg);
  transition:
    transform 1s ease,
    top 1s ease,
    left 1s ease,
    opacity 0.6s ease;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 0 14px #000) drop-shadow(0 0 8px #000);
}

.reveal-letter.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotateY(-180deg);
}

.reveal-letter.to-corner {
  top: 8px;
  left: 8px;
  height: 26%;
  transform: translate(0, 0) scale(1) rotateY(-180deg);
}

.reveal-letter.fade-out {
  opacity: 0;
}


/* Sieg-Overlay-Text */

.overlay-message {
  margin-top: 32px;
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity 0.4s ease-out;
  text-align: center;
  min-height: 1.4em;
}

.overlay-message.visible {
  opacity: 1;
}

/* Musik-Toggle */

.music-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 24px;
  padding: 10px 14px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
  transition: background 0.2s ease-out, transform 0.15s ease-out;
  z-index: 60;
}

.music-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

/* ==== Responsive Anpassungen ==== */

@media (max-width: 1200px) {
  .game-board {
    max-width: 1000px;
  }
}

@media (max-width: 1000px) {
  .game-board {
    grid-template-columns: repeat(4, 1fr);
    max-width: 800px;
  }
}

@media (max-width: 700px) {
  .bm-header-inner {
    padding: 0 1rem;
  }
  .bm-nav a {
    margin-left: 1rem;
    letter-spacing: 0.08em;
  }
  .game-board {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0 10px;
  }
  .card {
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  .game-board {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .card {
    max-width: 140px;
  }
}

/* SLOT-REVEAL / Endscreen im gleichen Stil wie das Intro-Panel */
.slot-reveal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-out;
  z-index: 500;
}

.slot-reveal.visible {
  opacity: 1;
  pointer-events: auto;
}

.slot-panel {
  display: none;
  padding: 18px 30px 20px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 22px;
  border: 1px solid rgba(255, 0, 0, 0.55);
  box-shadow: 0 0 26px rgba(255, 0, 0, 0.55);
  max-width: 90%;
  text-align: center;
  backdrop-filter: blur(22px);
}

.slot-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.slot-sub {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

.slot-buttons {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.next-stage-btn {
  padding: 10px 28px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  background: #900;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
  transition: background 0.2s ease-out, transform 0.15s ease-out, box-shadow 0.2s ease-out;
}

.next-stage-btn:hover {
  background: #b00;
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(255, 0, 0, 0.8);
}

@media (max-width: 600px) {
  .slot-panel {
  display: none;
    padding: 16px 18px 16px;
  }
  .slot-title {
    font-size: 0.98rem;
  }
  .slot-sub {
    font-size: 0.82rem;
  }
  .next-stage-btn {
    font-size: 0.82rem;
    padding: 9px 22px;
  }
}



.slot-panel.visible {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}


/* Finaler Karten-Strip nach dem Memory-Sieg */
.final-strip {
  display: flex;
  gap: 18px;
  margin-bottom: 26px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.final-strip.fade-out {
  opacity: 0;
  transition: opacity 0.8s ease-out;
}

.final-card {
  width: 120px;
  aspect-ratio: 2 / 3;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 0 18px rgba(0, 0, 0, 0.8),
    0 0 14px rgba(0, 120, 220, 0.6);
}

.final-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
