/* Login Sayfası Stilleri */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Default body styles for login page */
body.login-page { 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Main menu page body styles */
body.main-menu-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-attachment: fixed;
}

.login-container { 
  max-width: 420px; 
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px; 
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.05);
  padding: 40px 35px;
  animation: slideUp 0.6s ease-out;
  position: relative;
}

/* Enhanced Visual Effects */
.login-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05),
    transparent,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.1)
  );
  border-radius: 22px;
  z-index: -1;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Login Header Styles */
.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  font-weight: 400;
}

/* Auth Tabs Styles */
.auth-tabs {
  display: flex;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 4px;
  position: relative;
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

/* Auth Form Styles */
.auth-form {
  animation: fadeInForm 0.4s ease-out;
}

.auth-form h2 {
  text-align: center;
  color: #ffffff;
  margin-bottom: 25px;
  font-size: 24px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Auth Button Styles */
.auth-btn {
  width: 100%;
  padding: 15px;
  margin: 20px 0 15px 0;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
  position: relative;
  overflow: hidden;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.6);
  background: linear-gradient(135deg, #45a049, #3d8b3d);
}

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

.auth-btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.auth-btn:hover:before {
  left: 100%;
}

/* Improved Form Validation States */
input:valid:not(:placeholder-shown) {
  border-color: rgba(81, 207, 102, 0.6);
  box-shadow: 0 0 10px rgba(81, 207, 102, 0.2);
}

input:invalid:not(:placeholder-shown) {
  border-color: rgba(255, 107, 107, 0.6);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.2);
}

/* Message Styles */
.message {
  margin-top: 15px;
  min-height: 20px;
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInForm {
  0% {
    opacity: 0;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

h2 { 
  text-align: center; 
  color: #ffffff;
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

input { 
  width: 100%; 
  padding: 15px 20px; 
  border-radius: 12px; 
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 0 20px rgba(255, 255, 255, 0.1),
    0 0 0 3px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

input:invalid {
  border-color: rgba(255, 107, 107, 0.6);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

input:valid {
  border-color: rgba(81, 207, 102, 0.6);
}

button { 
  width: 100%; 
  margin: 15px 0; 
  padding: 15px; 
  border-radius: 12px; 
  border: none;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

button:active {
  transform: translateY(0);
}

.auth-form.success .auth-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  animation: successPulse 0.6s ease-out;
}

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

/* Error state styling improvements */
.error {
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ff6b6b;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 15px 0;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  animation: errorShake 0.5s ease-in-out;
  backdrop-filter: blur(10px);
}

.success {
  background: rgba(81, 207, 102, 0.15);
  border: 1px solid rgba(81, 207, 102, 0.4);
  color: #51cf66;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 15px 0;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  animation: successSlide 0.5s ease-out;
  backdrop-filter: blur(10px);
}

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

@keyframes fadeIn {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

.game-title {
  text-align: center;
  margin-bottom: 10px;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Oyun Sayfası Stilleri */
html, body.game-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
  background: linear-gradient(to bottom, #a0e3f0, #ffffff);
  font-family: 'Arial', sans-serif;
}

canvas {
  display: block;
  margin: auto;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  touch-action: none;
  z-index: 1;
}

#message {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  max-width: 85vw;
  text-align: center;
  z-index: 100;
  
  /* Modern glassmorphism design */
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  
  /* Animation */
  animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

#message .game-over-title {
  font-size: 28px;
  font-weight: 800;
  color: #2c3e50;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#message .score-display {
  font-size: 48px;
  font-weight: 900;
  color: #e74c3c;
  margin: 16px 0;
  text-shadow: 0 3px 6px rgba(231, 76, 60, 0.3);
  letter-spacing: -1px;
}

#message .restart-hint {
  font-size: 14px;
  color: #7f8c8d;
  margin-top: 20px;
  font-weight: 500;
  opacity: 0.9;
}

#message .restart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

#message .restart-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

#message .restart-button:active {
  transform: translateY(0);
}

#globalHighSmall {
  position: absolute;
  left: 20px;
  top: 120px;
  font-size: 13px;
  color: #00796b;
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  padding: 2px 10px;
  z-index: 12;
  font-weight: normal;
  opacity: 0.85;
  pointer-events: none;
}

/* Ana Menü Stilleri */
#mainMenu {
  position: relative;
  width: 100%;
  max-width: 800px;
  min-height: auto;
  text-align: center;
  z-index: 15;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 40px 30px;
  margin: 20px auto;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.05);
  animation: fadeInScale 0.5s ease-out;
}

#mainMenu h1 {
  font-size: 36px;
  font-weight: 800;
  color: #2c3e50;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#mainMenu .subtitle {
  font-size: 14px;
  color: #7f8c8d;
  margin-bottom: 30px;
}

.menu-button {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 15px 20px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.menu-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

.menu-button.secondary {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.menu-button.secondary:hover {
  box-shadow: 0 6px 16px rgba(149, 165, 166, 0.4);
}

/* Main menu container wrapper for better scrolling */
.main-menu-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Ana Menü Oyun Seçimi - Modernize */
.welcome-message {
  text-align: center;
  color: #ffffff;
  font-size: 18px;
  margin: 20px 0 35px 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  padding: 18px 20px;
  border-radius: 15px;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin: 35px 0;
  align-items: start;
  justify-content: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.game-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 30px 25px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.08);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    transparent 0%,
    rgba(255, 255, 255, 0.1) 40%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 60%,
    transparent 100%
  );
  background-size: 200px 100%;
  background-repeat: no-repeat;
  background-position: -200px 0;
  transition: opacity 0.3s ease;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  border-color: rgba(255, 255, 255, 0.4);
}

.game-card:hover::before {
  animation: shimmer 1.5s ease-in-out;
}

.game-card:active {
  transform: translateY(-4px) scale(1.01);
}

.game-icon {
  font-size: 56px;
  margin-bottom: 20px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  transition: all 0.3s ease;
}

.game-card:hover .game-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

.game-card h3 {
  color: #ffffff;
  font-size: 22px;
  margin-bottom: 12px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.game-card p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  margin-bottom: 20px;
  font-weight: 400;
  line-height: 1.4;
}

.play-button {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 15px rgba(40, 167, 69, 0.4),
    0 2px 8px rgba(40, 167, 69, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-card:hover .play-button {
  background: linear-gradient(135deg, #20c997, #17a2b8);
  transform: translateY(-2px) scale(1.08);
  box-shadow: 
    0 8px 25px rgba(32, 201, 151, 0.5),
    0 4px 15px rgba(32, 201, 151, 0.4);
}

.menu-actions {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Leaderboard Stilleri */
#leaderboard {
  display: none;
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 20px auto;
  z-index: 15;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#leaderboard h2 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 20px;
  font-size: 24px;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #2c3e50;
}

.leaderboard-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #2c3e50;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.leaderboard-entry .rank {
  font-weight: bold;
  font-size: 18px;
  width: 35px;
  color: #3498db;
}

.leaderboard-entry .name {
  flex: 1;
  text-align: left;
  margin-left: 15px;
  font-weight: 500;
}

.leaderboard-entry .score {
  font-weight: 600;
  color: #e74c3c;
  font-size: 16px;
}

.leaderboard-rank {
  font-weight: bold;
  font-size: 18px;
  width: 30px;
}

.leaderboard-name {
  flex: 1;
  text-align: left;
  margin-left: 15px;
}

.leaderboard-score {
  font-weight: 600;
  color: #e74c3c;
}

.game-selector,
.game-buttons {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  gap: 10px;
  flex-wrap: wrap;
}

.game-select-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.game-select-btn.active {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

.game-select-btn:hover {
  transform: translateY(-1px);
}

/* Ayarlar Stilleri */
#settings {
  display: none;
  position: relative;
  width: 100%;
  max-width: 450px;
  margin: 20px auto;
  z-index: 15;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#settings h2 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 25px;
  font-size: 24px;
}

.setting-group {
  margin-bottom: 25px;
}

.setting-group label {
  display: block;
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 16px;
}

.setting-label {
  display: block;
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 8px;
}

.color-options {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.color-option {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  text-indent: -9999px;
}

.color-option.selected {
  border-color: #2c3e50;
  box-shadow: 0 0 10px rgba(44, 62, 80, 0.5);
  transform: scale(1.1);
}

.color-option:hover {
  transform: scale(1.05);
}

/* Background Color Options */
.color-option[data-bg="default"] {
  background: linear-gradient(to bottom, #a0e3f0, #ffffff);
}

.color-option[data-bg="sunset"] {
  background: linear-gradient(to bottom, #ff7e5f, #feb47b);
}

.color-option[data-bg="ocean"] {
  background: linear-gradient(to bottom, #2196F3, #21CBF3);
}

.color-option[data-bg="forest"] {
  background: linear-gradient(to bottom, #56ab2f, #a8e6cf);
}

.color-option[data-bg="purple"] {
  background: linear-gradient(to bottom, #667eea, #764ba2);
}

.color-option[data-bg="night"] {
  background: linear-gradient(to bottom, #2c3e50, #3498db);
}

/* Pipe Color Options */
.color-option[data-pipe="default"] {
  background: #001f4d;
}

.color-option[data-pipe="green"] {
  background: #27ae60;
}

.color-option[data-pipe="red"] {
  background: #e74c3c;
}

.color-option[data-pipe="purple"] {
  background: #8e44ad;
}

.color-option[data-pipe="orange"] {
  background: #f39c12;
}

.color-option[data-pipe="brown"] {
  background: #8b4513;
}

/* Ball/Bird Color Options */
.color-option[data-ball="yellow"] {
  background: radial-gradient(circle at 30% 30%, #ffdd00, #e1b900);
}

.color-option[data-ball="red"] {
  background: radial-gradient(circle at 30% 30%, #e74c3c, #c0392b);
}

.color-option[data-ball="blue"] {
  background: radial-gradient(circle at 30% 30%, #3498db, #2980b9);
}

.color-option[data-ball="green"] {
  background: radial-gradient(circle at 30% 30%, #27ae60, #219a52);
}

.color-option[data-ball="purple"] {
  background: radial-gradient(circle at 30% 30%, #8e44ad, #7d3c98);
}

.color-option[data-ball="orange"] {
  background: radial-gradient(circle at 30% 30%, #f39c12, #d68910);
}

/* Color Option Tooltips */
.color-option::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
  font-weight: 500;
}

.color-option:hover::after {
  opacity: 1;
}

/* Tooltip specific text for different color types */
.color-option[data-bg="default"]::after { content: "Varsayılan"; }
.color-option[data-bg="sunset"]::after { content: "Günbatımı"; }
.color-option[data-bg="ocean"]::after { content: "Okyanus"; }
.color-option[data-bg="forest"]::after { content: "Orman"; }
.color-option[data-bg="purple"]::after { content: "Mor"; }
.color-option[data-bg="night"]::after { content: "Gece"; }

.color-option[data-pipe="default"]::after { content: "Varsayılan"; }
.color-option[data-pipe="green"]::after { content: "Yeşil"; }
.color-option[data-pipe="red"]::after { content: "Kırmızı"; }
.color-option[data-pipe="purple"]::after { content: "Mor"; }
.color-option[data-pipe="orange"]::after { content: "Turuncu"; }
.color-option[data-pipe="brown"]::after { content: "Kahverengi"; }

.color-option[data-ball="yellow"]::after { content: "Sarı"; }
.color-option[data-ball="red"]::after { content: "Kırmızı"; }
.color-option[data-ball="blue"]::after { content: "Mavi"; }
.color-option[data-ball="green"]::after { content: "Yeşil"; }
.color-option[data-ball="purple"]::after { content: "Mor"; }
.color-option[data-ball="orange"]::after { content: "Turuncu"; }

.back-button {
  margin-top: 20px;
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

/* Mobil Kontroller */
.touch-controls {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 5;
  pointer-events: none;
}

.touch-area {
  position: absolute;
  bottom: 0;
  height: 80px;
  background: rgba(52, 152, 219, 0.2);
  border: 2px solid rgba(52, 152, 219, 0.5);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3498db;
  font-size: 24px;
  font-weight: bold;
  pointer-events: auto;
  user-select: none;
  transition: all 0.2s ease;
}

.touch-area:active {
  background: rgba(52, 152, 219, 0.4);
  transform: scale(0.95);
}

.touch-left {
  left: 20px;
  width: 80px;
}

.touch-right {
  right: 20px;
  width: 80px;
}

.touch-center {
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
}

/* Snake Game Mobile Controls */
#mobileControls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.control-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.control-btn {
  width: 60px;
  height: 60px;
  background: rgba(52, 152, 219, 0.8);
  border: 2px solid rgba(52, 152, 219, 1);
  border-radius: 15px;
  color: white;
  font-size: 24px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.control-btn:hover {
  background: rgba(52, 152, 219, 0.9);
  transform: scale(1.05);
}

.control-btn:active {
  background: rgba(52, 152, 219, 1);
  transform: scale(0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 600px) {
  #message { 
    font-size: 16px; 
    max-width: 95vw;
  }
  #globalHighSmall { 
    font-size: 11px; 
    top: 100px; 
    left: 10px; 
  }
  
  .touch-controls {
    display: none;
  }
  
  /* Login screen responsive improvements */
  .login-container {
    padding: 30px 20px;
    margin: 10px;
  }
  
  .login-header h1 {
    font-size: 28px;
  }
  
  .auth-tabs {
    margin-bottom: 25px;
  }
  
  .tab-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 25px 20px;
    max-width: 95vw;
  }
  
  .login-header h1 {
    font-size: 26px;
  }
  
  .login-header p {
    font-size: 14px;
  }
  
  .auth-form h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  input {
    padding: 12px 15px;
    font-size: 15px;
  }
  
  .auth-btn {
    padding: 12px;
    font-size: 15px;
  }
  
  .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .game-title {
    font-size: 28px;
  }
}

/* iPhone and Android specific optimizations */
@media (max-width: 414px) {
  .login-container {
    padding: 20px 15px;
    border-radius: 15px;
  }
  
  .login-header h1 {
    font-size: 24px;
    margin-bottom: 6px;
  }
  
  .login-header p {
    font-size: 13px;
  }
  
  .auth-tabs {
    padding: 3px;
    margin-bottom: 20px;
  }
  
  .tab-btn {
    padding: 8px 10px;
    font-size: 11px;
  }
  
  input {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .auth-btn {
    padding: 10px;
    font-size: 14px;
    margin: 15px 0 10px 0;
  }
}

/* Windows mobile specific adjustments */
@media (max-width: 320px) {
  .login-container {
    padding: 15px 10px;
    border-radius: 12px;
  }
  
  .login-header h1 {
    font-size: 22px;
  }
  
  .auth-form h2 {
    font-size: 18px;
  }
  
  input {
    padding: 8px 10px;
    font-size: 13px;
  }
  
  .auth-btn {
    padding: 8px;
    font-size: 13px;
  }
}

/* Enhanced Mobile Responsiveness for Main Menu */
@media (max-width: 768px) {
  #mainMenu {
    max-width: 95vw;
    padding: 25px 20px;
    margin: 10px auto;
  }
  
  .welcome-message {
    font-size: 16px;
    padding: 15px 18px;
    margin: 15px 0 25px 0;
  }
  
  .game-selection {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 25px 0;
  }
  
  .game-card {
    max-width: 100%;
    padding: 25px 20px;
  }
  
  .game-icon {
    font-size: 48px;
    margin-bottom: 15px;
  }
  
  .game-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  .game-card p {
    font-size: 14px;
    margin-bottom: 18px;
  }
  
  .play-button {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .menu-actions {
    margin-top: 30px;
    gap: 12px;
  }
}

@media (max-width: 500px) {
  #mainMenu {
    max-width: 95vw;
    padding: 20px 15px;
    margin: 5px auto;
  }
  
  #mainMenu h1 {
    font-size: 24px;
    margin-bottom: 8px;
  }
  
  .subtitle {
    font-size: 14px;
    margin-bottom: 20px;
  }
  
  .welcome-message {
    font-size: 15px;
    padding: 12px 15px;
    margin: 12px 0 20px 0;
    border-radius: 12px;
  }
  
  .game-selection {
    gap: 15px;
    margin: 20px 0;
  }
  
  .game-card {
    padding: 20px 18px;
    border-radius: 15px;
  }
  
  .game-icon {
    font-size: 42px;
    margin-bottom: 12px;
  }
  
  .game-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
  }
  
  .game-card p {
    font-size: 13px;
    margin-bottom: 15px;
  }
  
  .play-button {
    padding: 8px 18px;
    font-size: 13px;
    border-radius: 20px;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 900px) and (orientation: landscape) {
  .game-selection {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .game-card {
    padding: 20px 15px;
  }
  
  .game-icon {
    font-size: 40px;
    margin-bottom: 10px;
  }
  
  .game-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
  }
  
  .game-card p {
    font-size: 12px;
    margin-bottom: 12px;
  }
  
  .play-button {
    padding: 6px 14px;
    font-size: 12px;
  }
}

/* Tablet and medium desktop optimizations */
@media (min-width: 769px) and (max-width: 1199px) {
  .main-menu-container {
    padding: 30px;
    justify-content: center;
  }
  
  #mainMenu {
    max-width: 700px;
    padding: 45px 35px;
  }
  
  .game-selection {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    max-width: 600px;
  }
  
  .game-card {
    padding: 30px 25px;
  }
  
  .game-icon {
    font-size: 56px;
    margin-bottom: 20px;
  }
  
  .game-card h3 {
    font-size: 22px;
  }
  
  .game-card p {
    font-size: 15px;
  }
  
  #leaderboard, #settings {
    max-width: 500px;
    padding: 35px;
  }
}

/* Modern Accessibility and Focus Improvements */
input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 0 20px rgba(255, 255, 255, 0.1),
    0 0 0 3px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.auth-btn:focus {
  outline: none;
  box-shadow: 
    0 8px 25px rgba(76, 175, 80, 0.6),
    0 0 0 3px rgba(255, 255, 255, 0.3);
}

.tab-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Loading State for Buttons */
.auth-btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.auth-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Enhanced Mobile Touch Targets */
@media (pointer: coarse) {
  .auth-btn {
    min-height: 48px;
    padding: 15px;
  }
  
  .tab-btn {
    min-height: 44px;
    padding: 12px 20px;
  }
  
  input {
    min-height: 48px;
    padding: 15px 20px;
  }
}

/* Enhanced Touch Interactions for Main Menu */
@media (pointer: coarse) {
  .game-card {
    min-height: 48px;
    padding: 25px 20px;
    cursor: pointer;
  }
  
  .game-card:active {
    transform: translateY(-2px) scale(0.98);
    transition: transform 0.1s ease;
  }
  
  .play-button {
    min-height: 44px;
    padding: 12px 24px;
  }
  
  .menu-button {
    min-height: 48px;
    padding: 15px 25px;
  }
}

/* Smooth scrolling and overflow improvements */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.login-page,
body.main-menu-page {
  -webkit-overflow-scrolling: touch;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  .game-card {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
    input {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 12px;
  }
}

/* High-resolution displays (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .game-icon {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  .game-card h3,
  .game-card p {
    text-rendering: optimizeLegibility;
  }
}

/* Hover states for devices that support hover */
@media (hover: hover) and (pointer: fine) {
  .game-card:hover {
    transform: translateY(-8px) scale(1.02);
  }
  
  .game-card:hover .game-icon {
    transform: scale(1.1);
  }
  
  .game-card:hover .play-button {
    transform: translateY(-2px) scale(1.08);
  }
}

/* Remove hover effects on touch devices */
@media (hover: none) {
  .game-card:hover {
    transform: none;
  }
  
  .game-card:hover .game-icon {
    transform: none;
  }
  
  .game-card:hover .play-button {
    transform: none;
  }
  
  .game-card:hover::before {
    opacity: 0;
  }
}

/* Focus states for keyboard navigation */
.game-card:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.menu-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 2px;
}

/* Modern Micro-Interactions and Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Apply animations to main menu elements */
#mainMenu h1 {
  animation: fadeInScale 0.6s ease-out;
}

.subtitle {
  animation: slideInUp 0.8s ease-out 0.1s both;
}

.welcome-message {
  animation: slideInUp 0.8s ease-out 0.2s both;
}

.game-card:nth-child(1) {
  animation: slideInUp 0.8s ease-out 0.3s both;
}

.game-card:nth-child(2) {
  animation: slideInUp 0.8s ease-out 0.4s both;
}

.menu-actions {
  animation: slideInUp 0.8s ease-out 0.5s both;
}

/* Desktop optimizations for larger screens */
@media (min-width: 1200px) {
  .main-menu-container {
    padding: 40px;
    justify-content: center;
  }
  
  #mainMenu {
    max-width: 1000px;
    padding: 60px 50px;
    margin: 0 auto;
  }
  
  #mainMenu h1 {
    font-size: 42px;
    margin-bottom: 12px;
  }
  
  .subtitle {
    font-size: 16px;
    margin-bottom: 35px;
  }
  
  .welcome-message {
    font-size: 20px;
    padding: 22px 25px;
    margin: 25px 0 40px 0;
  }
  
  .game-selection {
    gap: 40px;
    margin: 50px 0;
    max-width: 900px;
  }
  
  .game-card {
    padding: 40px 35px;
    border-radius: 24px;
  }
  
  .game-icon {
    font-size: 72px;
    margin-bottom: 30px;
  }
  
  .game-card h3 {
    font-size: 26px;
    margin-bottom: 18px;
  }
  
  .game-card p {
    font-size: 17px;
    margin-bottom: 25px;
  }
  
  .play-button {
    padding: 16px 32px;
    font-size: 17px;
    border-radius: 28px;
  }
  
  .menu-actions {
    margin-top: 50px;
    gap: 18px;
  }
  
  .menu-button {
    padding: 18px 30px;
    font-size: 17px;
    border-radius: 14px;
  }
  
  #leaderboard, #settings {
    max-width: 600px;
    padding: 40px;
    margin: 20px auto;
  }
}
