/* ── Child picker button (header) ── */
#spelling-child-btn {
  font-size: 0.9rem;
}

.spelling-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spelling-modal-overlay.hidden { display: none; }
.spelling-child-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.6rem;
  width: min(320px, 88vw);
  text-align: center;
}
.spelling-child-box h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.spelling-child-option {
  display: block;
  width: 100%;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
}
.spelling-child-option.current {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ── Quiz overlay ── */
.spelling-quiz-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 350;
  display: flex;
  flex-direction: column;
  font-family: Georgia, serif;
  color: var(--text);
}
.spelling-quiz-overlay.hidden { display: none; }
.spelling-quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.spelling-quiz-progress {
  font-size: 0.95rem;
  color: var(--text2);
}
.spelling-quiz-header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.spelling-quiz-dict {
  font-family: Georgia, serif;
  font-size: 0.85rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text2);
  cursor: pointer;
  padding: .35rem .9rem;
}
.spelling-quiz-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text2);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
}

/* ── Λεξικό overlay ── */
.spelling-dict-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 360;
  display: flex;
  flex-direction: column;
  font-family: Georgia, serif;
  color: var(--text);
}
.spelling-dict-overlay.hidden { display: none; }
.spelling-dict-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.spelling-dict-title {
  font-size: 1.1rem;
  font-weight: bold;
}
.spelling-dict-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.2rem 2rem;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.spelling-dict-letter {
  position: sticky;
  top: 0;
  background: var(--bg);
  color: var(--accent);
  font-weight: bold;
  font-size: 1.1rem;
  padding: .6rem 0 .3rem;
  border-bottom: 1px solid var(--border);
  margin-top: .4rem;
}
.spelling-dict-entry {
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}
.spelling-dict-entry.gloss-clickable {
  cursor: pointer;
}
.spelling-dict-entry.gloss-clickable::after {
  content: " 💬";
  font-size: .85em;
  opacity: .6;
}

/* ── Γλωσσάρι: επεξηγήσεις-συννεφάκι (Λεξικό + ιστορίες) ── */
.gloss-word {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.gloss-bubble {
  position: fixed;
  z-index: 500;
  max-width: min(320px, 86vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  padding: .9rem 1.1rem;
  font-family: Georgia, serif;
  color: var(--text);
}
.gloss-bubble.hidden { display: none; }
.gloss-bubble-word {
  font-weight: bold;
  color: var(--accent);
  margin-bottom: .4rem;
}
.gloss-bubble-text {
  font-size: .92rem;
  line-height: 1.55;
  text-align: left;
}
.spelling-quiz-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}
.spelling-context {
  font-size: 0.95rem;
  color: var(--text2);
  font-style: italic;
  max-width: 480px;
  margin-bottom: 1.6rem;
  line-height: 1.6;
}
.spelling-target-word {
  color: var(--text);
  font-style: normal;
  font-weight: bold;
}
.spelling-blank-slot {
  display: inline-block;
  min-width: 1.1em;
  border-bottom: 3px solid var(--accent);
}
.spelling-context-typed {
  font-size: 1.15rem;
  font-style: normal;
  color: var(--text);
}
.spelling-type-input-inline {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  text-align: center;
  width: 7em;
  border: none;
  border-bottom: 3px solid var(--accent);
  background: transparent;
  color: var(--text);
  margin: 0 .2em;
}
.spelling-type-input-inline:focus { outline: none; }
.spelling-letter-input {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
  width: 2.4em;
  border: none;
  border-bottom: 3px solid var(--accent);
  background: transparent;
  color: var(--text);
  margin: 0 .1em;
}
.spelling-letter-input:focus { outline: none; }
.spelling-choices {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  justify-content: center;
  max-width: 480px;
}
.spelling-choice-btn {
  font-family: Georgia, serif;
  font-size: 1.15rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1.6rem;
  cursor: pointer;
  min-width: 88px;
}
.spelling-choice-btn:active { transform: scale(0.97); }
.spelling-choice-btn.correct { border-color: #4a9d5f; background: #e9f7ed; color: #205c30; }
.spelling-choice-btn.wrong { border-color: #c25454; background: #fbeaea; color: #7a2626; }
[data-theme="dark"] .spelling-choice-btn.correct { background: #163a20; color: #a9e6bb; }
[data-theme="dark"] .spelling-choice-btn.wrong { background: #3a1a1a; color: #f0b0b0; }

.spelling-check-btn {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 2rem;
  cursor: pointer;
}

.spelling-feedback {
  margin-top: 1.8rem;
  max-width: 480px;
}
.spelling-feedback-mark {
  font-size: 2.2rem;
  margin-bottom: .4rem;
}
.spelling-feedback-text {
  font-size: 1.1rem;
  margin-bottom: .6rem;
}
.spelling-rule {
  margin-top: .6rem;
}
.spelling-rule-why {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: Georgia, serif;
}
.spelling-rule-full {
  margin-top: .6rem;
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--accent-light);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  text-align: left;
}
.spelling-rule-fact {
  color: var(--text);
}
.spelling-rule-fact + .spelling-rule-fact {
  margin-top: .6rem;
}
.spelling-rule-note {
  margin-top: .6rem;
  font-style: italic;
  color: var(--text2);
}
.spelling-continue-btn {
  margin-top: 1.4rem;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.8rem 2.2rem;
  cursor: pointer;
}

.spelling-summary-emoji { font-size: 2.6rem; margin-bottom: .6rem; }
.spelling-summary-score {
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: .3rem;
}
.spelling-summary-pct {
  display: inline-block;
  border-radius: 999px;
  padding: .25em .8em;
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: .9rem;
}
.spelling-summary-pct.good { background: #e9f7ed; color: #205c30; }
.spelling-summary-pct.mid  { background: #fbf3d6; color: #7a5c10; }
.spelling-summary-pct.low  { background: #fbeaea; color: #7a2626; }
[data-theme="dark"] .spelling-summary-pct.good { background: #163a20; color: #a9e6bb; }
[data-theme="dark"] .spelling-summary-pct.mid  { background: #3a2f10; color: #f0d896; }
[data-theme="dark"] .spelling-summary-pct.low  { background: #3a1a1a; color: #f0b0b0; }
.spelling-summary-mastered {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: .3rem;
}
.spelling-summary-actions {
  display: flex;
  gap: .8rem;
  justify-content: center;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}
.spelling-summary-retry,
.spelling-summary-close {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  border-radius: 999px;
  padding: 0.8rem 1.8rem;
  cursor: pointer;
}
.spelling-summary-retry {
  background: var(--accent);
  color: #fff;
  border: none;
}
.spelling-summary-close {
  background: var(--accent-light);
  color: var(--text);
  border: 1px solid var(--highlight-border);
}
