/* ===========================================
   TÜRKÇE HECE ÖĞRENME OYUNLARI
   Ortak Tasarım Sistemi
   =========================================== */

/* CSS Değişkenleri - Renk Paleti */
:root {
  /* Ünlü Renkleri */
  --color-a: #ff6b6b;
  --color-e: #ffa94d;
  --color-i: #ffe066;
  --color-ii: #69db7c; /* İ */
  --color-o: #74c0fc;
  --color-oo: #b197fc; /* Ö */
  --color-u: #f783ac;
  --color-uu: #e64980; /* Ü */

  /* Pastel versiyonlar */
  --color-a-light: #ffe8e8;
  --color-e-light: #fff0e0;
  --color-i-light: #fff9e0;
  --color-ii-light: #e8f8eb;
  --color-o-light: #e8f4ff;
  --color-oo-light: #f0ebff;
  --color-u-light: #ffe8f2;
  --color-uu-light: #ffe0eb;

  /* Genel Renkler */
  --primary: #6c5ce7;
  --primary-dark: #5b4bd4;
  --secondary: #00cec9;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-800: #343a40;
  --dark: #2d3436;

  /* Gradyanlar */
  --gradient-rainbow: linear-gradient(
    135deg,
    #ff6b6b,
    #ffa94d,
    #ffe066,
    #69db7c,
    #74c0fc,
    #b197fc,
    #f783ac
  );
  --gradient-fun: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-sunny: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-ocean: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

  /* Gölgeler */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.4);

  /* Geçişler */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --radius-full: 50%;

  /* Font */
  --font-main: "Nunito", "Segoe UI", sans-serif;
}

/* Google Font Import */
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap");

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background: linear-gradient(180deg, #f8f9ff 0%, #e8f4ff 100%);
  min-height: 100vh;
  color: var(--dark);
  overflow-x: hidden;
}

/* ===========================================
   Animasyonlar
   =========================================== */

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

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

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

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

@keyframes pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 5px currentColor;
  }
  50% {
    box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
  }
}

@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(720deg);
    opacity: 0;
  }
}

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

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

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

/* ===========================================
   Temel Bileşenler
   =========================================== */

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Başlıklar */
.page-title {
  font-size: 2.5rem;
  font-weight: 900;
  text-align: center;
  background: var(--gradient-rainbow);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow 4s ease infinite;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
  font-size: 1.25rem;
  text-align: center;
  color: var(--gray-800);
  margin-bottom: 30px;
}

/* Butonlar */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-main);
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient-fun);
  color: var(--white);
}

.btn-success {
  background: linear-gradient(135deg, #00b894, #00cec9);
  color: var(--white);
}

.btn-warning {
  background: linear-gradient(135deg, #fdcb6e, #f39c12);
  color: var(--dark);
}

.btn-danger {
  background: linear-gradient(135deg, #e17055, #d63031);
  color: var(--white);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.3rem;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* Kartlar */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  transition: all var(--transition-normal);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.game-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--gradient-rainbow);
}

.game-card-icon {
  font-size: 4rem;
  margin: 20px 0;
  animation: float 3s ease-in-out infinite;
}

.game-card-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--primary);
}

.game-card-desc {
  font-size: 1rem;
  color: var(--gray-800);
  line-height: 1.6;
}

/* ===========================================
   Hece Blokları
   =========================================== */

.syllable {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 60px;
  padding: 10px 16px;
  font-size: 1.5rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.syllable:hover {
  transform: scale(1.1);
}

.syllable:active {
  transform: scale(0.95);
}

.syllable.correct {
  animation: bounce 0.5s ease;
}

.syllable.wrong {
  animation: shake 0.5s ease;
}

/* Ünlüye Göre Hece Renkleri */
.syllable-a {
  background: var(--color-a-light);
  border-color: var(--color-a);
  color: #c0392b;
}
.syllable-e {
  background: var(--color-e-light);
  border-color: var(--color-e);
  color: #d35400;
}
.syllable-i {
  background: var(--color-i-light);
  border-color: var(--color-i);
  color: #f39c12;
}
.syllable-ii {
  background: var(--color-ii-light);
  border-color: var(--color-ii);
  color: #27ae60;
}
.syllable-o {
  background: var(--color-o-light);
  border-color: var(--color-o);
  color: #2980b9;
}
.syllable-oo {
  background: var(--color-oo-light);
  border-color: var(--color-oo);
  color: #8e44ad;
}
.syllable-u {
  background: var(--color-u-light);
  border-color: var(--color-u);
  color: #e84393;
}
.syllable-uu {
  background: var(--color-uu-light);
  border-color: var(--color-uu);
  color: #c0392b;
}

/* ===========================================
   Skor ve İstatistikler
   =========================================== */

.score-board {
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 15px 30px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 700;
}

.score-icon {
  font-size: 1.5rem;
}

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

/* Yıldızlar */
.stars {
  display: flex;
  gap: 5px;
}

.star {
  font-size: 2rem;
  color: var(--gray-300);
  transition: all var(--transition-fast);
}

.star.active {
  color: #f1c40f;
  animation: pop 0.3s ease;
}

/* ===========================================
   Modal
   =========================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

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

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  transform: scale(0.8);
  transition: all var(--transition-normal);
}

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

.modal-icon {
  font-size: 5rem;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 15px;
  color: var(--primary);
}

.modal-message {
  font-size: 1.1rem;
  color: var(--gray-800);
  margin-bottom: 25px;
}

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

/* ===========================================
   Progress Bar
   =========================================== */

.progress-container {
  width: 100%;
  height: 20px;
  background: var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin: 15px 0;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-rainbow);
  background-size: 200% auto;
  border-radius: var(--radius-xl);
  transition: width var(--transition-normal);
  animation: rainbow 2s ease infinite;
}

/* ===========================================
   Oyun Alanı
   =========================================== */

.game-container {
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.back-button:hover {
  background: var(--gray-200);
}

.sound-toggle {
  width: 44px;
  height: 44px;
  margin-left: 12px;
  padding: 0;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: all var(--transition-fast);
  user-select: none;
}

.sound-toggle:hover {
  background: var(--gray-200);
  transform: translateY(-1px);
}

.sound-toggle:active {
  transform: translateY(0);
}

.sound-toggle:focus-visible {
  outline: 3px solid rgba(108, 92, 231, 0.35);
  outline-offset: 2px;
}

.sound-toggle[data-enabled="false"] {
  opacity: 0.6;
  filter: grayscale(40%);
}

/* ===========================================
   Responsive
   =========================================== */

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .page-title {
    font-size: 2rem;
  }

  .container {
    padding: 15px;
  }

  .score-board {
    flex-wrap: wrap;
    gap: 15px;
  }

  .modal {
    padding: 30px 20px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 12px;
  }

  .btn {
    padding: 10px 20px;
  }

  .syllable {
    min-width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
}

/* ===========================================
   Konfeti Efekti
   =========================================== */

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 3s ease-in-out forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(-100px) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}
