:root {
  --ink: #172426;
  --muted: #5f6f72;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --teal: #2f7d7e;
  --teal-dark: #1c5f61;
  --coral: #f0785a;
  --gold: #f1b84b;
  --mint: #dff3ec;
  --line: #dbe3df;
  --shadow: 0 18px 55px rgba(23, 36, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(251, 250, 247, 0.92);
  border-bottom: 1px solid rgba(219, 227, 223, 0.8);
  backdrop-filter: blur(16px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 8px;
}

.language-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(48px, 1fr));
  gap: 4px;
  padding: 4px;
  background: #edf4f2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.language-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 900;
}

.language-button.is-active {
  color: #fff;
  background: var(--teal);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.top-nav a:hover {
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 68px);
  padding: clamp(34px, 6vw, 86px) clamp(18px, 5vw, 72px) 44px;
  background:
    linear-gradient(135deg, rgba(223, 243, 236, 0.9), rgba(255, 255, 255, 0.42) 46%, rgba(240, 120, 90, 0.16)),
    var(--paper);
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 6.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.hero-text {
  max-width: 570px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.7;
}

.typing-panel {
  width: 100%;
  padding: clamp(18px, 3vw, 28px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar,
.feedback-row,
.lead-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar {
  justify-content: space-between;
}

.word-bank-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.word-bank-panel[hidden] {
  display: none;
}

.select-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.practice-select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  font-weight: 800;
}

.practice-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(47, 125, 126, 0.14);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 290px);
  padding: 4px;
  background: #edf4f2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-button,
.sound-button,
.primary-button,
.lead-row button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 850;
}

.mode-button {
  color: var(--muted);
  background: transparent;
}

.mode-button.is-active {
  color: #fff;
  background: var(--teal);
}

.sound-button {
  min-width: 98px;
  padding: 0 12px;
  color: var(--teal-dark);
  background: #fff4d6;
  border: 1px solid #f5d47c;
  font-size: 0.9rem;
}

.prompt-wrap {
  margin-top: 24px;
  padding: clamp(18px, 4vw, 28px);
  background: #f7fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.speak-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--teal-dark);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 900;
}

.speak-button:hover {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(47, 125, 126, 0.1);
}

.game-strip {
  display: grid;
  grid-template-columns: minmax(76px, 0.45fr) minmax(160px, 1fr) minmax(82px, 0.45fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  background: #fffaf0;
  border: 1px solid #f2d99a;
  border-radius: 8px;
}

.best-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.best-strip div {
  display: grid;
  gap: 3px;
  min-height: 58px;
  align-content: center;
  padding: 10px;
  background: #f3f7f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.best-strip span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.best-strip strong {
  font-size: 1.15rem;
}

.timer-pill,
.stars {
  display: grid;
  min-height: 54px;
  place-items: center;
  padding: 8px;
  background: #fff;
  border: 1px solid #f2d99a;
  border-radius: 8px;
  text-align: center;
}

.timer-pill span,
.power-top span,
.next-key-line span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timer-pill strong {
  font-size: 1.3rem;
}

.power-wrap {
  min-width: 0;
}

.power-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.power-track {
  height: 14px;
  overflow: hidden;
  background: #f4e6bd;
  border-radius: 999px;
}

.power-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--teal));
  border-radius: inherit;
  transition: width 180ms ease;
}

.stars {
  color: var(--gold);
  font-size: 1.18rem;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.prompt-label,
.input-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prompt-text {
  min-height: 74px;
  margin-top: 8px;
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.prompt-meaning {
  min-height: 26px;
  margin-top: 10px;
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.45;
}

.prompt-text.is-correct {
  color: var(--teal-dark);
}

.prompt-text.is-wrong {
  color: #a9382a;
}

.input-label {
  margin-top: 18px;
}

.typing-input,
.lead-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.typing-input {
  min-height: 58px;
  margin-top: 8px;
  padding: 0 16px;
  font-size: 1.28rem;
  font-weight: 750;
}

.keyboard-panel {
  margin-top: 14px;
  padding: 14px;
  background: #f7fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.next-key-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.next-key-line strong {
  display: grid;
  min-width: 40px;
  min-height: 34px;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 7px;
  font-size: 1.1rem;
}

.keyboard {
  display: grid;
  gap: 7px;
}

.key-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.key {
  display: grid;
  width: clamp(24px, 5.8vw, 42px);
  height: clamp(30px, 6vw, 42px);
  place-items: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 2px 0 #c7d2cf;
  cursor: default;
  font-size: 0.92rem;
  font-weight: 900;
  text-transform: uppercase;
}

.key.is-next {
  color: #fff;
  background: var(--coral);
  border-color: #cf573d;
  box-shadow: 0 0 0 4px rgba(240, 120, 90, 0.18), 0 2px 0 #a33f2a;
  transform: translateY(-1px);
}

.typing-input:focus,
.lead-row input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(47, 125, 126, 0.14);
}

.feedback-row {
  justify-content: space-between;
  margin-top: 14px;
}

.feedback {
  min-height: 24px;
  color: var(--muted);
  font-weight: 750;
}

.primary-button,
.secondary-button,
.lead-row button {
  color: #fff;
  background: var(--coral);
  padding: 0 18px;
  white-space: nowrap;
}

.primary-button:hover,
.secondary-button:hover,
.lead-row button:hover {
  background: #d95f45;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.result-card {
  margin-top: 16px;
  padding: 18px;
  background: #fffaf0;
  border: 1px solid #f2d99a;
  border-radius: 8px;
}

.result-card h3 {
  margin-bottom: 6px;
}

.result-card p {
  color: var(--muted);
  line-height: 1.6;
}

.secondary-button {
  min-height: 42px;
  padding: 0 16px;
}

.stat {
  padding: 14px 10px;
  text-align: center;
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-value {
  display: block;
  font-size: clamp(1.22rem, 3vw, 1.8rem);
  font-weight: 950;
}

.stat-label {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.ad-band,
.content-band,
.split-band,
.seo-band {
  padding: clamp(34px, 6vw, 78px) clamp(18px, 5vw, 72px);
}

.ad-band {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 120px;
  color: #4e5960;
  background: #eef1f0;
  border-block: 1px dashed #b9c7c4;
  text-align: center;
}

.ad-band span,
.ad-band small {
  color: var(--muted);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.feature-grid,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature,
.tool-link,
.lead-box,
.faq-list details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feature {
  padding: 22px;
}

.feature p,
.split-band p,
.seo-band p,
.lead-box p {
  color: var(--muted);
  line-height: 1.65;
}

.split-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  gap: clamp(18px, 5vw, 58px);
  align-items: center;
  background: var(--mint);
}

.lead-box {
  padding: 20px;
}

.lead-box label {
  display: block;
  margin-bottom: 10px;
  font-weight: 900;
}

.print-button {
  width: 100%;
  margin-bottom: 12px;
}

.lead-row input {
  min-height: 46px;
  padding: 0 13px;
}

.tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 82px;
  padding: 18px;
  font-weight: 900;
}

.tool-link small {
  color: var(--teal-dark);
  white-space: nowrap;
}

.seo-band {
  max-width: 980px;
}

.seo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.trust-band {
  background: #f3f7f5;
}

.faq-list {
  display: grid;
  gap: 10px;
  max-width: 900px;
}

.faq-list details {
  padding: 18px 20px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 900;
}

.faq-list p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 5vw, 72px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer a {
  font-weight: 850;
}

@media (max-width: 860px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .split-band {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .feature-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .toolbar,
  .feedback-row,
  .lead-row,
  .word-bank-panel,
  .game-strip,
  .best-strip {
    align-items: stretch;
    display: flex;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .sound-button,
  .primary-button,
  .lead-row button {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
