/* RESET DASAR */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body, html {
  height: 100vh;
  overflow: hidden;
  font-family: 'Comic Sans MS', cursive, sans-serif;
}

/* SENTRALISASI LAYOUT */
body {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

/* BACKGROUND VIDEO */
#bgVideo, #background-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover; /* Agar video tidak ter-zoom dan tetap proporsional */
  z-index: -1;
  background-color: rgb(255, 253, 253); /* Tambahan: agar area kosong diisi warna netral */
}



/* TOMBOL START */
.start-button {
  position: relative;
  z-index: 1;
  padding: 20px 40px;
  font-size: 24px;
  font-weight: bold;
  color: white;
  background-color: #28a745;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4);
  transition: background-color 0.3s ease;
}
.start-button:hover {
  background-color: #218838;
}

/* KONTEN UTAMA */
.container {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 50px auto;
  background: rgba(255, 255, 255, 0.8);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
  max-width: 700px;
}

/* MENU */
.menu {
  margin-top: 30px;
}
.menu button {
  display: block;
  width: 200px;
  margin: 10px auto;
  padding: 15px;
  font-size: 20px;
  font-weight: bold;
  background: #7ed957;
  border: none;
  border-radius: 10px;
  color: white;
  box-shadow: 3px 3px 5px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: background 0.3s;
}
.menu button:hover {
  background: #66c24e;
}
.menu button:active {
  transform: scale(0.95);
  background: #5cbf44;
}

/* GRID HURUF */
.huruf-container {
  display: grid;
  grid-template-columns: repeat(6, 60px);
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
}
.huruf {
  font-size: 24px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s;
  color: white;
}
.huruf:hover {
  transform: scale(1.1);
}


/* GAME BOARD */
.game-board {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  gap: 15px;
  justify-content: center;
  margin: 30px 0;
}
.card {
  width: 80px;
  height: 80px;
  background-color: rgba(0, 128, 0, 0.3); /* hijau transparan */
  border: 2px solid #ffffff;
  color: transparent;
  font-size: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.3s, background-color 0.3s;
}

.card.flipped {
  background-color: #fff;
  color: black;
  transform: scale(1.05);
}

.card.matched {
  background-color: #4caf50;
  color: white;
  cursor: default;
}
.card span.hidden {
  visibility: hidden;
}
.card.flipped span {
  visibility: visible;
}

/* WARNA HURUF */
.warna-1 { background: #ff6666; color: white; }
.warna-2 { background: #66ccff; color: white; }
.warna-3 { background: #66ff66; color: white; }
.warna-4 { background: #ffcc66; color: white; }
.warna-5 { background: #ff66ff; color: white; }
.warna-6 { background: #cccc66; color: white; }

/* TOMBOL UMUM */
button {
  font-size: 18px;
  padding: 10px 20px;
  margin: 5px;
  background-color: #c8331b;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}
button:hover {
  background-color: #1976d2;
}


/* TOMBOL KEMBALI */
.back-button {
  margin-top: 30px;
  background: #ff3333;
}
.back-button:hover {
  background: #cc0000;
}

.start-button {
  position: relative;
  z-index: 1;
  padding: 20px 40px;
  font-size: 50px;
  font-weight: bold;
  color: white;
  background-color: #c8331b;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4);
  transition: background-color 0.3s ease;
}

.start-button:hover {
  background-color: #218838;
}


/* KONTEN TAMBAHAN */
h2 {
  font-size: 32px;
  color: #f57c00;
  margin-bottom: 20px;
}
#letter-box {
  font-size: 50px;
  font-weight: bold;
  padding: 20px;
  background: #f5f5f5;
  display: inline-block;
  border-radius: 10px;
  margin: 20px 0;
}
input {
  font-size: 18px;
  padding: 10px;
  margin: 10px;
  width: 200px;
  text-align: center;
}
#feedback, #result {
  font-size: 20px;
  font-weight: bold;
  margin-top: 15px;
}

/*tombol musik setting dan keluar*/
.icon-buttons {
  position: fixed;
  top: 20px;
  right: 70px; /* geser agar tidak menimpa ikon musik */
  display: flex;
  gap: 15px;
  z-index: 10;
  font-size: 24px;
}

.icon-buttons a {
  color: white;
  text-decoration: none;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.icon-buttons a:hover {
  background-color: rgba(0, 0, 0, 0.7);
}
/* IKON MUSIK (DISERAGAMKAN DENGAN TOMBOL ATAS) */
#music-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 24px;
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s;
}
#music-toggle:hover {
  background-color: rgba(0, 0, 0, 0.7);
}
/* MODAL CUSTOM */
.modal {
  display: none; 
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  animation: popin 0.4s ease;
}

.modal-content span {
  font-size: 18px;
  line-height: 1.6;
  display: block;
}

.modal-buttons button {
  margin-top: 20px;
  padding: 10px 25px;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  background-color: #4caf50;
  color: white;
  cursor: pointer;
}

.modal-buttons button:hover {
  background-color: #4caf50;
}

@keyframes popin {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.finish-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* latar gelap transparan */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.finish-modal.hidden {
  display: none;
}

.finish-box {
  background: linear-gradient(to bottom, #eaffea, #a3d9a5);
  border: 5px solid #59a56c;
  border-radius: 30px;
  padding: 30px;
  text-align: center;
  width: 300px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  position: relative;
  font-family: 'Comic Sans MS', cursive;
}

.ribbon {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #4CAF50;
  color: white;
  padding: 10px 30px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: bold;
  box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

.stars span {
  font-size: 30px;
  color: gold;
  margin: 0 3px;
}

.finish-box p {
  margin: 10px 0;
  font-size: 18px;
  color: #333;
}

.finish-buttons {
  margin-top: 15px;
}

.finish-buttons button {
  background-color: #fff;
  border: 3px solid #4CAF50;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 22px;
  margin: 0 10px;
  cursor: pointer;
  transition: transform 0.2s;
}

.finish-buttons button:hover {
  transform: scale(1.1);
}


/* TEBAK HURUF – STYLING */
html, body {
  height: 100%;
  margin: 0;
  font-family: Arial, sans-serif;
  text-align: center;
  position: relative;
  overflow-x: hidden;
  background-size: cover;
}

#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -2;
}

/* Overlay gelap di atas video */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: -1;
}

/* Kontainer utama kuis */
.container {
  margin: 40px auto;
  padding: 20px;
  max-width: 600px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 450px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

h2 {
  margin-top: 0;
  color: #123456;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

#question-text {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #333;
}

.choice-button {
  margin: 10px 5px;
  padding: 15px 25px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: #e96161;
  color: white;
  transition: background-color 0.3s, transform 0.2s;
  min-width: 70px;
}

.choice-button:hover {
  background-color: #e76161;
  transform: scale(1.1);
}

.choice-button:active {
  transform: scale(0.9);
}

#result {
  margin-top: 20px;
  font-size: 1.3rem;
  font-weight: 600;
  min-height: 30px;
}

.text-belajar{
  display: block;
  color: #000;
  background-color: #fff;
  font-size: 50pt;
  padding: 10px;
}

/* Tombol umum di dalam kuis */
button {
  margin-top: 20px;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  background-color: #c8331b;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #1e7e34;
}

/* Tombol kembali ke beranda */
.back-button {
  background-color: #ec6161;
  margin-top: 30px;
}

.back-button:hover {
  background-color: #5a6268;
}

/* Ikon musik */
.music-icon {
  cursor: pointer;
  font-size: 28px;
  margin-top: 20px;
  color: #e44d61;
  transition: color 0.3s;
  user-select: none;
}

.music-icon.paused {
  color: #aaa;
}

/* RESPONSIF */
@media (max-width: 600px) {
  .container {
    width: 90%;
    margin: 20px auto;
    padding: 15px;
    min-height: 400px;
  }

  #question-text {
    font-size: 1.2rem;
  }

  .choice-button {
    font-size: 16px;
    padding: 12px 20px;
    min-width: 60px;
  }

  button {
    font-size: 14px;
    padding: 10px 25px;
  }

  .music-icon {
    font-size: 24px;
    margin-top: 15px;
  }
}

body, html {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  color: white;
  text-align: center;
}

#bg-video {
  position: fixed;
  right: 0;
  bottom: 0;
  min-width: 100%;
  min-height: 100%;
  z-index: -1;
  filter: brightness(50%);
}

.container {
  position: relative;
  z-index: 1;
  padding: 20px;
}

.choice-button {
  padding: 15px 25px;
  margin: 10px;
  font-size: 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background-color: #ffffffaa;
  color: black;
  transition: background-color 0.3s;
}

.choice-button:hover {
  background-color: #ddd;
}

.back-button {
  padding: 10px 20px;
  background-color: #29a151;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

/* SETTING*/
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
    background-color: #ffffff;
    color: #000000;
}

body.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

.settings {
    max-width: 400px;
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    background-color: #f5f5f5;
}

body.dark-mode .settings {
    background-color: #1e1e1e;
}

.setting-item {
    margin-bottom: 20px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin: 0 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0;
    right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px; width: 26px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #fcfcfc;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/*notif tebak huruf*/
.notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 3rem;
  padding: 1rem 2rem;
  border-radius: 20px;
  display: none;
  z-index: 9999;
  animation: fadeInOut 2s ease;
}

/*tampilan tebak huruf*/
.finish-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.hidden {
  display: none;
}

.finish-box {
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  max-width: 400px;
  width: 90%;
}

.ribbon {
  background: #ffc107;
  color: #000;
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  margin-bottom: 1rem;
  display: inline-block;
}

.stars span {
  font-size: 2rem;
  margin: 0 0.2rem;
}

.finish-buttons button {
  font-size: 1.5rem;
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: #28a745;
  color: white;
  border-radius: 10px;
  cursor: pointer;
}

.finish-buttons button:hover {
  background: #218838;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: scale(0.9) translate(-50%, -50%); }
  10% { opacity: 1; transform: scale(1.05) translate(-50%, -50%); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.1) translate(-50%, -50%); }
}

.finish-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.finish-box {
  background: white;
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  width: 80%;
  max-width: 400px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.ribbon {
  font-size: 2em;
  color: #fff;
  background-color: #28a745;
  padding: 10px 20px;
  margin-bottom: 15px;
  border-radius: 10px;
  display: inline-block;
}

.stars span {
  font-size: 2em;
  color: gold;
  margin: 0 5px;
}

.finish-buttons button {
  font-size: 1.5em;
  padding: 10px 20px;
  margin: 10px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background-color: #007bff;
  color: white;
}

.hidden {
  display: none;
}

/*tebak huruf*/
