@import url('https://fonts.googleapis.com/css2?family=Luckiest+Guy&family=Poppins:wght@400;600&display=swap');

/* ===== BASE STYLES ===== */
body {
  font-family: 'Poppins', 'Luckiest Guy', sans-serif;
  background: #F6F8FC;
  color: #222;
  background-image: url('img/container_bg.png');
  background-repeat: repeat;
  background-size: auto;
  text-align: center;
  padding: 20px;
  min-height: 100vh;
}

.pokemon-title {
  font-family: 'Luckiest Guy', 'Poppins', sans-serif;
  color: #FFE066;
  text-shadow: 1px 1px 0 #4F6DDE, 2px 2px 0 #3b4cca;
  font-size: 2.8rem;
  margin-bottom: 0.5em;
  letter-spacing: 2px;
}

/* ===== GAME CONTAINER ===== */
#game {
  max-width: 900px;
  margin: auto;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 4px 24px rgba(60,60,120,0.10);
  padding: 32px 16px;
  border: 2px solid #4F6DDE;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 8px;
}

.game-header .pokemon-title {
  margin: 0;
  flex: 1;
  text-align: center;
}

/* ===== STATUS BAR ===== */
.status-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  margin-bottom: 24px;
  background: #E3EAFD;
  border-radius: 14px;
  padding: 18px 0 18px 0;
  box-shadow: 0 2px 8px #4F6DDE22;
  border: 2px solid #FFE066;
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #222;
  font-weight: 600;
  background: #F9FAFB;
  border-radius: 12px;
  box-shadow: 0 1px 4px #4F6DDE11;
  padding: 8px 18px 8px 18px;
  border: 1.5px solid #4F6DDE;
  min-width: 110px;
}

.status-label {
  font-size: 1.1rem;
  color: #4F6DDE;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 2px;
  text-shadow: none;
  font-family: 'Luckiest Guy', 'Poppins', sans-serif;
}

.status-value {
  font-size: 2rem;
  color: #FFE066;
  text-shadow: 1px 1px 0 #4F6DDE;
  font-family: 'Luckiest Guy', 'Poppins', sans-serif;
}

/* ===== GAME GRIDS ===== */
.number-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin: 32px 0;
}

/* Sequence Area */
#number-sequence {
  background: linear-gradient(135deg, #e3eafd 0%, #f0f4ff 100%);
  border: 3px solid #4F6DDE;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 
    0 4px 16px rgba(79, 109, 222, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.8);
  position: relative;
}

#number-sequence::before {
  content: "👁️ Watch Sequence";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #FFE066, #FFD700);
  color: #3b4cca;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  border: 2px solid #3b4cca;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* Choices Area */
#choices {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 3px solid #FFE066;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 
    0 4px 16px rgba(255, 224, 102, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.8);
  position: relative;
}

#choices::before {
  content: "🎯 Click Choices";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #4F6DDE, #3b4cca);
  color: #FFE066;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  border: 2px solid #FFE066;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* ===== POKÉMON CARDS ===== */
.number-box {
  width: 120px;
  height: 150px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 50%, #e3eafd 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  font-size: 24px;
  font-weight: 600;
  color: #4F6DDE;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 12px rgba(79, 109, 222, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.number-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 224, 102, 0.1) 100%);
  border-radius: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.number-box img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(59, 76, 202, 0.3));
  transition: transform 0.3s ease;
  z-index: 1;
}

.pokemon-name {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #3b4cca;
  text-align: center;
  margin-top: 8px;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(59, 76, 202, 0.2);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sequence Cards */
#number-sequence .number-box {
  background: linear-gradient(135deg, #ffffff 0%, #e3eafd 50%, #d1e7ff 100%);
  border: 3px solid #4F6DDE;
}

#number-sequence .number-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79, 109, 222, 0.1) 0%, transparent 100%);
  border-radius: 18px;
  pointer-events: none;
}

/* Choice Cards */
#choices .number-box {
  background: linear-gradient(135deg, #ffffff 0%, #fff3cd 50%, #ffeaa7 100%);
  border: 3px solid #FFE066;
}

#choices .number-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 224, 102, 0.1) 0%, transparent 100%);
  border-radius: 18px;
  pointer-events: none;
}

#choices .number-box:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 
    0 8px 20px rgba(79, 109, 222, 0.25),
    0 4px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#choices .number-box:hover::after {
  opacity: 1;
}

/* ===== CARD STATES ===== */
.selected {   
  transform: scale(0.95);
  opacity: 0.7;
}

.hint-highlight { 
  animation: hintPulse 1.5s infinite;
  box-shadow: 0 0 20px rgba(255, 224, 102, 0.5);
}

@keyframes hintPulse {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(255, 224, 102, 0.5);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 224, 102, 1);
    transform: translateY(-5px);
  }
}

.disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* ===== OVERLAY EFFECTS ===== */
.overlayWrong, .overlayRight {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: bold;
  z-index: 10;
  animation: bounce 0.5s ease;
}

.overlayWrong {
  color: #dc3545;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.overlayRight {
  color: #28a745;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

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

@keyframes bounce {
  0% { transform: translate(-50%, -50%) scale(0.5); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* ===== FLIP ANIMATION ===== */
.flip-container {
  perspective: 1000px;
  width: 120px;
  height: 150px;
}

.flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flipped .flipper {
  transform: rotateY(180deg);
}

.front, .back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 18px;
}

.front {
  z-index: 2;
}

.back {
  transform: rotateY(180deg);
}

/* ===== BUTTONS ===== */
button, .landing-btn {
  margin: 12px 0 0 0;
  padding: 14px 36px;
  font-size: 1.2rem;
  font-family: 'Luckiest Guy', 'Poppins', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 24px;
  background: #4F6DDE;
  color: #fff;
  box-shadow: 0 2px 8px rgba(80,80,160,0.08);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  text-shadow: none;
  border: 2px solid #4F6DDE;
}

button:hover, .landing-btn:hover {
  transform: scale(1.07);
}

button:focus, .landing-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 109, 222, 0.3);
}

.hint-btn {
  background: #FFE066;
  color: #3b4cca;
  border: 2px solid #FFE066;
  font-size: 1rem;
  padding: 10px 20px;
}

.hint-btn:hover {
  background: #FFD700;
  border-color: #FFD700;
}

.hint-btn:disabled {
  background: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
  transform: none;
}

.return-btn {
  background: #28a745;
  color: white;
  border: 2px solid #28a745;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.return-btn:hover {
  background: #218838;
  border-color: #218838;
  transform: scale(1.05);
}

.audio-btn {
  background: #FFE066;
  color: #3b4cca;
  border: 2px solid #FFE066;
  font-size: 1.2rem;
  padding: 10px 15px;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.audio-btn:hover {
  background: #FFD700;
  border-color: #FFD700;
  transform: scale(1.1);
}

.audio-btn.muted {
  background: #ccc;
  border-color: #ccc;
  color: #666;
}

.landing-audio-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F6DDE, #3b4cca);
  color: #FFE066;
  border: 2px solid #FFE066;
  box-shadow: 0 4px 12px rgba(79, 109, 222, 0.3);
  transition: all 0.3s ease;
  z-index: 10;
}

.landing-audio-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(79, 109, 222, 0.4);
}

.landing-audio-btn.muted {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  border-color: #ff6b6b;
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

/* ===== LANDING PAGE ===== */
.landing-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
}

.landing-content {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(15px);
  border-radius: 25px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 45px 35px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #4F6DDE;
  max-width: 550px;
  width: 90%;
  position: relative;
  animation: slideInUp 0.8s ease-out;
}

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

.landing-header {
  text-align: center;
  margin-bottom: 40px;
}

.logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.landing-logo {
  width: 75px;
  height: 75px;
  filter: drop-shadow(0 0 12px #3b4cca);
  animation: float 4s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.landing-logo:hover {
  transform: scale(1.1) rotate(10deg);
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(2deg); }
  50% { transform: translateY(-12px) rotate(0deg); }
  75% { transform: translateY(-8px) rotate(-2deg); }
}

.landing-title {
  font-size: 2.8rem;
  margin: 0;
  color: #FFE066;
  text-shadow: 2px 2px 0 #3b4cca, 4px 4px 0 #2a3a9a;
  animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from { text-shadow: 2px 2px 0 #3b4cca, 4px 4px 0 #2a3a9a, 0 0 10px rgba(255, 224, 102, 0.5); }
  to { text-shadow: 2px 2px 0 #3b4cca, 4px 4px 0 #2a3a9a, 0 0 20px rgba(255, 224, 102, 0.8); }
}

.landing-subtitle {
  font-size: 1.1rem;
  color: #3b4cca;
  font-weight: 600;
  margin: 0;
  opacity: 0.9;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
  animation: fadeInUp 1s ease-out 0.3s both;
}

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

.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-bottom: 35px;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.landing-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 22px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 22px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.landing-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;
}

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

.primary-btn {
  background: linear-gradient(135deg, #4F6DDE, #3b4cca);
  color: white;
  border-color: #3b4cca;
  box-shadow: 0 6px 16px rgba(79, 109, 222, 0.25);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(79, 109, 222, 0.35);
  border-color: #2a3a9a;
}

.secondary-btn {
  background: linear-gradient(135deg, #FFE066, #FFD700);
  color: #3b4cca;
  border-color: #FFD700;
  box-shadow: 0 4px 12px rgba(255, 224, 102, 0.25);
}

.secondary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(255, 224, 102, 0.35);
  border-color: #FFC107;
}

.btn-icon {
  font-size: 1.3rem;
}

.btn-text {
  font-family: 'Luckiest Guy', sans-serif;
  letter-spacing: 1px;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  width: 100%;
  margin-bottom: 20px;
  animation: fadeInUp 1s ease-out 0.9s both;
}

.feature-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
  border: 2px solid rgba(79, 109, 222, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: #4F6DDE;
  box-shadow: 0 8px 16px rgba(79, 109, 222, 0.12);
  background: rgba(255, 255, 255, 0.95);
}

.feature-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.feature-card h3 {
  color: #3b4cca;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 1rem;
  margin: 0 0 6px 0;
  text-shadow: 1px 1px 0 #ffcb05;
}

.feature-card p {
  color: #3b4cca;
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.3;
  opacity: 0.85;
  font-weight: 500;
}

/* ===== MODALS ===== */
.leaderboard-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(59,76,202,0.12);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.leaderboard-content {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(60,60,120,0.18);
  padding: 32px 18px 24px 18px;
  width: 60%;
  max-width: 60%;
  height: 85%;
  max-height: 85%;
  border: 4px solid #3b4cca;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  gap: 12px;
  width: 100%;
}

.header-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.pokeball-icon {
  filter: drop-shadow(0 2px 4px rgba(59, 76, 202, 0.3));
}

/* ===== CHARACTER SPEECH ===== */
.character-speech {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 600px;
}

.character-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #4F6DDE;
  box-shadow: 0 4px 12px rgba(59, 76, 202, 0.3);
  flex-shrink: 0;
}

.speech-bubble {
  background: #E3EAFD;
  padding: 16px 20px;
  border-radius: 20px;
  border: 2px solid #4F6DDE;
  box-shadow: 0 4px 12px rgba(59, 76, 202, 0.15);
  flex: 1;
  position: relative;
}

.speech-bubble p {
  margin: 0;
  color: #3b4cca;
  font-weight: 600;
  line-height: 1.5;
}

/* ===== LEADERBOARD TABLE ===== */
.leaderboard-table {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(79, 109, 222, 0.15);
  margin: 20px 0;
  border: 2px solid #4F6DDE;
  border-collapse: collapse;
}

.leaderboard-table thead {
  background: linear-gradient(135deg, #FFE066 0%, #FFD700 100%);
  border-bottom: 3px solid #4F6DDE;
  display: table;
  width: 100%;
  table-layout: fixed;
}

.leaderboard-table th {
  padding: 16px 8px;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 1.1rem;
  color: #3b4cca;
  font-weight: bold;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
  border: none;
}

.rank-header {
  text-align: center;
  width: 80px;
}

.trainer-header {
  text-align: left;
  width: auto;
}

.score-header {
  text-align: center;
  width: 100px;
}

.level-header {
  text-align: center;
  width: 80px;
}

.date-header {
  text-align: center;
  width: 120px;
}

.leaderboard-table tbody {
  background: linear-gradient(135deg, #f8f9ff 0%, #e3eafd 100%);
  display: block;
  overflow-y: auto;
  max-height: 300px;
}

.leaderboard-table tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.leaderboard-table tr {
  border-bottom: 1px solid rgba(79, 109, 222, 0.1);
}

.leaderboard-table tr:last-child {
  border-bottom: none;
}

.leaderboard-table td {
  padding: 12px 8px;
  border: none;
  vertical-align: middle;
}

.rank-cell {
  text-align: center;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 1.2rem;
  font-weight: bold;
  color: #3b4cca;
  width: 80px;
}

.rank-1 {
  color: #FFD700;
  text-shadow: 1px 1px 0 #3b4cca;
}

.rank-2 {
  color: #C0C0C0;
  text-shadow: 1px 1px 0 #3b4cca;
}

.rank-3 {
  color: #CD7F32;
  text-shadow: 1px 1px 0 #3b4cca;
}

.trainer-cell {
  padding: 0 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  color: #3b4cca;
  font-weight: 600;
  text-align: left;
}

.score-cell {
  text-align: center;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 1.1rem;
  color: #3b4cca;
  font-weight: bold;
  width: 100px;
}

.level-cell {
  text-align: center;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 1rem;
  color: #3b4cca;
  font-weight: bold;
  width: 80px;
}

.date-cell {
  text-align: center;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
  width: 120px;
}

.badge {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.leaderboard-empty {
  padding: 40px 20px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.leaderboard-empty::before {
  content: "🏆";
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

/* ===== CUSTOM MODALS ===== */
.custom-modal {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(246, 248, 252, 0.50);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.custom-modal-content {
  background: #fff;
  padding: 48px 56px 36px 56px;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(60,60,120,0.15);
  text-align: center;
  min-width: 480px;
  max-width: 95vw;
  position: relative;
}

.custom-modal-content span#custom-alert-message,
.custom-modal-content span#custom-prompt-message {
  display: block;
  font-size: 1.4em;
  color: #3b4cca;
  margin-bottom: 24px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
  padding: 0 12px;
}

.custom-modal-content input[type="text"] {
  margin-top: 12px;
  margin-bottom: 20px;
  padding: 12px 18px;
  border: 1.5px solid #4F6DDE;
  border-radius: 10px;
  width: 80%;
  font-size: 1.15em;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(80,80,160,0.1);
  background: #F6F8FC;
  color: #222;
}

.custom-modal-content input[type="text"]:focus {
  border: 2px solid #FFE066;
  box-shadow: 0 0 0 2px #FFE06633;
}

.custom-modal-content button {
  margin: 10px 8px 0 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 20px;
  background: #4F6DDE;
  color: #fff;
  font-size: 1.15em;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(80,80,160,0.1);
  transition: background 0.2s, transform 0.2s;
}

.custom-modal-content button:hover, .custom-modal-content button:focus {
  background: #3b4cca;
  transform: scale(1.07);
}

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

.modal-buttons button {
  flex: 1;
  max-width: 150px;
}

/* ===== HOW TO PLAY MODAL ===== */
.howtoplay-content {
  max-width: 1000px;
  height: 90vh;
  overflow-y: auto;  
}

.howtoplay-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 16px;
}

.professor-section {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #e3eafd 0%, #f0f4ff 100%);
  border-radius: 20px;
  padding: 24px;
  border: 2px solid #4F6DDE;
  box-shadow: 0 4px 16px rgba(79, 109, 222, 0.15);
}

.professor-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #4F6DDE;
  box-shadow: 0 4px 12px rgba(59, 76, 202, 0.3);
  flex-shrink: 0;
}

.professor-speech h3 {
  color: #3b4cca;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 1.4rem;
  margin: 0 0 12px 0;
  text-shadow: 1px 1px 0 #ffcb05;
}

.professor-speech p {
  color: #3b4cca;
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0;
  font-weight: 600;
}

.instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.instruction-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  border: 2px solid #FFE066;
  box-shadow: 0 4px 12px rgba(255, 224, 102, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.instruction-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(255, 224, 102, 0.3);
}

.instruction-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.instruction-card h4 {
  color: #3b4cca;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 1.2rem;
  margin: 0 0 12px 0;
  text-shadow: 1px 1px 0 #ffcb05;
}

.instruction-card p {
  color: #3b4cca;
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0 0 16px 0;
  font-weight: 500;
}

.step-image {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 8px;
  border: 2px solid #4F6DDE;
  box-shadow: 0 2px 8px rgba(79, 109, 222, 0.2);
}

.features-section {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border-radius: 20px;
  padding: 24px;
  border: 2px solid #FFE066;
  box-shadow: 0 4px 16px rgba(255, 224, 102, 0.2);
}

.features-section h3 {
  color: #3b4cca;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 1.4rem;
  margin: 0 0 20px 0;
  text-align: center;
  text-shadow: 1px 1px 0 #ffcb05;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #FFE066;
}

.feature-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.feature-text strong {
  color: #3b4cca;
  font-size: 1rem;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.feature-text p {
  color: #3b4cca;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.3;
}

.professor-tip {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-radius: 16px;
  padding: 20px;
  border: 2px solid #28a745;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.tip-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #28a745;
  flex-shrink: 0;
}

.tip-content h4 {
  color: #155724;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 1.1rem;
  margin: 0 0 8px 0;
}

.tip-content p {
  color: #155724;
  font-size: 1rem;
  line-height: 1.4;
  margin: 0;
  font-weight: 500;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 600px), (max-height: 600px) {
  body {
    padding: 10px;
  }
  
  #game {
    padding: 20px 10px;
    border-radius: 20px;
  }

  .game-header {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }

  .game-header .pokemon-title {
    font-size: 2rem;
  }

  .return-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  
  .status-bar {
    gap: 16px;
    padding: 12px 0;
  }
  
  .status-item {
    padding: 6px 12px;
    min-width: 80px;
  }
  
  .status-label {
    font-size: 0.9rem;
  }
  
  .status-value {
    font-size: 1.5rem;
  }
  
  .pokemon-title {
    font-size: 2rem;
  }
  
  .number-grid {
    gap: 16px;
    margin: 20px 0;
  }
  
  #number-sequence, #choices {
    padding: 16px;
    border-radius: 16px;
  }
  
  #number-sequence::before, #choices::before {
    font-size: 12px;
    padding: 4px 12px;
  }
  
  .number-box {
    width: 100px;
    height: 120px;
    border-radius: 16px;
  }
  
  .number-box::before {
    border-radius: 16px;
  }
  
  .number-box img {
    width: 50px;
    height: 50px;
  }
  
  .pokemon-name {
    font-size: 0.7rem;
    margin-top: 4px;
    padding: 2px 4px;
    max-width: 80px;
  }
  
  .overlayWrong, .overlayRight {
    border-radius: 16px;
  }
  
  .flip-container {
    width: 100px;
    height: 120px;
  }
  
  .landing-content {
    padding: 30px 20px;
    border-radius: 20px;
    max-width: 95%;
  }

  .landing-header {
    margin-bottom: 30px;
  }

  .landing-logo {
    width: 60px;
    height: 60px;
  }

  .landing-title {
    font-size: 2.2rem;
  }

  .landing-subtitle {
    font-size: 1rem;
  }

  .landing-buttons {
    gap: 12px;
    margin-bottom: 30px;
  }

  .landing-btn {
    padding: 14px 20px;
    font-size: 1rem;
  }

  .btn-icon {
    font-size: 1.1rem;
  }

  .landing-features {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .feature-card {
    padding: 16px;
  }

  .feature-icon {
    font-size: 2rem;
  }

  .feature-card h3 {
    font-size: 1rem;
  }

  .feature-card p {
    font-size: 0.85rem;
  }
  
  .leaderboard-content {
    padding: 14px 4px 14px 4px;
    border-radius: 12px;
    min-width: 0;
  }
  
  .landing-btn {
    font-size: 1rem;
    padding: 10px 18px;
  }
  
  /* Mobile leaderboard adjustments */
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 8px 4px;
    font-size: 0.9rem;
  }
  
  .date-header,
  .date-cell {
    display: none; /* Hide date on mobile to save space */
  }
  
  .level-header,
  .level-cell {
    width: 60px;
  }
  
  .score-header,
  .score-cell {
    width: 80px;
  }
  
  .modal-header {
    flex-direction: column;
    gap: 8px;
  }
  
  .header-icon {
    width: 30px;
    height: 30px;
  }
  
  .pokeball-icon {
    width: 25px;
    height: 25px;
  }
  
  .character-speech {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .character-avatar {
    width: 80px;
    height: 80px;
  }
  
  .speech-bubble {
    width: 100%;
  }
  
  .speech-bubble::before,
  .speech-bubble::after {
    display: none;
  }
  
  .modal-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .modal-buttons button {
    max-width: none;
  }
  
  .leaderboard-content {
    width: 95%;
    max-width: 95%;
    height: 90%;
    max-height: 90%;
  }
  
    .howtoplay-content {
    height: 85vh;
    padding: 16px 8px;
  }

  .howtoplay-content-wrapper {
    gap: 16px;
    padding: 0 8px;
  }

  .professor-section {
    flex-direction: column;
    text-align: center;
    gap: 16px;
    padding: 20px;
  }

  .professor-avatar {
    width: 100px;
    height: 100px;
  }

  .professor-speech h3 {
    font-size: 1.2rem;
  }

  .professor-speech p {
    font-size: 1rem;
  }

  .instructions-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .instruction-card {
    padding: 20px;
  }

  .instruction-icon {
    font-size: 2rem;
  }

  .instruction-card h4 {
    font-size: 1.1rem;
  }

  .step-image {
    max-width: 150px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .feature-item {
    padding: 12px;
  }

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

  .professor-tip {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 16px;
  }

  .tip-avatar {
    width: 60px;
    height: 60px;
  }

  .tip-content h4 {
    font-size: 1rem;
  }

  .tip-content p {
    font-size: 0.9rem;
  }
}

