:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-soft: #1d222b;
  --surface-strong: #202733;
  --accent: #1f6f8b;
  --accent-soft: rgba(31, 111, 139, 0.2);
  --text-primary: #e5e9f0;
  --text-secondary: #b7c0cd;
  --text-muted: #8f99a8;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --danger: #d17070;
  --danger-bg: rgba(209, 112, 112, 0.14);
  --success: #79b4c8;
  --success-bg: rgba(31, 111, 139, 0.16);
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --btn-h: 44px;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 0% -10%, rgba(31, 111, 139, 0.16), transparent 52%),
    radial-gradient(900px 500px at 100% -20%, rgba(59, 70, 84, 0.2), transparent 58%),
    var(--bg);
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
  padding: var(--s2) 10px var(--s3);
}

.app-shell {
  width: min(100%, 430px);
  margin: 0 auto;
  display: grid;
  gap: var(--s2);
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 40%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.welcome-card {
  padding: var(--s3) var(--s2);
}

.welcome-kicker {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
}

.welcome-card h1 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.welcome-copy {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.icon-legend {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.icon-pill {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 4px;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.icon-pill img {
  width: 15px;
  height: 15px;
}

.icon-pill span {
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

.panel {
  padding: var(--s2);
}

.panel-head {
  margin-bottom: var(--s2);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  line-height: 1.45;
  font-size: 13px;
}

.status-card {
  padding: 12px var(--s2);
}

.status-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s1);
  margin-bottom: 10px;
}

.status-head strong {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.status-head span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-skeleton {
  display: grid;
  gap: 6px;
}

.skeleton-line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 180% 100%;
  animation: skeleton-shift 1.2s linear infinite;
}

.skeleton-line.w-80 {
  width: 80%;
}

.skeleton-line.w-55 {
  width: 55%;
}

.status-text {
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

.status-text.ok {
  border-color: rgba(31, 111, 139, 0.4);
  background: var(--success-bg);
  color: #b8d4df;
  animation: appear-soft 0.25s ease-out;
}

.status-text.error,
.error {
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(209, 112, 112, 0.4);
  background: var(--danger-bg);
  color: #efb3b3;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

.form-grid {
  display: grid;
  gap: 6px;
}

.form-grid label,
#screen-feedback label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  min-height: var(--btn-h);
  padding: 10px 12px;
  margin: 0 0 6px;
  font-family: inherit;
  font-size: 13px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(31, 111, 139, 0.65);
  box-shadow: 0 0 0 2px rgba(31, 111, 139, 0.18);
}

.btn,
.ghost-btn,
.bottom-item,
.menu-item {
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  min-height: var(--btn-h);
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn {
  width: 100%;
  background: var(--accent);
  color: #deeff5;
  border-color: rgba(31, 111, 139, 0.8);
  margin-top: 10px;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn.secondary {
  background: var(--surface-strong);
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn.secondary:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.btn:disabled,
.ghost-btn:disabled,
.bottom-item:disabled,
.menu-item:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: saturate(0.7);
}

.ghost-btn {
  min-width: 84px;
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
  padding: 0 12px;
}

.ghost-btn:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
}

.question-progress {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.onboarding-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s1);
  margin-top: var(--s2);
}

.onboarding-nav .btn {
  margin-top: 0;
}

.workspace {
  padding: 0;
  overflow: hidden;
}

.workspace-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s1);
  padding: 12px var(--s2);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.workspace-title-wrap {
  min-width: 0;
  text-align: center;
}

.workspace-kicker {
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-title-wrap h2 {
  margin: 2px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 18px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen {
  padding: var(--s2);
  animation: appear-soft 0.24s ease-out;
}

.screen-head {
  margin-bottom: var(--s2);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.screen-head h3 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 18px;
  line-height: 1.25;
}

.screen-head p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

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

.stat-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--surface-soft);
}

.stat-tile span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tile-label {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

.tile-icon {
  width: 14px;
  height: 14px;
}

.stat-tile strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 21px;
  line-height: 1;
  color: #eef3fa;
}

.progress-wrap {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.xp-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(31, 111, 139, 0.95), rgba(80, 133, 154, 0.95));
  transition: width 0.28s ease-out;
}

.sub-title {
  margin: var(--s2) 0 8px;
  color: var(--text-secondary);
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.roadmap-day {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 8px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
}

.roadmap-day.active {
  border-color: rgba(31, 111, 139, 0.6);
  color: #b8d6e2;
}

.roadmap-day.completed {
  border-color: rgba(122, 176, 198, 0.55);
  color: #d3e7ef;
}

.resource-panel {
  margin-top: var(--s2);
  display: grid;
  gap: var(--s1);
}

.resource-card,
.result,
.lesson-slide,
.practice-card,
.dictionary-card,
.rating-card,
.shop-card,
.achievement-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 12px;
}

.resource-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s1);
  align-items: start;
}

.resource-head h4 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
}

.inline-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 6px;
}

.resource-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  text-align: right;
  max-width: 180px;
}

.hearts-visual {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.heart-chip {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #232a36;
  display: grid;
  place-items: center;
}

.heart-core {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #4e5665;
}

.heart-chip.full {
  border-color: rgba(132, 174, 191, 0.48);
  background: rgba(31, 111, 139, 0.2);
}

.heart-chip.full .heart-core {
  background: #c5ddea;
}

.heart-chip.empty {
  background: #1f2430;
}

.coin-goals {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.coin-goal {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.015);
}

.coin-goal strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.coin-goal span {
  font-size: 11px;
  color: var(--text-muted);
}

.coin-goal.ready {
  border-color: rgba(31, 111, 139, 0.52);
  background: rgba(31, 111, 139, 0.14);
}

.mentor-zone,
.lesson-stack {
  margin-top: var(--s2);
  display: grid;
  gap: var(--s1);
}

.mentor-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background:
    radial-gradient(120px 80px at 10% 10%, rgba(31, 111, 139, 0.24), transparent 70%),
    var(--surface-soft);
}

.mentor-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mentor-figure {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1px solid rgba(31, 111, 139, 0.45);
  background: rgba(16, 20, 27, 0.9);
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}

.mentor-glow {
  position: absolute;
  inset: 6px 11px auto;
  height: 44px;
  border-radius: 999px;
  background: rgba(31, 111, 139, 0.3);
}

.mentor-head {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  left: 29px;
  top: 20px;
  background: #bdd8e4;
}

.mentor-body {
  position: absolute;
  width: 32px;
  height: 30px;
  border-radius: 14px 14px 10px 10px;
  left: 20px;
  top: 36px;
  background: linear-gradient(180deg, #3e8ca9, #2a6880);
}

.mentor-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.mentor-kicker {
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10px !important;
}

.mentor-copy h4 {
  margin: 3px 0 4px;
  font-family: "Manrope", sans-serif;
  font-size: 15px;
}

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

.model-chip {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  padding: 7px;
}

.model-chip strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  color: var(--text-secondary);
}

.model-chip span {
  font-size: 10px;
  color: var(--text-muted);
}

.model-chip.active {
  border-color: rgba(31, 111, 139, 0.58);
}

.result {
  margin-top: var(--s2);
  animation: appear-soft 0.25s ease-out;
}

.result h3,
.result h4,
.lesson-slide h4,
.practice-card h4,
.dictionary-card h4,
.rating-card h4,
.shop-card h4,
.achievement-card h4 {
  margin: 0 0 8px;
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  line-height: 1.3;
}

.result p,
.lesson-slide p,
.practice-card p,
.dictionary-card p,
.rating-card p,
.shop-card p,
.achievement-card p {
  margin: 4px 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.result img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 8px;
}

.cabinet-grid {
  margin-top: var(--s2);
  display: grid;
  gap: var(--s1);
}

.board-title {
  margin: 0 0 8px;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
}

.mission-list,
.inventory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.mission-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.mission-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
  margin-top: 2px;
}

.mission-item.done .mission-dot {
  border-color: rgba(31, 111, 139, 0.6);
  background: rgba(31, 111, 139, 0.42);
}

.mission-item strong,
.inventory-list strong {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 2px;
}

.mission-item span,
.inventory-list span,
.inventory-empty {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.actions-row {
  margin-top: var(--s2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s1);
}

.actions-row .btn {
  margin-top: 0;
}

.lesson-nav {
  margin-top: var(--s1);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s1);
}

.lesson-nav .btn {
  margin-top: 0;
}

.practice-options {
  display: grid;
  gap: var(--s1);
}

.practice-answer {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid rgba(31, 111, 139, 0.5);
  background: rgba(31, 111, 139, 0.14);
  padding: 9px;
  animation: appear-soft 0.22s ease-out;
}

.practice-answer.wrong {
  border-color: rgba(209, 112, 112, 0.5);
  background: rgba(209, 112, 112, 0.14);
}

.block-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 12px;
}

.block-card h3 {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.question {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.question strong {
  display: block;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.45;
}

.question label {
  display: block;
  margin: 6px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.question input[type="radio"] {
  accent-color: var(--accent);
  margin-right: 8px;
}

.bottom-nav {
  margin-top: var(--s2);
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.bottom-item {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
  min-height: 50px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  padding: 4px 0;
}

.bottom-item:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.bottom-item.active {
  border-color: rgba(31, 111, 139, 0.58);
  background: rgba(31, 111, 139, 0.14);
  color: #d0e3eb;
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
}

.nav-icon img {
  width: 16px;
  height: 16px;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}

.nav-label {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: end center;
  padding: 10px;
  z-index: 20;
}

.menu-panel {
  width: min(100%, 430px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--s2);
}

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s1);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.menu-head h3 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 16px;
}

.menu-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.menu-item {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text-secondary);
  text-align: left;
  padding: 0 12px;
}

.menu-icon-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.menu-icon-wrap img {
  width: 16px;
  height: 16px;
}

.menu-item:hover {
  border-color: var(--border-strong);
}

.shop-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s1);
}

.shop-row .btn {
  width: auto;
  min-width: 90px;
  margin-top: 0;
  padding: 0 10px;
}

@keyframes skeleton-shift {
  0% {
    background-position: 180% 0;
  }
  100% {
    background-position: -20% 0;
  }
}

@keyframes appear-soft {
  from {
    opacity: 0.5;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 480px) {
  body {
    padding-top: var(--s3);
  }

  .cabinet-grid {
    grid-template-columns: 1fr 1fr;
  }

  .model-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}
