@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&display=swap");

:root {
  --primary: #ff6b6b;
  --secondary: #4ecdc4;
  --accent: #ffe66d;
  --success: #6bcb77;
  --background: #f7fbff;
  --card-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --radius: 24px;
  --font-main: "Outfit", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--background);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)),
    url("assets/hero.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  color: #2d3436;
  overflow-x: hidden;
}

/* Login Screen */
.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f7ff 0%, #e6fffb 100%);
  padding: 20px;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
  text-align: center;
  max-width: 400px;
  width: 100%;
  border: 4px solid var(--accent);
}

.login-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.login-box h1 {
  color: var(--primary);
  margin-bottom: 10px;
}

#user-name-input {
  width: 100%;
  padding: 15px 20px;
  font-size: 1.2rem;
  border-radius: 15px;
  border: 2px solid #ddd;
  margin-top: 10px;
  text-align: center;
  font-weight: 600;
  color: var(--primary);
  transition: all 0.3s;
}

#user-name-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(77, 171, 245, 0.1);
}

#app {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  min-height: 100vh;
}

/* Animations */
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Home Screen */
.home-screen {
  text-align: center;
  padding-top: 40px;
}

.home-header {
  margin-bottom: 40px;
}

.home-header h1 {
  font-size: 3rem;
  color: var(--primary);
  text-shadow: 2px 2px 0 var(--accent);
  margin-bottom: 10px;
}

.home-header p {
  font-size: 1.2rem;
  color: #636e72;
}

/* Category Sections */
.category-section {
  margin-bottom: 50px;
  padding: 0 10px;
}

.category-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 1.6rem;
  color: var(--secondary);
  margin-bottom: 25px;
  padding: 15px;
  background: white;
  border-radius: 30px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  position: sticky;
  top: 10px;
  z-index: 10;
  border: 2px solid #fff5f5;
}

.category-title span {
  font-size: 2.2rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.game-card {
  background: var(--card-bg);
  border: 3px solid white;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  backdrop-filter: blur(10px);
}

.game-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--secondary);
}

.game-card .icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
  animation: bounce 3s infinite ease-in-out;
}

.game-card h3 {
  font-size: 1.2rem;
  color: #2d3436;
}

/* Game Views */
.game-view {
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
}

.game-view.active {
  display: flex;
}

.btn-back {
  align-self: flex-start;
  background: white;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 600;
  margin-bottom: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.game-container {
  width: 100%;
  background: white;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

/* Game 1: Tebak Hewan */
.animal-img-container {
  width: 250px;
  height: 250px;
  margin: 0 auto 30px;
  background: #f0f7ff;
  border-radius: 50%;
  padding: 20px;
  border: 8px solid var(--accent);
}

.animal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.choices {
  display: grid;
  gap: 12px;
}

.btn-choice {
  background: white;
  border: 4px solid #f1f2f6;
  padding: 18px;
  border-radius: 20px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #444;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 6px 0 #f1f2f6;
  position: relative;
}

.btn-choice:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #f1f2f6;
}

.btn-choice:hover {
  background: var(--accent);
  border-color: #ffd93d;
  transform: scale(1.02);
}

.btn-choice.correct {
  background: var(--success);
  color: white;
  transform: scale(1.05);
}

.btn-choice.wrong {
  background: var(--primary);
  color: white;
  animation: shake 0.5s;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* More Game Styles */
.score-badge {
  background: var(--secondary);
  color: white;
  padding: 8px 20px;
  border-radius: 50px;
  margin-bottom: 20px;
  font-weight: 800;
}

/* Memory Cards */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  perspective: 1000px;
}

.memory-card {
  aspect-ratio: 1;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  cursor: pointer;
}

.memory-card.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border-radius: 12px;
  border: 3px solid white;
}

.card-front {
  background: var(--primary);
  color: white;
}

.card-back {
  background: white;
  transform: rotateY(180deg);
}

/* Math Game */
.object-display {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  min-height: 150px;
}

.math-object {
  font-size: 3.5rem;
  animation: bounce 2s infinite ease-in-out;
}

/* Puzzle */
.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: #ddd;
  border: 4px solid #fff;
  border-radius: 12px;
  overflow: hidden;
  width: 300px;
  height: 300px;
  margin: 0 auto;
}

.puzzle-tile {
  width: 100px;
  height: 100px;
  background-size: 300px 300px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Colors Game */
.color-splash {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 0 auto 30px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.1);
}

/* Habits Game */
.habit-img {
  width: 100%;
  max-height: 250px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 20px;
}

/* Game Intro & Voice */
.game-intro {
  padding: 20px;
  text-align: center;
}

.voice-btn {
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  padding: 8px 15px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  cursor: pointer;
  margin-bottom: 20px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.voice-btn:hover {
  background: var(--accent);
  border-color: #ffd93d;
  transform: scale(1.05);
}

.voice-btn:active {
  transform: scale(0.95);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Footer Style */
.app-footer {
  text-align: center;
  padding: 20px;
  margin: 40px auto 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  color: #2d3436;
  font-size: 1rem;
  font-weight: 600;
  border: 3px solid var(--accent);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.app-footer a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: bold;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* Ad Slots */
.ad-slot {
  margin: 30px auto;
  width: 100%;
  max-width: 500px;
  text-align: center;
}

.ad-slot small {
  display: block;
  color: #b2bec3;
  font-size: 0.7rem;
  margin-bottom: 5px;
  letter-spacing: 1px;
  font-weight: 600;
}

.ad-placeholder {
  background: rgba(255, 255, 255, 0.5);
  border: 3px dashed #dfe6e9;
  border-radius: 20px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b2bec3;
  font-size: 0.9rem;
  backdrop-filter: blur(5px);
  transition: all 0.3s;
}

.ad-placeholder:hover {
  border-color: var(--secondary);
  background: rgba(255, 255, 255, 0.8);
}

