* {
  box-sizing: border-box;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;

  background-image: url("https://raw.githubusercontent.com/boxgank/48/main/img/20260124_030612.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  color: #fff; /* FONT TETAP PUTIH */
}

/* ===== JUDUL WARNA BERGERAK ===== */
.main-title {
  text-align: center;
  margin: 36px 0 40px;

  font-family: 'Montserrat', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;

  /* GRADIENT WARNA */
  background: linear-gradient(
    90deg,
    #ff3cac,
    #784ba0,
    #2b86c5,
    #3cb7fa,
    #ffd000,
    #fe924a,
    #ff3cac
  );
  background-size: 300% 100%;

  /* TEKS JADI GRADIENT */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  /* DEPTH BIAR TETAP GARANG */
  text-shadow:
    0 2px 0 rgba(0,0,0,0.7),
    0 8px 30px rgba(0,0,0,0.9);

  animation: titleGradientMove 6s linear infinite;
}

/* ===== ANIMASI GRADIENT ===== */
@keyframes titleGradientMove {
  0%   { background-position:   0% 50%; }
  100% { background-position: 100% 50%; }
}
/* ===== SELECT SCREEN ===== */
#selectScreen {
  max-width: 900px;
  margin: auto;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

/* ===== MODE RADIO ===== */
#selectScreen label {
  margin-right: 16px;
  cursor: pointer;
  font-weight: 600;
}

input[type="radio"] {
  accent-color: #ff79c6;
}

/* ===== TEAM / GEN BOX ===== */
#genSelect,
#teamSelect {
  margin-top: 20px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
}

/* ===== ALL BUTTON ===== */
button {
  border: none;
  outline: none;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #ff79c6, #8be9fd);
  color: #111;
  margin: 6px 0 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(255,121,198,0.4);
}

button:active {
  transform: scale(0.95);
}

/* ===== CHECKBOX MEMBER ===== */
label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.05);
  transition: background 0.15s ease;
}

label:hover {
  background: rgba(255,255,255,0.12);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #8be9fd;
  cursor: pointer;
}

/* ===== START BUTTON ===== */
#selectScreen > button {
  display: block;
  margin: 30px auto 0;
  padding: 14px 36px;
  font-size: 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #50fa7b, #8be9fd);
  box-shadow: 0 12px 30px rgba(80,250,123,0.4);
}

#selectScreen > button:hover {
  box-shadow: 0 16px 40px rgba(80,250,123,0.6);
}

/* ===== SORTER SCREEN ===== */
#sorterScreen {
  max-width: 900px;
  margin: auto;
  margin-top: 30px;
  text-align: center;
}

/* ===== PROGRESS ===== */
#progress {
  margin-bottom: 14px;
  font-weight: 600;
  opacity: 0.85;
}

/* ===== BATTLE CARD ===== */
.container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 10px;
}


.card {
  width: 100%;
  max-width: 170px;
  min-width: 140px;
  text-align: center;
}

.card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: none;
}

/* ========== SHADOW GLOW PER TEAM ========== */
.team-love {
  background-color: rgba(255,105,180,0.5);
}

.team-passion {
  background-color: rgba(255,200,60,0.5);
}

.team-dream {
  background-color: rgba(80,140,255,0.5);
}

.team-trainee {
  background-color: rgba(255,255,255,0.5);
  color: #111;
}

/* ===== SHADOW DI BELAKANG ===== */

.team-love:hover,
.team-love.selected {
  box-shadow: 0 0 28px rgba(255,105,180,0.9);
}

.team-passion:hover,
.team-passion.selected {
  box-shadow: 0 0 28px rgba(255,200,60,0.9);
}

.team-dream:hover,
.team-dream.selected {
  box-shadow: 0 0 28px rgba(80,140,255,0.9);
}

.team-trainee:hover,
.team-trainee.selected {
  box-shadow: 0 0 28px rgba(255,255,255,0.9);
}



.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
}

.card p {
  margin-top: 28px;
  font-size: 14px;
  line-height: 1.2;
}

/* ===== TIE BUTTON ===== */
#sorterScreen button {
  margin-top: 20px;
  background: linear-gradient(135deg, #ffb86c, #ff79c6);
  box-shadow: 0 10px 30px rgba(255,184,108,0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.8rem;
  }
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.result-card {
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.result-card img {
  width: 100%;
  border-radius: 12px;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.rank {
  font-weight: 900;
  font-size: 1.1rem;
  color: #ff79c6;
  margin-bottom: 6px;
}

.name {
  font-weight: 700;
  margin-top: 8px;
}

.meta {
  font-size: 0.8rem;
  opacity: 0.75;
}

#genSelect label,
#teamSelect label {
  font-size: 0.85rem;
  padding: 6px 8px;
  border-radius: 10px;
}

#genSelect input[type="checkbox"],
#teamSelect input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

#genSelect h4,
#teamSelect h4 {
  font-size: 0.95rem;
  margin-top: 18px;
}

.battle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.cards {
  display: flex;
  gap: 32px;
}

.card {
  width: 220px;
  text-align: center;
  cursor: pointer;
}

.card img {
  width: 100%;
  border-radius: 18px;
  transition: transform 0.2s ease;
}

.card:hover img {
  transform: scale(1.04);
}

.battle-controls {
  display: flex;
  gap: 16px;
}

.battle-controls button {
  padding: 10px 20px;
  border-radius: 14px;
  border: none;
  font-weight: bold;
  cursor: pointer;
}

.undo-btn {
  background: #333;
  color: #fff;
}

.tie-btn {
  background: #ff5c8a;
  color: white;
}

#progress {
  font-size: 14px;
  opacity: 0.7;
}

.progress-wrapper {
  width: 100%;
  max-width: 420px;
  margin: 18px auto 0;
  text-align: center;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 12px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
}

/* BAR UTAMA */
#progressFill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(
    270deg,
    #ff4fd8,
    #7b6cff,
    #00f2ff,
    #ff4fd8
  );
  background-size: 400% 400%;
  animation: gradientFlow 4s ease infinite;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 14px rgba(255, 120, 255, 0.8);
}

/* SHIMMER */
#progressFill::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.6),
    transparent
  );
  animation: shimmer 1.8s infinite;
}

/* TEXT */
#progressText {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.85;
  font-weight: 600;
}

/* ANIMATIONS */
@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0% { left: -40%; }
  100% { left: 120%; }
}

/* PULSE SAAT UPDATE */
.progress-pulse {
  animation: pulseGlow 0.35s ease;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: 0 0 22px rgba(255,255,255,0.9); }
  100% { box-shadow: 0 0 14px rgba(255,120,255,0.8); }
}

/* =====================================================
   MEMBER CARD
===================================================== */

/* ===== HARD RESET CARD LAYER ===== */
.member-card::before {
  display: none !important;
}

.member-card {
  background-color: rgba(15, 27, 45, 0.5); /* 50% tembus */
  backdrop-filter: blur(2px);              /* HALUS, OPSIONAL */
  -webkit-backdrop-filter: blur(2px);
  position: relative;
  width: 220px;
  padding: 14px;
  border-radius: 22px;
  background-clip: padding-box;
  filter: none;
}

/* ===== FOTO MEMBER BASE ===== */
.member-card img {
  position: relative;
  z-index: 1;

  border: 3px solid rgba(255,255,255,0.95);
  border-radius: 16px;
  box-sizing: border-box;
  background: #fff;

  box-shadow: 0 4px 12px rgba(0,0,0,0.25); /* opsional */
}

.gen-13 img {
  border-color: #f3c101;
}

.gen-12 img {
  border-color: #bf7e7a;
}

.gen-11 img {
  border-color: #fe924a;
}

.gen-10 img {
  border-color: #04989c;
}

.gen-9 img {
  border-color: #3cb7fa;
}

.gen-8 img {
  border-color: #0249a9;
}

.gen-7 img {
  border-color: #01803a;
}

.gen-6 img {
  border-color: #7ed559;
}

.gen-3 img {
  border-color: #fb62be;
}

/* ===== NAMA MEMBER ===== */
.member-name {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 10px;
}

/* ===== TEAM DI BAWAH NAMA ===== */
.member-team {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.75;
  margin-top: 2px;
}

.member-card p {
  margin-top: 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.gen-bar {
  position: absolute;        /* WAJIB */
  top: 8px;
  left: 50%;
  transform: translateX(-50%);

  height: 12px;
  width: 80%;
  max-width: 140px;

  border-radius: 8px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;

  z-index: 2;               /* normal */
}
/* ===== TEAM BACKGROUND (50%) VIA ::before ===== */

.team-love::before {
  background: rgba(255,105,180,0.5);
}

.team-passion::before {
  background: rgba(255,200,60,0.5);
}

.team-dream::before {
  background: rgba(80,140,255,0.5);
}

.team-trainee::before {
  background: rgba(255,255,255,0.5);
}

.member-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  z-index: 0;                /* DI DALAM CARD */
  pointer-events: none;
}




/* ================= GEN COLORS ================= */

.gen-13 .gen-bar { background:#f3c101; }
.gen-12 .gen-bar { background:#bf7e7a; }
.gen-11 .gen-bar { background:#fe924a; }
.gen-10 .gen-bar { background:#04989c; }
.gen-9  .gen-bar { background:#3cb7fa; }
.gen-8  .gen-bar { background:#0249a9; }
.gen-7  .gen-bar { background:#01803a; }
.gen-6  .gen-bar { background:#7ed559; }
.gen-3  .gen-bar { background:#fb62be; }

/* ================= HOVER (HANYA SEBELUM DI KLIK) ================= */

.member-card:not(.selected):hover {
  transform: scale(1.03);
}

.member-card:not(.selected):hover .gen-bar {
  z-index: 999;
}

/* ================= GLOW SELECT (NO JS, AUTO COLOR) ================= */


/* layer glow */
.member-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  z-index: -1;              /* DI DALAM CARD */
  opacity: 0.5;             /* 50% */
  filter: none;             /* HILANGKAN BLUR */
}


.member-card.selected::after {
  animation: none;
}



.team-love::after {
  background: rgb(255,105,180);
}

.team-passion::after {
  background: rgb(255,200,60);
}

.team-dream::after {
  background: rgb(80,140,255);
}

.team-trainee::after {
  background: rgb(255,255,255);
}



/* ===== SHADOW TEMBUS BACKGROUND ===== */

.team-love:hover,
.team-love.selected {
  filter: drop-shadow(0 0 22px rgba(255,105,180,0.9));
}

.team-passion:hover,
.team-passion.selected {
  filter: drop-shadow(0 0 22px rgba(255,200,60,0.9));
}

.team-dream:hover,
.team-dream.selected {
  filter: drop-shadow(0 0 22px rgba(80,140,255,0.9));
}

.team-trainee:hover,
.team-trainee.selected {
  filter: drop-shadow(0 0 22px rgba(255,255,255,0.9));
}


