:root {
  --primary-color: #2e7d32; /* 신뢰감을 주는 숲속 초록색 */
  --primary-light: #e8f5e9;
  --secondary-color: #f57c00; /* 주의 집중을 위한 오렌지색 */
  --text-dark: #263238;
  --text-muted: #546e7a;
  --bg-soft: #fafafa;
  --white: #ffffff;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
  --border-radius: 16px;
  --font-senior: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-senior);
  background-color: var(--bg-soft);
  color: var(--text-dark);
  line-height: 1.7;
  font-size: 19px; /* 시니어를 위해 기본 폰트 크기 확대 */
  word-break: keep-all; /* 한글 가독성 향상 */
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.nav-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all 0.2s;
}

.nav-link.active, .nav-link:hover {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

/* Header */
.main-header {
  text-align: center;
  padding: 60px 0 40px;
}

.main-header h1 {
  font-size: 2.8rem;
  color: var(--primary-color);
  margin-bottom: 10px;
  letter-spacing: -1px;
}

.tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.audio-controls {
  margin-top: 20px;
}

.btn-audio {
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--primary-color);
  border-radius: 30px;
  background: white;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-audio.active {
  background: var(--primary-color);
  color: white;
}

/* Ad Containers */
.ad-container {
  margin: 30px 0;
  padding: 20px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--border-radius);
  text-align: center;
}

.ad-label {
  font-size: 0.8rem;
  color: #ccc;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* Game Styles */
.game-wrapper {
  background: var(--white);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  margin-bottom: 40px;
}

.section-title {
  text-align: center;
  margin-bottom: 30px;
}

.section-title h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.game-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary-color);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 550px;
  margin: 0 auto;
}

.card {
  aspect-ratio: 1/1;
  background-color: #f1f3f4;
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3rem;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s, background-color 0.2s;
}

.card:hover {
  transform: translateY(-5px);
  background-color: #e8eaed;
}

.card.flipped {
  background-color: var(--white);
  border: 4px solid var(--primary-color);
}

.card.matched {
  background-color: var(--primary-light);
  border: none;
  cursor: default;
  opacity: 0.8;
}

.btn-primary {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 40px auto 0;
  padding: 18px;
  font-size: 1.4rem;
  font-weight: 800;
  border: none;
  border-radius: 50px;
  background-color: var(--primary-color);
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(46, 125, 50, 0.25);
}

.btn-primary:hover {
  background-color: #1b5e20;
  transform: translateY(-2px);
}

.game-guide {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px dashed #eee;
}

.game-guide h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

/* Article Cards (SEO/AdSense Content) */
.expert-content {
  margin-bottom: 60px;
}

.article-card {
  background: var(--white);
  padding: 40px;
  border-radius: var(--border-radius);
  margin-bottom: 30px;
  box-shadow: var(--shadow-soft);
}

.article-card h2 {
  font-size: 1.7rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-top: 25px;
}

.info-box {
  padding: 25px;
  border-radius: 15px;
}

.info-box.green { background: #f1f8e9; border: 1px solid #dcedc8; }
.info-box.red { background: #fff3e0; border: 1px solid #ffe0b2; }

.info-box h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.info-box ul {
  padding-left: 20px;
}

.info-box li {
  margin-bottom: 10px;
}

.food-tips {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.food-item {
  padding: 15px;
  background: #fdfdfd;
  border-left: 5px solid var(--secondary-color);
  border-radius: 0 10px 10px 0;
}

/* Community Section */
.community-section {
  background: var(--white);
  padding: 40px;
  border-radius: var(--border-radius);
  margin-bottom: 60px;
}

/* Footer */
.main-footer {
  padding: 60px 0;
  border-top: 1px solid #eee;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-links {
  margin-top: 15px;
}

.footer-links a {
  color: var(--primary-color);
  text-decoration: none;
  margin: 0 10px;
}

/* Ad Labels and Spacing */
.ad-section {
  margin: 40px 0;
}
.ad-notice {
  font-size: 0.8rem;
  color: #bbb;
  text-align: center;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.action-area {
  margin-top: 30px;
  padding: 20px 0;
}

/* Celebration Overlay */
.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
}

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

.celebration-content {
  background: white;
  padding: 50px 30px;
  border-radius: 30px;
  text-align: center;
  max-width: 90%;
  width: 400px;
  transform: scale(0.7);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.celebration-emoji {
  font-size: 5rem;
  display: block;
  margin-bottom: 20px;
}

.celebration-content h2 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.celebration-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: var(--text-dark);
}

/* Responsive Design (Mobile/Tablet Optimization) */
@media (max-width: 768px) {
  body {
    font-size: 18px;
  }
  
  .main-header {
    padding: 40px 0 30px;
  }
  
  .main-header h1 {
    font-size: 2.2rem;
  }
  
  .game-wrapper, .article-card, .community-section {
    padding: 25px 20px;
  }
  
  .card-grid {
    gap: 12px;
  }
  
  .card {
    font-size: 2.2rem;
    border-radius: 12px;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .game-stats {
    gap: 20px;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .nav-bar {
    gap: 10px;
    padding: 15px 0;
  }
  
  .nav-link {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  
  .main-header h1 {
    font-size: 1.8rem;
  }
  
  .tagline {
    font-size: 1rem;
  }
  
  .card-grid {
    gap: 8px;
  }
  
  .card {
    font-size: 1.8rem;
    border-radius: 10px;
  }
  
  .btn-primary {
    font-size: 1.2rem;
    padding: 15px;
  }
  
  .article-card h2 {
    font-size: 1.4rem;
  }
  
  .footer-content p {
    font-size: 0.85rem;
  }
}

