body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #006556;
  color: #183a2c;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /*background-image: url('assets/background-left.png'), url('assets/background-right.png');*/
  /*background-image: url('assets/full-background.png');*/
  /*background-position: left bottom;*/
  background-repeat: no-repeat;
  /*background-size: auto 100%;*/
  background-attachment: fixed;
  background-size: 100% auto;
  background-position: center bottom -200px;
}

#logo {
  width: 330px;
  margin: 40px auto 10px auto;
  padding-left: 25px;
  display: block;
}

h1 {
  font-size: 2.2rem;
  margin: 10px 0 30px 0;
  color: #afca0b; /* Frisse groengele tint uit je illustratie */
  text-align: center;
  letter-spacing: 1px;
  font-weight: 700;
}

form#player-form {
  background: rgba(255,255,255,0.92); /* Licht transparant wit voor zachtheid */
  color: #183a2c;
  padding: 32px 28px 24px 28px;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  margin-bottom: 28px;
  width: 100%;
  max-width: 370px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

form#player-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

form#player-form input {
  width: 100%;
  padding: 10px 0;
  margin-bottom: 18px;
  border: 1.5px solid #afca0b;
  border-radius: 7px;
  background: #f6fbe9;
  font-size: 1rem;
  color: #183a2c;
}

button {
  background-color: #afca0b;
  color: #183a2c;
  border: none;
  border-radius: 7px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  width: 100%;
  margin: 12px 0 0 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  letter-spacing: 0.5px;
}

button:hover {
  background-color: #8fa40a;
}

#logout-btn {
  max-width: 370px;
  width: 100%;
  margin: 0 0 18px 0;
}

#category-selector {
  width: 100%;
  max-width: 370px;
  padding: 10px;
  border-radius: 7px;
  border: 1.5px solid #afca0b;
  margin-top: 5px;
  margin-bottom: 18px;
  font-size: 1rem;
  background: #f6fbe9;
  color: #183a2c;
}

#scoreboard, #highscore, #scorelist {
  width: 100%;
  max-width: 370px;
  margin: 0;
  text-align: center;
}

#game-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  max-width: 600px;
  width: 100%;
  margin-top: 24px;
}

.flip-container {
  perspective: 1200px;
  width: 370px;
  max-width: 95vw;
  margin: 0 auto 28px auto;
}
.flipper {
  position: relative;
  width: 100%;
  transition: transform 0.7s cubic-bezier(.4,2.3,.3,1);
  transform-style: preserve-3d;
}
.flip-container.flipped .flipper {
  transform: rotateY(180deg);
}
.front, .back {
  position: absolute;
  width: 100%;
  backface-visibility: hidden;
  left: 0;
  top: 0;
}
.front {
  z-index: 2;
}
.back {
  transform: rotateY(180deg);
  z-index: 1;
  background: rgba(255,255,255,0.92);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  padding: 32px 28px 24px 28px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

/* hide name-step by default */
#category-step, #name-step { display: none; }

/* Als de kaart omgedraaid is (flipped) en je hebt nog geen name-step actief: toon categorie */
#flip-container.flipped .back #category-step {
  display: block;
}
#flip-container.flipped .back #name-step {
  display: none;
}

/* Zodra je .show-name-step toevoegt: verberg categorie en toon name-step */
#flip-container.show-name-step.flipped .back #category-step {
  display: none;
}
#flip-container.show-name-step.flipped .back #name-step {
  display: block;
}

#restart-btn {
  background-color: #afca0b;
  color: #183a2c;
  border: none;
  border-radius: 7px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  width: 100%;
  margin: 0 0 0 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  letter-spacing: 0.5px;
  display: none; /* Wordt zichtbaar als het spel gestart is */
}

#restart-btn:hover {
  background-color: #8fa40a;
  transform: translateY(-2px) scale(1.03);
}

#restart-btn,
#choose-category-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* optioneel: stel een min-height in als je zeker wilt zijn dat ze nooit kleiner worden dan… */
  min-height: 48px;
  /* en zorg dat padding gelijk is */
  padding: 12px 0;
}

.card {
  width: 140px;
  height: 140px;
  perspective: 800px;
  background: none;
  box-shadow: none;
  display: inline-block;
  margin: 8px;
  vertical-align: top;
  cursor: pointer;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.5s cubic-bezier(.4,2,.6,1);
  transform-style: preserve-3d;
}

.card-inner.flipped {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0; top: 0;
  backface-visibility: hidden;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 600;
  background: linear-gradient(135deg, #eaf7d5 60%, #afca0b 100%);
  color: #183a2c;
  box-shadow: 0 4px 18px rgba(0,0,0,0.10), 0 1.5px 4px rgba(175,202,11,0.13);
  text-align: center;
}

.card-front {
  z-index: 2;
}

.card-back {
  transform: rotateY(180deg);
  z-index: 1;
  background: #fffbe6;
  color: #afca0b;
}
.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
}
.card-back span {
  padding: 0 7px;;
}

#info-bar {
  background: rgba(255,255,255,0.93);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 18px 32px 12px 32px;
  margin: 0 auto 0 auto;
  display: none;
  gap :10px;
  flex-direction: column;
  align-items: center;
  min-width: 320px;
  max-width: 420px;
  min-height: 75px;
}

.info-bar-row {
  display: flex;
  align-items: center; /* Zorgt voor verticale centrering */
  justify-content: center;
  gap: 36px;
  margin-bottom: 18px;
}

#info-bar .score-row {
  display: flex;
  gap: 32px;
  font-size: 1.25rem;
  color: #007e6b;
  font-weight: 700;
  margin-bottom: 0;
}

#info-bar .highscore-row {
  font-size: 1rem;
  color: #183a2c;
  font-weight: 500;
  text-align: center;
}

/* Scorelijst styling */
#scorelist {
  background: rgba(255,255,255,0.93);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 18px 24px 24px 24px;
  margin: 32px auto 0 auto;
  max-width: 520px;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#scorelist h3 {
  color: #007e6b;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

#scorelist table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  margin-bottom: 16px;
}

#scorelist th, #scorelist td {
  padding: 6px 8px;
  text-align: center;
}

#scorelist th {
  background: #eaf7d5;
  color: #183a2c;
  font-weight: 700;
  border-radius: 8px;
}

#scorelist td {
  background: #f6fbe9;
  color: #183a2c;
  border-radius: 8px;
}

#scorelist button {
  background-color: #afca0b;
  color: #183a2c;
  border: none;
  border-radius: 7px;
  padding: 10px 0;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: background 0.2s;
}

#scorelist button:hover {
  background-color: #8fa40a;
}

#scorelist {
  display: none; /* Initially hidden */
}

.button-column {
  width: 250px;
  display: flex;
  flex-direction: column;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 24px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  text-align: center;
  width: 90vw;
  max-width: 400px;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.5rem;
  color: #afca0b;
  cursor: pointer;
}

.modal button {
  margin-top: 18px;
  background-color: #afca0b;
  color: #183a2c;
  border: none;
  border-radius: 8px;
  padding: 10px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.modal button:hover {
  background-color: #8fa40a;
}

/* Specific modal overrides */
#score-modal .modal-content,
#naam-modal .modal-content {
  max-width: 30vw;
  min-width: 320px;
}

/* Hide default win-modal duplicate classes */
.win-modal,
.win-modal-content {
  display: none !important;
}


@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

#win-modal-message {
  font-size: 1.1em;
  margin-bottom: 1.5em;
  color: #222;
}

#win-modal-message b {
  display: block;
  margin-top: 0.7em;
  color: #5a9100;
  font-weight: bold;
  font-size: 1.08em;
}

.win-modal-btn {
  background: #bada22;
  color: #222;
  border: none;
  border-radius: 8px;
  padding: 0.9em 2.5em;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.win-modal-btn:hover {
  background: #a0c41a;
}

@media (max-width: 600px) {
  body,
  .background,
  .bg-image {
    background-image: none !important;
    /*background: #07897c !important;*/ /* of je gewenste effen kleur */
  }
  /* Als je losse <img> gebruikt als decoratie: */
  .background-img,
  .decor-img {
    display: none !important;
  }
  #player-form,
  .player-form {
    width: 90vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 0 auto 18px auto !important;
    padding: 12px 1vw 14px 1vw !important;
    box-sizing: border-box;
  }
  #player-form input,
  .player-form input {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    font-size: 1.1rem;
    margin-bottom: 12px;
  }
  #player-form button,
  .player-form button {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 1.1rem;
    margin-top: 10px;
    box-sizing: border-box;
  }
  #info-bar {
    min-width: auto !important;
    margin-bottom: 10px;
  }
  .info-bar-row {
    width: 90vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 12px 1vw 14px 1vw !important;
    box-sizing: border-box;
    display: block;
    float: none;
  }
  .back {
    width: 90vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 12px 1vw 14px 1vw !important;
    box-sizing: border-box;
    display: block;
    float: none;
  }
  #game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr)!important;
    gap: 0;
    width: 100vw;
    max-width: 100vw;
    margin: 0 auto;
    padding: 0 2vw 2vw 2vw;
    box-sizing: border-box;
    justify-items: center;
    align-items: center;
  }
  .card {
    width: 30vw;
    height: 30vw;
    /* min-width: 60px; */
    /* min-height: 60px; */
    max-width: 120px;
    max-height: 120px;
    box-sizing: border-box;
    margin: 0;
  }
  .card-front, .card-back {
    font-size: 0.9rem;
  }
  #scorelist {
    width: 90vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 12px 1vw 14px 1vw !important;
    box-sizing: border-box;
    float: none;
  }

  #choose-category-btn {
    margin-top: 0!important;
  }

  .button-column {
    /* maak de knoppen full-width én naast elkaar */
    flex-direction: row;
  }
}

@media (max-width: 700px) {
  .info-bar-row {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }
  .button-column {
    flex-direction: row;
    gap: 12px;
    width: 100%;
    justify-content: center;
  }
}

#win-modal {
  z-index: 1000;
}
.win-modal-content {
  z-index: 1002;
  position: relative;
}

/* Canvas van canvas-confetti */
.confetti-canvas {
  position: fixed !important;
  top: 0; left: 0;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none;
  z-index: 1001 !important; /* Tussen modal-bg en modal-content */
}

.form-container input[type="text"],
.form-container input[type="email"] {
    padding-left: 14px; /* Pas dit getal aan naar wens */
}

/* --- Firefox-safe flip fix --- */
.flip-container.flipped .front {
  visibility: hidden;      /* voorkom dat de achterkant van het formulier zichtbaar blijft */
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}
.flip-container.flipped .back {
  z-index: 2;
  opacity: 1;
}

