﻿:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #fffcf5;
  --surface-strong: #ffffff;
  --text: #17202a;
  --muted: #68707a;
  --line: #ded7ca;
  --accent: #1f7a5a;
  --accent-dark: #10583f;
  --soft: #e7f2eb;
  --danger: #a84632;
  --shadow: 0 18px 50px rgba(31, 41, 55, 0.10);
  --radius: 22px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(31, 122, 90, .14), transparent 26rem),
    linear-gradient(180deg, #fbf8ef 0%, var(--bg) 46%, #eee8dc 100%);
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 16px 96px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 32px; letter-spacing: -0.05em; }
h2 { margin-bottom: 0; font-size: 25px; letter-spacing: -0.035em; }
h3 { margin-bottom: 10px; font-size: 19px; }

.muted { color: var(--muted); line-height: 1.65; }

.view { display: none; animation: rise .22s ease-out; }
.active-view { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  * { scroll-behavior: auto !important; }
}

.hero-card, .section-card, .word-card, .metric-card {
  border: 1px solid rgba(74, 85, 104, .14);
  border-radius: var(--radius);
  background: rgba(255, 252, 245, .92);
  box-shadow: var(--shadow);
}

.hero-card { padding: 22px; }
.section-card { margin-top: 16px; padding: 20px; }
.settings-card {
  box-shadow: none;
}

.settings-head p {
  margin-bottom: 0;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.setting-row:first-of-type {
  margin-top: 14px;
}

.setting-row label {
  color: var(--text);
  font-weight: 760;
}

.number-input {
  width: 92px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: #fff;
  text-align: center;
  font-weight: 780;
  outline: none;
}

.number-input:focus {
  border-color: rgba(31, 122, 90, .55);
  box-shadow: 0 0 0 4px rgba(31, 122, 90, .12);
}

.saved-text {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 720;
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.metric-card {
  padding: 16px 10px;
  text-align: center;
  box-shadow: none;
  background: var(--surface-strong);
}

.metric-card span {
  display: block;
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.metric-card small { color: var(--muted); }

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-btn, .secondary-btn, .ghost-btn, .text-btn, .grade-btn {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.primary-btn:active, .secondary-btn:active, .ghost-btn:active, .text-btn:active, .grade-btn:active, .nav-btn:active {
  transform: translateY(1px) scale(.99);
}

.primary-btn {
  color: #fff;
  background: var(--accent);
  font-weight: 760;
}

.secondary-btn, .ghost-btn, .grade-btn {
  color: var(--text);
  background: var(--soft);
  font-weight: 720;
}

.ghost-btn {
  min-height: 38px;
  padding: 0 16px;
}

.text-btn {
  min-height: 38px;
  padding: 0 14px;
  color: var(--accent-dark);
  background: transparent;
  border: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 16px;
}

.word-card {
  min-height: 430px;
  padding: 22px;
  background: var(--surface);
}

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

.word-main {
  margin: 8px 0 10px;
  font-size: clamp(42px, 13vw, 72px);
  line-height: .95;
  letter-spacing: -0.075em;
}

.word-category {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--soft);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.meaning {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.pronunciation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.phonetic {
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: .01em;
}

.sound-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(31, 122, 90, .22);
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 14px;
  font-weight: 760;
}

.sound-btn:active {
  transform: translateY(1px) scale(.99);
}

.info-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.info-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.info-block p { margin-bottom: 0; line-height: 1.65; }

.grade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.grade-btn {
  padding: 12px 10px;
  border: 1px solid rgba(31, 122, 90, .18);
  background: #fff;
}

.grade-btn.again { color: #fff; background: var(--danger); }
.grade-btn.good { color: #fff; background: var(--accent); }

.empty-state {
  display: grid;
  min-height: 330px;
  place-items: center;
  text-align: center;
}

.empty-state div { max-width: 280px; }

.search-input {
  width: 100%;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,.86);
  outline: none;
}

.search-input:focus {
  border-color: rgba(31, 122, 90, .55);
  box-shadow: 0 0 0 4px rgba(31, 122, 90, .12);
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,.74);
}

.chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }

.word-list {
  display: grid;
  gap: 10px;
}

.word-row {
  padding: 15px;
  border: 1px solid rgba(74, 85, 104, .13);
  border-radius: 18px;
  background: rgba(255,255,255,.82);
}

.word-row strong { display: block; margin-bottom: 4px; font-size: 18px; }
.word-row span { color: var(--muted); line-height: 1.5; }

.copy-card ul { margin-bottom: 0; padding-left: 20px; color: var(--muted); line-height: 1.8; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: min(calc(100% - 24px), 540px);
  padding: 8px;
  border: 1px solid rgba(74, 85, 104, .16);
  border-radius: 24px;
  background: rgba(255, 252, 245, .94);
  box-shadow: 0 14px 44px rgba(31, 41, 55, .15);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.nav-btn {
  min-height: 42px;
  border: 0;
  border-radius: 17px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 760;
}

.nav-btn.active {
  color: #fff;
  background: var(--text);
}

@media (max-width: 360px) {
  .app-shell { padding-inline: 12px; }
  .hero-card, .section-card, .word-card { padding: 18px; }
  .nav-btn { font-size: 12px; }
}


