body {
  background-color: #0a1e4a;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: white;
  margin: 20px;
  padding-left: 10px;
  padding-right: 10px;
}

h2 {
  text-align: center;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 24px;
}

.search-container {
  position: relative;
  max-width: 400px;
  margin: 0 auto 20px auto;
}

#searchBox {
  width: 100%;
  padding: 12px 40px 12px 16px; /* padding kanan dikurangi supaya icon tidak terlalu ke kanan */
  font-size: 16px;
  border-radius: 30px;
  border: none;
  outline: none;
  box-sizing: border-box;
  background-color: #1f3d7a;
  color: white;
  transition: box-shadow 0.3s ease;
}

#searchBox::placeholder {
  color: #a3b1d1;
}

#searchBox:focus {
  box-shadow: 0 0 10px 3px #4a90e2;
  background-color: #274b9c;
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  fill: #a3b1d1;
  transition: fill 0.3s ease;
}

#searchBox:focus + .search-icon {
  fill: #4a90e2;
}


/* GRID CONTAINER */
.grid-container {
  max-width: 1200px;
  margin: 0 auto 30px auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 kolom desktop */
  gap: 16px;
}

/* Responsive: 2 kolom untuk tablet/mobil */
@media (max-width: 960px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* Responsive: 1 kolom untuk layar sangat kecil */
@media (max-width: 480px) {
  .grid-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  body {
    padding-left: 15px;
    padding-right: 15px;
  }
  #searchBox {
    font-size: 16px;
    padding: 14px 40px 14px 16px;
  }
  .card-image-container {
    width: 90px;
    height: 90px;
  }
  .game-name {
    font-size: 16px;
  }
  .card {
    min-height: 140px;
    padding: 14px;
  }
}

.card {
  background-color: #16438e;
  border-radius: 12px;
  box-shadow: 0 0 15px #003974;
  display: flex;
  gap: 12px;
  padding: 12px;
  align-items: center;
  min-height: 130px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.card-image-container {
  position: relative;
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  flex-grow: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #0e2a5b;
}

.card-image-container img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: linear-gradient(45deg, #ff3d3d, #b20202);
  color: white;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 5px;
  z-index: 10;
}

.badge.top {
  background: linear-gradient(45deg, #00c853, #00701a);
}

.content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow-wrap: break-word;
}

.game-name {
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.pattern-container {
  background-color: #0f2d70;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  min-width: 0;
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jam-gacor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 600;
  color: #a3b1d1;
}

.jam-gacor svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #a3b1d1;
  margin: 0;
}

.pattern-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0;
}

.pattern-bet {
  font-weight: 700;
  min-width: 90px;
  color: #c7d6f7;
}

.pattern-icons {
  display: flex;
  gap: 6px;
}

.checkmark {
  color: #00ff6a;
  font-weight: 700;
}

.crossmark {
  color: #ff3f3f;
  font-weight: 700;
}

.rtp-box {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  color: white;
  text-align: center;
  user-select: none;
  background: linear-gradient(90deg, #76d275, #408b0f);
  display: inline-block;
  min-width: 40px;
  position: relative;
  overflow: hidden;
}

.rtp-box.yellow {
  background: linear-gradient(90deg, #f1c40f, #b27b00);
}

.rtp-box.red {
  background: linear-gradient(90deg, #ff6b6b, #bb0000);
}

.rtp-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #76d275, #408b0f);
  border-radius: 6px;
  width: 0;
  animation: fillBar 1s forwards ease-in-out;
  z-index: -1;
}

.rtp-box.yellow .rtp-fill {
  background: linear-gradient(90deg, #f1c40f, #b27b00);
}

.rtp-box.red .rtp-fill {
  background: linear-gradient(90deg, #ff6b6b, #bb0000);
}

@keyframes fillBar {
  from { width: 0; }
  to { width: var(--rtp-value); }
}

/* Loading spinner overlay */
#loadingSpinner {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Spinner circle */
.spinner {
  border: 5px solid rgba(255,255,255,0.2);
  border-top: 5px solid white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty state message */
.empty-message {
  color: #ff6961;
  text-align: center;
  font-weight: 700;
  margin-top: 20px;
  font-size: 18px;
}