* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "San Francisco", Segoe UI, Roboto, "Helvetica Neue", sans-serif !important;
  background: #0f172a;
  font-weight: 200;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

/* ========================================
   HEADER SECTION
   ======================================== */
.app-header {
  width: 100%;
  background: #0d1b34;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  z-index: 50;
}

/* Header Top */
.header-top {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.brand {
  color: white;
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search Box */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  padding: 6px 12px;
  border-radius: 6px;
  max-width: 300px;
  width: 100%;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 14px;
  width: 100%;
}

.search-box input::placeholder {
  color: rgba(255,255,255,0.5);
}

.search-box .icon {
  stroke: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

/* Header Menu */
.header-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 48px;
  padding: 0 24px;
  border-top: 1px solid rgba(255,255,255,0.03);
  background: #0f203d;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.header-menu::-webkit-scrollbar {
  display: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  text-decoration: none;
  padding-bottom: 3px;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.menu-item .icon {
  stroke: rgba(255,255,255,0.6);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: stroke 0.2s ease;
}

.menu-item.active {
  color: #4da3ff;
}

.menu-item.active .icon {
  stroke: #4da3ff;
}

.menu-item:hover {
  color: white;
}

.menu-item:hover .icon {
  stroke: white;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
  margin-left: 12px;
  z-index: 3000;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* ========================================
   DROPDOWN MENU (DESKTOP)
   ======================================== */
.menu-dropdown {
  position: relative;
  z-index: 100;
}

.menu-dropdown .dropdown-list {
  display: none;
  position: fixed;
  background: #0f203d;
  padding: 10px 0;
  border-radius: 6px;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 9999;
  margin-top: 5px;
}

.dropdown-list .menu-item {
  padding: 10px 16px !important;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-list .menu-item:last-child {
  border-bottom: none;
}

.menu-dropdown.open > .menu-item {
  background: rgba(255,255,255,0.06);
}

.menu-dropdown > .menu-item {
  cursor: pointer !important;
}

/* ========================================
   LOGIN WRAPPER & CONTAINER
   ======================================== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: calc(100vh - 120px);
    padding: 20px;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
}

.boxlogin {
    justify-self: center;
    z-index: 10;
}

.character-left   { justify-self: end; }
.character-right  { justify-self: start; }

/* ========================================
   CHARACTERS (JOKO & SUSI)
   ======================================== */
.character {
  position: relative;
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
  z-index: 10;
}

.character img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 10px 25px rgba(0,0,0,0.3));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ========================================
   SPEECH BUBBLE
   ======================================== */
.speech-bubble {
  position: absolute;
  background: white;
  padding: 10px 16px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  animation: fadeInBounce 0.5s ease-out both;
  z-index: 9999;
  pointer-events: none;
}

.character-left .speech-bubble {
  top: 20px;
  right: 80%;
  margin-right: 0px;
}

.character-left .speech-bubble::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 0 8px 12px;
  border-style: solid;
  border-color: transparent transparent transparent white;
}

.character-right .speech-bubble {
  top: 20px;
  left: 80%;
  margin-left: 20px;
}

.character-right .speech-bubble::after {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 12px 8px 0;
  border-style: solid;
  border-color: transparent white transparent transparent;
}

@keyframes fadeInBounce {
  0% { opacity:0; transform:translateY(10px) scale(0.95); }
  60% { opacity:1; transform:translateY(0) scale(1.03); }
  100% { transform:translateY(0) scale(1); }
}

/* ========================================
   LOGIN BOX
   ======================================== */
.boxlogin {
  animation: fadeIn .3s ease-out;
  width: 100%;
  max-width: 360px;
  background: white;
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  text-align: center;
  position: relative;
  z-index: 10;
}

@keyframes fadeIn {
  from { opacity:0; transform:translateY(20px); }
  to { opacity:1; transform:translateY(0); }
}

.boxlogin h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
}

.boxlogin .tagline {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 24px;
}

.inputlogin {
  width: 100%;
  padding: 14px 16px;
  margin-top: 12px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  font-size: 15px;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.inputlogin:focus {
  outline: none;
  border-color: #58cc02;
  background: white;
  box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.1);
}

.buttonlogin {
  width: 100%;
  background: #58cc02;
  color: white;
  padding: 14px;
  border-radius: 14px;
  border: 0;
  margin-top: 20px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 0 #46a302;
  transition: all 0.1s ease;
}

.buttonlogin:hover {
  background: #4eb100;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #46a302;
}

.buttonlogin:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #46a302;
}

.msglogin {
  margin-top: 12px;
  color: #ef4444;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 20px;
}

.register-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.register-text {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 8px;
}

.alogin {
  display: inline-block;
  text-decoration: none;
  color: #2b7df7;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.alogin:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ========================================
   GAME WRAPPER
   ======================================== */
.game-wrapper {
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 24px 16px;
  background: radial-gradient(circle at top, #1e293b, #020617);
}

.game-upacara {
  width: 100%;
  max-width: 1080px;
}

.game-upacara .app {
  display: grid;
  grid-template-columns: minmax(0,2.2fr) minmax(280px,1fr);
  gap: 16px;
  width: 100%;
}

.game-upacara .card {
  background: #020617;
  border-radius: 24px;
  padding: 20px 20px 18px;
  box-shadow: 0 20px 45px rgba(15,23,42,0.7);
  border: 1px solid rgba(148,163,184,0.4);
}

.game-upacara .title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e5e7eb;
}

.game-upacara .title span {
  font-size: 1.8rem;
}

.game-upacara .subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 16px;
}

.game-upacara .screen {
  display: none;
}

.game-upacara .screen.active {
  display: block;
}

.game-upacara .input-group {
  margin-bottom: 16px;
}

.game-upacara label {
  font-size: 0.85rem;
  color: #94a3b8;
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.game-upacara input[type="text"],
.game-upacara select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #020617;
  color: #e5e7eb;
  outline: none;
  font-size: 0.9rem;
}

.game-upacara input[type="text"]:focus,
.game-upacara select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px #22c55e;
}

.game-upacara .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: none;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.game-upacara .btn-primary {
  background: #22c55e;
  color: #052e16;
  box-shadow: 0 8px 0 #15803d;
}

.game-upacara .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 0 #15803d;
}

.game-upacara .btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 4px 0 #15803d;
}

.game-upacara .btn-secondary {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid #334155;
}

.game-upacara .btn-secondary:hover {
  background: #111827;
}

.game-upacara .btn[disabled] {
  opacity: 0.4;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.game-upacara .flex-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.game-upacara .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #020617;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

.game-upacara .pill span {
  font-size: 0.9rem;
}

.game-upacara .question-text {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 10px 0 12px;
  color: #e5e7eb;
}

.game-upacara .options {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.game-upacara .option {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid #1e293b;
  background: #020617;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}

.game-upacara .option-prefix {
  font-weight: 800;
  color: #9ca3af;
  min-width: 18px;
}

.game-upacara .option:hover {
  background: #0f172a;
  transform: translateY(-1px);
}

.game-upacara .option.correct {
  border-color: #22c55e;
  background: #022c22;
}

.game-upacara .option.wrong {
  border-color: #ef4444;
  background: #450a0a;
}

.game-upacara .option.disabled {
  cursor: default;
  opacity: 0.9;
  transform: none;
}

.game-upacara .explanation {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 6px;
  min-height: 32px;
}

.game-upacara .duo-progress-wrap {
  margin-top: 10px;
}

.game-upacara .progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #1e293b;
  overflow: hidden;
}

.game-upacara .progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.25s ease-out;
}

.game-upacara .score-label {
  font-size: 0.8rem;
  color: #9ca3af;
}

.game-upacara .score-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fde047;
}

.game-upacara .leaderboard-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #e5e7eb;
}

.game-upacara .leaderboard-subtitle {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 10px;
}

.game-upacara .leaderboard-list {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.game-upacara .leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 6px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
  background: #020617;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

.game-upacara .leaderboard-rank {
  font-weight: 800;
  min-width: 22px;
}

.game-upacara .leaderboard-name {
  flex: 1;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-upacara .leaderboard-score {
  font-weight: 700;
  color: #fde047;
}

.game-upacara .badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  color: #e0f2fe;
  background: rgba(37,99,235,0.1);
}

.game-upacara .result-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #e5e7eb;
}

.game-upacara .result-text {
  font-size: 0.95rem;
  color: #9ca3af;
  margin-bottom: 10px;
}

.game-upacara .xp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid #1d4ed8;
  font-size: 0.8rem;
  color: #bfdbfe;
  margin-top: 4px;
}

/* ========================================
   QUIZ CHARACTER
   ======================================== */
.quiz-character {
  width: 150px;
  height: 150px;
  margin: 0 auto 8px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  position: relative;
}

.quiz-character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.character-bounce {
  animation: charBounce 1.6s ease-in-out infinite;
}

@keyframes charBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.character-celebrate {
  animation: charCelebrate 0.5s ease-in-out 0s 3;
}

@keyframes charCelebrate {
  0%   { transform: translateY(0) rotate(0deg); }
  25%  { transform: translateY(-6px) rotate(-4deg); }
  50%  { transform: translateY(0) rotate(4deg); }
  75%  { transform: translateY(-6px) rotate(-3deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.character-sad {
  animation: charSad 0.35s ease-in-out 0s 2;
}

@keyframes charSad {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.pill-xp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #052e16;
  border: 1px solid #16a34a;
  font-size: 0.75rem;
  color: #bbf7d0;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background-color: #020617;
  color: #9ca3af;
  padding: 12px 24px;
  font-size: 0.85rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(148,163,184,0.25);
}

footer .copyright {
  user-select: none;
  line-height: 1.4;
}

footer .links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

footer .links span,
footer .copyright .dot {
  color: #64748b;
  font-weight: 300;
}

footer .links a {
  color: #e5e7eb;
  text-decoration: none;
  transition: 0.25s ease;
  cursor: pointer;
}

footer .links a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

footer .links .heart {
  color: #fb7185;
  font-weight: 600;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* TABLET (768px - 1024px) */
@media (max-width: 1024px) {
  .header-top {
    padding: 0 16px;
  }
  
  .header-menu {
    padding: 0 16px;
    gap: 16px;
  }
  
  .search-box {
    max-width: 200px;
  }
  
  .login-container {
    gap: 30px;
  }
  
  .character img {
    width: 140px;
    height: 140px;
  }
  
  .speech-bubble {
    font-size: 0.8rem;
    padding: 10px 14px;
  }
  
  .game-upacara .app {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   MOBILE MODE (FIXED)
   ======================================== */
@media (max-width: 768px) {
  .header-top {
    height: 56px;
    padding: 0 12px;
  }
  
  .brand {
    font-size: 18px;
  }
  
  .header-right {
    gap: 8px;
  }
  
  .search-box {
    display: none;
  }
  
  .header-menu {
    height: 44px;
    padding: 0 12px;
    gap: 16px;
  }
  
  .menu-item {
    font-size: 14px;
  }
  
  .menu-item .icon {
    width: 16px;
    height: 16px;
  }
  
  .menu-toggle {
    display: flex !important;
  }
  
  .app-header {
    position: relative !important;
  }
  
  /* === MOBILE MENU CONTAINER === */
  #pdfTopMenu.header-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    gap: 0 !important;
    background: #0f203d !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    transition: max-height 0.3s ease, padding 0.3s ease !important;
    z-index: 2500 !important;
    border-top: 1px solid rgba(255,255,255,0.05) !important;
  }
  
  #pdfTopMenu.header-menu.open {
    max-height: 500px !important;
    padding: 8px 0 !important;
    overflow-y: auto !important;
  }
  
  #pdfTopMenu.header-menu .menu-item {
    padding: 14px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    display: flex !important;
    position: relative !important;
  }
  
  #pdfTopMenu.header-menu .menu-item:last-child {
    border-bottom: none !important;
  }
  
  #pdfTopMenu.header-menu .menu-item.active {
    background: rgba(77, 163, 255, 0.15) !important;
  }
  
  #pdfTopMenu.header-menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
  }
  
  /* === PERBAIKAN DROPDOWN MOBILE === */
  /* DEFAULT: Sembunyikan semua dropdown */
  .menu-dropdown .dropdown-list {
    display: none !important;
    position: static !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
  }
  
  /* AKTIF: Tampilkan dropdown hanya saat .open */
  .menu-dropdown.open .dropdown-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    max-height: 500px !important;
    opacity: 1 !important;
    padding-left: 20px !important;
    margin-top: 8px !important;
    margin-bottom: 8px !important;
  }
  
  /* Styling untuk item di dalam dropdown */
  .dropdown-list .menu-item {
    padding: 12px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.03) !important;
    background: transparent !important;
  }
  
  .dropdown-list .menu-item:last-child {
    border-bottom: none !important;
  }
  
  .dropdown-list .menu-item:hover {
    background: rgba(255, 255, 255, 0.03) !important;
  }
  
  /* Login Container Mobile */
  .login-wrapper {
    padding: 40px 16px;
    min-height: calc(100vh - 120px);
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  .character {
    display: none !important;
  }
  
  .speech-bubble {
    display: none !important;
  }
  
  .boxlogin {
    width: 100%;
    max-width: 400px;
  }
  
  footer {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    gap: 6px;
  }
  
  footer .links {
    justify-content: center;
    gap: 10px;
  }
}

/* SMALL MOBILE (max-width: 480px) */
@media (max-width: 480px) {
  .header-top {
    padding: 0 8px;
  }
  
  .brand {
    font-size: 16px;
  }
  
  .header-menu {
    padding: 0 8px;
    gap: 12px;
  }
  
  .menu-item {
    font-size: 13px;
    gap: 4px;
  }
  
  .login-wrapper {
    padding: 20px 16px;
  }
  
  .boxlogin {
    padding: 24px;
  }
  
  .boxlogin h2 {
    font-size: 1.5rem;
  }
  
  footer {
    font-size: 0.7rem;
  }
}

/* LARGE DESKTOP (min-width: 1440px) */
@media (min-width: 1440px) {
  .header-top {
    padding: 0 48px;
  }
  
  .header-menu {
    padding: 0 48px;
    gap: 32px;
  }
  
  .search-box {
    max-width: 400px;
  }
  
  footer {
    padding: 16px 48px;
  }
}

/* ========================================
   DESKTOP DROPDOWN BEHAVIOR
   ======================================== */
@media (min-width: 769px) {
  .header-menu {
    overflow-x: auto !important;
    overflow-y: visible !important;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid #4da3ff;
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #4da3ff;
  outline-offset: 2px;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.game-upacara .leaderboard-list::-webkit-scrollbar {
  width: 6px;
}

.game-upacara .leaderboard-list::-webkit-scrollbar-track {
  background: #020617;
  border-radius: 3px;
}

.game-upacara .leaderboard-list::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

.game-upacara .leaderboard-list::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ========================================
   LOADING STATES
   ======================================== */
.loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .app-header,
  .menu-toggle,
  footer,
  .character,
  .speech-bubble {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  .boxlogin {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
@media (prefers-color-scheme: dark) {
  /* Already dark by default */
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .character {
    animation: none;
  }
  
  .speech-bubble {
    animation: none;
  }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: high) {
  .menu-item,
  .boxlogin,
  .character img {
    border: 2px solid currentColor;
  }
  
  .buttonlogin {
    border: 3px solid #000;
  }
}

/* ========================================
   FORCE HIDE DROPDOWN (SAFETY OVERRIDE)
   ======================================== */
@media (max-width: 768px) {
  /* Paksa sembunyikan dropdown saat menu belum dibuka */
  #pdfTopMenu:not(.open) .dropdown-list {
    display: none !important;
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
  
  /* Paksa sembunyikan dropdown yang belum diklik */
  .menu-dropdown:not(.open) .dropdown-list {
    display: none !important;
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}
 .feedback-button {
    background-color: #0C1B34;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.feedback-button:hover {
    background-color: #34495e;
    transform: translateY(-1px);
}

.feedback-button.active {
    background-color: #1a252f;
}

.feedback-icon {
    width: 24px;
    height: 24px;
    color: white;
}

/* Red Dot Notification */
.feedback-button .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: #e74c3c;
    border-radius: 50%;
    border: 2px solid #2c3e50;
}

/* Feedback Panel */
.feedback-panel {
    position: fixed;
    top: 70px;
    right: 30px;
    background-color: white;
    width: 400px;
    max-height: 80vh;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border-radius: 12px;
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow-y: auto;
}

.feedback-panel.open {
    display: flex;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-panel h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .feedback-button {
        width: 40px;
        height: 40px;
        padding: 8px;
    }

    .feedback-icon {
        width: 20px;
        height: 20px;
    }

    .feedback-panel {
        width: calc(100vw - 40px);
        max-width: 400px;
        right: 20px;
        left: 20px;
        margin: 0 auto;
    }

    .notification-dot {
        top: 6px !important;
        right: 6px !important;
        width: 6px !important;
        height: 6px !important;
    }
}

.visitor-box {
    color: #111; /* warna teks utama */
    font-family: Arial, sans-serif;
}

.visitor-row span,
.visitor-row b {
    color: #111;       /* warna teks hitam agar terlihat */
    font-size: 15px;
}

.visitor-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #ddd;
}

.visitor-box h3 {
    color: #0C1B34;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 700;
}

.like-box {
    display: inline-flex;
    align-items: center;
    background: #f2f2f2;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: sans-serif;
}

.like-button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.like-button:hover {
    opacity: 0.7;
}

.like-count {
    margin-left: 10px;
    font-size: 18px;
    font-weight: bold;
}

.like-button {
    background-color: #0C1B34;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    width: auto;
    height: 48px;
    margin-right: 10px;
    gap: 6px;
    font-size: 16px;
}

.like-button:hover {
    background-color: #34495e;
    transform: translateY(-1px);
}

.like-icon {
    font-size: 18px;
}

@media (max-width: 768px) {
    .like-button {
        height: 40px;
        padding: 6px 12px;
        font-size: 14px;
    }
    .like-icon {
        font-size: 16px;
    }
}

/* --- WRAPPER TOMBOL KECIL --- */

.header-small-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    transition: 0.15s ease;
}

.header-small-btn:hover {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.25);
}

/* Icon */
.header-small-btn svg {
    width: 18px;
    height: 18px;
}

/* Container header-right lebih rapat */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px; /* lebih kecil */
}

/* Panel Visitor padding */
.visitor-box {
    margin-top: 10px;
    padding: 12px;
    background: #ffffff;
    border-radius: 12px;
}






* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "San Francisco", Segoe UI, Roboto, "Helvetica Neue", sans-serif !important;
  background: #0f172a;
  font-weight: 200;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

/* ========================================
   HEADER SECTION
   ======================================== */
.app-header {
  width: 100%;
  background: #0d1b34;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  z-index: 50;
}

/* Header Top */
.header-top {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.brand {
  color: white;
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search Box */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  padding: 6px 12px;
  border-radius: 6px;
  max-width: 300px;
  width: 100%;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 14px;
  width: 100%;
}

.search-box input::placeholder {
  color: rgba(255,255,255,0.5);
}

.search-box .icon {
  stroke: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

/* Header Menu */
.header-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 48px;
  padding: 0 24px;
  border-top: 1px solid rgba(255,255,255,0.03);
  background: #0f203d;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.header-menu::-webkit-scrollbar {
  display: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  text-decoration: none;
  padding-bottom: 3px;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.menu-item .icon {
  stroke: rgba(255,255,255,0.6);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: stroke 0.2s ease;
}

.menu-item.active {
  color: #4da3ff;
}

.menu-item.active .icon {
  stroke: #4da3ff;
}

.menu-item:hover {
  color: white;
}

.menu-item:hover .icon {
  stroke: white;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
  margin-left: 12px;
  z-index: 3000;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* ========================================
   DROPDOWN MENU (DESKTOP)
   ======================================== */
.menu-dropdown {
  position: relative;
  z-index: 100;
}

.menu-dropdown .dropdown-list {
  display: none;
  position: fixed;
  background: #0f203d;
  padding: 10px 0;
  border-radius: 6px;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 9999;
  margin-top: 5px;
}

.dropdown-list .menu-item {
  padding: 10px 16px !important;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-list .menu-item:last-child {
  border-bottom: none;
}

.menu-dropdown.open > .menu-item {
  background: rgba(255,255,255,0.06);
}

.menu-dropdown > .menu-item {
  cursor: pointer !important;
}

/* ========================================
   LOGIN WRAPPER & CONTAINER
   ======================================== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: calc(100vh - 120px);
    padding: 20px;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
}

.boxlogin {
    justify-self: center;
    z-index: 10;
}

.character-left   { justify-self: end; }
.character-right  { justify-self: start; }

/* ========================================
   CHARACTERS (JOKO & SUSI)
   ======================================== */
.character {
  position: relative;
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
  z-index: 10;
}

.character img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 10px 25px rgba(0,0,0,0.3));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ========================================
   SPEECH BUBBLE
   ======================================== */
.speech-bubble {
  position: absolute;
  background: white;
  padding: 10px 16px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  animation: fadeInBounce 0.5s ease-out both;
  z-index: 9999;
  pointer-events: none;
}

.character-left .speech-bubble {
  top: 20px;
  right: 80%;
  margin-right: 0px;
}

.character-left .speech-bubble::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 0 8px 12px;
  border-style: solid;
  border-color: transparent transparent transparent white;
}

.character-right .speech-bubble {
  top: 20px;
  left: 80%;
  margin-left: 20px;
}

.character-right .speech-bubble::after {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 12px 8px 0;
  border-style: solid;
  border-color: transparent white transparent transparent;
}

@keyframes fadeInBounce {
  0% { opacity:0; transform:translateY(10px) scale(0.95); }
  60% { opacity:1; transform:translateY(0) scale(1.03); }
  100% { transform:translateY(0) scale(1); }
}

/* ========================================
   LOGIN BOX
   ======================================== */
.boxlogin {
  animation: fadeIn .3s ease-out;
  width: 100%;
  max-width: 360px;
  background: white;
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  text-align: center;
  position: relative;
  z-index: 10;
}

@keyframes fadeIn {
  from { opacity:0; transform:translateY(20px); }
  to { opacity:1; transform:translateY(0); }
}

.boxlogin h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
}

.boxlogin .tagline {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 24px;
}

.inputlogin {
  width: 100%;
  padding: 14px 16px;
  margin-top: 12px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  font-size: 15px;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.inputlogin:focus {
  outline: none;
  border-color: #58cc02;
  background: white;
  box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.1);
}

.buttonlogin {
  width: 100%;
  background: #58cc02;
  color: white;
  padding: 14px;
  border-radius: 14px;
  border: 0;
  margin-top: 20px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 0 #46a302;
  transition: all 0.1s ease;
}

.buttonlogin:hover {
  background: #4eb100;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #46a302;
}

.buttonlogin:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #46a302;
}

.msglogin {
  margin-top: 12px;
  color: #ef4444;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 20px;
}

.register-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.register-text {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 8px;
}

.alogin {
  display: inline-block;
  text-decoration: none;
  color: #2b7df7;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.alogin:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ========================================
   GAME WRAPPER
   ======================================== */
.game-wrapper {
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 24px 16px;
  background: radial-gradient(circle at top, #1e293b, #020617);
}

.game-upacara {
  width: 100%;
  max-width: 1080px;
}

.game-upacara .app {
  display: grid;
  grid-template-columns: minmax(0,2.2fr) minmax(280px,1fr);
  gap: 16px;
  width: 100%;
}

.game-upacara .card {
  background: #020617;
  border-radius: 24px;
  padding: 20px 20px 18px;
  box-shadow: 0 20px 45px rgba(15,23,42,0.7);
  border: 1px solid rgba(148,163,184,0.4);
}

.game-upacara .title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e5e7eb;
}

.game-upacara .title span {
  font-size: 1.8rem;
}

.game-upacara .subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 16px;
}

.game-upacara .screen {
  display: none;
}

.game-upacara .screen.active {
  display: block;
}

.game-upacara .input-group {
  margin-bottom: 16px;
}

.game-upacara label {
  font-size: 0.85rem;
  color: #94a3b8;
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.game-upacara input[type="text"],
.game-upacara select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #020617;
  color: #e5e7eb;
  outline: none;
  font-size: 0.9rem;
}

.game-upacara input[type="text"]:focus,
.game-upacara select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px #22c55e;
}

.game-upacara .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: none;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.game-upacara .btn-primary {
  background: #22c55e;
  color: #052e16;
  box-shadow: 0 8px 0 #15803d;
}

.game-upacara .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 0 #15803d;
}

.game-upacara .btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 4px 0 #15803d;
}

.game-upacara .btn-secondary {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid #334155;
}

.game-upacara .btn-secondary:hover {
  background: #111827;
}

.game-upacara .btn[disabled] {
  opacity: 0.4;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.game-upacara .flex-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.game-upacara .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #020617;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

.game-upacara .pill span {
  font-size: 0.9rem;
}

.game-upacara .question-text {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 10px 0 12px;
  color: #e5e7eb;
}

.game-upacara .options {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.game-upacara .option {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid #1e293b;
  background: #020617;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}

.game-upacara .option-prefix {
  font-weight: 800;
  color: #9ca3af;
  min-width: 18px;
}

.game-upacara .option:hover {
  background: #0f172a;
  transform: translateY(-1px);
}

.game-upacara .option.correct {
  border-color: #22c55e;
  background: #022c22;
}

.game-upacara .option.wrong {
  border-color: #ef4444;
  background: #450a0a;
}

.game-upacara .option.disabled {
  cursor: default;
  opacity: 0.9;
  transform: none;
}

.game-upacara .explanation {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 6px;
  min-height: 32px;
}

.game-upacara .duo-progress-wrap {
  margin-top: 10px;
}

.game-upacara .progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #1e293b;
  overflow: hidden;
}

.game-upacara .progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.25s ease-out;
}

.game-upacara .score-label {
  font-size: 0.8rem;
  color: #9ca3af;
}

.game-upacara .score-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fde047;
}

.game-upacara .leaderboard-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #e5e7eb;
}

.game-upacara .leaderboard-subtitle {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 10px;
}

.game-upacara .leaderboard-list {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.game-upacara .leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 6px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
  background: #020617;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

.game-upacara .leaderboard-rank {
  font-weight: 800;
  min-width: 22px;
}

.game-upacara .leaderboard-name {
  flex: 1;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-upacara .leaderboard-score {
  font-weight: 700;
  color: #fde047;
}

.game-upacara .badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  color: #e0f2fe;
  background: rgba(37,99,235,0.1);
}

.game-upacara .result-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #e5e7eb;
}

.game-upacara .result-text {
  font-size: 0.95rem;
  color: #9ca3af;
  margin-bottom: 10px;
}

.game-upacara .xp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid #1d4ed8;
  font-size: 0.8rem;
  color: #bfdbfe;
  margin-top: 4px;
}

/* ========================================
   QUIZ CHARACTER
   ======================================== */
.quiz-character {
  width: 150px;
  height: 150px;
  margin: 0 auto 8px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  position: relative;
}

.quiz-character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.character-bounce {
  animation: charBounce 1.6s ease-in-out infinite;
}

@keyframes charBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.character-celebrate {
  animation: charCelebrate 0.5s ease-in-out 0s 3;
}

@keyframes charCelebrate {
  0%   { transform: translateY(0) rotate(0deg); }
  25%  { transform: translateY(-6px) rotate(-4deg); }
  50%  { transform: translateY(0) rotate(4deg); }
  75%  { transform: translateY(-6px) rotate(-3deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.character-sad {
  animation: charSad 0.35s ease-in-out 0s 2;
}

@keyframes charSad {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.pill-xp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #052e16;
  border: 1px solid #16a34a;
  font-size: 0.75rem;
  color: #bbf7d0;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background-color: #020617;
  color: #9ca3af;
  padding: 12px 24px;
  font-size: 0.85rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(148,163,184,0.25);
}

footer .copyright {
  user-select: none;
  line-height: 1.4;
}

footer .links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

footer .links span,
footer .copyright .dot {
  color: #64748b;
  font-weight: 300;
}

footer .links a {
  color: #e5e7eb;
  text-decoration: none;
  transition: 0.25s ease;
  cursor: pointer;
}

footer .links a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

footer .links .heart {
  color: #fb7185;
  font-weight: 600;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* TABLET (768px - 1024px) */
@media (max-width: 1024px) {
  .header-top {
    padding: 0 16px;
  }
  
  .header-menu {
    padding: 0 16px;
    gap: 16px;
  }
  
  .search-box {
    max-width: 200px;
  }
  
  .login-container {
    gap: 30px;
  }
  
  .character img {
    width: 140px;
    height: 140px;
  }
  
  .speech-bubble {
    font-size: 0.8rem;
    padding: 10px 14px;
  }
  
  .game-upacara .app {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   MOBILE MODE (FIXED)
   ======================================== */
@media (max-width: 768px) {
  .header-top {
    height: 56px;
    padding: 0 12px;
  }
  
  .brand {
    font-size: 18px;
  }
  
  .header-right {
    gap: 8px;
  }
  
  .search-box {
    display: none;
  }
  
  .header-menu {
    height: 44px;
    padding: 0 12px;
    gap: 16px;
  }
  
  .menu-item {
    font-size: 14px;
  }
  
  .menu-item .icon {
    width: 16px;
    height: 16px;
  }
  
  .menu-toggle {
    display: flex !important;
  }
  
  .app-header {
    position: relative !important;
  }
  
  /* === MOBILE MENU CONTAINER === */
  #pdfTopMenu.header-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    gap: 0 !important;
    background: #0f203d !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    transition: max-height 0.3s ease, padding 0.3s ease !important;
    z-index: 2500 !important;
    border-top: 1px solid rgba(255,255,255,0.05) !important;
  }
  
  #pdfTopMenu.header-menu.open {
    max-height: 500px !important;
    padding: 8px 0 !important;
    overflow-y: auto !important;
  }
  
  #pdfTopMenu.header-menu .menu-item {
    padding: 14px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    display: flex !important;
    position: relative !important;
  }
  
  #pdfTopMenu.header-menu .menu-item:last-child {
    border-bottom: none !important;
  }
  
  #pdfTopMenu.header-menu .menu-item.active {
    background: rgba(77, 163, 255, 0.15) !important;
  }
  
  #pdfTopMenu.header-menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
  }
  
  /* === PERBAIKAN DROPDOWN MOBILE === */
  /* DEFAULT: Sembunyikan semua dropdown */
  .menu-dropdown .dropdown-list {
    display: none !important;
    position: static !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
  }
  
  /* AKTIF: Tampilkan dropdown hanya saat .open */
  .menu-dropdown.open .dropdown-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    max-height: 500px !important;
    opacity: 1 !important;
    padding-left: 20px !important;
    margin-top: 8px !important;
    margin-bottom: 8px !important;
  }
  
  /* Styling untuk item di dalam dropdown */
  .dropdown-list .menu-item {
    padding: 12px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.03) !important;
    background: transparent !important;
  }
  
  .dropdown-list .menu-item:last-child {
    border-bottom: none !important;
  }
  
  .dropdown-list .menu-item:hover {
    background: rgba(255, 255, 255, 0.03) !important;
  }
  
  /* Login Container Mobile */
  .login-wrapper {
    padding: 40px 16px;
    min-height: calc(100vh - 120px);
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  .character {
    display: none !important;
  }
  
  .speech-bubble {
    display: none !important;
  }
  
  .boxlogin {
    width: 100%;
    max-width: 400px;
  }
  
  footer {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    gap: 6px;
  }
  
  footer .links {
    justify-content: center;
    gap: 10px;
  }
}

/* SMALL MOBILE (max-width: 480px) */
@media (max-width: 480px) {
  .header-top {
    padding: 0 8px;
  }
  
  .brand {
    font-size: 16px;
  }
  
  .header-menu {
    padding: 0 8px;
    gap: 12px;
  }
  
  .menu-item {
    font-size: 13px;
    gap: 4px;
  }
  
  .login-wrapper {
    padding: 20px 16px;
  }
  
  .boxlogin {
    padding: 24px;
  }
  
  .boxlogin h2 {
    font-size: 1.5rem;
  }
  
  footer {
    font-size: 0.7rem;
  }
}

/* LARGE DESKTOP (min-width: 1440px) */
@media (min-width: 1440px) {
  .header-top {
    padding: 0 48px;
  }
  
  .header-menu {
    padding: 0 48px;
    gap: 32px;
  }
  
  .search-box {
    max-width: 400px;
  }
  
  footer {
    padding: 16px 48px;
  }
}

/* ========================================
   DESKTOP DROPDOWN BEHAVIOR
   ======================================== */
@media (min-width: 769px) {
  .header-menu {
    overflow-x: auto !important;
    overflow-y: visible !important;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid #4da3ff;
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #4da3ff;
  outline-offset: 2px;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.game-upacara .leaderboard-list::-webkit-scrollbar {
  width: 6px;
}

.game-upacara .leaderboard-list::-webkit-scrollbar-track {
  background: #020617;
  border-radius: 3px;
}

.game-upacara .leaderboard-list::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

.game-upacara .leaderboard-list::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ========================================
   LOADING STATES
   ======================================== */
.loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .app-header,
  .menu-toggle,
  footer,
  .character,
  .speech-bubble {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  .boxlogin {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
@media (prefers-color-scheme: dark) {
  /* Already dark by default */
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .character {
    animation: none;
  }
  
  .speech-bubble {
    animation: none;
  }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: high) {
  .menu-item,
  .boxlogin,
  .character img {
    border: 2px solid currentColor;
  }
  
  .buttonlogin {
    border: 3px solid #000;
  }
}

/* ========================================
   FORCE HIDE DROPDOWN (SAFETY OVERRIDE)
   ======================================== */
@media (max-width: 768px) {
  /* Paksa sembunyikan dropdown saat menu belum dibuka */
  #pdfTopMenu:not(.open) .dropdown-list {
    display: none !important;
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
  
  /* Paksa sembunyikan dropdown yang belum diklik */
  .menu-dropdown:not(.open) .dropdown-list {
    display: none !important;
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}

.video-grid {
    display: grid;
    gap: 20px;
    margin-top: 30px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.video-card {
    background: #020617;
    border-radius: 20px;
    border: 1px solid rgba(148,163,184,0.4);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transition: transform .2s ease, box-shadow .2s ease;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 60px rgba(0,0,0,0.55);
}

.video-thumb iframe,
.video-thumb video {
    width: 100%;
    height: 180px;
    display: block;
    border: 0;
}

.video-info {
    padding: 16px 20px;
}

.video-title {
    color: #e5e7eb;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.video-desc {
    font-size: 0.85rem;
    color: #9ca3af;
    line-height: 1.4;
    min-height: 40px;
}

/* =============================
   VIDEO SEARCH BAR
   ============================= */
.video-search {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

#videoSearchInput {
    width: 100%;
    max-width: 420px;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid #334155;
    background: #020617;
    color: #e5e7eb;
    font-size: 0.95rem;
    transition: 0.2s ease;
}

#videoSearchInput:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.3);
    outline: none;
}

/* =============================
   UNDER DEVELOPMENT SECTION
   ============================= */
.under-dev-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}

.under-dev-card {
    background: #0f172a;
    border: 1px solid rgba(148,163,184,0.3);
    border-radius: 24px;
    padding: 40px 32px;
    text-align: center;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 45px rgba(15,23,42,0.5);
}

.under-dev-img {
    width: 160px;
    height: auto;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.25));
}

.under-dev-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #e5e7eb;
    margin-bottom: 10px;
}

.under-dev-text {
    font-size: 1rem;
    color: #94a3b8;
    margin-bottom: 20px;
    line-height: 1.5;
}

.under-dev-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(234,179,8,0.1);
    border: 1px solid #eab308;
    color: #fef08a;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* ===============================
   DRAG & DROP STYLING
   =============================== */

/* Target Drop Area */
.drag-target {
    min-height: 80px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 3px dashed #475569;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin-bottom: 24px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.drag-target::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drag-target:hover::before {
    opacity: 1;
}

.drag-target.drag-over {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.target-placeholder {
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

/* Drag Options Container */
.drag-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .drag-options {
        grid-template-columns: 1fr;
    }
}

/* Drag Items */
.drag-item {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 14px 18px;
    border-radius: 12px;
    cursor: grab;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.drag-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

.drag-item:hover::before {
    left: 100%;
}

.drag-item:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 12px rgba(59, 130, 246, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.drag-item:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.drag-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    cursor: grabbing;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.drag-item[draggable="false"] {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Dropped Answer */
.dropped-answer {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    animation: dropIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

@keyframes dropIn {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Correct Answer State */
.drag-target.correct-answer {
    border-color: #22c55e;
    background: linear-gradient(135deg, #166534 0%, #15803d 100%);
    animation: correctPulse 0.5s ease;
}

.drag-target.correct-answer .dropped-answer {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

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

/* Wrong Answer State */
.drag-target.wrong-answer {
    border-color: #ef4444;
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    animation: wrongShake 0.5s ease;
}

.drag-target.wrong-answer .dropped-answer {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.dropped-answer.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

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

/* Correct Answer Label (shown after wrong answer) */
.correct-answer-label {
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Explanation Box Enhancement */
#ddExplanationBox {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-left: 4px solid #3b82f6;
    padding: 16px;
    border-radius: 12px;
    margin: 16px 0;
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.6;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Touch Improvements */
@media (max-width: 768px) {
    .drag-item {
        padding: 16px;
        font-size: 1rem;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .drag-target {
        min-height: 100px;
        font-size: 0.95rem;
    }
    
    .dropped-answer {
        font-size: 1rem;
        padding: 12px 16px;
    }
}

/* Loading State */
.drag-options.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Empty State */
.drag-options:empty::after {
    content: 'Memuat pilihan...';
    display: block;
    text-align: center;
    color: #64748b;
    padding: 20px;
}

/* Mode Label Styling */
#ddModeLabel {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Touch Feedback */
.drag-item:active {
    transform: scale(0.95);
}

/* Prevent text selection during drag */
.drag-item,
.drag-target,
.dropped-answer {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Accessibility */
.drag-item:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.drag-target:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

