/* Global */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100%;
}

/* HEADER */
.header {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.site-title {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.site-title:hover {
  opacity: 0.9;
}

/* Desktop nav */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.desktop-nav a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.desktop-nav a:hover {
  color: #ffffff;
  transform: scale(1.05);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown button {
  background: none;
  border: none;
  color: #e5e7eb;
  font-weight: 500;
  cursor: pointer;
}

.dropdown button:hover {
  color: #ffffff;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  min-width: 220px;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 1100;
}

.dropdown-content.show {
  display: block;
}

.dropdown-content a {
  display: block;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: #111827;
  transition: all 0.2s ease;
}

.dropdown-content a:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 2px solid #22c55e;
  color: #22c55e;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 1.3rem;
  cursor: pointer;
}

.mobile-menu-btn:active {
  transform: scale(0.96);
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #047857;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  flex-direction: column;
  padding: 0.75rem 1.25rem 1rem;
  z-index: 999;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu a {
  display: block;
  color: #ecfdf5;
  padding: 0.5rem 0.25rem;
  text-decoration: none;
  font-weight: 500;
  border-radius: 0.5rem;
}

.mobile-menu a:hover {
  background: rgba(16, 185, 129, 0.3);
}

.mobile-menu.open {
  display: flex;
  max-height: 400px;
}

.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* HERO */
.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 4rem 1.25rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.25), transparent 60%);
  opacity: 0.7;
}

.page-header-emoji {
  position: relative;
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.page-header h1 {
  position: relative;
  font-size: 2.8rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.page-header p {
  position: relative;
  font-size: 1.05rem;
  opacity: 0.96;
}

/* Animations */
.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

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

/* MAIN GAME LAYOUT */
.game-container {
  max-width: 1400px;
  margin: -3.5rem auto 4rem;
  padding: 0 1.25rem;
  position: relative;
  z-index: 10;
}

.game-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 1.5rem;
}

.game-card {
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 2.25rem;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.5);
  animation: slideUp 0.5s ease;
}

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

/* Inputs / titles */
.card-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #4f46e5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.card-title span:first-child {
  font-size: 1.8rem;
}

.input-group {
  margin-bottom: 1.25rem;
}

.input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4f46e5;
  margin-bottom: 0.4rem;
}

.input-field {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  border: 2px solid #4f46e5;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  outline: none;
  transition: all 0.2s ease;
}

.input-field:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
  transform: scale(1.01);
}

/* Buttons */
.game-btn {
  display: inline-block;
  width: 100%;
  padding: 0.85rem 1.2rem;
  border-radius: 0.9rem;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.6rem;
  transition: all 0.18s ease;
  color: #ffffff;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.game-btn.secondary {
  background: linear-gradient(135deg, #ec4899 0%, #ef4444 100%);
}

.game-btn.tertiary {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.game-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.4);
}

.game-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Info box */
.info-box {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-radius: 0.9rem;
  padding: 1.1rem;
  border-left: 4px solid #4f46e5;
}

.info-title {
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 0.35rem;
}

.info-text {
  font-size: 0.9rem;
  color: #4b5563;
}

/* Difficulty */
.difficulty-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.difficulty-btn {
  padding: 0.6rem;
  border-radius: 0.8rem;
  border: 2px solid #4f46e5;
  background: #ffffff;
  color: #4f46e5;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.difficulty-btn:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
}

.difficulty-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.stat-box {
  background: linear-gradient(135deg, #f0f4ff 0%, #e9e4f0 100%);
  padding: 0.9rem;
  border-radius: 0.95rem;
  text-align: center;
  border-left: 4px solid #4f46e5;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #4f46e5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: #7c3aed;
}

/* Game status */
.game-status {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: #4f46e5;
  margin-bottom: 1.4rem;
}

/* Simon board */
.simon-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  max-width: 420px;
  margin: 0 auto 1.8rem;
  aspect-ratio: 1;
}

.simon-button {
  border-radius: 1.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.simon-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease;
}

.simon-button.green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.simon-button.red {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.simon-button.yellow {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.simon-button.blue {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.simon-button:hover {
  transform: scale(1.03);
}

.simon-button.active {
  filter: brightness(1.5);
  transform: scale(1.07);
}

.simon-button.active::before {
  width: 140%;
  height: 140%;
}

/* Sound info */
.sound-info {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-radius: 0.9rem;
  padding: 1rem;
  border-left: 4px solid #4f46e5;
}

.sound-info-title {
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 0.5rem;
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.sound-item {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.6rem;
  text-align: center;
}

.sound-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.green-text { color: #10b981; }
.red-text { color: #ef4444; }
.yellow-text { color: #f59e0b; }
.blue-text { color: #3b82f6; }

.sound-freq {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Ads box */
.adsense-container {
  margin: 1.5rem 0;
  border-radius: 1.25rem;
  padding: 1.4rem;
  background: linear-gradient(135deg, #eef2ff 0%, #e5e7eb 100%);
  border: 2px dashed #c7d2fe;
  display: flex;
  align-items: center;
  justify-content: center;
}

.adsense-placeholder {
  text-align: center;
  color: #4f46e5;
}

.adsense-emoji {
  font-size: 2.25rem;
  margin-bottom: 0.35rem;
}

.adsense-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.adsense-text {
  font-size: 0.85rem;
}

/* History */
.history-empty {
  text-align: center;
  padding: 1.25rem;
  color: #9ca3af;
  font-size: 0.9rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #eef2ff 0%, #e5e7eb 100%);
  margin-bottom: 0.6rem;
  transition: all 0.18s ease;
}

.history-item:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.35);
}

.history-level {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.history-date {
  font-size: 0.75rem;
  color: #6b7280;
}

.history-medal {
  font-size: 1.6rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.modal-content {
  width: min(90%, 640px);
  max-height: 80vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 1.6rem;
  padding: 2.2rem;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.7);
  animation: slideUp 0.3s ease;
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: #4f46e5;
  text-align: center;
  margin-bottom: 1.25rem;
}

.modal-body {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 1.4rem;
}

.modal-body ul {
  margin-left: 1.1rem;
  margin-bottom: 0.75rem;
}

/* Notification */
.notification {
  position: fixed;
  top: 5rem;
  right: 1rem;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  padding: 0.9rem 1.1rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(22, 163, 74, 0.6);
  z-index: 1300;
  font-size: 0.9rem;
  animation: slideInRight 0.3s ease;
}

.notification.error {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 10px 25px rgba(248, 113, 113, 0.6);
}

.notification-text {
  font-weight: 600;
}

.notification.hide {
  animation: slideOutRight 0.3s ease forwards;
}

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

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

/* BLOG */
.blog-section {
  max-width: 900px;
  margin: 4.5rem auto 4rem;
  padding: 0 1.25rem;
}

.blog-content {
  background: #ffffff;
  border-radius: 1.75rem;
  padding: 2.75rem 2.5rem;
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.5);
  line-height: 1.8;
}

.blog-content h2 {
  font-size: 2.1rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
  margin-top: 1.7rem;
  margin-bottom: 0.7rem;
}

.blog-content p {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 0.9rem;
}

.blog-content ul {
  margin-left: 1.25rem;
  margin-bottom: 0.9rem;
  color: #4b5563;
  font-size: 0.95rem;
}

.blog-content li {
  margin-bottom: 0.35rem;
}

.blog-content a {
  color: #4f46e5;
  text-decoration: underline;
}

.highlight-box,
.example-box {
  background: linear-gradient(135deg, #f0f4ff 0%, #e9e4f0 100%);
  padding: 1.2rem;
  border-radius: 0.9rem;
  border-left: 4px solid #4f46e5;
  font-size: 0.9rem;
  color: #4b5563;
  margin: 1.8rem 0;
}

/* FAQ */
.faq-section {
  max-width: 900px;
  margin: 3rem auto 4rem;
  padding: 0 1.25rem;
}

.faq-container {
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.4);
}

.faq-container h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #111827;
  margin-bottom: 1.4rem;
}

.faq-item + .faq-item {
  margin-top: 0.6rem;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f3f4f6;
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  transition: all 0.18s ease;
}

.faq-question:hover {
  background: #e5e7eb;
}

.faq-icon {
  font-weight: 700;
  transition: transform 0.18s ease;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  padding: 0 0.3rem;
  font-size: 0.9rem;
  color: #4b5563;
  transition: max-height 0.25s ease;
}

.faq-answer p {
  margin: 0.45rem 0 0.75rem;
}

/* FOOTER */
.footer {
  margin-top: 4rem;
  background: linear-gradient(135deg, #1f2937 0%, #020617 100%);
  color: #e5e7eb;
  padding: 3.5rem 0 1.5rem;
}

.footer-column h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
  margin-bottom: 0.9rem;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 0.45rem;
}

.footer-column a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.18s ease;
}

.footer-column a:hover {
  color: #4f46e5;
  transform: translateX(3px);
}

.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  margin-top: 2.25rem;
  padding-top: 1.4rem;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }
}

@media (max-width: 768px) {
  .page-header h1 {
    font-size: 2rem;
  }

  .page-header p {
    font-size: 0.95rem;
  }

  .game-card {
    padding: 1.7rem 1.5rem;
  }

  .blog-content {
    padding: 2.1rem 1.6rem;
  }

  .faq-container {
    padding: 2rem 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .simon-board {
    max-width: 100%;
    gap: 0.7rem;
  }

  .sound-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
