* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Fredoka One', cursive;
}

body {
  overflow: hidden;
  height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: none;
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('assets/img/bgskynew2.png');
  background-repeat: repeat-x;
  background-position: bottom left;
  background-size: auto 100%;
  animation: scroll 30s linear infinite;
  z-index: -1;
}

@keyframes scroll {
  0% { background-position-x: 0; }
  100% { background-position-x: -1000px; }
}

#menu-screen {
  text-align: center;
  z-index: 10;
  position: relative;
}

.game-title {
  font-size: 4rem;
  color: #fff;
  text-shadow: 3px 3px 0 #000;
  margin-bottom: 30px;
}

.bird-wrapper {
  margin-bottom: 30px;
}

#menu-bird {
  width: 90px;
  animation: flap 0.3s steps(2) infinite alternate,
             float 1s ease-in-out infinite alternate;
  filter: drop-shadow(2px 2px 0 #222);
}

@keyframes flap {
  0% { content: url('assets/img/closedwings1.png'); }
  100% { content: url('assets/img/openedwings1.png'); }
}

@keyframes float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

button#start-btn {
  margin: 10px auto;
  padding: 14px 34px;
  font-size: 1.5rem;
  background: #ffcc00;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  animation: pulse 1.5s infinite;
  box-shadow: 0 6px 0 #c9a500;
  transition: transform 0.2s ease;
}

button#start-btn:hover {
  transform: scale(1.05);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

#high-score {
  margin-top: 20px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  font-size: 1.2rem;
}

.hidden {
  display: none !important;
}

canvas#game-screen {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  background-color: transparent;
}

#countdown {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 100px;
  color: #fff;
  text-shadow: 2px 2px 5px #000;
  z-index: 100;
  animation: scaleCount 1s ease-in-out;
}

@keyframes scaleCount {
  0% { transform: scale(0.5) translate(-50%, -50%); opacity: 0; }
  50% { transform: scale(1.2) translate(-50%, -50%); opacity: 1; }
  100% { transform: scale(1) translate(-50%, -50%); opacity: 0; }
}

#game-over-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.card-content {
  background: #fff;
  padding: 30px 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  animation: fadeIn 0.4s ease-in-out;
}

.card-content h2 {
  font-size: 2.5rem;
  color: #e53935;
  margin-bottom: 20px;
}

.card-content p {
  font-size: 1.3rem;
  margin: 10px 0;
  color: #333;
}

.card-content button {
  margin-top: 20px;
  padding: 10px 24px;
  font-size: 1.1rem;
  border: none;
  background: #ffcc00;
  color: #333;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s;
}

.card-content button:hover {
  transform: scale(1.05);
}

.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.control-info {
  margin-top: 12px;
  font-size: 1rem;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  font-style: italic;
}

.info-card {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    font-family: 'Fredoka One', sans-serif;
    font-size: 16px;
    z-index: 100;
}

.pause-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #222;
    color: #fff;
    padding: 30px 40px;
    border-radius: 16px;
    text-align: center;
    z-index: 200;
    font-family: 'Fredoka One', sans-serif;
}

.pause-card button {
    margin: 10px;
    padding: 10px 22px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: #00bcd4;
    color: white;
}

.hidden {
    display: none;
}

/* === Tombol Ganti Tema Map === */
#map-btn {
  margin-top: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #7b2ff7, #f107a3); /* ungu ke pink */
  border: none;
  color: white;
  font-weight: bold;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
  width: auto;
  min-width: 160px;
}

#map-btn:hover {
  background: linear-gradient(135deg, #6a1cc2, #d1008b);
  transform: scale(1.05);
}

/* === Modal Overlay === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* === Modal Box === */
.modal-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  width: 90%;
  max-width: 600px;
}

.modal-content h2 {
  margin-bottom: 20px;
  font-family: 'Fredoka One', sans-serif;
}

/* === Grid Map Options === */
.map-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.map-option {
  position: relative;
  border: 3px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.map-option:hover {
  transform: scale(1.05);
  border-color: #7b2ff7;
}

.map-option img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* === Checkmark === */
.checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #4caf50;
  color: white;
  font-weight: bold;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* === Tutup Button Modal === */
#close-map-modal {
  background-color: #555;
  color: white;
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}
#close-map-modal:hover {
  background-color: #333;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.option-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 10px;
}

.option-buttons button {
  min-width: 160px;
}

#music-toggle-btn {
  margin-top: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #43cea2, #185a9d); /* hijau ke biru */
  border: none;
  color: white;
  font-weight: bold;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
}

#music-toggle-btn:hover {
  background: linear-gradient(135deg, #2b9e7b, #104e8b);
  transform: scale(1.05);
}
