:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  --accent-cyan: #06b6d4;
  --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 35%, #e0e7ff 70%, #ecfeff 100%);
  --text-dark: #0f172a;
  --text-muted: #475569;
  --card-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.9);
  --shadow-main: 0 20px 45px -10px rgba(14, 165, 233, 0.15), 0 4px 12px rgba(0, 0, 0, 0.03);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* Header Nav */
.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  color: #0369a1;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.btn-leaderboard-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-leaderboard-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.18);
  background: #ffffff;
  color: var(--primary);
}

.icon-small {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-main);
  margin: 20px 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero {
  text-align: center;
  padding: 38px 24px;
}

.water {
  font-size: 70px;
  margin-bottom: 10px;
}

.hero-card {
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Hero Graphics */
.hero-image-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 10px;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 12px 24px rgba(2, 132, 199, 0.25));
}

.floating-anim {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.4) 0%, rgba(2, 132, 199, 0) 70%);
  border-radius: 50%;
  z-index: 1;
}

/* Typography */
h1 {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-weight: 800;
  margin: 10px 0;
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.gradient-title {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 40%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  margin-top: 0;
  font-size: clamp(22px, 4vw, 28px);
  color: #0f172a;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 580px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* Feature Chips */
.features-grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(224, 242, 254, 0.6);
  border: 1px solid rgba(186, 230, 253, 0.8);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #0369a1;
  transition: all 0.2s ease;
}

.feature-chip:hover {
  background: #e0f2fe;
  transform: translateY(-2px);
}

.chip-icon {
  font-size: 16px;
}

/* Glass Form */
.glass-form {
  max-width: 440px;
  margin: 0 auto;
  padding: 24px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04);
  text-align: left;
}

.form-header {
  text-align: center;
  margin-bottom: 18px;
}

.form-header h3 {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 20px;
  color: #0f172a;
}

.form-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.input-field {
  margin-bottom: 16px;
}

.input-field label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
}

.input-field input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: #ffffff;
  color: #0f172a;
  transition: all 0.2s ease;
}

.input-field input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

/* Buttons */
button, .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: var(--radius-md);
  padding: 16px 28px;
  background: var(--primary-gradient);
  color: white;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 20px -4px rgba(2, 132, 199, 0.4);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

button:hover, .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(2, 132, 199, 0.5);
  filter: brightness(1.05);
}

button:active, .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px -2px rgba(2, 132, 199, 0.4);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

button.secondary {
  background: #e2e8f0;
  color: #1e293b;
  box-shadow: none;
}

button.secondary:hover {
  background: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-launch {
  font-size: 17px;
  letter-spacing: 0.2px;
  margin-top: 6px;
}

.hidden {
  display: none !important;
}

/* Progress bar */
.progress {
  height: 16px;
  background: #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  margin: 16px 0 24px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.bar {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #0284c7, #2563eb);
  width: 20%;
  transition: width 0.5s ease;
  border-radius: 20px;
  position: relative;
}

.bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
  border-radius: 20px;
}

/* Game Choices Grid */
.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.choice {
  background: #ffffff;
  color: #1e293b;
  border: 2px solid #cbd5e1;
  min-height: 120px;
  border-radius: var(--radius-md);
  padding: 18px 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column; /* Icon di ATAS, teks di BAWAH */
  align-items: center;
  justify-content: center;
  gap: 10px; /* Jarak antara ikon & teks */
  text-align: center;
  line-height: 1.3;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.choice-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Emoji di choice harus seukuran gambar */
.choice .emoji-icon {
  font-size: 48px;
  line-height: 1;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.choice:hover .emoji-icon {
  transform: scale(1.12) translateY(-2px);
}

.choice:hover .choice-icon {
  transform: scale(1.12) translateY(-2px);
}

.choice:hover {
  border-color: var(--primary);
  background: #f0f9ff;
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(2, 132, 199, 0.12);
}

.choice.selected {
  border-color: var(--primary);
  background: #e0f2fe;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

.choice.correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
  animation: correctPulse 0.5s ease;
}

.choice.wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
  animation: shake 0.4s ease;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Feedback */
.feedback {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-align: center;
  font-size: 15px;
}

.feedback.ok {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.feedback.bad {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Drag & Drop Filter Lab */
.items {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 20px 0;
  justify-content: center;
}

.drag {
  padding: 16px 20px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  cursor: grab;
  text-align: center;
  font-weight: 700;
  min-width: 130px;
  display: flex;
  flex-direction: column; /* Icon di ATAS, teks di BAWAH */
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  user-select: none;
  touch-action: manipulation;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.drag:hover {
  background: #f0f9ff;
  border-color: var(--primary);
  transform: translateY(-3px);
}

.drag:active {
  cursor: grabbing;
  transform: scale(0.96);
}

.filter {
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  border: 2px solid #93c5fd;
}

.slots {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.slot {
  min-height: 90px;
  border: 3px dashed #60a5fa;
  border-radius: var(--radius-md);
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column; /* Icon di ATAS, teks di BAWAH saat terisi */
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #3b82f6;
  font-weight: 700;
  text-align: center;
}

.slot.filled {
  border-style: solid;
  background: #ffffff;
  border-color: var(--primary);
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.slot.dragover {
  border-color: #2563eb;
  background: #dbeafe;
  transform: scale(1.02);
}

/* Result & Score */
.score {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(52px, 12vw, 80px);
  font-weight: 800;
  text-align: center;
  color: var(--primary);
  margin: 16px 0;
  text-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.mascot-img-large {
  width: 130px;
  height: 130px;
  object-fit: contain;
  margin: 0 auto 10px;
  filter: drop-shadow(0 10px 20px rgba(2, 132, 199, 0.2));
}

.trophy-img-large {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin: 0 auto 10px;
  filter: drop-shadow(0 12px 24px rgba(234, 179, 8, 0.3));
}

textarea {
  width: 100%;
  min-height: 110px;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  transition: border-color 0.2s;
  margin: 12px 0 18px;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

/* Leaderboard Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

th, td {
  padding: 16px 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

th {
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
  font-size: 14px;
}

tr:hover {
  background: rgba(241, 245, 249, 0.6);
}

.rank-1 {
  background: rgba(254, 240, 138, 0.35);
  font-weight: 700;
}

.rank-2 {
  background: rgba(226, 232, 240, 0.5);
  font-weight: 600;
}

.rank-3 {
  background: rgba(254, 215, 170, 0.35);
  font-weight: 600;
}

.medal {
  font-size: 24px;
}

/* Footer */
.main-footer {
  text-align: center;
  margin-top: 30px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Mobile Responsiveness */
@media (max-width: 580px) {
  .app {
    padding: 16px 12px 30px;
  }
  .card {
    padding: 22px 16px;
    border-radius: 22px;
  }
  .hero-image-wrapper {
    width: 170px;
    height: 170px;
  }
  .glass-form {
    padding: 18px 14px;
  }
  .choices {
    grid-template-columns: 1fr;
  }
  th, td {
    padding: 12px 8px;
    font-size: 13px;
  }
}

/* ===================================================
   🎮 GAME UX POLISH & TACTILE STYLES
   =================================================== */

/* Sound Toggle Button */
.btn-sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  color: #0369a1;
  padding: 0;
}

.btn-sound-toggle:hover {
  transform: scale(1.1) rotate(5deg);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.2);
}

.btn-sound-toggle:active {
  transform: scale(0.95);
}

/* Tactile 3D Choice Buttons */
.choice {
  border-bottom: 4px solid #cbd5e1;
  transform: translateY(0);
}

.choice:active {
  border-bottom-width: 1px;
  transform: translateY(3px);
  box-shadow: none;
}

.choice.selected {
  border-bottom-color: var(--primary);
}

.choice.correct {
  border-bottom-color: #059669;
}

.choice.wrong {
  border-bottom-color: #dc2626;
}

/* Tactile 3D Main Buttons */
.btn-primary, button:not(.secondary):not(.btn-sound-toggle) {
  border-bottom: 4px solid #1d4ed8;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:active, button:not(.secondary):not(.btn-sound-toggle):active {
  border-bottom-width: 1px;
  transform: translateY(3px) !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3) !important;
}

/* Floating "+10 PTS" Score Popup */
.score-float {
  position: absolute;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 24px;
  color: #10b981;
  text-shadow: 0 2px 8px rgba(16, 185, 129, 0.4), 0 0 2px #ffffff;
  pointer-events: none;
  z-index: 1000;
  animation: floatUpFade 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes floatUpFade {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  30% {
    opacity: 1;
    transform: translateY(-20px) scale(1.3);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(1);
  }
}

/* Shimmer animation for Progress Bar */
.bar {
  background-size: 200% 100%;
  animation: shimmerGradient 3s linear infinite;
}

@keyframes shimmerGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Drag & Drop tactile item */
.drag {
  border-bottom: 3px solid #cbd5e1;
  cursor: grab;
  transition: all 0.2s ease;
}

.drag:active {
  cursor: grabbing;
  transform: scale(1.05) rotate(2deg);
}

.slot {
  transition: all 0.25s ease;
}

