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

:root {
  --purple:       #6d28d9;
  --purple-light: #ede9fe;
  --bg:           #f5f3ff;
  --surface:      #fff;
  --border:       #e5e7eb;
  --text:         #111827;
  --muted:        #6b7280;
  --green:        #059669;
  --amber:        #d97706;
  --red:          #dc2626;
  --blue:         #2563eb;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Header ── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--purple);
  flex-shrink: 0;
}

.header-stats {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.stat-pill {
  background: var(--bg);
  color: var(--muted);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.stat-pill.due { background: #fee2e2; color: var(--red); }

/* ── Tabs ── */
.tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  padding: 0 12px;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .15s;
}

.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--purple); border-bottom-color: var(--purple); }

.badge {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.badge:empty { display: none; }

/* ── Main area ── */
.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.tab-content         { display: none; }
.tab-content.active  { display: block; }

/* ── Search ── */
.toolbar {
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--purple); }

.lib-select {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.lib-select:focus { border-color: var(--purple); }

.lib-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 14px 0 6px;
  padding-left: 4px;
}
.lib-group-label:first-child { margin-top: 0; }

/* ── Word card ── */
.word-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  transition: box-shadow .15s;
}
.word-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }

.word-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.word-main  { flex: 1; min-width: 0; }

.word-name        { font-size: 15px; font-weight: 600; }
.word-translation { color: var(--muted); font-size: 13px; margin-left: 6px; }

.word-cefr {
  font-size: 10px;
  font-weight: 700;
  background: var(--purple-light);
  color: var(--purple);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.word-meta {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.stage-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.stage-new      { background: #dbeafe; color: var(--blue); }
.stage-learning { background: #fef3c7; color: var(--amber); }
.stage-mature   { background: #d1fae5; color: var(--green); }
.stage-due      { background: #fee2e2; color: var(--red); }

.word-actions { display: flex; gap: 2px; flex-shrink: 0; }

.icon-btn {
  background: none;
  border: none;
  padding: 4px 7px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  transition: background .12s, color .12s;
}
.icon-btn:hover      { background: var(--bg); color: var(--text); }
.icon-btn.del:hover  { background: #fee2e2; color: var(--red); }
.icon-btn.learn-btn.is-on { color: var(--green); font-weight: 700; }
.icon-btn.learn-btn:hover { background: #d1fae5; color: var(--green); }

.word-card.is-learned       { opacity: 0.55; background: var(--bg); }
.word-card.is-learned:hover { opacity: 0.85; }

.word-source {
  color: var(--purple);
  background: var(--purple-light);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Word expand ── */
.word-expand {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.word-card.expanded .word-expand { display: block; }

.ctx-block       { margin-bottom: 8px; }
.ctx-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 3px;
}
.ctx-text        { font-size: 13px; color: var(--text); line-height: 1.5; }
.ctx-translation { font-size: 12px; color: var(--purple); margin-top: 2px; }

/* ── Empty state ── */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 56px 16px;
  font-size: 15px;
}

/* ── Review ── */
.review-header {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 16px;
}

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px 24px;
  text-align: center;
}

.review-word { font-size: 32px; font-weight: 700; margin-bottom: 6px; }
.review-sub  { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.review-speak-btn {
  background: var(--purple-light);
  color: var(--purple);
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background .15s;
}
.review-speak-btn:hover { background: #ddd6fe; }

.show-answer-btn {
  display: block;
  width: 100%;
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.show-answer-btn:hover { background: #5b21b6; }

/* Answer section */
.review-reveal {
  display: none;
  text-align: left;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.review-card.revealed .review-reveal  { display: block; }
.review-card.revealed .show-answer-btn { display: none; }

.review-translation {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

.btn-again, .btn-hard, .btn-good, .btn-easy {
  border: none;
  padding: 10px 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: opacity .15s;
}
.btn-again:hover, .btn-hard:hover, .btn-good:hover, .btn-easy:hover { opacity: .8; }

.btn-again { background: #fee2e2; color: var(--red); }
.btn-hard  { background: #fef3c7; color: var(--amber); }
.btn-good  { background: #d1fae5; color: var(--green); }
.btn-easy  { background: #dbeafe; color: var(--blue); }

.btn-interval { font-size: 11px; font-weight: 400; opacity: .8; }

.review-done { text-align: center; padding: 64px 24px; color: var(--muted); }
.review-done h2 { font-size: 24px; color: var(--text); margin-bottom: 8px; }

/* ── Add form ── */
.add-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.add-form h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.input-row { display: flex; gap: 8px; margin-bottom: 16px; }

.word-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.word-input:focus { border-color: var(--purple); }

.gen-btn {
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.gen-btn:hover    { background: #5b21b6; }
.gen-btn:disabled { background: #c4b5fd; cursor: not-allowed; }

.gen-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

.pv-word         { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.pv-meta         { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.pv-transcription { font-style: italic; color: var(--muted); font-size: 13px; margin-bottom: 12px; }

.save-btn {
  width: 100%;
  background: var(--green);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.save-btn:hover { background: #047857; }

.error-msg  { color: var(--red); font-size: 13px; padding: 8px 0; }
.loading    { color: var(--muted); font-size: 13px; padding: 8px 0; text-align: center; }

.hidden { display: none !important; }

/* ── Textbook ── */
.tb-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.tb-breadcrumb a {
  color: var(--purple);
  text-decoration: none;
  cursor: pointer;
}
.tb-breadcrumb a:hover { text-decoration: underline; }

.tb-book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow .15s;
}
.tb-book-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.tb-book-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.tb-book-meta { font-size: 12px; color: var(--muted); }

.tb-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.tb-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width .3s;
}

.tb-chapter-list { list-style: none; }
.tb-chapter-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow .15s;
}
.tb-chapter-item:hover { box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.tb-chapter-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  min-width: 28px;
  text-align: center;
}
.tb-chapter-info { flex: 1; min-width: 0; }
.tb-chapter-title { font-size: 14px; font-weight: 500; }
.tb-chapter-type { font-size: 11px; color: var(--muted); }
.tb-chapter-check {
  font-size: 16px;
  color: var(--green);
  flex-shrink: 0;
}

/* ── Vocab page (interactive textbook page with clickable bold words) ───── */
.vocab-page { display: flex; flex-direction: column; gap: 18px; }
.vocab-section {
  background: var(--bg-card, #fff);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border, #eaeaea);
}
.vocab-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.vocab-section-letter {
  background: var(--accent, #0068a9);
  color: #fff;
  font-weight: 700;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
}
.vocab-section-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent, #0068a9);
}
.vocab-section-text {
  margin: 0;
  line-height: 1.6;
  color: var(--text, #222);
}
.vocab-word {
  font-weight: 600;
  color: var(--accent, #0068a9);
  cursor: pointer;
  border-bottom: 1px dashed var(--accent, #0068a9);
  transition: background 0.12s;
  padding: 0 1px;
}
.vocab-word:hover {
  background: rgba(0, 104, 169, 0.12);
}

/* Word popup */
.vocab-popup {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--border, #ddd);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  padding: 14px 16px;
  width: 320px;
  max-width: calc(100vw - 24px);
  font-size: 14px;
  color: #222;
}
.vocab-popup-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.vocab-popup-word {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent, #0068a9);
  flex: 1;
}
.vocab-popup-ipa {
  color: #888;
  font-size: 13px;
  font-family: 'TimesLTStd-Phonetic', 'Doulos SIL', serif;
}
.vocab-popup-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #aaa;
  cursor: pointer;
  padding: 0 4px;
}
.vocab-popup-close:hover { color: #333; }
.vocab-popup-translation {
  font-weight: 600;
  color: var(--purple, #7a3ed1);
  margin-bottom: 6px;
}
.vocab-popup-definition {
  color: #444;
  margin-bottom: 8px;
}
.vocab-popup-example {
  font-style: italic;
  color: #555;
  margin-bottom: 2px;
}
.vocab-popup-example-ru {
  font-style: italic;
  color: var(--purple, #7a3ed1);
  margin-bottom: 10px;
  font-size: 13px;
}
.vocab-popup-add {
  width: 100%;
  background: var(--accent, #0068a9);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.vocab-popup-add:hover:not(:disabled) { background: #00558c; }
.vocab-popup-add:disabled { opacity: 0.7; cursor: default; }
.vocab-popup-add.added { background: #4caf50; }
.vocab-popup-status {
  margin-top: 6px;
  font-size: 12px;
  color: #4caf50;
  min-height: 16px;
}

.tb-section { margin-bottom: 24px; }
.tb-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--purple);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--purple-light);
}

/* Vocabulary block */
.tb-vocab-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.tb-vocab-word {
  font-weight: 600;
  font-size: 15px;
}
.tb-vocab-ipa {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  margin-left: 6px;
}
.tb-vocab-def { font-size: 13px; margin-top: 2px; }
.tb-vocab-trans { color: var(--purple); font-size: 13px; }
.tb-vocab-example {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 4px;
}

/* Explanation block */
.tb-explanation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 8px;
}
.tb-explanation h4 { font-size: 14px; margin-bottom: 6px; }
.tb-explanation p { font-size: 13px; line-height: 1.6; margin-bottom: 6px; }
.tb-explanation .note {
  background: #fffbeb;
  border-left: 3px solid var(--amber);
  padding: 6px 10px;
  font-size: 12px;
  margin-top: 6px;
  border-radius: 0 6px 6px 0;
}
.tb-ex-item {
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.tb-ex-item:last-child { border-bottom: none; }
.tb-ex-highlight { background: #fef08a; padding: 1px 3px; border-radius: 2px; }
.tb-ex-ru { color: var(--muted); font-size: 12px; }

/* Exercise styles */
.tb-exercise {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
}
.tb-exercise-q {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.tb-exercise-prompt {
  font-size: 15px;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Multiple choice */
.tb-mc-options { list-style: none; }
.tb-mc-option {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background .12s, border-color .12s;
}
.tb-mc-option:hover { background: var(--bg); border-color: var(--purple); }
.tb-mc-option.selected { border-color: var(--purple); background: var(--purple-light); }
.tb-mc-option.correct { border-color: var(--green); background: #d1fae5; }
.tb-mc-option.wrong { border-color: var(--red); background: #fee2e2; }

/* Fill blank */
.tb-fill-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tb-fill-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.tb-fill-input:focus { border-color: var(--purple); }
.tb-fill-input.correct { border-color: var(--green); background: #d1fae5; }
.tb-fill-input.wrong { border-color: var(--red); background: #fee2e2; }
textarea.tb-free-text {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
}
textarea.tb-free-text:focus { border-color: var(--purple); }
.tb-check-btn {
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tb-check-btn:hover { background: #5b21b6; }
.tb-check-btn:disabled { background: #c4b5fd; cursor: not-allowed; }

/* Matching */
.tb-match-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tb-match-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: all .12s;
  user-select: none;
}
.tb-match-item:hover { border-color: var(--purple); }
.tb-match-item.selected { border-color: var(--purple); background: var(--purple-light); }
.tb-match-item.matched { border-color: var(--green); background: #d1fae5; opacity: .7; pointer-events: none; }
.tb-match-item.wrong { border-color: var(--red); background: #fee2e2; }
.tb-match-left, .tb-match-right { display: flex; flex-direction: column; gap: 6px; }

/* True/False */
.tb-tf-options { display: flex; gap: 8px; }
.tb-tf-btn {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  background: var(--surface);
  transition: all .12s;
}
.tb-tf-btn:hover { border-color: var(--purple); background: var(--bg); }
.tb-tf-btn.correct { border-color: var(--green); background: #d1fae5; }
.tb-tf-btn.wrong { border-color: var(--red); background: #fee2e2; }

/* Hint & explanation feedback */
.tb-hint {
  font-size: 12px;
  color: var(--amber);
  margin-top: 6px;
  cursor: pointer;
}
.tb-explanation-feedback {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}
.tb-explanation-feedback.correct { background: #d1fae5; color: #065f46; }
.tb-explanation-feedback.wrong { background: #fee2e2; color: #991b1b; }

/* Image exercise */
.tb-image-note {
  font-size: 12px;
  color: var(--amber);
  font-style: italic;
  margin-bottom: 8px;
}
.tb-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.tb-image-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tb-image-card .tb-exercise-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.tb-image-card .tb-fill-row { flex-wrap: wrap; }
.tb-image-card .tb-fill-input { min-width: 0; font-size: 13px; }
.tb-image-card .tb-check-btn { padding: 7px 10px; font-size: 12px; }
.tb-img-desc-box {
  background: #f3f4f6;
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tb-item-num {
  font-weight: 600;
  min-width: 24px;
  text-align: right;
  color: var(--muted);
}

/* Poster cards exercise */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.poster-card {
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #333;
  background: #fdf6e3;
}
.poster-header {
  background: #1a1a1a;
  color: #fbbf24;
  font-weight: 800;
  font-size: 12px;
  text-align: center;
  padding: 8px 6px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.poster-card.poster-missing .poster-header {
  background: #1e3a5f;
  color: #93c5fd;
}
.poster-portrait {
  display: flex;
  justify-content: center;
  padding: 12px;
}
.poster-silhouette {
  width: 80px;
  height: 90px;
  background: #e5e1d6;
  border: 2px solid #c4bfb0;
  border-radius: 6px;
  position: relative;
}
.poster-silhouette::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  background: #c4bfb0;
  border-radius: 50%;
}
.poster-silhouette::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 26px;
  background: #c4bfb0;
  border-radius: 22px 22px 0 0;
}
.poster-name {
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 0 10px;
  color: #1a1a1a;
}
.poster-desc {
  font-size: 12px;
  text-align: center;
  padding: 4px 10px 2px;
  color: #555;
}
.poster-blanks {
  padding: 4px 10px 14px;
  font-size: 12px;
  text-align: center;
  line-height: 2;
  color: #555;
}
.poster-blank-group { white-space: nowrap; }
.poster-input {
  width: 70px;
  border: none;
  border-bottom: 2px dotted #999;
  background: transparent;
  font-size: 12px;
  text-align: center;
  padding: 2px 4px;
  outline: none;
  color: #1a1a1a;
  font-family: inherit;
  transition: border-color .15s;
}
.poster-input:focus { border-bottom-color: var(--purple); }
.poster-input:not(:placeholder-shown) { border-bottom-color: var(--green); border-bottom-style: solid; }

@media (max-width: 500px) {
  .poster-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .poster-silhouette { width: 60px; height: 70px; }
  .poster-input { width: 56px; font-size: 11px; }
}

/* Score bar */
.tb-score-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  margin-top: 20px;
}
.tb-score-value { font-size: 32px; font-weight: 700; color: var(--purple); }
.tb-score-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tb-score-bar .tb-check-btn { margin-top: 12px; }

/* ── Responsive ── */
@media (max-width: 500px) {
  .review-word     { font-size: 24px; }
  .review-actions  { grid-template-columns: 1fr 1fr; }
  .review-card     { padding: 24px 16px 16px; }
}
