:root {
  --green: #49c86d;
  --green-dark: #19994a;
  --ink: #17202a;
  --muted: #647184;
  --line: #d9e2df;
  --panel: #ffffff;
  --soft: #f4f8f6;
  --sky: #dff3ff;
  --yellow: #ffd166;
  --coral: #ff7a73;
  --blue: #4f8cff;
  --shadow: 0 18px 40px rgba(23, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(223, 243, 255, 0.55), rgba(244, 248, 246, 0.9)),
    var(--soft);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  padding: 28px 22px;
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 3px solid var(--green-dark);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.mobile-status {
  display: none;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  padding: 14px 16px;
  text-decoration: none;
}

.nav-item.active,
.nav-item:hover {
  background: #e9f9ee;
  color: var(--green-dark);
}

.daily-box {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.daily-label,
.eyebrow {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mini-progress {
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8efec;
}

.mini-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.3s ease;
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
}

h2 {
  margin-bottom: 10px;
  font-size: 28px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats span {
  min-width: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.stats strong {
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
  gap: 26px;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid #b7dfc3;
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 209, 102, 0.7), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #e8fff0 58%, #dcf3ff 100%);
  padding: 32px;
  box-shadow: var(--shadow);
}

.hero-copy {
  align-self: center;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.primary-btn,
.ghost-btn,
.check-btn,
.answer-btn {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.primary-btn,
.check-btn {
  background: var(--green);
  color: #fff;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.16);
  padding: 0 22px;
}

.ghost-btn {
  border: 2px solid var(--line);
  background: #fff;
  color: var(--green-dark);
  padding: 0 20px;
}

.mascot-panel {
  position: relative;
  display: grid;
  min-height: 220px;
  place-items: center;
}

.mascot {
  position: relative;
  width: 148px;
  height: 164px;
  border: 5px solid #169245;
  border-radius: 46% 46% 38% 38%;
  background: linear-gradient(160deg, #5edb82, #23b75a);
  box-shadow: inset 0 -14px 0 rgba(0, 0, 0, 0.08), 0 18px 26px rgba(25, 153, 74, 0.22);
}

.mascot::before {
  position: absolute;
  top: 24px;
  left: 50%;
  width: 82px;
  height: 62px;
  border-radius: 50%;
  background: #dcffe7;
  content: "";
  transform: translateX(-50%);
}

.mascot-face {
  position: absolute;
  top: 48px;
  left: 50%;
  z-index: 1;
  display: flex;
  width: 72px;
  justify-content: space-between;
  transform: translateX(-50%);
}

.mascot-face span {
  width: 14px;
  height: 18px;
  border-radius: 999px;
  background: var(--ink);
}

.mascot::after {
  position: absolute;
  top: 86px;
  left: 50%;
  z-index: 1;
  width: 34px;
  height: 18px;
  border-radius: 0 0 999px 999px;
  background: var(--yellow);
  content: "";
  transform: translateX(-50%);
}

.mascot-wing {
  position: absolute;
  top: 78px;
  width: 42px;
  height: 62px;
  border-radius: 999px;
  background: #2ebc61;
}

.mascot-wing.left {
  left: -24px;
  transform: rotate(-24deg);
}

.mascot-wing.right {
  right: -24px;
  transform: rotate(24deg);
}

.speech-chip {
  position: absolute;
  right: 20px;
  bottom: 24px;
  border: 2px solid #f2c553;
  border-radius: 8px;
  background: #fff8da;
  padding: 10px 14px;
  font-weight: 900;
}

.category-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.category-btn {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.category-btn span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.category-btn.active {
  border-color: var(--green);
  background: #ecfff2;
  color: var(--green-dark);
}

.lesson-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 22px;
}

.study-card,
.quiz-card,
.word-bank {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.08);
}

.study-card,
.quiz-card {
  min-height: 370px;
  padding: 24px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.uzbek-word {
  margin: 44px 0 8px;
  color: var(--green-dark);
  font-size: clamp(48px, 8vw, 78px);
  font-weight: 950;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.translation {
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 900;
}

.pronunciation {
  color: var(--muted);
}

.card-actions {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  gap: 10px;
  margin-top: 28px;
}

.icon-btn {
  width: 54px;
  height: 48px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  font-size: 28px;
  font-weight: 900;
}

.quiz-card h3 {
  margin: 44px 0 20px;
  font-size: 26px;
}

.answers {
  display: grid;
  gap: 12px;
}

.typing-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.typing-form input {
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 0 14px;
  font-weight: 800;
}

.typing-form input:focus {
  border-color: var(--green);
}

.answer-btn {
  width: 100%;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 14px 16px;
  text-align: left;
}

.answer-btn:hover {
  border-color: var(--blue);
}

.answer-btn.correct {
  border-color: var(--green);
  background: #e9f9ee;
}

.answer-btn.wrong {
  border-color: var(--coral);
  background: #fff0ef;
}

.feedback {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.word-bank {
  margin-top: 22px;
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 0;
}

input[type="search"] {
  width: min(280px, 100%);
  min-height: 44px;
  border: 2px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 0 14px;
}

input[type="search"]:focus {
  border-color: var(--green);
}

.import-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
  gap: 12px;
  align-items: end;
}

.import-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.import-form input {
  min-height: 46px;
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 0 12px;
}

.import-form input:focus {
  border-color: var(--green);
}

.format-note,
.empty-note {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.custom-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.custom-base {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.custom-base strong,
.custom-base small {
  display: block;
}

.custom-base small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.danger-btn {
  min-height: 44px;
  border: 2px solid #ffd0cd;
  border-radius: 8px;
  background: #fff5f4;
  color: #b42318;
  font-weight: 900;
  padding: 0 16px;
}

.word-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.word-pill {
  display: block;
  width: 100%;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: inherit;
  text-align: left;
}

.word-pill strong,
.word-pill span {
  display: block;
  overflow-wrap: anywhere;
}

.word-pill strong {
  margin-bottom: 5px;
  color: var(--green-dark);
  font-size: 18px;
}

.word-pill span {
  color: var(--muted);
  font-size: 14px;
}

.word-pill:hover {
  border-color: var(--green);
  background: #f4fff7;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    z-index: 10;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
  }

  .nav-list {
    grid-template-columns: repeat(4, 1fr);
  }

  .daily-box {
    margin-top: 0;
  }

  .hero,
  .lesson-grid,
  .import-form {
    grid-template-columns: 1fr;
  }

  .category-bar,
  .word-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body {
    background: var(--soft);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 14px;
  }

  .brand {
    min-height: 44px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-width: 2px;
    border-radius: 8px;
  }

  .brand small {
    display: none;
  }

  .mobile-status {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
  }

  .mobile-status span {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    padding: 7px 8px;
  }

  .mobile-status strong {
    color: var(--ink);
  }

  .nav-list {
    display: none;
  }

  .daily-box,
  .topbar,
  .mascot-panel {
    display: none;
  }

  .main,
  .hero,
  .study-card,
  .quiz-card,
  .word-bank {
    padding: 18px;
  }

  .main {
    padding: 12px 12px 24px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .stats,
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .category-bar,
  .word-list {
    grid-template-columns: 1fr;
  }

  .hero {
    display: block;
    min-height: 0;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(23, 32, 42, 0.08);
  }

  .hero-copy p:not(.eyebrow) {
    display: none;
  }

  .hero h2 {
    margin-bottom: 0;
    font-size: 24px;
    line-height: 1.12;
  }

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

  .primary-btn,
  .ghost-btn,
  .check-btn,
  .answer-btn {
    min-height: 44px;
  }

  .category-bar {
    display: flex;
    gap: 8px;
    margin: 0 -12px 12px;
    overflow-x: auto;
    padding: 0 12px 4px;
    scroll-snap-type: x proximity;
  }

  .category-btn {
    flex: 0 0 136px;
    min-height: 60px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 10px 12px;
    scroll-snap-align: start;
  }

  .category-btn span {
    font-size: 12px;
  }

  .lesson-grid {
    gap: 12px;
  }

  .study-card,
  .quiz-card {
    min-height: auto;
  }

  .card-topline {
    font-size: 12px;
  }

  .uzbek-word {
    margin: 28px 0 8px;
    font-size: clamp(42px, 15vw, 58px);
  }

  .translation {
    font-size: 21px;
  }

  .quiz-card h3 {
    margin: 28px 0 16px;
    font-size: 22px;
    line-height: 1.22;
  }

  .word-bank {
    margin-top: 12px;
  }

  .section-heading {
    gap: 10px;
    margin-bottom: 14px;
  }

  .section-heading h2 {
    font-size: 23px;
  }

  input[type="search"] {
    width: 100%;
  }

  .typing-form {
    grid-template-columns: 1fr;
  }

  .custom-base {
    grid-template-columns: 1fr;
  }

}
