/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #FF6B35;
  --primary-light: #FF8F65;
  --secondary: #4ECDC4;
  --accent: #FFE66D;
  --purple: #A855F7;
  --green: #22C55E;
  --red: #EF4444;
  --bg: #FFF8F0;
  --card-bg: #FFFFFF;
  --text: #2D2D2D;
  --text-muted: #888;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
  --radius: 18px;
  --radius-sm: 10px;

  --pastel-mint: #B8E4D9;
  --pastel-lavender: #D4C2F0;
  --pastel-peach: #FFD8C2;
  --pastel-pink: #FBC8D5;
  --pastel-blue: #B8D4F5;
  --pastel-yellow: #FFF0B5;
  --pastel-sage: #C5E0D4;
  --pastel-lilac: #E0D0F0;
  --pastel-coral: #FFC8B0;
  --pastel-sky: #C8E4FF;
}

/* Home Stats */
.home-stats-left {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.stat-chip-top {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 800;
  color: #1E3A6F;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.8);
  font-family: 'Nunito', sans-serif;
}

.stat-chip-top strong {
  color: #FF6B35;
  font-size: 15px;
}

/* Sound Toggle Button */
.sound-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50px;
  padding: 8px 18px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1E3A6F;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  z-index: 1000;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.sound-toggle:hover {
  transform: scale(1.05);
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sound-toggle.active {
  background: #4ECDC4;
  color: white;
}

/* Modal Konfirmasi */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-confirm {
  background: white;
  border-radius: 28px;
  padding: 28px 32px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-confirm {
  transform: scale(1);
}

.modal-confirm h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  color: #1E3A6F;
  margin-bottom: 12px;
}

.modal-confirm p {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  color: #666;
  margin-bottom: 24px;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  padding: 10px 24px;
  border-radius: 50px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.modal-btn.confirm {
  background: #EF4444;
  color: white;
}

.modal-btn.confirm:hover {
  background: #DC2626;
  transform: scale(1.02);
}

.modal-btn.cancel {
  background: #E5E7EB;
  color: #374151;
}

.modal-btn.cancel:hover {
  background: #D1D5DB;
  transform: scale(1.02);
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Screens */
.screen {
  display: none;
  min-height: 100vh;
  position: relative;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* Home */
#screen-home {
  background: linear-gradient(145deg, #7FB3F0 0%, #A8CFFF 25%, #C8E0FF 65%, #E2F0FF 120%);
  align-items: center;
  justify-content: center;
  position: relative;
}

.home-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(110, 168, 247, 0.22);
  backdrop-filter: blur(5px);
  animation: float 6s ease-in-out infinite;
}

.b1 {
  width: 180px;
  height: 180px;
  top: 4%;
  left: 6%;
  animation-delay: 0s;
}

.b2 {
  width: 90px;
  height: 90px;
  top: 18%;
  right: 8%;
  animation-delay: 1.5s;
}

.b3 {
  width: 130px;
  height: 130px;
  bottom: 14%;
  left: 12%;
  animation-delay: 3s;
}

.b4 {
  width: 70px;
  height: 70px;
  bottom: 24%;
  right: 18%;
  animation-delay: 2s;
}

.b5 {
  width: 50px;
  height: 50px;
  top: 50%;
  left: 45%;
  animation-delay: 4s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

.home-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px 20px 80px;
  width: 100%;
  max-width: 580px;
}

/* Logo */
.logo-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.logo-img {
  width: 230px;
  height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.18));
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-10px)
  }
}

.logo-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 3px 12px rgba(50, 100, 180, 0.25);
  line-height: 1.2;
  margin-top: 0;
}

.logo-title span {
  color: #FFE66D;
  text-shadow: 0 2px 8px rgba(200, 160, 0, 0.3);
}

.logo-sub {
  color: #1E3A6F;
  font-size: 14px;
  margin-top: 5px;
  font-weight: 700;
}

/* Mode Cards */
.home-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  margin-top: 10px;
}

.mode-card {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  padding: 20px 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #1E3A6F;
  text-align: center;
}

.mode-card:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-5px);
  box-shadow: 0 14px 36px rgba(50, 100, 200, 0.2);
  border-color: rgba(255, 255, 255, 0.9);
}

.mode-emoji {
  font-size: 42px;
}

.mode-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #0F2B5E;
}

.mode-desc {
  font-size: 11px;
  color: #2A4A8A;
  font-weight: 600;
  margin-top: 2px;
}

.mode-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.mode-emoji-fallback {
  font-size: 42px;
}

/* Responsive untuk layar kecil */
@media (max-width: 550px) {
  .home-modes {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .mode-card {
    padding: 12px 6px;
  }

  .mode-emoji {
    font-size: 28px;
  }

  .mode-name {
    font-size: 12px;
  }

  .mode-desc {
    font-size: 9px;
  }
}

/* Stats chips */
.home-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 5px;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50px;
  padding: 8px 18px;
  color: #1E3A6F;
  font-size: 13px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.stat-chip strong {
  color: #0F2B5E;
}

/* Credit */
.home-credit {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 12px;
  color: #FFFFFF;
  z-index: 2;
  background: linear-gradient(135deg, #A855F7, #7C3AED);
  padding: 6px 20px;
  border-radius: 50px;
  width: auto;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 500;
}

.home-credit strong {
  color: #FFE66D;
  font-weight: 700;
}

.back-circle {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--blue-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  transition: all 0.2s;
}

.back-circle:hover {
  background: #fff;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.back-circle.dark {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.95);
  position: static;
}

#screen-level-select {
  background: linear-gradient(165deg, #6FB3E8 0%, #87CEEB 30%, #B8E4F5 70%, #D4F1F9 100%);
  align-items: center;
  justify-content: flex-start;
  padding-top: 70px;
  position: relative;
}

/* Background */
.level-select-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.lvl-bubble {
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 80% 20% 75% 25% / 25% 70% 30% 75%;
  filter: blur(2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  animation: cloudFloat 12s ease-in-out infinite;
}

.lb1 {
  width: 280px;
  height: 160px;
  top: 8%;
  right: -60px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 60% 40% 70% 30% / 40% 55% 45% 60%;
  animation-delay: 0s;
}

.lb2 {
  width: 200px;
  height: 110px;
  bottom: 12%;
  left: -50px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 55% 45% 65% 35% / 45% 60% 40% 55%;
  animation-delay: 2s;
}

.lb3 {
  width: 130px;
  height: 75px;
  bottom: 35%;
  right: 15%;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 65% 35% 70% 30% / 40% 65% 35% 60%;
  animation-delay: 4s;
}

.lb4 {
  width: 100px;
  height: 55px;
  top: 45%;
  left: 5%;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 70% 30% 65% 35% / 50% 55% 45% 50%;
  animation-delay: 1s;
}

.lb5 {
  width: 170px;
  height: 95px;
  top: 70%;
  right: 25%;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 45% 55% 40% 60% / 55% 40% 60% 45%;
  animation-delay: 6s;
}

@keyframes cloudFloat {

  0%,
  100% {
    transform: translateX(0) translateY(0);
  }

  50% {
    transform: translateX(15px) translateY(-12px);
  }
}

.level-select-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 700px;
  padding: 0 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.level-title-wrap {
  text-align: center;
}

.level-select-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.level-select-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.15);
  display: inline-block;
  padding: 4px 16px;
  border-radius: 50px;
  backdrop-filter: blur(4px);
}

/* Level icon gambar */
.level-icon-img {
  width: 65px;
  height: 65px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 14px;
}


.level-select-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1E3A6F;
  /* BIRU TUA */
  font-size: 14px;
  font-weight: 700;
  text-shadow: none;
}

/* Jalur Level */
.level-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 35px;
  width: 100%;
  position: relative;
  padding: 20px 10px;
}

/* Garis penghubung antar */
.level-grid::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 8%;
  right: 8%;
  height: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
  border-radius: 4px;
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
}

/* Tombol level bulat */
.level-btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 110px;
  height: 110px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 2;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.12), 0 4px 15px rgba(0, 0, 0, 0.1);
}

.level-btn .lvl-number {
  font-family: 'Fredoka', sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-top: 2px;
}

.level-btn .lvl-emoji {
  font-size: 20px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.level-btn .lvl-diff {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.4);
  padding: 2px 5px;
  border-radius: 20px;
  white-space: normal;
  text-align: center;
  line-height: 1.1;
  max-width: 100px;
}

.level-btn .lvl-stars {
  font-size: 8px;
  letter-spacing: 0px;
  opacity: 0.9;
  margin-top: 1px;
  white-space: nowrap;
}

.level-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px 30px;
  width: 100%;
  position: relative;
  padding: 20px 10px;
}

@media (max-width: 650px) {
  .level-btn {
    width: 90px;
    height: 90px;
  }

  .level-btn .lvl-number {
    font-size: 22px;
  }

  .level-btn .lvl-emoji {
    font-size: 18px;
  }

  .level-btn .lvl-diff {
    font-size: 7px;
    max-width: 80px;
  }

  .level-btn .lvl-stars {
    font-size: 8px;
  }
}

@media (max-width: 500px) {
  .level-btn {
    width: 75px;
    height: 75px;
  }

  .level-btn .lvl-number {
    font-size: 18px;
  }

  .level-btn .lvl-emoji {
    font-size: 14px;
  }

  .level-btn .lvl-diff {
    font-size: 6px;
    max-width: 65px;
  }

  .level-btn .lvl-stars {
    font-size: 6px;
  }
}

.level-btn:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.1), 0 8px 25px rgba(0, 0, 0, 0.15);
}

.level-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

/* 1-3 */
.level-btn.easy {
  background: linear-gradient(145deg, #A8E6CF, #7ECBA5);
  color: #1B5E3F;
  border: 3px solid rgba(255, 255, 255, 0.5);
}

.level-btn.easy .lvl-number {
  color: #0D4A32;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 4-6 */
.level-btn.medium {
  background: linear-gradient(145deg, #FFDDA1, #FFC76E);
  color: #8B5E2C;
  border: 3px solid rgba(255, 255, 255, 0.5);
}

.level-btn.medium .lvl-number {
  color: #A86F24;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 7-10 */
.level-btn.hard {
  background: linear-gradient(145deg, #D4B8E8, #C29AD9);
  color: #5A3A7A;
  border: 3px solid rgba(255, 255, 255, 0.5);
}

.level-btn.hard .lvl-number {
  color: #4A2D6E;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.level-btn .lvl-number {
  font-family: 'Fredoka', sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.level-btn .lvl-emoji {
  font-size: 22px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.level-btn .lvl-diff {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.4);
  padding: 2px 8px;
  border-radius: 20px;
}

.level-btn .lvl-stars {
  font-size: 10px;
  letter-spacing: 2px;
  opacity: 0.9;
}

/* locked style */
.level-btn.locked {
  background: linear-gradient(145deg, #C0C0C0, #A8A8A8);
  color: rgba(255, 255, 255, 0.6);
  cursor: not-allowed;
  filter: grayscale(0.3);
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.level-btn.locked:hover {
  transform: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.level-legend {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  padding: 8px 20px;
  border-radius: 50px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1E3A6F;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dot-easy {
  background: #7ECBA5;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.dot-med {
  background: #FFC76E;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.dot-hard {
  background: #C29AD9;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Level mode icon */
.level-mode-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
}

.level-select-subtitle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.15);
  padding: 4px 16px;
  border-radius: 50px;
  backdrop-filter: blur(4px);
}

/* Game Themes */
/* Anagram */
#screen-anagram {
  background: linear-gradient(145deg, #FFF5ED, #FFE8DC);
}

#screen-anagram .game-header {
  background: linear-gradient(135deg, #FFE8DC, #FFD8C2) !important;
  border-bottom: 3px solid #FF9A6E !important;
  box-shadow: 0 4px 20px rgba(255, 154, 110, 0.2) !important;
}

#screen-anagram .mode-badge.anagram {
  background: linear-gradient(135deg, #FF9A6E, #FF7A4A) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 15px rgba(255, 154, 110, 0.5) !important;
  transform: scale(1);
  transition: all 0.3s ease;
}

#screen-anagram .mode-badge.anagram:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(255, 154, 110, 0.7) !important;
}

#screen-anagram .progress-fill {
  background: linear-gradient(90deg, #FF9A6E, #FF7A4A, #FF5A2A) !important;
  background-size: 200% 100%;
  animation: progressShine 2s ease-in-out infinite;
}

#screen-anagram .anagram-card {
  border-top: 5px solid #FF9A6E !important;
  background: linear-gradient(145deg, #FFFFFF, #FFF5ED) !important;
  box-shadow: 0 8px 32px rgba(255, 154, 110, 0.2) !important;
  border-radius: 20px;
  transition: all 0.3s ease;
}

#screen-anagram .anagram-card:hover {
  box-shadow: 0 12px 48px rgba(255, 154, 110, 0.3) !important;
  transform: translateY(-2px);
}

#screen-anagram .scrambled-display {
  background: linear-gradient(135deg, #FFE8DC, #FFD8C2) !important;
  color: #C96A3E !important;
  border: 2px solid #FF9A6E !important;
  border-radius: 12px;
  font-size: 32px;
  letter-spacing: 10px;
  animation: pulseGlow 2s ease-in-out infinite;
}

#screen-anagram .letter-tile {
  background: linear-gradient(145deg, #FFD8C2, #FFB48A) !important;
  color: #7A3A1A !important;
  border-color: #FF9A6E !important;
  box-shadow: 0 4px 0 #E07C3E !important;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

#screen-anagram .letter-tile:hover {
  transform: translateY(-5px) scale(1.05) !important;
  box-shadow: 0 8px 0 #E07C3E, 0 8px 25px rgba(255, 154, 110, 0.4) !important;
}

#screen-anagram .letter-tile:active {
  transform: translateY(2px) scale(0.95) !important;
  box-shadow: 0 2px 0 #E07C3E !important;
}

#screen-anagram .answer-slot {
  border-color: #FFB48A !important;
  background: linear-gradient(145deg, #FFF5ED, #FFE8DC) !important;
  color: #E07C3E !important;
  border-radius: 10px;
  transition: all 0.2s ease;
}

#screen-anagram .answer-slot:hover {
  background: #FFD8C2 !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 15px rgba(255, 154, 110, 0.3) !important;
}

#screen-anagram .hint-label {
  background: linear-gradient(135deg, #FFF5ED, #FFE8DC) !important;
  border-left: 4px solid #FF9A6E !important;
  border-radius: 0 10px 10px 0;
}

/* Keyboard Hint */
.keyboard-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  border: 1px solid #FFD8C2;
  max-width: 560px;
  width: 100%;
}

.key-hint {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: #7A5A4A;
  background: #FFF5ED;
  padding: 4px 12px;
  border-radius: 50px;
  border: 1px solid #FFD8C2;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#screen-anagram .scrambled-display {
  transition: all 0.2s ease;
}

/* Match */
#screen-match {
  background: linear-gradient(145deg, #F0F9F5, #DCEAE4);
}

#screen-match .game-header {
  background: linear-gradient(135deg, #E0F2EC, #B8E4D9) !important;
  border-bottom: 3px solid #4ECDC4 !important;
  box-shadow: 0 4px 20px rgba(78, 205, 196, 0.2) !important;
}


#screen-match .mode-badge.match {
  background: linear-gradient(135deg, #4ECDC4, #2DA89E) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.5) !important;
  transform: scale(1);
  transition: all 0.3s ease;
}

#screen-match .mode-badge.match:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(78, 205, 196, 0.7) !important;
}

#screen-match .progress-fill {
  background: linear-gradient(90deg, #4ECDC4, #2DA89E, #1A8A80) !important;
  background-size: 200% 100%;
  animation: progressShine 2s ease-in-out infinite;
}

#screen-match .match-container {
  border-top: 5px solid #4ECDC4 !important;
  background: linear-gradient(145deg, #FFFFFF, #F0F9F5) !important;
  box-shadow: 0 8px 32px rgba(78, 205, 196, 0.2) !important;
  border-radius: 20px;
  transition: all 0.3s ease;
}

#screen-match .match-container:hover {
  box-shadow: 0 12px 48px rgba(78, 205, 196, 0.3) !important;
}

#screen-match .match-item {
  background: linear-gradient(145deg, #E8F4F0, #D4E8E0) !important;
  border: 2px solid #B8E4D9 !important;
  color: #2C6E5A !important;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  cursor: pointer;
}

#screen-match .match-item:hover:not(.matched-ok) {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.3) !important;
  border-color: #4ECDC4 !important;
}

#screen-match .match-item.selected {
  border-color: #4ECDC4 !important;
  background: linear-gradient(135deg, #D4F0E8, #B8E4D9) !important;
  transform: scale(1.04) !important;
  box-shadow: 0 4px 25px rgba(78, 205, 196, 0.4) !important;
}

#screen-match .match-item.matched-ok {
  background: linear-gradient(135deg, #A8E6CF, #7ECBA5) !important;
  border-color: #4ECDC4 !important;
  opacity: 0.8 !important;
  text-decoration: line-through;
  text-decoration-color: #2DA89E;
  text-decoration-thickness: 2px;
}

#screen-match .match-item.matched-wrong {
  background: linear-gradient(135deg, #FEE2E2, #FDD4D4) !important;
  border-color: #EF4444 !important;
  animation: shake 0.5s ease !important;
}

#screen-match .col-title {
  color: #2C6E5A !important;
  border-bottom: 3px solid #4ECDC4 !important;
  padding-bottom: 10px;
}

/* Quiz */
#screen-quiz {
  background: linear-gradient(145deg, #F8F4FF, #EDE6F5);
}

#screen-quiz .game-header {
  background: linear-gradient(135deg, #EDE6F5, #D4C2F0) !important;
  border-bottom: 3px solid #B48AD9 !important;
  box-shadow: 0 4px 20px rgba(180, 138, 217, 0.2) !important;
}


#screen-quiz .mode-badge.quiz {
  background: linear-gradient(135deg, #B48AD9, #9B72B3) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 15px rgba(180, 138, 217, 0.5) !important;
  transform: scale(1);
  transition: all 0.3s ease;
}

#screen-quiz .mode-badge.quiz:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(180, 138, 217, 0.7) !important;
}

#screen-quiz .progress-fill {
  background: linear-gradient(90deg, #B48AD9, #9B72B3, #7A5A9A) !important;
  background-size: 200% 100%;
  animation: progressShine 2s ease-in-out infinite;
}

#screen-quiz .quiz-card {
  border-top: 5px solid #B48AD9 !important;
  background: linear-gradient(145deg, #FFFFFF, #F8F4FF) !important;
  box-shadow: 0 8px 32px rgba(180, 138, 217, 0.2) !important;
  border-radius: 20px;
  transition: all 0.3s ease;
}

#screen-quiz .quiz-card:hover {
  box-shadow: 0 12px 48px rgba(180, 138, 217, 0.3) !important;
}

#screen-quiz .quiz-category {
  color: #6B4E8E !important;
  background: linear-gradient(135deg, #EDE6F5, #D4C2F0) !important;
  padding: 6px 18px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 13px;
}

#screen-quiz .quiz-question {
  color: #4A3B6E !important;
  font-size: 24px;
}

#screen-quiz .quiz-opt {
  border: 2px solid #D4C2F0 !important;
  background: linear-gradient(145deg, #FFFFFF, #FAF8FF) !important;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  cursor: pointer;
}

#screen-quiz .quiz-opt:hover:not(:disabled) {
  border-color: #B48AD9 !important;
  background: linear-gradient(135deg, #F3ECFF, #E8DCF5) !important;
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 6px 20px rgba(180, 138, 217, 0.3) !important;
}

#screen-quiz .quiz-opt:active:not(:disabled) {
  transform: translateY(0px) scale(0.98) !important;
}

#screen-quiz .quiz-opt.correct {
  background: linear-gradient(135deg, #A8E6CF, #7ECBA5) !important;
  border-color: #22C55E !important;
  color: #166534 !important;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4) !important;
  transform: scale(1.03);
}

#screen-quiz .quiz-opt.wrong {
  background: linear-gradient(135deg, #FEE2E2, #FDD4D4) !important;
  border-color: #EF4444 !important;
  color: #991B1B !important;
  animation: shake 0.5s ease !important;
}

#screen-quiz .timer-ring {
  stroke: #B48AD9 !important;
  filter: drop-shadow(0 0 8px rgba(180, 138, 217, 0.3));
}

/* Animasi */
@keyframes progressShine {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 0 0px rgba(255, 154, 110, 0);
  }

  50% {
    box-shadow: 0 0 20px rgba(255, 154, 110, 0.3);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-10px);
  }

  40% {
    transform: translateX(10px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(6px);
  }
}

/* Efek Interaktif */
.game-body .btn-primary {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.game-body .btn-primary:hover {
  transform: translateY(-3px) scale(1.03) !important;
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4) !important;
}

.game-body .btn-primary:active {
  transform: translateY(2px) scale(0.97) !important;
}

.game-body .btn-secondary {
  transition: all 0.3s ease !important;
}

.game-body .btn-secondary:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
}

.game-body .btn-secondary:active {
  transform: translateY(2px) scale(0.97) !important;
}

/* Game Header */
.game-header {
  background: var(--card-bg);
  border-bottom: 2px solid #f0e8e0;
  padding: 10px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.header-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
  position: relative;
}

.header-top-row .mode-badge {
  flex-shrink: 0;
}

.header-top-row .level-badge {
  flex-shrink: 0;
}

.header-top-row .score-badge {
  flex-shrink: 0;
  margin: 0;
}

.header-top-row .lives-display {
  flex-shrink: 0;
  margin-left: auto;
}

.header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 50px;
}

.mode-badge-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.score-badge {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.score-badge strong {
  color: var(--primary);
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #f0e8e0;
  border-radius: 50px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-wrap span {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

/* Game Body */
.game-body {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

/* Anagram */
.anagram-card {
  width: 100%;
  max-width: 560px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hint-label {
  font-size: 15px;
  color: var(--text-muted);
  font-style: italic;
  background: #FFF8F0;
  border-left: 3px solid var(--primary);
  padding: 8px 14px;
  border-radius: 0 8px 8px 0;
}

.scrambled-display {
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
}

.answer-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 60px;
  justify-content: center;
  padding: 12px;
  border: 2px dashed #D0C0FF;
  border-radius: var(--radius-sm);
  background: #FAFAFA;
}

.answer-slot {
  width: 44px;
  height: 48px;
  border: 2px solid #C4B0FF;
  border-radius: 8px;
  background: #EDE9FF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.answer-slot:hover {
  transform: scale(1.05);
}

.answer-slot.empty {
  background: transparent;
  border-color: #ddd;
  color: transparent;
}

.letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.letter-tile {
  width: 48px;
  height: 52px;
  border: 2px solid var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.letter-tile:active {
  transform: translateY(1px);
}

.letter-tile.used {
  opacity: 0.3;
  pointer-events: none;
}

.anagram-actions {
  display: flex;
  gap: 12px;
}

/* 16:9 Aspect Ratio */
html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

.screen {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

#screen-home,
#screen-level-select,
#screen-anagram,
#screen-match,
#screen-quiz,
#screen-result {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Container utama */
.home-content,
.level-select-content,
.game-body,
.result-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Responsif untuk layar lebar */
@media (min-aspect-ratio: 16/9) {

  .home-content,
  .level-select-content {
    max-width: 800px;
  }
}

@media (max-aspect-ratio: 16/9) {

  .home-content,
  .level-select-content {
    max-width: 90%;
  }
}

/* Match */
.match-container {
  width: 100%;
  max-width: 800px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  position: relative;
  align-items: start;
}

.match-lines-svg {
  display: none;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.col-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #2C6E5A;
  margin-bottom: 8px;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 2px solid #B8E4D9;
}

.match-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s;
  border: 2px solid #B8E4D9;
  position: relative;
  user-select: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  height: 60px;
  width: 100%;
  background: #E8F4F0;
  color: #2C6E5A;
  box-sizing: border-box;
}

.match-item.selected {
  border-color: #5FBCA6;
  background: #D4F0E8;
  transform: scale(1.02);
}

.match-item.matched-ok {
  cursor: default;
  opacity: 0.6;
  text-decoration: line-through;
  background: #D4F0E8;
  border-color: #4ECDC4;
}

.match-item.matched-wrong {
  background: #FEE2E2;
  border-color: #EF4444;
}

.match-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  width: 100%;
  max-width: 800px;
}

/* Responsive */
@media (max-width: 550px) {
  .match-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .match-item {
    min-height: 50px;
    height: 50px;
    padding: 10px 12px;
  }
}

/* Quiz */
.quiz-card {
  width: 100%;
  max-width: 560px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.quiz-timer-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-timer-ring span {
  position: absolute;
  font-family: 'Fredoka', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.quiz-category {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.quiz-question {
  font-family: 'Fredoka', sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.quiz-options {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quiz-opt {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
}

.quiz-opt.correct {
  background: #ECFDF5;
  border-color: var(--green);
  color: #166534;
}

.quiz-opt.wrong {
  background: #FEF2F2;
  border-color: var(--red);
  color: #991B1B;
}

.quiz-opt:disabled {
  cursor: default;
}

/* Buttons */
.btn-primary {
  flex: 1;
  padding: 13px 24px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), #E85A28);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 17px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 0 #C84820;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #C84820;
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #C84820;
}

.btn-secondary {
  flex: 1;
  padding: 13px 24px;
  border-radius: 50px;
  border: 2px solid #DDD;
  cursor: pointer;
  background: #F9F9F9;
  color: var(--text);
  font-family: 'Fredoka', sans-serif;
  font-size: 17px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #EEE;
}

/* Level Badge */
.level-badge {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 800;
  padding: 4px 16px;
  border-radius: 50px;
  margin-left: 8px;
  background: linear-gradient(135deg, #FFE66D, #FFD93D);
  color: #5B3A00;
  border: 2px solid rgba(255, 215, 0, 0.6);
  box-shadow: 0 2px 12px rgba(255, 215, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: levelPulse 2s ease-in-out infinite;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.level-badge::before {
  content: '⭐';
  font-size: 14px;
  display: inline-block;
  animation: starSpin 4s linear infinite;
}

.level-badge[data-level="1"],
.level-badge[data-level="2"],
.level-badge[data-level="3"] {
  background: linear-gradient(135deg, #A8E6CF, #6FCF97);
  color: #1B4A3A;
  border-color: rgba(111, 207, 151, 0.6);
  box-shadow: 0 2px 12px rgba(111, 207, 151, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.level-badge[data-level="1"]::before {
  content: '🌱';
}

.level-badge[data-level="2"]::before {
  content: '🌿';
}

.level-badge[data-level="3"]::before {
  content: '🍀';
}

.level-badge[data-level="4"],
.level-badge[data-level="5"],
.level-badge[data-level="6"] {
  background: linear-gradient(135deg, #FFDDA1, #FFC76E);
  color: #7A4A1A;
  border-color: rgba(255, 199, 110, 0.6);
  box-shadow: 0 2px 12px rgba(255, 199, 110, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.level-badge[data-level="4"]::before {
  content: '🔥';
}

.level-badge[data-level="5"]::before {
  content: '💥';
}

.level-badge[data-level="6"]::before {
  content: '⚡';
}

.level-badge[data-level="7"],
.level-badge[data-level="8"],
.level-badge[data-level="9"],
.level-badge[data-level="10"] {
  background: linear-gradient(135deg, #D4B8E8, #C29AD9);
  color: #4A2D6E;
  border-color: rgba(194, 154, 217, 0.6);
  box-shadow: 0 2px 12px rgba(194, 154, 217, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.level-badge[data-level="7"]::before {
  content: '🧠';
}

.level-badge[data-level="8"]::before {
  content: '🏆';
}

.level-badge[data-level="9"]::before {
  content: '💎';
}

.level-badge[data-level="10"]::before {
  content: '👑';
}

/* Animasi level badge */
@keyframes levelPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }
}

@keyframes starSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Hover effect */
.level-badge:hover {
  animation: none;
  transform: scale(1.08) !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Tombol Level Selanjutnya */
#btn-next-level {
  background: linear-gradient(135deg, #4ECDC4, #2DA89E) !important;
  box-shadow: 0 4px 0 #1A8A80 !important;
  color: white !important;
}

#btn-next-level:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 6px 0 #1A8A80, 0 8px 20px rgba(78, 205, 196, 0.4) !important;
}

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.result-actions .btn-primary,
.result-actions .btn-secondary,
#btn-next-level {
  min-width: 140px;
}

/* Feedback */
.feedback-box {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  min-height: 24px;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  transition: all 0.3s;
}

.feedback-box.show-ok {
  background: #ECFDF5;
  color: #166534;
}

.feedback-box.show-err {
  background: #FEF2F2;
  color: #991B1B;
}

/* Result */
#screen-result {
  background: linear-gradient(135deg, #667EEA, #764BA2);
  align-items: center;
  justify-content: center;
}

.result-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-wrap {
  position: absolute;
  inset: 0;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

.result-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 24px;
}

.result-trophy {
  font-size: 80px;
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% {
    transform: scale(0)
  }

  100% {
    transform: scale(1)
  }
}

.result-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: #fff;
}

.result-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
}

.result-stats {
  display: flex;
  gap: 20px;
}

.rstat {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rstat-val {
  font-family: 'Fredoka', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.rstat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.result-actions {
  display: flex;
  gap: 12px;
}

.result-actions .btn-primary {
  background: linear-gradient(135deg, #FF6B35, #F7931E);
  box-shadow: 0 4px 0 #C84820;
}

.result-actions .btn-secondary {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Hasil akhir animasi */
.result-emoji-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 10px;
  animation: resultPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-emoji-wrap .result-icon {
  width: 180px;
  height: 180px;
  object-fit: contain;
  display: block;
  animation: resultFloat 3s ease-in-out infinite;
}

@keyframes resultPop {
  0% {
    transform: scale(0) rotate(-20deg);
    opacity: 0;
  }

  60% {
    transform: scale(1.2) rotate(5deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes resultFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

/* Efek glitter */
.result-stars-anim {
  display: inline-block;
  animation: starsPulse 1.5s ease-in-out infinite;
}

@keyframes starsPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* Efek subtitle */
.result-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  animation: subtitleFade 1s ease 0.5s both;
}

@keyframes subtitleFade {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animations */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0)
  }

  25% {
    transform: translateX(-6px)
  }

  75% {
    transform: translateX(6px)
  }
}

.pop {
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mode-card {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mode-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 14px 36px rgba(50, 100, 200, 0.2);
}

.level-btn {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.level-btn:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.1), 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 0 #C84820, 0 8px 20px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 550px) {
  .home-modes {
    grid-template-columns: 1fr;
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }

  .match-container {
    padding: 16px;
  }

  .logo-title {
    font-size: 38px;
  }

  .result-stats {
    flex-direction: column;
    align-items: center;
  }

  .level-grid {
    gap: 15px 20px;
  }

  .level-btn {
    width: 70px;
    height: 70px;
  }

  .level-btn .lvl-number {
    font-size: 24px;
  }

  .level-btn .lvl-emoji {
    font-size: 18px;
  }

  .level-btn .lvl-diff {
    font-size: 7px;
  }

  .level-grid::before {
    display: none;
  }
}

/* Credit Screen */
#screen-credit {
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 50%, #A855F7 100%);
  align-items: center;
  justify-content: center;
  position: relative;
}

.credit-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  border: 4px solid #A855F7;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: block;
}

.credit-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.credit-bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 8s ease-in-out infinite;
}

.cb1 {
  width: 250px;
  height: 250px;
  top: -80px;
  right: -80px;
  animation-delay: 0s;
}

.cb2 {
  width: 180px;
  height: 180px;
  bottom: -50px;
  left: -60px;
  animation-delay: 2s;
}

.cb3 {
  width: 120px;
  height: 120px;
  top: 40%;
  right: 20%;
  animation-delay: 4s;
}

.credit-back {
  position: fixed !important;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.9);
  z-index: 100;
}

.credit-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  padding: 20px;
}

.credit-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 40px;
  padding: 35px 30px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.credit-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 15px;
  position: relative;
}

.credit-avatar-icon {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #A855F7, #7C3AED);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  border: 4px solid white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  margin: 0 auto;
}

.credit-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  border: 4px solid #A855F7;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

.credit-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #1E3A6F;
  margin-bottom: 5px;
}

.credit-role {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: #A855F7;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.credit-info {
  background: #F3F4F6;
  border-radius: 20px;
  padding: 12px 20px;
  margin-bottom: 20px;
  width: 100%;
}

.credit-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0;
}

.credit-icon {
  font-size: 20px;
}

.credit-text {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.credit-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, #A855F7, #7C3AED, #A855F7, transparent);
  margin: 20px 0;
}

.credit-course {
  background: linear-gradient(135deg, #F3E8FF, #EDE9FE);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 20px;
}

.course-badge {
  display: inline-block;
  background: #A855F7;
  color: white;
  padding: 5px 15px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
}

.course-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #5B21B6;
  margin-bottom: 8px;
}

.course-institution {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: #6B7280;
  margin-bottom: 4px;
}

.course-year {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: #8B5CF6;
  font-weight: 700;
}

.credit-footer {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  color: #9CA3AF;
  margin-top: 15px;
}

/* Tombol kredit di home */
.credit-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #A855F7, #7C3AED);
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  z-index: 100;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.credit-button:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Tutorial */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tutorial-overlay.show {
  opacity: 1;
  visibility: visible;
}

.tutorial-card {
  background: linear-gradient(145deg, #FFFFFF, #F2FCE6);
  border-radius: 24px;
  max-width: 320px;
  width: 90%;
  padding: 16px 20px 20px 20px;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(111, 207, 151, 0.3);
}

.tutorial-overlay.show .tutorial-card {
  transform: scale(1);
}

.tutorial-card h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  background: linear-gradient(135deg, #2D8C5A, #5DBF87);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

.tutorial-mode-badge {
  display: inline-block;
  background: linear-gradient(135deg, #A8E6CF, #7ECBA5);
  color: #1B5E3F;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
  border: 1px solid rgba(111, 207, 151, 0.3);
}

.tutorial-steps {
  text-align: left;
  margin: 12px 0;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.tutorial-steps::-webkit-scrollbar {
  width: 3px;
}

.tutorial-steps::-webkit-scrollbar-track {
  background: #D8F0E5;
  border-radius: 10px;
}

.tutorial-steps::-webkit-scrollbar-thumb {
  background: #7ECBA5;
  border-radius: 10px;
}

.tutorial-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #C8E6D9;
}

.tutorial-step:last-child {
  border-bottom: none;
}

.tutorial-step-icon {
  width: 26px;
  height: 26px;
  background: linear-gradient(145deg, #7ECBA5, #5DBF87);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.tutorial-step-text {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: #4B5563;
  line-height: 1.3;
}

.tutorial-step-text strong {
  color: #1B5E3F;
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}

.tutorial-tip {
  background: linear-gradient(135deg, #E8F8F0, #D4F0E8);
  border-radius: 14px;
  padding: 8px 10px;
  margin: 10px 0;
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  color: #2D8C5A;
  text-align: center;
  font-weight: 600;
  border-left: 3px solid #5DBF87;
}

.tutorial-dont-show {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  color: #5DBF87;
}

.tutorial-dont-show input {
  width: 12px;
  height: 12px;
  cursor: pointer;
  accent-color: #5DBF87;
}

.tutorial-btn {
  background: linear-gradient(135deg, #5DBF87, #3D9E6A);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 50px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
  width: 100%;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 5px rgba(93, 191, 135, 0.3);
}

.tutorial-btn:hover {
  transform: scale(1.02);
  background: linear-gradient(135deg, #4DB07A, #2D8C5A);
  box-shadow: 0 4px 10px rgba(93, 191, 135, 0.4);
}

/* Transisi Screen */
.screen {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen.active {
  animation: screenFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes screenFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Lives */
.lives-display {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.1);
  padding: 5px 12px;
  border-radius: 50px;
  margin-left: auto;
}

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

.life-icon.lost {
  opacity: 0.3;
}


.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tutorial-overlay.show {
  opacity: 1;
  visibility: visible;
}

.tutorial-card {
  background: white;
  border-radius: 40px;
  max-width: 500px;
  width: 90%;
  padding: 30px;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.tutorial-overlay.show .tutorial-card {
  transform: scale(1);
}

.tutorial-card h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 28px;
  color: #1E3A6F;
  margin-bottom: 20px;
}

.tutorial-steps {
  text-align: left;
  margin: 20px 0;
}

.tutorial-step {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid #E5E7EB;
}

.tutorial-step-icon {
  width: 40px;
  height: 40px;
  background: #5DBF87;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
}

.tutorial-step-text {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: #374151;
}

.tutorial-step-text strong {
  color: #1E3A6F;
  display: block;
  font-size: 16px;
}

.tutorial-btn {
  background: linear-gradient(135deg, #5DBF87, #3D9E6A);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.2s;
}

.tutorial-btn:hover {
  transform: scale(1.02);
  background: linear-gradient(135deg, #4DB07A, #2D8C5A);
}

/* Icon gambar di tutorial */
.tutorial-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.tutorial-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #A8E6CF, #7ECBA5);
  color: #1B5E3F;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  border: 1px solid rgba(111, 207, 151, 0.3);
}

.tutorial-mode-badge span {
  display: none;
}

.screen {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen.active {
  animation: screenFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes screenFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.leaderboard-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 40px;
  width: 90%;
  max-width: 400px;
  z-index: 2000;
  padding: 25px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.leaderboard-panel.show {
  opacity: 1;
  visibility: visible;
}

.leaderboard-panel h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  color: #1E3A6F;
  text-align: center;
  margin-bottom: 20px;
}

.leaderboard-list {
  max-height: 300px;
  overflow-y: auto;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid #E5E7EB;
  font-family: 'Nunito', sans-serif;
}

.leaderboard-rank {
  font-weight: 800;
  color: #A855F7;
  width: 40px;
}

.leaderboard-score {
  font-weight: 800;
  color: #FF6B35;
}

.leaderboard-close {
  background: #E5E7EB;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  cursor: pointer;
  margin-top: 15px;
  width: 100%;
}

.leaderboard-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: linear-gradient(135deg, #FF6B35, #F7931E);
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 100;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.leaderboard-btn:hover {
  transform: scale(1.05);
}

.lives-display {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.1);
  padding: 5px 12px;
  border-radius: 50px;
  margin-left: auto;
}

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

.life-icon.lost {
  opacity: 0.3;
}

/* Game Over Modal */
.gameover-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.gameover-modal.show {
  opacity: 1;
  visibility: visible;
}

.gameover-card {
  background: white;
  border-radius: 40px;
  padding: 30px;
  text-align: center;
  max-width: 350px;
  width: 90%;
}

.gameover-card h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 28px;
  color: #EF4444;
  margin-bottom: 15px;
}

.gameover-card p {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.gameover-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.gameover-btn {
  padding: 10px 20px;
  border-radius: 50px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.gameover-btn.retry {
  background: #22C55E;
  color: white;
}

.gameover-btn.home {
  background: #E5E7EB;
  color: #374151;
}

/* Responsive untuk credit */
@media (max-width: 500px) {
  .credit-card {
    padding: 25px 20px;
  }

  .credit-name {
    font-size: 20px;
  }

  .credit-avatar-icon {
    width: 80px;
    height: 80px;
    font-size: 40px;
  }

  .credit-avatar {
    width: 80px;
    height: 80px;
  }

  .course-title {
    font-size: 14px;
  }
}

.mode-card .mode-icon-wrapper {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.mode-card .mode-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  object-position: center;
}

.mode-card:first-child .mode-icon {
  margin-top: 12px;
}

/* Responsif HP */
/* Tutorial */
.tutorial-overlay {
  padding: 20px;
  overflow-y: auto !important;
  align-items: flex-start !important;
  padding-top: 40px !important;
}

.tutorial-card {
  max-height: 90vh !important;
  overflow-y: auto !important;
  margin: auto !important;
}

.tutorial-steps {
  max-height: 180px !important;
}

/* Header */
@media (max-width: 480px) {
  .header-top-row {
    gap: 4px !important;
    flex-wrap: wrap !important;
  }

  .mode-badge {
    font-size: 10px !important;
    padding: 2px 8px !important;
  }

  .mode-badge-img {
    width: 16px !important;
    height: 16px !important;
  }

  .level-badge {
    font-size: 9px !important;
    padding: 2px 8px !important;
    margin-left: 2px !important;
  }

  .level-badge::before {
    font-size: 8px !important;
  }

  .score-badge {
    font-size: 10px !important;
    padding: 2px 8px !important;
    position: static !important;
    transform: none !important;
    margin-left: auto !important;
    background: transparent !important;
    border: none !important;
  }

  .lives-display {
    padding: 2px 6px !important;
    gap: 2px !important;
    margin-left: 4px !important;
  }

  .life-icon {
    font-size: 12px !important;
  }

  .back-circle.dark {
    width: 30px !important;
    height: 30px !important;
  }

  .back-circle.dark svg {
    width: 14px !important;
    height: 14px !important;
  }

  .game-header {
    padding: 6px 10px !important;
    gap: 4px !important;
  }

  .progress-bar {
    height: 6px !important;
  }

  .progress-wrap span {
    font-size: 10px !important;
    min-width: 30px !important;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .game-header {
    padding: 4px 10px !important;
    gap: 2px !important;
  }

  .header-top-row {
    gap: 3px !important;
  }

  .mode-badge {
    font-size: 9px !important;
    padding: 2px 6px !important;
  }

  .mode-badge-img {
    width: 14px !important;
    height: 14px !important;
  }

  .level-badge {
    font-size: 8px !important;
    padding: 1px 6px !important;
  }

  .level-badge::before {
    font-size: 7px !important;
  }

  .score-badge {
    font-size: 9px !important;
    padding: 1px 6px !important;
  }

  .lives-display {
    padding: 1px 4px !important;
    gap: 1px !important;
  }

  .life-icon {
    font-size: 10px !important;
  }

  .back-circle.dark {
    width: 24px !important;
    height: 24px !important;
  }

  .back-circle.dark svg {
    width: 12px !important;
    height: 12px !important;
  }

  .progress-bar {
    height: 4px !important;
  }

  .progress-wrap span {
    font-size: 9px !important;
    min-width: 24px !important;
  }

  .game-body {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  /* Tutorial di landscape */
  .tutorial-card {
    max-width: 70% !important;
    max-height: 80vh !important;
    padding: 12px 16px !important;
  }

  .tutorial-card h3 {
    font-size: 16px !important;
  }

  .tutorial-steps {
    max-height: 80px !important;
  }

  .tutorial-step {
    padding: 4px 0 !important;
  }

  .tutorial-step-icon {
    width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
  }

  .tutorial-step-text {
    font-size: 10px !important;
  }

  .tutorial-step-text strong {
    font-size: 11px !important;
  }

  .tutorial-tip {
    font-size: 9px !important;
    padding: 4px 8px !important;
    margin: 6px 0 !important;
  }

  .tutorial-btn {
    font-size: 11px !important;
    padding: 6px 12px !important;
    margin-top: 6px !important;
  }

  .tutorial-dont-show {
    font-size: 9px !important;
    margin-top: 4px !important;
  }
}

/* Konfirmasi */
@media (max-width: 480px) {
  .modal-confirm {
    padding: 20px !important;
    max-width: 300px !important;
  }

  .modal-confirm h3 {
    font-size: 20px !important;
  }

  .modal-confirm p {
    font-size: 13px !important;
  }

  .modal-btn {
    padding: 8px 16px !important;
    font-size: 12px !important;
  }
}

/* Home */
@media (max-width: 480px) {
  .home-content {
    padding: 10px 12px 60px !important;
    gap: 12px !important;
  }

  .logo-img {
    width: 150px !important;
    height: 150px !important;
  }

  .logo-title {
    font-size: 30px !important;
  }

  .logo-sub {
    font-size: 12px !important;
  }

  .home-modes {
    gap: 8px !important;
  }

  .mode-card {
    padding: 10px 6px !important;
    gap: 4px !important;
  }

  .mode-icon {
    width: 36px !important;
    height: 36px !important;
  }

  .mode-name {
    font-size: 11px !important;
  }

  .mode-desc {
    font-size: 8px !important;
  }

  .stat-chip-top {
    font-size: 10px !important;
    padding: 4px 12px !important;
  }

  .stat-chip-top strong {
    font-size: 12px !important;
  }

  .sound-toggle {
    font-size: 12px !important;
    padding: 4px 12px !important;
    top: 12px !important;
    right: 12px !important;
  }

  .credit-button {
    font-size: 12px !important;
    padding: 6px 14px !important;
    bottom: 12px !important;
    right: 12px !important;
  }

  .home-stats-left {
    top: 12px !important;
    left: 12px !important;
    gap: 4px !important;
  }
}

/* Level */
@media (max-width: 480px) {
  #screen-level-select {
    padding-top: 50px !important;
  }

  .level-select-title {
    font-size: 22px !important;
  }

  .level-icon-img {
    width: 40px !important;
    height: 40px !important;
  }

  .level-select-subtitle {
    font-size: 12px !important;
    padding: 3px 12px !important;
  }

  .level-grid {
    gap: 12px 16px !important;
    padding: 10px 5px !important;
  }

  .level-btn {
    width: 60px !important;
    height: 60px !important;
  }

  .level-btn .lvl-number {
    font-size: 16px !important;
  }

  .level-btn .lvl-emoji {
    font-size: 14px !important;
  }

  .level-btn .lvl-diff {
    font-size: 6px !important;
    padding: 1px 4px !important;
  }

  .level-btn .lvl-stars {
    font-size: 6px !important;
  }

  .level-legend {
    gap: 12px !important;
    padding: 4px 12px !important;
  }

  .legend-item {
    font-size: 10px !important;
    gap: 4px !important;
  }

  .legend-dot {
    width: 10px !important;
    height: 10px !important;
  }
}

/* Result */
@media (max-width: 480px) {
  .result-content {
    padding: 20px 16px !important;
    gap: 12px !important;
  }

  .result-emoji-wrap {
    width: 120px !important;
    height: 120px !important;
  }

  .result-emoji-wrap .result-icon {
    width: 120px !important;
    height: 120px !important;
  }

  .result-title {
    font-size: 28px !important;
  }

  .result-subtitle {
    font-size: 13px !important;
  }

  .result-stats {
    gap: 10px !important;
  }

  .rstat {
    padding: 12px 16px !important;
  }

  .rstat-val {
    font-size: 20px !important;
  }

  .rstat-label {
    font-size: 10px !important;
  }

  .result-actions {
    gap: 8px !important;
  }

  .result-actions .btn-primary,
  .result-actions .btn-secondary,
  #btn-next-level {
    font-size: 13px !important;
    padding: 10px 16px !important;
    min-width: 100px !important;
  }
}

/* Credit */
.credit-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  padding: 20px;
  margin: 0 auto;
}

.credit-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 40px;
  padding: 30px 24px 25px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.credit-avatar {
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
  position: relative;
  flex-shrink: 0;
}

.credit-avatar-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #A855F7, #7C3AED);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  border: 4px solid white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  margin: 0 auto;
}

.credit-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  border: 4px solid #A855F7;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

.credit-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #1E3A6F;
  margin-bottom: 4px;
  margin-top: 4px;
}

.credit-role {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: #A855F7;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.credit-info {
  background: #F3F4F6;
  border-radius: 20px;
  padding: 10px 16px;
  margin-bottom: 16px;
  width: 100%;
}

.credit-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0;
}

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

.credit-text {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

.credit-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, #A855F7, #7C3AED, #A855F7, transparent);
  margin: 16px 0;
}

.credit-course {
  background: linear-gradient(135deg, #F3E8FF, #EDE9FE);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
}

.course-badge {
  display: inline-block;
  background: #A855F7;
  color: white;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 10px;
}

.course-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #5B21B6;
  margin-bottom: 6px;
}

.course-institution {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: #6B7280;
  margin-bottom: 3px;
}

.course-year {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  color: #8B5CF6;
  font-weight: 700;
}

.credit-footer {
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  color: #9CA3AF;
  margin-top: 12px;
}

@media (max-width: 480px) {
  .credit-content {
    padding: 10px;
    max-width: 100%;
  }

  .credit-card {
    padding: 20px 16px 18px 16px;
    border-radius: 28px;
  }

  .credit-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
  }

  .credit-avatar-icon {
    width: 80px;
    height: 80px;
    font-size: 32px;
  }

  .credit-photo {
    width: 80px;
    height: 80px;
  }

  .credit-name {
    font-size: 18px;
  }

  .credit-role {
    font-size: 11px;
    margin-bottom: 12px;
  }

  .credit-info {
    padding: 8px 12px;
    margin-bottom: 12px;
  }

  .credit-item {
    padding: 6px 0;
    gap: 10px;
  }

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

  .credit-text {
    font-size: 11px;
  }

  .credit-divider {
    margin: 12px 0;
  }

  .credit-course {
    padding: 12px;
    margin-bottom: 12px;
  }

  .course-badge {
    font-size: 9px;
    padding: 3px 10px;
    margin-bottom: 8px;
  }

  .course-title {
    font-size: 13px;
  }

  .course-institution {
    font-size: 10px;
  }

  .course-year {
    font-size: 9px;
  }

  .credit-footer {
    font-size: 8px;
    margin-top: 10px;
  }

  .credit-back {
    width: 32px !important;
    height: 32px !important;
    top: 12px !important;
    left: 12px !important;
  }

  .credit-back svg {
    width: 16px !important;
    height: 16px !important;
  }
}

body {
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
}