/* ============================================================
   A GUIDE TO CPR — design.css
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --bg:               #EFF6FF;
  --bg-welcome:       #E6F1FF;
  --header-bg:        #C4D7EF;
  --navy:             #0A205C;
  --dark-blue:        #0A205C;
  --accent-blue:      #2245C4;
  --btn-blue:         #4D84D7;
  --btn-light:        #a8c8f0;
  --card-bg:          #ffffff;
  --card-border:      #c8dcf0;
  --level-card-bg:    #7ca8d8;
  --level-card-border:#2d4db5;
  --tip-bg:           #b0cce4;
  --green:            #7ab32e;
  --green-light:      #c5e89a;
  --red:              #e47070;
  --red-light:        #f5c0c0;
  --star:             #f0b832;
  --progress-bg:      #c0d8f0;
  --progress-fill:    #B6E0FF;
  --gradient:         linear-gradient(to bottom, #2245C4 16.75%, #4D84D7 81.38%);
  --font-pixel:       'Unbounded', sans-serif;
  --font-body:        'Space Grotesk', sans-serif;
  --radius:           12px;
  --radius-sm:        8px;
  --shadow:           0 2px 12px rgba(10, 32, 92, 0.10);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--navy);
  min-height: 100vh;
  overflow-x: hidden;
}
button { cursor: pointer; font-family: var(--font-body); border: none; outline: none; }
input, textarea { font-family: var(--font-body); }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ---- App Shell ---- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.screen { display: none; flex-direction: column; min-height: 100vh; background: var(--bg); }
.screen.active { display: flex; }

/* ============================================================
   WELCOME SCREEN
   ============================================================ */
#screen-welcome {
  position: relative;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px 20px;
  background: var(--bg-welcome);
}
.welcome-corner {
  position: absolute;
  width: 180px;
  height: 180px;
  background-image: url('img/cloud.png');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.75;
}
.welcome-corner.tl { top: -10px; left: -10px; }
.welcome-corner.tr { top: -10px; right: -10px; transform: scaleX(-1); }
.welcome-corner.bl { bottom: -10px; left: -10px; transform: scaleY(-1); }
.welcome-corner.br { bottom: -10px; right: -10px; transform: scale(-1); }

.welcome-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.welcome-title {
  font-family: var(--font-pixel);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.25;
  letter-spacing: 2px;
}
.welcome-desc {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.6;
  max-width: 560px;
}
.welcome-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.welcome-icon { width: 90px; image-rendering: pixelated; }

/* ============================================================
   LEVELS SCREEN
   ============================================================ */
#screen-levels { padding: 0; }
.levels-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  gap: 10px;
}
.sign-in-pill {
  background: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.user-avatar {
  width: 36px; height: 36px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--navy);
  background: #fff;
}
.levels-body {
  flex: 1;
  padding: 20px 48px 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.levels-heading {
  font-family: var(--font-pixel);
  font-size: 3.5rem;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 900px;
}
.level-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  cursor: pointer;
}
.level-card-box {
  background: var(--level-card-bg);
  border: 3px solid var(--level-card-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(30,58,148,0.13);
}
.level-card-box:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(30,58,148,0.2); }
.level-card-box.locked { opacity: 0.55; cursor: not-allowed; }
.level-card-box h3 {
  font-size: 1.05rem; font-weight: 900; color: var(--navy);
  text-align: center;
}
.level-card-box p {
  font-size: 0.95rem; font-weight: 700; color: var(--navy);
  text-align: center;
}
.level-card-icon { width: 64px; image-rendering: pixelated; }
.level-card-icon-emoji { font-size: 3rem; line-height: 1; }
.stars-row {
  display: flex; gap: 8px; align-items: center; justify-content: center;
}
.star-img { width: 36px; image-rendering: pixelated; }
.star-img.empty { filter: grayscale(1) opacity(0.4); }

/* ============================================================
   SHARED LEVEL HEADER BAR
   ============================================================ */
.level-header {
  background: var(--header-bg);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.back-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.back-btn:hover { background: rgba(30,58,148,0.1); }
.back-btn img { width: 22px; }
.back-arrow-char { font-size: 1.3rem; color: var(--navy); font-weight: 900; }

.level-header-titles { display: flex; flex-direction: column; gap: 2px; }
.level-header-titles .subtitle {
  font-size: 0.72rem; font-weight: 700; color: var(--dark-blue);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.level-header-titles .title {
  font-size: 0.95rem; font-weight: 900; color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ============================================================
   BOTTOM NAV BAR (L1 / L2 / L3)
   ============================================================ */
.bottom-bar {
  background: var(--bg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  border-top: 1px solid var(--card-border);
}
.progress-track {
  flex: 1;
  height: 8px;
  background: var(--progress-bg);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.nav-btn {
  width: 52px; height: 42px;
  background: #B6E0FF;
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 900; color: var(--navy);
  transition: background 0.15s, opacity 0.15s;
  cursor: pointer;
}
.nav-btn:hover:not(:disabled) { background: var(--btn-light); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.nav-btn img { width: 20px; }

.practice-now-btn {
  background: #fff;
  border: 2px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
  font-size: 0.85rem; font-weight: 800;
  padding: 8px 18px;
  transition: background 0.15s, color 0.15s;
}
.practice-now-btn:hover:not(:disabled) { background: var(--accent-blue); color: #fff; }
.practice-now-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.done-btn {
  background: #fff;
  border: 2px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
  font-size: 0.9rem; font-weight: 800;
  padding: 9px 28px;
  transition: background 0.15s, color 0.15s;
}
.done-btn:hover:not(:disabled) { background: var(--accent-blue); color: #fff; }
.done-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.timer-display {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 800; color: var(--navy);
  background: #fff;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}

/* ============================================================
   LEVEL 1 SLIDES
   ============================================================ */
.l1-main {
  flex: 1;
  padding: 28px 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}
.step-badge {
  display: inline-flex;
  align-items: center;
  background: var(--gradient);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  align-self: flex-start;
}
.step-counter {
  font-size: 0.8rem; font-weight: 700; color: var(--accent-blue);
  text-align: right; margin-top: -10px;
}

.l1-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  flex: 1;
}
.l1-left { display: flex; flex-direction: column; gap: 20px; }
.l1-right { display: flex; flex-direction: column; gap: 16px; }

.l1-body-text {
  font-size: 1.05rem; font-weight: 700; color: var(--accent-blue);
  line-height: 1.65;
}
.l1-body-text strong { color: var(--navy); }

.recall-label {
  font-size: 0.82rem; font-weight: 700; color: var(--dark-blue);
  margin-bottom: 4px;
}
.recall-list { display: flex; flex-direction: column; gap: 6px; }
.recall-list li {
  font-size: 0.95rem; font-weight: 700; color: var(--accent-blue);
  display: flex; gap: 8px; line-height: 1.45;
}
.recall-list li::before { content: '•'; color: var(--accent-blue); flex-shrink: 0; }

.video-thumb-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a2a4a;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  max-height: 220px;
}
.video-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.play-btn-overlay {
  position: absolute;
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.play-triangle {
  width: 0; height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 18px solid var(--navy);
  margin-left: 4px;
}
.video-placeholder-bg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a2a4a 0%, #2d4a7a 100%);
}

.info-box {
  background: #fff;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.info-tag {
  display: inline-flex;
  background: var(--tip-bg);
  color: var(--navy);
  font-size: 0.78rem; font-weight: 800;
  padding: 5px 12px;
  border-radius: 6px;
  align-self: flex-start;
}
.info-body-text {
  font-size: 0.82rem; font-weight: 600; color: var(--dark-blue);
  line-height: 1.55;
}
.tip-box {
  background: var(--bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.tip-tag {
  display: inline-flex;
  background: var(--tip-bg);
  color: var(--navy);
  font-size: 0.78rem; font-weight: 800;
  padding: 5px 12px;
  border-radius: 6px;
  align-self: flex-start;
}
.mistakes-list { display: flex; flex-direction: column; gap: 8px; }
.mistakes-list li {
  font-size: 0.82rem; font-weight: 600; color: var(--dark-blue);
  line-height: 1.5;
  display: flex; gap: 8px;
}
.mistakes-list li::before { content: '•'; flex-shrink: 0; color: var(--accent-blue); }
.full-width-col { grid-column: 1 / -1; }

/* ============================================================
   LEVEL 2 QUESTIONS
   ============================================================ */
.l2-main {
  flex: 1;
  padding: 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}
.hint-bar {
  display: flex; align-items: center; gap: 10px;
}
.hint-toggle-btn {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 0.82rem; font-weight: 700; color: var(--navy);
  transition: background 0.15s;
}
.hint-toggle-btn:hover { background: var(--bg); }
.hint-icon { font-size: 1.2rem; }
.hint-panel {
  background: #fffbea;
  border: 1.5px solid #e8d97a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem; font-weight: 600; color: #7a6000;
  line-height: 1.5;
  display: none;
}
.hint-panel.visible { display: block; }

.q-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.q-badge-row {
  display: flex; justify-content: center;
  padding: 14px 20px 0;
}
.q-badge {
  background: var(--gradient);
  color: #fff;
  font-size: 0.95rem; font-weight: 900;
  padding: 10px 32px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
}
.q-body {
  padding: 16px 28px 20px;
  text-align: center;
}
.q-type-label {
  font-size: 0.88rem; font-weight: 700; color: var(--accent-blue);
  display: block; margin-bottom: 6px;
}
.q-text {
  font-size: 1.15rem; font-weight: 800; color: var(--dark-blue);
  line-height: 1.5;
}

/* MC / TF options grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  border-top: 1px solid var(--card-border);
}
.option-btn {
  background: #fff;
  border: none;
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  padding: 22px 20px;
  font-size: 0.95rem; font-weight: 700; color: var(--dark-blue);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1.4;
}
.option-btn:hover:not(:disabled) { background: var(--bg); }
.option-btn.selected { background: var(--btn-light); color: var(--navy); }
.option-btn.correct  { background: var(--green-light); color: var(--green); font-weight: 900; }
.option-btn.incorrect{ background: var(--red-light); color: var(--red); font-weight: 900; }
.option-btn:disabled { cursor: default; }

/* Done btn centered */
.done-row { display: flex; justify-content: center; padding: 16px 20px 8px; }

/* Feedback row */
.feedback-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--card-border);
  display: none;
}
.feedback-row.visible { display: flex; }
.feedback-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 900;
  white-space: nowrap; flex-shrink: 0;
}
.feedback-badge.correct { background: var(--green-light); color: var(--green); border: 1.5px solid var(--green); }
.feedback-badge.incorrect { background: var(--red-light); color: var(--red); border: 1.5px solid var(--red); }
.feedback-text {
  font-size: 0.88rem; font-weight: 600; color: var(--dark-blue);
  line-height: 1.5;
}

/* Fill-in-the-blank */
.fitb-text {
  font-size: 1.1rem; font-weight: 700; color: var(--dark-blue);
  line-height: 2.2;
  padding: 16px 28px 20px;
  text-align: center;
}
.blank-input {
  display: inline-block;
  width: 72px;
  border: none;
  border-bottom: 2.5px solid var(--accent-blue);
  background: transparent;
  font-size: 1rem; font-weight: 700;
  text-align: center; color: var(--navy);
  padding: 2px 4px;
  outline: none;
  -webkit-appearance: none;
}
.blank-input:focus { border-bottom-color: var(--dark-blue); }
.blank-input.correct { border-bottom-color: var(--green); color: var(--green); }
.blank-input.incorrect { border-bottom-color: var(--red); color: var(--red); }

/* Matching */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 28px 20px;
  border-top: 1px solid var(--card-border);
}
.match-col { display: flex; flex-direction: column; gap: 10px; }
.match-item {
  background: #fff;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.9rem; font-weight: 700; color: var(--dark-blue);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-height: 60px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1.35;
}
.match-item:hover { background: var(--bg); }
.match-item.selected { border-color: var(--accent-blue); background: #e8f0fc; }
.match-item.matched-0 { border-color: #4a7bcf; background: #dce9fc; }
.match-item.matched-1 { border-color: #e47070; background: #fce8e8; }
.match-item.matched-2 { border-color: #7ab32e; background: #e8f5d0; }
.match-item.matched-3 { border-color: #e0a020; background: #fdf0d0; }
.match-item.correct  { border-color: var(--green); background: var(--green-light); }
.match-item.incorrect { border-color: var(--red); background: var(--red-light); }

/* Short answer textarea */
.short-answer-wrap { padding: 16px 28px 20px; }
.short-answer-textarea {
  width: 100%;
  min-height: 80px;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.95rem; font-weight: 600; color: var(--navy);
  resize: vertical;
  background: var(--bg);
  outline: none;
  line-height: 1.5;
}
.short-answer-textarea:focus { border-color: var(--accent-blue); background: #fff; }
.short-answer-textarea::placeholder { color: #90a8c8; }

/* ============================================================
   LEVEL 2 RESULT SCREEN
   ============================================================ */
.l2-result-main {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 32px; gap: 28px; text-align: center;
}
.result-score-circle {
  width: 130px; height: 130px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  font-weight: 900;
  border: 5px solid;
}
.result-score-circle.pass { border-color: var(--green); background: var(--green-light); color: var(--green); }
.result-score-circle.fail { border-color: var(--red); background: var(--red-light); color: var(--red); }
.score-big { font-size: 2.2rem; }
.score-label { font-size: 0.8rem; }
.result-title { font-size: 1.5rem; font-weight: 900; color: var(--navy); }
.result-msg { font-size: 1rem; font-weight: 600; color: var(--dark-blue); max-width: 480px; line-height: 1.6; }
.result-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ============================================================
   LEVEL 3 SCENARIOS
   ============================================================ */
.l3-intro-main {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 24px; padding: 24px 32px;
  overflow-y: auto;
}
.l3-intro-badge {
  background: var(--gradient); color: #fff;
  font-size: 1.1rem; font-weight: 900;
  padding: 12px 48px; border-radius: var(--radius-sm);
  letter-spacing: 1px;
}
.l3-intro-desc {
  font-size: 0.95rem; font-weight: 700; color: var(--dark-blue);
  text-align: center; max-width: 500px; line-height: 1.7;
}
.l3-intro-img {
  width: 100%; max-width: 580px;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #1a2a4a;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.l3-intro-img img { width: 100%; height: 100%; object-fit: cover; }
.l3-tagline {
  font-size: 1.3rem; font-weight: 900; color: var(--accent-blue);
  text-align: center;
}
.begin-mission-btn {
  background: #fff;
  border: 2.5px solid var(--accent-blue);
  color: var(--accent-blue);
  padding: 12px 36px;
  font-size: 1rem; font-weight: 800;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.begin-mission-btn:hover { background: var(--accent-blue); color: #fff; }

.l3-scenario-main {
  flex: 1;
  padding: 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}
.scenario-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column; gap: 0;
}
.scenario-desc {
  padding: 20px 28px 16px;
  font-size: 1.05rem; font-weight: 700; color: var(--accent-blue);
  text-align: center; line-height: 1.55;
  border-bottom: 1px solid var(--card-border);
}
.scenario-img {
  width: 100%; aspect-ratio: 16/9; max-height: 260px;
  background: linear-gradient(135deg, #1a2a4a 0%, #2d4a7a 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.scenario-img img { width: 100%; height: 100%; object-fit: cover; }
.scenario-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 4rem; opacity: 0.6;
}
.scenario-answer-wrap {
  padding: 16px 20px;
  border-top: 1px solid var(--card-border);
}
.scenario-textarea {
  width: 100%;
  min-height: 90px;
  background: #fafbff;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.95rem; font-weight: 600; color: var(--navy);
  resize: vertical; outline: none; line-height: 1.5;
}
.scenario-textarea:focus { border-color: var(--accent-blue); background: #fff; }
.scenario-textarea::placeholder { color: #90a8c8; }

/* L3 Ending screen */
.l3-end-main {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 24px; padding: 28px 32px;
  overflow-y: auto;
}
.l3-end-desc {
  font-size: 1rem; font-weight: 700; color: var(--dark-blue);
  text-align: center; max-width: 560px; line-height: 1.65;
}
.l3-end-img {
  width: 100%; max-width: 600px;
  border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 16/9;
  box-shadow: var(--shadow);
}
.l3-end-img img { width:100%; height:100%; object-fit: cover; }
.l3-congrats {
  font-size: 1.25rem; font-weight: 900; color: var(--navy);
  text-align: center; max-width: 580px; line-height: 1.6;
}

/* ============================================================
   MODAL / OVERLAY (L3 feedback popups)
   ============================================================ */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20,40,100,0.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
#modal-overlay.hidden { display: none; }
#modal-box {
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: var(--radius);
  overflow: hidden;
  width: min(560px, 92vw);
  box-shadow: 0 8px 40px rgba(10,20,80,0.25);
}
.modal-header {
  padding: 20px 28px;
  font-size: 1.6rem; font-weight: 900;
  text-align: center;
  color: var(--navy);
}
.modal-header.correct { background: var(--green); color: var(--navy); }
.modal-header.incorrect { background: var(--red); color: #fff; }
.modal-body { padding: 24px 28px 28px; }
.modal-body p { font-size: 0.92rem; font-weight: 600; color: var(--dark-blue); line-height: 1.6; }
.modal-remember {
  font-size: 0.88rem; font-weight: 700; color: var(--dark-blue);
  margin-bottom: 8px;
}
.modal-hint-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.modal-hint-list li {
  font-size: 0.88rem; font-weight: 600; color: var(--dark-blue);
  line-height: 1.45; display: flex; gap: 8px;
}
.modal-hint-list li::before { content: '•'; color: var(--accent-blue); flex-shrink: 0; }
.modal-actions {
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap; margin-top: 16px;
}

/* ============================================================
   BUTTONS (global)
   ============================================================ */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 800; cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  font-size: 1rem;
  padding: 14px 42px;
  border: none;
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  letter-spacing: 1px;
}
.btn-primary:hover { background: var(--dark-blue); }
.btn-secondary {
  background: #fff;
  color: var(--accent-blue);
  border: 2px solid var(--accent-blue);
  font-size: 0.88rem;
  padding: 10px 22px;
}
.btn-secondary:hover { background: var(--accent-blue); color: #fff; }
.btn-small {
  font-size: 0.82rem;
  padding: 9px 20px;
}
.try-again-btn {
  background: #fff;
  border: 2px solid var(--accent-blue);
  color: var(--accent-blue);
  font-size: 0.88rem; font-weight: 800;
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.try-again-btn:hover { background: var(--accent-blue); color: #fff; }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  .l1-two-col { grid-template-columns: 1fr; }
  .levels-grid { grid-template-columns: 1fr; max-width: 320px; }
  .options-grid { grid-template-columns: 1fr; }
  .match-grid { grid-template-columns: 1fr; }
  .l2-main, .l1-main, .l3-scenario-main { padding: 16px; }
  .welcome-title { font-size: 1.8rem; }
  .levels-body { padding: 16px; }
  .l3-intro-main { padding: 16px; }
}
