/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Georgia', serif; line-height: 1.6; background: #fafaf8; }

/* ================= KENTE STRIP ================= */
.kente-strip {
  height: 8px;
  background: repeating-linear-gradient(90deg,
    #006b3f 0px, #006b3f 20px, #fcd116 20px, #fcd116 40px,
    #ce1126 40px, #ce1126 60px, #000 60px, #000 80px,
    #fcd116 80px, #fcd116 100px, #006b3f 100px, #006b3f 120px);
}

/* ================= NAVBAR ================= */
.navbar {
  position: fixed; top: 0; width: 100%;
  background: #fff; display: flex;
  justify-content: space-between; align-items: center;
  padding: 0 2rem; height: 64px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); z-index: 1000;
}
.navbar::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 100%; height: 4px;
  background: repeating-linear-gradient(90deg,
    #006b3f 0px, #006b3f 15px, #fcd116 15px, #fcd116 30px,
    #ce1126 30px, #ce1126 45px, #000 45px, #000 60px);
}
.logo { font-weight: bold; font-size: 1.2rem; }
.nav-links a { margin-left: 1.5rem; text-decoration: none; color: #000; font-weight: 500; }
.nav-links a:hover { color: #006b3f; }
.hamburger { display: none; font-size: 1.5rem; background: none; border: none; cursor: pointer; }

/* ================= HERO ================= */
.hero {
  margin-top: 64px; min-height: 65vh;
  background: linear-gradient(135deg, #ce1126 0%, #006b3f 60%, #000 100%);
  color: #fff; text-align: center; padding: 5rem 2rem 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ccircle cx='40' cy='40' r='20' fill='none' stroke='rgba(255,215,0,0.12)' stroke-width='2'/%3E%3Ccircle cx='40' cy='40' r='10' fill='none' stroke='rgba(255,215,0,0.08)' stroke-width='2'/%3E%3Cline x1='40' y1='20' x2='40' y2='0' stroke='rgba(255,215,0,0.1)' stroke-width='1.5'/%3E%3Cline x1='40' y1='60' x2='40' y2='80' stroke='rgba(255,215,0,0.1)' stroke-width='1.5'/%3E%3Cline x1='20' y1='40' x2='0' y2='40' stroke='rgba(255,215,0,0.1)' stroke-width='1.5'/%3E%3Cline x1='60' y1='40' x2='80' y2='40' stroke='rgba(255,215,0,0.1)' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 80px 80px; pointer-events: none;
}
.hero-kente {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 10px;
  background: repeating-linear-gradient(90deg,
    #fcd116 0, #fcd116 20px, #ce1126 20px, #ce1126 40px,
    #000 40px, #000 60px, #006b3f 60px, #006b3f 80px);
}
.hero h1 { font-size: 2.8rem; font-weight: bold; text-shadow: 0 2px 8px rgba(0,0,0,0.3); position: relative; }
.hero p { margin: 1rem 0 2rem; font-size: 1.2rem; opacity: 0.9; position: relative; }
.hero-adinkra { display: flex; justify-content: center; gap: 2rem; margin: 1.5rem 0; opacity: 0.65; position: relative; }
.adinkra-symbol { font-size: 2.5rem; animation: floatSymbol 3s ease-in-out infinite; }
.adinkra-symbol:nth-child(2) { animation-delay: 0.5s; }
.adinkra-symbol:nth-child(3) { animation-delay: 1s; }
.adinkra-symbol:nth-child(4) { animation-delay: 1.5s; }
@keyframes floatSymbol { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

.btn-primary {
  background: #fcd116; padding: 0.9rem 2.5rem; border-radius: 30px;
  text-decoration: none; color: #000; font-weight: bold; font-size: 1.05rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s; display: inline-block; position: relative;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }

/* ================= CULTURE STRIP ================= */
.culture-strip {
  background: #111; color: #fcd116; text-align: center;
  padding: 1.2rem 2rem; font-size: 0.9rem; letter-spacing: 2px;
  text-transform: uppercase; font-weight: bold;
}

/* ================= CATEGORIES ================= */
.categories { padding: 4rem 2rem; text-align: center; background: #fafaf8; }
.categories h2 { color: #ce1126; margin-bottom: 0.5rem; font-size: 2rem; }
.subtitle { margin-bottom: 2rem; color: #555; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem; }

.card {
  background: #fff; padding: 2.5rem 2rem; border-radius: 16px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), box-shadow 0.4s ease;
  will-change: transform; position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px;
  background: repeating-linear-gradient(90deg,
    #006b3f 0, #006b3f 10px, #fcd116 10px, #fcd116 20px, #ce1126 20px, #ce1126 30px);
}
.card span { font-size: 2.5rem; }
.card h3 { margin: 1rem 0 0.5rem; color: #006b3f; font-size: 1.1rem; }
.card p { color: #666; font-size: 0.9rem; }
.card a { display: inline-block; margin-top: 1rem; color: #ce1126; text-decoration: none; font-weight: bold; }

@media (hover: hover) {
  .card:hover { transform: translateY(-6px) scale(1.03); box-shadow: 0 12px 30px rgba(0,0,0,0.15); }
}

/* ================= SCROLL ANIMATIONS ================= */
.fade-slide { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease, transform 0.8s ease; }
.fade-slide.show { opacity: 1; transform: translateY(0); }

/* ================= ADINKRA SECTION ================= */
.adinkra-section {
  background: #006b3f; color: #fff;
  padding: 3rem 2rem; text-align: center; position: relative; overflow: hidden;
}
.adinkra-section::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='15' fill='none' stroke='rgba(255,215,0,0.15)' stroke-width='1.5'/%3E%3Ccircle cx='30' cy='30' r='7' fill='none' stroke='rgba(255,215,0,0.1)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 60px 60px; pointer-events: none;
}
.adinkra-section h3 { font-size: 1.4rem; color: #fcd116; margin-bottom: 0.5rem; position: relative; }
.adinkra-section p { color: rgba(255,255,255,0.8); margin-bottom: 1.5rem; position: relative; }
.adinkra-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; margin-top: 1rem; position: relative; }
.adinkra-item { text-align: center; max-width: 110px; }
.adinkra-item .sym { font-size: 2.5rem; display: block; margin-bottom: 0.4rem; }
.adinkra-item .sym-name { font-size: 0.78rem; color: #fcd116; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; display: block; }
.adinkra-item .sym-meaning { font-size: 0.7rem; color: rgba(255,255,255,0.65); display: block; margin-top: 0.2rem; }

/* ================= ABOUT ================= */
.about { padding: 4rem 2rem; text-align: center; background: #fff; }
.about h2 { color: #ce1126; margin-bottom: 1rem; }

/* ================= FOOTER ================= */
.footer { background: #111; color: #ddd; padding: 3rem 2rem 1rem; }
.footer-kente { height: 6px; background: repeating-linear-gradient(90deg, #006b3f 0, #006b3f 20px, #fcd116 20px, #fcd116 40px, #ce1126 40px, #ce1126 60px, #000 60px, #000 80px); margin-bottom: 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.footer h3, .footer h4 { color: #fcd116; margin-bottom: 1rem; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 0.5rem; }
.footer a { color: #fcd116; text-decoration: none; }
.socials span { display: inline-block; background: #222; padding: 0.5rem; margin-right: 0.5rem; border-radius: 50%; color: #fcd116; font-weight: bold; }
.footer p { text-align: center; margin-top: 2rem; font-size: 0.9rem; }

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  .nav-links { position: absolute; top: 64px; right: 0; background: #fff; width: 100%; flex-direction: column; display: none; text-align: center; }
  .nav-links a { padding: 1rem; display: block; margin: 0; }
  .nav-links.active { display: block; }
  .hamburger { display: block; }
  .hero h1 { font-size: 1.9rem; }
}

/* ================= DARK MODE ================= */
body.dark { background: #121212; color: #eee; }
body.dark .navbar { background: #1e1e1e; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
body.dark .nav-links { background: #1e1e1e; }
body.dark .nav-links a { color: #eee; }
body.dark .card { background: #1e1e1e; box-shadow: 0 5px 20px rgba(0,0,0,0.3); }
body.dark .card p { color: #aaa; }
body.dark .footer { background: #0a0a0a; }
body.dark .about { background: #1a1a1a; }
body.dark .categories { background: #121212; }
body.dark .quiz-container { background: #1e1e1e; color: #eee; }
body.dark .option-btn { background: #2a2a2a; color: #eee; border-color: #444; }
body.dark .subtitle { color: #aaa; }
body.dark .culture-strip { background: #0a0a0a; }

/* ================= NAVBAR RIGHT ================= */
.navbar-right { display: flex; align-items: center; gap: 0.5rem; }
.theme-toggle { background: none; border: 2px solid #ccc; border-radius: 50%; width: 38px; height: 38px; font-size: 1.1rem; cursor: pointer; transition: border-color 0.3s; }
.theme-toggle:hover { border-color: #006b3f; }

/* ================= QUIZ PAGE ================= */
.quiz-page-body { background: #f5f5f5; min-height: 100vh; }
body.dark.quiz-page-body { background: #121212; }

.quiz-container {
  max-width: 700px; margin: 80px auto 40px; background: #fff;
  border-radius: 16px; padding: 2rem; box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  position: relative; overflow: hidden;
}
.quiz-container::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px;
  background: repeating-linear-gradient(90deg,
    #006b3f 0, #006b3f 15px, #fcd116 15px, #fcd116 30px,
    #ce1126 30px, #ce1126 45px, #000 45px, #000 60px);
}

/* ================= MODAL ================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 1rem; }
.modal-box { background: #fff; border-radius: 20px; padding: 2.5rem; max-width: 440px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.35); position: relative; overflow: hidden; max-height: 90vh; overflow-y: auto; }
.modal-box::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px; background: repeating-linear-gradient(90deg, #006b3f 0, #006b3f 15px, #fcd116 15px, #fcd116 30px, #ce1126 30px, #ce1126 45px, #000 45px, #000 60px); }
body.dark .modal-box { background: #1e1e1e; color: #eee; }
.modal-box h2 { color: #006b3f; margin-bottom: 0.5rem; font-size: 1.5rem; }
.modal-box p { color: #666; margin-bottom: 1rem; font-size: 0.95rem; }
body.dark .modal-box p { color: #aaa; }
.modal-input { width: 100%; padding: 0.8rem 1rem; margin-bottom: 0.8rem; border: 2px solid #ddd; border-radius: 10px; font-size: 1rem; outline: none; transition: border-color 0.3s; font-family: inherit; }
.modal-input:focus { border-color: #006b3f; }
body.dark .modal-input { background: #2a2a2a; border-color: #444; color: #eee; }
.btn-start-quiz { background: linear-gradient(135deg, #006b3f, #ce1126); color: #fff; border: none; padding: 0.9rem 2.5rem; border-radius: 30px; font-size: 1.05rem; font-weight: bold; cursor: pointer; width: 100%; transition: opacity 0.3s, transform 0.2s; font-family: inherit; margin-top: 0.5rem; }
.btn-start-quiz:hover { opacity: 0.9; transform: translateY(-1px); }

/* ================= LEVEL SELECTOR ================= */
.level-label { font-size: 0.85rem; font-weight: bold; color: #555; margin-bottom: 0.5rem; text-align: left; display: block; }
body.dark .level-label { color: #aaa; }
.level-selector { display: flex; gap: 0.6rem; margin: 0.5rem 0 1rem; justify-content: center; }
.level-btn { flex: 1; padding: 0.65rem 0.4rem; border: 2px solid #ddd; border-radius: 12px; background: #f9f9f9; cursor: pointer; font-size: 0.8rem; font-weight: bold; transition: all 0.2s; font-family: inherit; text-align: center; }
.level-btn .level-icon { font-size: 1.3rem; display: block; margin-bottom: 0.2rem; }
.level-btn .level-name { display: block; color: #333; }
.level-btn .level-time { display: block; color: #888; font-size: 0.72rem; font-weight: normal; }
body.dark .level-btn { background: #2a2a2a; border-color: #444; }
body.dark .level-btn .level-name { color: #eee; }
.level-btn.selected-easy { border-color: #28a745; background: #d4edda; }
.level-btn.selected-medium { border-color: #ffc107; background: #fff3cd; }
.level-btn.selected-hard { border-color: #dc3545; background: #f8d7da; }
body.dark .level-btn.selected-easy { background: #1a3a25; }
body.dark .level-btn.selected-medium { background: #3a2f00; }
body.dark .level-btn.selected-hard { background: #3a1a1a; }

.level-badge { display: inline-block; padding: 0.2rem 0.8rem; border-radius: 20px; font-size: 0.78rem; font-weight: bold; margin-bottom: 0.75rem; }
.badge-easy { background: #d4edda; color: #155724; }
.badge-medium { background: #fff3cd; color: #856404; }
.badge-hard { background: #f8d7da; color: #721c24; }

/* ================= PROGRESS & TIMER ================= */
.quiz-header { margin-bottom: 1.5rem; }
.quiz-category { color: #006b3f; font-weight: bold; font-size: 0.9rem; text-transform: uppercase; }
.q-counter { font-size: 0.9rem; color: #888; margin-bottom: 0.5rem; }
.progress-track { background: #eee; border-radius: 10px; height: 8px; margin-bottom: 1rem; overflow: hidden; }
body.dark .progress-track { background: #333; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #006b3f, #ce1126); border-radius: 10px; transition: width 0.4s ease; width: 0%; }
.timer-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.timer-icon { font-size: 1.2rem; }
.timer-track { flex: 1; background: #eee; border-radius: 10px; height: 10px; overflow: hidden; }
body.dark .timer-track { background: #333; }
.timer-bar { height: 100%; background: #006b3f; border-radius: 10px; transition: width 1s linear, background 1s; width: 100%; }
.timer-text { font-weight: bold; font-size: 1.1rem; min-width: 28px; text-align: center; }

/* ================= QUESTION ================= */
.question-text { font-size: 1.2rem; font-weight: bold; margin-bottom: 1.5rem; line-height: 1.5; }

/* ================= OPTIONS ================= */
.options-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.option-btn {
  display: flex; align-items: center; gap: 0.75rem;
  background: #f9f9f9; border: 2px solid #ddd; border-radius: 10px;
  padding: 0.9rem 1.2rem; font-size: 1rem; cursor: pointer; text-align: left;
  transition: background 0.2s, border-color 0.2s;
  width: 100%; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
/* Hover ONLY on pointer devices (not mobile touch) */
@media (hover: hover) and (pointer: fine) {
  .option-btn:hover:not(:disabled) { border-color: #006b3f; background: #f0fff7; }
  body.dark .option-btn:hover:not(:disabled) { background: #1a2f22; border-color: #006b3f; }
}
.option-label { background: #006b3f; color: #fff; border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-weight: bold; font-size: 0.85rem; flex-shrink: 0; }
.option-btn.correct { background: #d4edda; border-color: #28a745; }
.option-btn.correct .option-label { background: #28a745; }
.option-btn.wrong { background: #f8d7da; border-color: #dc3545; }
.option-btn.wrong .option-label { background: #dc3545; }
.option-btn:disabled { cursor: not-allowed; }
.answer-tag { font-size: 0.85rem; font-weight: bold; }
.correct-tag { color: #28a745; }
.wrong-tag { color: #dc3545; }

/* ================= RESULTS ================= */
#results-section { display: none; }
.results-card { text-align: center; padding: 1rem; }
.results-emoji { font-size: 4rem; margin-bottom: 1rem; }
.results-card h2 { font-size: 2rem; color: #006b3f; margin-bottom: 0.5rem; }
.player-info { color: #666; margin-bottom: 1rem; font-size: 1rem; }
body.dark .player-info { color: #aaa; }
.score-display { background: linear-gradient(135deg, #006b3f, #ce1126); color: #fff; border-radius: 16px; padding: 2rem; margin: 1rem 0; display: flex; align-items: center; justify-content: center; gap: 2rem; }
.score-big { font-size: 3rem; font-weight: bold; }
.score-pct { font-size: 2rem; opacity: 0.9; }
.score-msg { color: #666; margin: 1rem 0 1.5rem; font-size: 1.05rem; }
body.dark .score-msg { color: #aaa; }
.results-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-bottom: 1.5rem; }
.btn-share, .btn-home, .btn-retry { padding: 0.8rem 1.5rem; border-radius: 30px; font-weight: bold; font-size: 0.9rem; cursor: pointer; text-decoration: none; border: none; transition: opacity 0.3s, transform 0.2s; font-family: inherit; }
.btn-share { background: #1da1f2; color: #fff; }
.btn-home { background: #006b3f; color: #fff; }
.btn-retry { background: #ce1126; color: #fff; }
.btn-share:hover, .btn-home:hover, .btn-retry:hover { opacity: 0.85; transform: translateY(-1px); }

/* ================= LEADERBOARD ================= */
.leaderboard-section { margin-top: 1.5rem; border-top: 2px solid #eee; padding-top: 1.5rem; }
body.dark .leaderboard-section { border-top-color: #333; }
.leaderboard-section h3 { color: #006b3f; font-size: 1.2rem; margin-bottom: 1rem; text-align: center; }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.leaderboard-table th { background: #006b3f; color: #fff; padding: 0.6rem 0.8rem; text-align: left; }
.leaderboard-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid #eee; }
body.dark .leaderboard-table td { border-bottom-color: #333; }
.leaderboard-table tr:nth-child(even) td { background: #f9f9f9; }
body.dark .leaderboard-table tr:nth-child(even) td { background: #222; }
.rank-medal { font-size: 1rem; }
.lb-empty { text-align: center; color: #888; padding: 1rem; font-style: italic; }

/* ================= BACK LINK ================= */
.back-link { display: inline-block; margin: 0.5rem 0 1.5rem; color: #ce1126; text-decoration: none; font-weight: bold; }
.back-link:hover { text-decoration: underline; }

/* ================= GUEST SKIP ================= */
.skip-link { display: block; margin-top: 0.75rem; color: #888; font-size: 0.85rem; cursor: pointer; text-decoration: underline; }

@media (max-width: 600px) {
  .quiz-container { margin: 75px 1rem 2rem; padding: 1.5rem; }
  .score-display { flex-direction: column; gap: 0.5rem; }
  .score-big { font-size: 2.5rem; }
  .hero h1 { font-size: 1.6rem; }
  .level-selector { gap: 0.4rem; }
}
/* ================= 4-LEVEL SELECTOR ================= */
.level-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0.5rem 0 1rem;
}

/* Soft Life & Hard Life span labels */
.level-btn .level-stage {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.15rem;
}

/* Selected states */
.level-btn.selected-easy      { border-color: #28a745; background: #d4edda; }
.level-btn.selected-medium    { border-color: #ffc107; background: #fff3cd; }
.level-btn.selected-softlife  { border-color: #fd7e14; background: #fde8d0; }
.level-btn.selected-hardlife  { border-color: #dc3545; background: #f8d7da; }

body.dark .level-btn.selected-easy      { background: #1a3a25; }
body.dark .level-btn.selected-medium    { background: #3a2f00; }
body.dark .level-btn.selected-softlife  { background: #3a1f00; }
body.dark .level-btn.selected-hardlife  { background: #3a1a1a; }

/* Badge colours for all 4 levels */
.badge-easy      { background: #d4edda; color: #155724; }
.badge-medium    { background: #fff3cd; color: #856404; }
.badge-softlife  { background: #fde8d0; color: #7a3800; }
.badge-hardlife  { background: #f8d7da; color: #721c24; }

/* Timer pulse animation for Hard Life last 3 seconds */
@keyframes timerPulse {
  0%,100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.7; }
}

/* Hard Life urgency border on quiz container */
.hardlife-active .quiz-container {
  box-shadow: 0 0 0 3px #dc3545, 0 8px 30px rgba(0,0,0,0.1);
}