:root {
  --bg: #071024;
  --card: #0c1a32;
  --neon: #06f6ff;
  --accent: #7c3aed;
  --muted: #93a4b8;
}
* { box-sizing: border-box; }
html { font-size: 16px; 
        height: 100dvh;
      }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui;
  background-color: var(--bg);
  color: #e6f2ff;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100dvh;
  -webkit-overflow-scrolling: touch;
}
.screen {
  position: relative; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom));
  overflow-y: auto;  
  min-height: 100dvh;         /* tiap screen boleh scroll kalau konten panjang */
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
}
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  padding: 2.5rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
  width: 100%;
}
.setup-card { max-width: 500px; }
.welcome-card h1 { font-size: 3rem; color: var(--neon); text-shadow: 0 0 10px rgba(6, 246, 255, 0.5); }
.welcome-card p { font-size: 1.2rem; color: var(--muted); }
.form-group { width: 100%; margin-bottom: 1rem; }
input[type="text"], .select {
  width: 100%; padding: 1rem; border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: inherit; font-size: 1rem; text-align: center;
}
.photo-group { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
#photoPreview { width: 80px; height: 80px; border-radius: 10px; background: rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
#photoPreview img { width: 100%; height: 100%; object-fit: cover; }
.photo-buttons { display: flex; flex-direction: column; flex: 1; gap: 0.5rem; }
.btn {
  background: linear-gradient(90deg, var(--neon), var(--accent));
  border: none; padding: 1rem 1.5rem; border-radius: 10px;
  color: #021018; font-weight: 700; cursor: pointer;
  transition: all 0.2s; font-size: 1rem; width: 100%;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(124, 58, 237, 0.2); }
.btn.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.1); color: var(--muted); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--neon); box-shadow: none; }
.btn:disabled { background: var(--muted); cursor: not-allowed; transform: none; box-shadow: none; color: #0c1a32; }
.status-message { margin-top: 1rem; font-weight: 500; transition: color 0.3s; }
.status-message.active { color: #22c55e; }
.status-message.inactive { color: #facc15; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255, 255, 255, 0.1); border-top-color: var(--neon); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.game-header { position: absolute; top: 1rem; left: 1rem; right: 1rem; display: flex; justify-content: space-between; font-size: 1.2rem; }
.game-card { max-width: 800px; }
#options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.opt { padding: 1rem; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; cursor: pointer; transition: all 0.2s; text-align: left; }
.opt:hover { background: rgba(255, 255, 255, 0.05); }
.opt.selected { background: var(--accent); color: white; border-color: var(--accent); }
.game-footer { position: sticky; margin-top:auto; left: 0; right: 0; display: flex; justify-content: space-between; max-width: 800px; margin: 0 auto; padding: 0.75rem; align-self: flex-start;}
.review-card { max-width: 800px; text-align: left; }
#reviewList { max-height: 70vh; overflow-y: auto; margin: 1.5rem 0; padding-right: 1rem; }
.review-item { padding: 1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.review-item .q-text { font-weight: bold; margin-bottom: 0.75rem; }
.your-answer.correct { color: #22c55e; }
.your-answer:not(.correct) { color: #ef4444; }
.correct-answer { color: #a3a3a3; font-size: 0.9rem; margin-top: 0.25rem; }
.review-match-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; margin-top: 0.5rem; }
.review-match-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.review-match-item img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; margin-bottom: 0.5rem; }
.result-card, .leaderboard-view-card { max-width: 600px; }
.final-score { font-size: 5rem; font-weight: 800; color: var(--neon); margin: 1rem 0; }
.leaderboard-mini, .leaderboard-full { max-height: 300px; overflow-y: auto; margin: 1rem 0; text-align: left; }
.lbItem { display: flex; gap: 1rem; align-items: center; padding: 0.75rem; border-radius: 8px; }
.lbItem:nth-child(odd) { background: rgba(255, 255, 255, 0.01); }
.lbItem img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
#matchContainer { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.match-items { display: flex; flex-direction: column; gap: 1rem; }
.match-item { display: flex; align-items: center; gap: 1rem; }
.match-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.drop-zone { width: 100%; height: 50px; border: 2px dashed rgba(255,255,255,0.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.drop-zone.over { background: rgba(6, 246, 255, 0.1); border-color: var(--neon); }
.drop-zone.filled { border-style: solid; }
.match-labels { display: flex; flex-wrap: wrap; gap: 0.75rem; align-content: flex-start; }
.match-label { padding: 0.75rem 1rem; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; cursor: grab; }
#background-wrap { position: fixed; bottom: 0; left: 0; right: 0; top: 0; z-index: -1; }
.bubble { position: absolute; bottom: -100px; background: rgba(6, 246, 255, 0.1); border-radius: 50%; animation: bubble-rise 25s infinite; width: 40px; height: 40px; }
@keyframes bubble-rise{0%{bottom:-100px;transform:translateX(0)}50%{transform:translateX(100px)}100%{bottom:1080px;transform:translateX(-200px)}}
.x1{left:5%;transform:scale(.9);animation-duration:20s;animation-delay:0s}.x2{left:15%;transform:scale(.5);animation-duration:25s;animation-delay:1s}.x3{left:25%;transform:scale(.7);animation-duration:18s;animation-delay:2s}.x4{left:35%;transform:scale(.8);animation-duration:22s;animation-delay:3s}.x5{left:45%;transform:scale(.4);animation-duration:28s;animation-delay:4s}.x6{left:55%;transform:scale(.9);animation-duration:17s;animation-delay:1s}.x7{left:65%;transform:scale(.5);animation-duration:23s;animation-delay:5s}.x8{left:75%;transform:scale(.8);animation-duration:20s;animation-delay:6s}.x9{left:85%;transform:scale(.4);animation-duration:26s;animation-delay:7s}.x10{left:95%;transform:scale(.6);animation-duration:21s;animation-delay:8s}
.fade-in-1{animation:fade-in .5s .2s ease-out backwards}.fade-in-2{animation:fade-in .5s .4s ease-out backwards}.fade-in-3{animation:fade-in .5s .6s ease-out backwards}.fade-in-4{animation:fade-in .5s .8s ease-out backwards}.fade-in-5{animation:fade-in .5s 1s ease-out backwards}.fade-in-6{animation:fade-in .5s 1.2s ease-out backwards}
@keyframes fade-in{from{opacity:0;transform:translateY(10px)}}
/* Fix scroll di mobile */


/* Pastikan list yang panjang tetap bisa scroll */
#reviewList,
.leaderboard-full,
.leaderboard-mini {
  max-height: calc(100vh - 180px);   /* lebih fleksibel */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}


