/* ==============================
   RESET & BASE
============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --wood:    #8b4513; /* Sedlová hnědá */
  --wood-lt: #d2b48c; /* Tan */
  --dark:    #1a0f00; /* Velmi tmavá hnědá */
  --dark2:   #2d1c02;
  --stone:   #4a3728;
  --accent:  #cd853f; /* Peru */
  --cream:   #f5deb3; /* Wheat */
  --text:    #fffaf0;
  --gold:    #ff8c00; /* Dark Orange */
  --radius:  18px;
  --shadow:  0 8px 40px rgba(0,0,0,.6);
}

html { scroll-behavior: smooth; }
body { font-family: 'Nunito', sans-serif; background: var(--dark); color: var(--text); overflow-x: hidden; }
h1,h2,h3 { font-family: 'Cinzel', serif; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ==============================
   HERO
============================== */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
  background: radial-gradient(ellipse at 50% 30%, #3e2700 0%, #1a0f00 70%),
              url('https://upload.wikimedia.org/wikipedia/commons/b/b3/Kyn%C5%A1perk_nad_Oh%C5%99%C3%AD_l%C3%A1vka_celkov%C3%BD_pohled.jpg') center/cover no-repeat;
  background-blend-mode: multiply;
  text-align: center; overflow: hidden;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(26,15,0,.2) 0%, rgba(26,15,0,.9) 100%);
  pointer-events: none;
}
.hero-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.particle {
  position: absolute; width: 4px; height: 4px; border-radius: 2px;
  background: var(--accent); opacity: 0;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  20%  { opacity: .6; }
  100% { opacity: 0; transform: translateY(-90vh) rotate(360deg); }
}
.hero-content { position: relative; z-index: 2; padding: 40px 20px; max-width: 850px; }
.bridge-icon {
  font-size: 80px; display: block;
  animation: bridgeSway 4s ease-in-out infinite;
  filter: drop-shadow(0 0 30px var(--accent));
}
@keyframes bridgeSway { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.hero-title {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  color: var(--wood-lt);
  text-shadow: 0 0 40px rgba(205,133,63,.5), 0 4px 8px rgba(0,0,0,.8);
  letter-spacing: .05em; margin-top: 15px;
  animation: fadeDown .8s ease both;
}
.hero-subtitle {
  font-size: 1.1rem; color: var(--accent); letter-spacing: .25em; text-transform: uppercase;
  margin: 10px 0 25px; animation: fadeDown .9s ease both;
}
.hero-desc {
  font-size: 1.2rem; color: var(--cream); line-height: 1.7;
  max-width: 650px; margin: 0 auto 35px; animation: fadeDown 1s ease both;
}
.hero-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 15px; flex-wrap: wrap; margin-bottom: 40px; animation: fadeDown 1.1s ease both;
}
.step-badge {
  background: rgba(205,133,63,.2); border: 1px solid var(--accent);
  color: var(--cream); padding: 10px 24px; border-radius: 50px;
  font-weight: 700; font-size: .95rem; backdrop-filter: blur(8px);
}
.step-arrow { color: var(--accent); font-size: 1.4rem; }
@keyframes fadeDown { from { opacity:0; transform: translateY(-20px); } to { opacity:1; transform: translateY(0); } }
.scroll-indicator {
  position: absolute; bottom: 30px; color: var(--accent); font-size: 1.8rem;
  animation: bounce 2s ease-in-out infinite; cursor: pointer; z-index: 2;
}
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(12px); } }

/* ==============================
   BUTTONS
============================== */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, #a0522d, #8b4513);
  color: #fff; border: none; padding: 15px 40px; border-radius: 50px;
  font-size: 1.1rem; font-weight: 800; font-family: 'Nunito', sans-serif;
  cursor: pointer; box-shadow: 0 4px 20px rgba(139,69,19,.4);
  transition: all .2s;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(139,69,19,.6); }
.btn-secondary {
  display: inline-block; background: transparent; color: var(--wood-lt);
  border: 2px solid var(--wood); padding: 13px 34px; border-radius: 50px;
  font-size: 1rem; font-weight: 700; font-family: 'Nunito', sans-serif;
  cursor: pointer; transition: all .2s;
}
.btn-secondary:hover { background: rgba(139,69,19,.2); transform: translateY(-2px); }
.btn-next {
  margin-top: 25px; display: inline-block;
  background: linear-gradient(135deg, #cd853f, #8b4513);
  color: #fff; border: none; padding: 13px 35px; border-radius: 50px;
  font-size: 1rem; font-weight: 800; font-family: 'Nunito', sans-serif;
  cursor: pointer; transition: all .2s;
}

/* ==============================
   SECTION COMMON
============================== */
.section-title {
  text-align: center; font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--wood-lt); margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(210,180,140,.3);
}
.section-title.light { color: #fff; }
.section-sub { text-align: center; color: var(--cream); font-size: 1.1rem; margin-bottom: 55px; opacity: .9; }
.section-sub.light { color: rgba(255,255,255,.8); }

/* ==============================
   LEARN SECTION
============================== */
.learn-section { padding: 100px 0 80px; background: #261701; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; margin-bottom: 90px; }
.flip-card { height: 230px; perspective: 1000px; cursor: pointer; }
.flip-card-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .6s cubic-bezier(.4,.2,.2,1); transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute; inset: 0; border-radius: var(--radius);
  backface-visibility: hidden; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 28px; text-align: center;
  box-shadow: var(--shadow);
}
.flip-front { background: linear-gradient(135deg, var(--dark2), var(--stone)); border: 1px solid rgba(210,180,140,.2); }
.flip-front .card-icon { font-size: 3.5rem; margin-bottom: 15px; }
.flip-front .card-title { font-family: 'Cinzel', serif; color: var(--wood-lt); font-size: 1.1rem; }
.flip-front .card-hint { font-size: .85rem; color: var(--accent); margin-top: 10px; opacity: .8; }
.flip-back { background: linear-gradient(135deg, #3d2700, #1a0f00); border: 1px solid rgba(210,180,140,.2); transform: rotateY(180deg); }
.flip-back p { color: var(--cream); font-size: 1rem; line-height: 1.6; }

/* TIMELINE */
.timeline-wrap { margin-bottom: 90px; }
.timeline-title { font-family: 'Cinzel', serif; color: var(--wood-lt); text-align: center; font-size: 1.8rem; margin-bottom: 45px; }
.timeline { position: relative; max-width: 800px; margin: 0 auto; padding-left: 50px; }
.timeline::before {
  content: ''; position: absolute; left: 20px; top: 0; bottom: 0;
  width: 4px; background: linear-gradient(180deg, var(--accent), transparent); border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 40px; opacity: 0; transform: translateX(-20px); transition: opacity .6s, transform .6s; }
.tl-item.visible { opacity: 1; transform: translateX(0); }
.tl-dot { position: absolute; left: -39px; top: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--wood-lt); border: 3px solid var(--accent); box-shadow: 0 0 15px var(--accent); }
.tl-year { font-family: 'Cinzel', serif; color: var(--accent); font-size: 1rem; font-weight: 700; }
.tl-text { color: var(--cream); font-size: 1rem; line-height: 1.6; margin-top: 5px; }

/* MAP + FACTS */
.map-fact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 850px) { .map-fact { grid-template-columns: 1fr; } }
.map-label { font-family: 'Cinzel', serif; color: var(--wood-lt); font-size: 1.1rem; margin-bottom: 15px; }
.map-note { font-size: .9rem; color: var(--accent); margin-top: 12px; text-align: center; opacity: .8; }
.fun-facts-box { background: linear-gradient(135deg, var(--dark2), var(--stone)); border: 1px solid rgba(210,180,140,.2); border-radius: var(--radius); padding: 35px; box-shadow: var(--shadow); }
.fun-facts-box h3 { font-family: 'Cinzel', serif; color: var(--wood-lt); font-size: 1.3rem; margin-bottom: 25px; }
.fun-list { list-style: none; }
.fun-list li {
  display: flex; gap: 15px; align-items: flex-start; padding: 12px 0;
  border-bottom: 1px solid rgba(210,180,140,.1); font-size: 1rem; color: var(--cream);
  line-height: 1.5; opacity: 0; transform: translateX(15px); transition: opacity .4s, transform .4s;
}
.fun-list li.visible { opacity: 1; transform: translateX(0); }
.fun-list li:last-child { border-bottom: none; }
.fun-list li .fi { font-size: 1.3rem; flex-shrink: 0; }

/* ==============================
   QUIZ SECTION
============================== */
.quiz-section { padding: 100px 0 80px; background: #1a0f00; position: relative; }
.quiz-card {
  max-width: 800px; margin: 0 auto;
  background: rgba(255,255,255,.03); border: 1px solid rgba(210,180,140,.15);
  border-radius: 24px; padding: 50px 40px;
  box-shadow: 0 10px 60px rgba(0,0,0,.6); backdrop-filter: blur(12px);
  position: relative; z-index: 1; min-height: 420px;
  display: flex; align-items: center; justify-content: center;
}
.quiz-start { text-align: center; }
.quiz-start-icon { font-size: 5.5rem; margin-bottom: 20px; }
.quiz-start h3 { font-size: 2rem; color: #fff; margin-bottom: 15px; }
.quiz-start p { color: rgba(255,255,255,.8); line-height: 1.7; margin-bottom: 35px; font-size: 1.1rem; }

.quiz-question-wrap { width: 100%; }
.quiz-progress-bar { width: 100%; height: 8px; background: rgba(255,255,255,.1); border-radius: 4px; margin-bottom: 25px; overflow: hidden; }
#quizProgressFill { height: 100%; background: linear-gradient(90deg, var(--wood), var(--accent)); transition: width .4s ease; width: 5%; }
.quiz-meta { display: flex; justify-content: space-between; margin-bottom: 30px; font-size: .95rem; color: rgba(255,255,255,.6); font-weight: 700; }
#quizQuestionText { font-size: 1.3rem; color: #fff; line-height: 1.5; margin-bottom: 30px; font-weight: 700; }

.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 580px) { .quiz-options { grid-template-columns: 1fr; } }
.quiz-opt {
  background: rgba(255,255,255,.05); border: 2px solid rgba(210,180,140,.2);
  border-radius: 12px; padding: 15px 20px; color: var(--cream);
  font-size: 1.05rem; font-family: 'Nunito', sans-serif; font-weight: 600;
  cursor: pointer; text-align: left; transition: all .2s;
}
.quiz-opt:hover:not(:disabled) { background: rgba(205,133,63,.15); border-color: var(--accent); transform: translateY(-2px); }
.quiz-opt.correct { background: rgba(46,204,113,.2); border-color: #2ecc71; color: #a8f0c8; }
.quiz-opt.wrong   { background: rgba(231,76,60,.2);  border-color: #e74c3c; color: #f4a9a2; }

.quiz-feedback { margin-top: 20px; padding: 15px 20px; border-radius: 12px; font-weight: 700; display: none; }
.quiz-feedback.show { display: block; animation: slideIn .3s ease; }
@keyframes slideIn { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }
.quiz-feedback.correct-fb { background: rgba(46,204,113,.1); border: 1px solid #2ecc71; color: #a8f0c8; }
.quiz-feedback.wrong-fb   { background: rgba(231,76,60,.1);  border: 1px solid #e74c3c; color: #f4a9a2; }

.quiz-result { text-align: center; width: 100%; }
.result-icon { font-size: 5.5rem; margin-bottom: 15px; }
.quiz-result h3 { font-size: 2.2rem; color: #fff; margin-bottom: 15px; }
.result-score { font-family: 'Cinzel', serif; font-size: 3.5rem; color: var(--wood-lt); font-weight: 800; }
.result-stars { font-size: 2.5rem; margin-top: 10px; color: var(--accent); }
.result-buttons { display: flex; gap: 20px; justify-content: center; margin-top: 35px; flex-wrap: wrap; }

/* ==============================
   DIPLOMA SECTION
============================== */
.diploma-section { padding: 100px 0; background: linear-gradient(180deg, #1a0f00 0%, #2d1c02 100%); text-align: center; }
.diploma-controls { display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; margin-bottom: 45px; }
.diploma-input {
  padding: 15px 25px; border-radius: 50px; border: 2px solid var(--wood);
  background: rgba(255,255,255,.05); color: var(--cream);
  font-size: 1.1rem; width: 350px; max-width: 100%; outline: none; transition: all .2s;
}
.diploma-input:focus { border-color: var(--accent); box-shadow: 0 0 15px rgba(205,133,63,.3); }
#diplomaCanvas { border-radius: 12px; box-shadow: 0 15px 50px rgba(0,0,0,.7); max-width: 100%; height: auto; }
.diploma-actions { display: flex; gap: 20px; justify-content: center; margin-top: 30px; }

/* ==============================
   FOOTER
============================== */
.site-footer { background: #0c0800; padding: 40px 24px; text-align: center; border-top: 1px solid rgba(210,180,140,.1); }
.site-footer p { color: var(--wood-lt); font-size: 1rem; margin: 5px 0; opacity: .7; }
.footer-small { font-size: .85rem !important; }

@media (max-width: 768px) {
  .hero-title { font-size: 3.5rem; }
  .quiz-card { padding: 35px 20px; }
  .cards-grid { grid-template-columns: 1fr; }
}
