:root {
  --ink: #142d45;
  --muted: #617887;
  --bg: #f2f7f5;
  --line: #d9e5e0;
  --teal: #137d73;
  --gold: #ffd66d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 10% 0, #d9efe8, transparent 38%), var(--bg);
  color: var(--ink);
  font:
    16px/1.6 system-ui,
    "Segoe UI",
    sans-serif;
}
.shell {
  width: min(850px, calc(100% - 32px));
  margin: auto;
}
.top {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  background: #ffffffed;
  backdrop-filter: blur(12px);
}
.topline {
  display: flex;
  justify-content: space-between;
}
.brand {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-decoration: none;
}
.back {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.hero {
  margin: 24px 0;
  padding: clamp(26px, 6vw, 52px);
  border-radius: 26px;
  color: white;
  background: linear-gradient(120deg, #153149, #176c71);
  box-shadow: 0 18px 40px #173b4d20;
}
.kicker {
  color: #c8f1df;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 8px 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
}
.hero p {
  margin: 0;
  color: #e0efec;
}
.card {
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 8px 24px #193d4e0a;
}
.prompt {
  margin: 5px 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.word {
  display: block;
  margin: 12px 0;
  font-size: clamp(36px, 8vw, 60px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--teal);
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn {
  padding: 12px 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f2f7f4;
  color: var(--ink);
  font: 800 14px system-ui;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--teal);
  background: #e5f3ec;
}
.btn.main {
  border: 0;
  background: var(--gold);
}
.feedback {
  min-height: 28px;
  margin: 14px 0;
  color: #315c58;
  font-weight: 750;
}
.note {
  color: var(--muted);
  font-size: 12px;
}
.dictionary {
  margin: 16px 0 36px;
}
.dictionary h2 {
  margin: 0 0 6px;
  font-size: 22px;
}
.dictionary-form {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}
.dictionary-form label {
  font-size: 13px;
  font-weight: 800;
  color: #385b68;
}
.dictionary-search {
  display: flex;
  gap: 8px;
}
.dictionary-search input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdfc;
  color: var(--ink);
  font: inherit;
}
.dictionary-search .btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.quick-words {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 10px 0;
}
.quick-words span {
  color: var(--muted);
  font-size: 12px;
}
.quick-word {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #f7faf8;
  color: #176c71;
  font: 700 12px system-ui;
  cursor: pointer;
}
.quick-word:hover {
  background: #e5f3ec;
}
.dictionary-status {
  min-height: 24px;
  color: #315c58;
  font-size: 13px;
}
.dictionary-result {
  margin-top: 12px;
}
.dictionary-result-word {
  margin: 10px 0 0;
  color: var(--teal);
  font-size: 27px;
}
.pronunciation,
.translation {
  margin: 2px 0;
  color: #385b68;
  font-weight: 700;
}
.dictionary-result audio {
  display: block;
  width: min(100%, 360px);
  height: 38px;
  margin: 10px 0;
}
.dictionary-meaning {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbf9;
}
.dictionary-meaning h4 {
  margin: 0 0 5px;
  text-transform: capitalize;
}
.definition p {
  margin: 5px 0;
  color: #425d70;
  font-size: 14px;
}
.definition .example {
  padding-left: 10px;
  border-left: 3px solid #b9d9ce;
  font-style: italic;
}
.dictionary-credit {
  display: inline-block;
  margin-top: 12px;
  color: #176c71;
  font-size: 12px;
  font-weight: 800;
}
.dictionary-status {
  margin: 10px 0;
}
.dictionary-search .btn {
  white-space: nowrap;
}
@media (max-width: 500px) {
  .dictionary-search {
    flex-direction: column;
  }
  .dictionary-search .btn {
    width: 100%;
  }
}
.phrase-section {
  margin: 16px 0 40px;
}
.phrase-section h2 {
  margin: 0 0 6px;
  font-size: 22px;
}
.phrase-form {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}
.phrase-form label {
  font-size: 13px;
  font-weight: 800;
  color: #385b68;
}
.phrase-results {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.phrases-language {
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdfc;
  color: var(--ink);
  font: 700 13px system-ui;
}
.phrase-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fbf9;
}
.phrase-english {
  margin: 0;
  color: #176c71;
  font-size: 18px;
  font-weight: 850;
}
.phrase-spanish {
  margin: 2px 0 8px;
  color: #344f61;
}
.phrase-translation-label {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.phrase-meta {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.phrase-more {
  display: block;
  margin: 14px auto 0;
}
.module-tabs {
  display: flex;
  gap: 7px;
  margin: 0 0 14px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #eaf2ef;
}
.module-tab {
  flex: 1;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #496472;
  font: 800 13px system-ui;
  cursor: pointer;
}
.module-tab.active {
  background: #176c71;
  color: #fff;
  box-shadow: 0 3px 10px #173b4d20;
}
.module-panel[hidden] {
  display: none !important;
}
.grammar-card {
  margin-bottom: 36px;
}
.grammar-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
}
.grammar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}
.grammar-controls label {
  font-size: 13px;
  font-weight: 800;
}
.grammar-controls select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfc;
  color: var(--ink);
  font: 700 13px system-ui;
}
.grammar-lesson {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7faf8;
}
.grammar-lesson h3 {
  margin: 0 0 5px;
  color: #176c71;
}
.grammar-lesson p {
  margin: 5px 0;
  color: #405a6a;
}
.grammar-pattern {
  padding: 9px 11px;
  border-radius: 9px;
  background: #e8f3ef;
  font-weight: 800;
}
.grammar-lesson ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #405a6a;
}
.grammar-challenge {
  margin-top: 16px;
}
.grammar-challenge h3 {
  margin: 0 0 12px;
  font-size: 18px;
}
.grammar-correct {
  color: #176c45;
}
.grammar-retry {
  color: #965814;
}
.grammar-answer-good {
  border-color: #248451 !important;
  background: #e4f5e9 !important;
}
.grammar-answer-wrong {
  border-color: #c45f5f !important;
  background: #fff0ed !important;
}
@media (max-width: 540px) {
  .module-tab {
    padding: 9px 5px;
    font-size: 11px;
  }
  .grammar-controls {
    align-items: flex-start;
    flex-direction: column;
  }
}
