* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #fac6ca;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.game-container {
  text-align: center;
  max-width: 800px;
  width: 100%;
  position: relative;
}

h1 {
  color: #333;
  font-size: 2.5em;
}

button {
  padding: 10px 20px;
  margin-top: 20px;
  background-color: #4CAF50;
  color: white;
  font-size: 1.2em;
  border: none;
  cursor: pointer;
  border-radius: 5px;
}

button:disabled {
  background-color: #ddd;
  cursor: not-allowed;
}

#score {
  font-size: 1.5em;
  margin-top: 20px;
}

#levelBarContainer {
  width: 200px;
  height: 35vh; /* Make the container full height of the screen */
  background-color: #ddd;
  margin: 20px auto;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

#levelBar {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 0%;
  background-color: #8A2BE2; /* Purple color */
  transition: height 0.1s ease-in-out;
}

#timeLeft {
  font-size: 1.2em;
  margin-top: 10px;
}
/* --- Water Wave Meter --- */
/* variabel default kecepatan gelombang */
:root{
  --wave-speed-1: 6s;
  --wave-speed-2: 9s;
}

.meter{ position: relative; width: 100px; height: 35vh; background-color:#ddd;
  margin:20px auto; border-radius:10px; overflow:hidden; border:2px solid #e6e1ff;
  background: linear-gradient(#f7f6ff,#f0ecff); box-shadow: inset 0 4px 10px rgba(0,0,0,.06);
}

/* tinggi air diubah via JS mengikuti level real-time */
.water{
  position:absolute; left:0; right:0; bottom:0; height:0%;
  overflow:hidden; border-bottom-left-radius:10px; border-bottom-right-radius:10px;
  /* gradien emas */
  background: linear-gradient(180deg,#ffd166 0%, #f9c74f 60%, #e9b949 100%);
  transition: height 120ms ease-out;
}


.wave{ position:absolute; left:0; bottom:0; width:200%; height:120px; opacity:.75;
  background-repeat: repeat-x; background-size:600px 120px; mix-blend-mode:screen;
  filter: drop-shadow(0 -2px 4px rgba(255,255,255,.35)); pointer-events:none;
}

.wave1{
  animation: wave-move-1 var(--wave-speed-1) linear infinite;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='600' height='120' viewBox='0 0 600 120'>\
<path d='M0,60 C50,40 100,80 150,60 C200,40 250,80 300,60 C350,40 400,80 450,60 C500,40 550,80 600,60 L600,120 L0,120 Z' fill='%23ffe29a'/>\
</svg>");
}

.wave2{
  animation: wave-move-2 var(--wave-speed-2) linear infinite;
  opacity:.5; transform: translateY(8px);
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='600' height='120' viewBox='0 0 600 120'>\
<path d='M0,62 C50,82 100,42 150,62 C200,82 250,42 300,62 C350,82 400,42 450,62 C500,82 550,42 600,62 L600,120 L0,120 Z' fill='%23fff3c4'/>\
</svg>");
}


@keyframes wave-move-1{ from{transform:translateX(0)} to{transform:translateX(-50%)} }
@keyframes wave-move-2{ from{transform:translateX(0)} to{transform:translateX(-50%)} }

/* Peak marker: garis tipis yang berhenti di puncak */
.peak{
  position:absolute; left:0; right:0; height:4px; bottom:0;
  background: linear-gradient(90deg,#ffb3c7, #ff4571, #ffb3c7);
  box-shadow: 0 0 6px rgba(255,69,113,.6);
  border-radius:4px;
}

/* Peak wave (puncak berbentuk gelombang air, statis pada high score) */
.peak-wave{
  position:absolute;
  left:0;
  right:0;
  height:26px;
  bottom:0;
  pointer-events:none;
  background-repeat: repeat-x;
  background-size: 600px 26px;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='600' height='26' viewBox='0 0 600 26'>\
<defs>\
  <linearGradient id='g' x1='0' y1='0' x2='0' y2='1'>\
    <stop offset='0%' stop-color='%23ffffff' stop-opacity='0.95'/>\
    <stop offset='60%' stop-color='%23ffe29a' stop-opacity='0.95'/>\
    <stop offset='100%' stop-color='%23ffd166' stop-opacity='1'/>\
  </linearGradient>\
</defs>\
<path d='M0,14 C50,6 100,22 150,14 C200,6 250,22 300,14 C350,6 400,22 450,14 C500,6 550,22 600,14 L600,26 L0,26 Z' fill='url(%23g)'/>\
</svg>");
  box-shadow: 0 -2px 6px rgba(255, 209, 102, .45);
  filter: saturate(1.05);
}

.peak-wave{ outline: 1px solid rgba(255,255,255,.35); }

#fx{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999; /* di atas semuanya */
}
h1 {
  font-size: 3em;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  /* gradien emas */
  background: linear-gradient(90deg, #896d2e, #8d702b, #8f6f26, #2c155b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;

  /* efek glow & bayangan */
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.6), 
               0 0 16px rgba(249, 199, 79, 0.5);
}
.gold-title {
font-size: 3em;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  /* gradien emas */
  background: linear-gradient(90deg, #bea053, #c99f3c, #d3ab4c, #ffd166);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;

  /* efek glow & bayangan */
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.6), 
               0 0 16px rgba(249, 199, 79, 0.5);
}

.red-title {
  font-size: 3em;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: red; /* merah solid */
  text-shadow: 0 0 8px rgba(255,0,0,0.6),
               0 0 16px rgba(200,0,0,0.5);
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
}

@keyframes pulse {
  0%   { transform: scale(1);   text-shadow: 0 0 6px rgba(255,255,255,0.6); }
  50%  { transform: scale(1.3); text-shadow: 0 0 16px rgba(255,255,255,1); }
  100% { transform: scale(1);   text-shadow: 0 0 6px rgba(255,255,255,0.6); }
}

#score {
  font-size: 1.5em;
  margin-top: 20px;
  color: white;
  font-weight: bold;
  text-shadow: 0 0 6px rgba(0,0,0,0.6);
  transition: transform 0.2s;
}

#score.pulse {
  animation: pulse 0.6s ease; /* animasi singkat setiap kali score berubah */
}

.title-image {
  max-width: 400px; /* ukuran logo */
  width: 100%;
  margin: 40px auto 10px; /* tambahkan margin/padding atas */
  display: block;
}


.meter {
  position: relative;
  width: 100px;
  height: 35vh; /* tadinya 50vh, dipendekkan */
  background-color: #ddd;
  margin: 20px auto;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e6e1ff;
  background: linear-gradient(#f7f6ff, #f0ecff);
  box-shadow: inset 0 4px 10px rgba(0,0,0,.06);
}

.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 20px 40px;
  border-radius: 10px;
  font-size: 2em;
  z-index: 1000;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.popup.show {
  display: block;
}
button {
  padding: 10px 20px;
  margin-top: 20px;
  background-color: #4CAF50;
  color: white;
  font-size: 1.2em;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  margin-right: 10px; /* Add space between the buttons */
}

button:disabled {
  background-color: #ddd;
  cursor: not-allowed;
}
#resetButton {
  display: none; /* Initially hidden */
  padding: 10px 20px;
  margin-top: 20px;
  background-color: #f39c12; /* Yellow color */
  color: white;
  font-size: 1.2em;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  margin-left: 10px; /* Space between the buttons */
}

button:disabled {
  background-color: #ddd;
  cursor: not-allowed;
}
