:root {
  --bg: #faf7f2;
  --bg-card: #ffffff;
  --bg-muted: #f3ede2;
  --ink: #1d1a16;
  --ink-soft: #6b6358;
  --accent: #c54b1c;       /* laranja queimado — tom Tamil Nadu sem ser bandeira */
  --accent-soft: #f3d9c9;
  --accent-deep: #8e2e0e;
  --green: #2f7d3e;
  --red: #b8341a;
  --line: #e5dccb;
  --shadow: 0 1px 3px rgba(40, 30, 20, 0.06), 0 4px 16px rgba(40, 30, 20, 0.04);
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; }

.app {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* Header */
header.top {
  padding: 28px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
header.top h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
header.top h1 .accent { color: var(--accent); }
header.top .tag {
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 4px;
}
.progress-wrap {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-muted);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}
.progress-txt {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Nav tabs */
nav.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
nav.tabs button {
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 0.15s;
}
nav.tabs button:hover { color: var(--ink); }
nav.tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

/* Lessons grid */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  text-align: left;
  width: 100%;
}
.lesson-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 75, 28, 0.08);
}
.lesson-card .num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}
.lesson-card h3 {
  margin: 6px 0 6px;
  font-size: 17px;
  font-weight: 600;
}
.lesson-card .sub {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}
.lesson-card .badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.lesson-card .badge.done {
  background: #d8eddb;
  color: var(--green);
}

/* Lesson detail */
.back-link {
  display: inline-block;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 16px;
  padding: 4px 0;
}
.lesson-title { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.lesson-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 16px; }
.intro-box {
  background: var(--bg-muted);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: 4px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--ink);
}

/* Vocab cards */
.vocab-list { display: flex; flex-direction: column; gap: 12px; }
.vocab-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  align-items: start;
}
.vocab-card .pt {
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 2px;
}
.vocab-card .ta {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.vocab-card .note {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  margin-top: 4px;
  line-height: 1.5;
}
.vocab-card .example {
  grid-column: 1 / -1;
  background: var(--bg-muted);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 4px;
}
.vocab-card .example .ex-pt { color: var(--ink-soft); }
.vocab-card .example .ex-ta { color: var(--accent-deep); font-weight: 500; }
.speak-btn {
  background: var(--bg-muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.speak-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Primary button */
.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.15s;
}
.btn:hover { background: var(--accent-deep); }
.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn.outline:hover { background: var(--accent-soft); }
.btn.big {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  font-size: 16px;
}

/* Practice */
.practice-shell {
  max-width: 600px;
  margin: 0 auto;
}
.practice-progress {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.question {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 28px;
  margin-bottom: 16px;
}
.question .q {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.4;
}
.options { display: flex; flex-direction: column; gap: 8px; }
.option-btn {
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  text-align: left;
  font-size: 15px;
  transition: all 0.15s;
}
.option-btn:hover { border-color: var(--accent); }
.option-btn.correct {
  background: #e9f5eb;
  border-color: var(--green);
  color: var(--green);
}
.option-btn.wrong {
  background: #f9e6e1;
  border-color: var(--red);
  color: var(--red);
}
.option-btn:disabled { cursor: default; }

.type-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  background: var(--bg);
}
.type-input:focus {
  outline: none;
  border-color: var(--accent);
}
.feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 14px;
}
.feedback.ok { background: #e9f5eb; color: var(--green); }
.feedback.bad { background: #f9e6e1; color: var(--red); }
.feedback .hint { color: var(--ink-soft); margin-top: 6px; }
.hint-text { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

/* Result screen */
.result {
  text-align: center;
  padding: 40px 20px;
}
.result .score {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  margin: 16px 0;
}
.result .msg {
  font-size: 17px;
  margin-bottom: 24px;
  color: var(--ink);
}
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Phrasebook */
.search-box {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  margin-bottom: 20px;
  background: var(--bg-card);
}
.search-box:focus { outline: none; border-color: var(--accent); }
.phrase-section { margin-bottom: 24px; }
.phrase-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin: 0 0 10px;
  font-weight: 600;
}
.phrase-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 14px;
}
.phrase-row:last-child { border-bottom: none; }
.phrase-row .pr-pt { color: var(--ink-soft); }
.phrase-row .pr-ta { font-weight: 600; color: var(--accent-deep); }
.phrase-row .pr-note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 0 0 8px;
  margin-top: -4px;
}

/* Pronunciation page */
.pron-list .pron-row {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.pron-list .sound {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-right: 10px;
}
.pron-list .ex {
  color: var(--ink-soft);
  font-size: 13px;
  font-style: italic;
}
.pron-list .tip {
  margin-top: 6px;
  font-size: 14px;
}

/* About */
.about p { font-size: 14px; line-height: 1.6; color: var(--ink); }
.about ul { font-size: 14px; line-height: 1.7; padding-left: 18px; }

/* Dialogues */
.dlg-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.dlg-line {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: start;
}
.dlg-who {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding-top: 14px;
}
.dlg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.dlg-ta {
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: 4px;
}
.dlg-pt {
  font-size: 14px;
  color: var(--ink-soft);
}
@media (max-width: 600px) {
  .dlg-line { grid-template-columns: 70px 1fr auto; gap: 8px; }
  .dlg-who { font-size: 11px; padding-top: 10px; }
  .dlg-bubble { padding: 10px 12px; }
  .dlg-ta { font-size: 15px; }
}

@media (max-width: 600px) {
  .app { padding: 0 14px 60px; }
  header.top h1 { font-size: 22px; }
  .lesson-card { padding: 14px; }
  .question { padding: 18px; }
  .vocab-card { padding: 14px; grid-template-columns: 1fr; }
  .speak-btn { justify-self: end; margin-top: -36px; }
  .phrase-row { grid-template-columns: 1fr; gap: 4px; padding: 10px 12px; }
}
