:root {
  color-scheme: dark;
  --bg: #070b12;
  --surface: #101722;
  --surface-2: #151f2d;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f8fb;
  --muted: #9ba8b8;
  --green: #38f28b;
  --blue: #4db6ff;
  --red: #ff5f74;
  --yellow: #ffd166;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(77, 182, 255, 0.18), transparent 34rem),
    linear-gradient(145deg, #05070d 0%, #0a1019 54%, #07130f 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 96px;
}

.screen {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.status-pill {
  width: fit-content;
  max-width: 100%;
  margin: 4px auto 18px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  text-align: center;
}

.page {
  animation: rise 360ms ease both;
}

.page-header {
  margin-bottom: 22px;
}

.page-header p,
.card-label {
  margin: 0 0 8px;
  color: var(--green);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-header h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2rem, 8vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.card,
.glass-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.9);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background:
    linear-gradient(140deg, rgba(56, 242, 139, 0.16), rgba(77, 182, 255, 0.08)),
    rgba(16, 23, 34, 0.92);
}

.hero-card h2,
.profile-hero h2 {
  margin: 0;
  font-size: clamp(1.5rem, 6vw, 2.6rem);
  line-height: 1.05;
}

.muted,
.hero-card p,
.lesson-card p,
.profile-hero p,
.glossary-card p,
.detail-card p {
  color: var(--muted);
}

.progress-ring {
  width: 116px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--progress), rgba(255, 255, 255, 0.12) 0);
  position: relative;
}

.progress-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: var(--surface);
}

.progress-ring strong,
.progress-ring span {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
}

.progress-ring strong {
  transform: translateY(-8px);
  font-size: 1.5rem;
}

.progress-ring span {
  transform: translateY(18px);
  color: var(--muted);
  font-size: 0.72rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.primary-button,
.secondary-button,
.buy-button,
.sell-button,
.adhd-button,
.back-button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.primary-button,
.buy-button {
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #04100b;
}

.secondary-button,
.adhd-button,
.back-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
}

.sell-button {
  background: rgba(255, 95, 116, 0.16);
  color: #ffd6dc;
  border: 1px solid rgba(255, 95, 116, 0.4);
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.full {
  width: 100%;
  margin-top: 14px;
}

.tip-card,
.disclaimer,
.detail-card,
.quiz-card,
.profile-hero,
.rank-list,
.holdings-card,
.history-card,
.trade-ticket {
  padding: 18px;
  margin-top: 14px;
}

.disclaimer {
  border-color: rgba(255, 209, 102, 0.32);
  background: rgba(255, 209, 102, 0.08);
}

.disclaimer .card-label {
  color: var(--yellow);
}

.lesson-strip,
.lesson-grid,
.glossary-list,
.market-list,
.sim-summary {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.lesson-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.mini-lesson,
.lesson-card,
.market-row,
.level-tabs button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.mini-lesson {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.mini-lesson span,
.lesson-number,
.badge,
.rank-badge {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
}

.lesson-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 16px;
}

.lesson-card h3 {
  margin: 0 0 8px;
}

.lesson-card p {
  margin: 0;
  line-height: 1.45;
}

.badge {
  grid-column: 2;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(56, 242, 139, 0.1);
}

.done {
  color: #051009;
  background: var(--green);
}

.lead {
  font-size: 1.08rem;
  line-height: 1.65;
}

.adhd-panel {
  margin: 14px 0;
  padding: 14px;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: rgba(77, 182, 255, 0.1);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d8e8f4;
}

.option-stack {
  display: grid;
  gap: 8px;
}

.quiz-option {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.quiz-option.selected,
.market-row.selected,
.level-tabs button.selected {
  border-color: rgba(56, 242, 139, 0.7);
  background: rgba(56, 242, 139, 0.13);
}

.feedback {
  display: inline-block;
  margin-top: 8px;
  font-weight: 800;
}

.correct,
.positive {
  color: var(--green);
}

.wrong,
.negative {
  color: var(--red);
}

.sim-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.1rem, 5vw, 1.7rem);
}

.market-row,
.holding-row,
.history-row,
.rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.market-row span,
.history-row span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.trade-ticket label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.trade-ticket input,
.search {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.history-row {
  grid-template-columns: 0.7fr 0.7fr 1fr auto;
  padding-inline: 0;
  border-top: 1px solid var(--line);
}

.level-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.level-tabs button {
  min-width: 170px;
  padding: 12px;
}

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

.score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
}

.glossary-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.glossary-card h3 {
  margin: 0;
}

.rank-list h3,
.holdings-card h3,
.history-card h3,
.trade-ticket h3 {
  margin-top: 0;
}

.rank-row {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.rank-row.active {
  color: var(--text);
}

.tab-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  width: min(680px, calc(100% - 20px));
  transform: translateX(-50%);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(10, 16, 25, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tab-bar button {
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab-bar button.active {
  background: rgba(56, 242, 139, 0.12);
  color: var(--green);
}

.tab-bar span {
  font-size: 1.1rem;
  line-height: 1;
}

.tab-bar b {
  font-size: 0.68rem;
}

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

@media (min-width: 760px) {
  .lesson-strip {
    grid-template-columns: repeat(4, 1fr);
  }

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

@media (max-width: 640px) {
  .screen {
    padding-inline: 12px;
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .progress-ring {
    width: 104px;
  }

  .action-grid,
  .sim-summary {
    grid-template-columns: 1fr;
  }

  .lesson-card {
    grid-template-columns: 1fr;
  }

  .badge {
    grid-column: auto;
  }

  .history-row {
    grid-template-columns: 1fr 0.8fr;
  }

  .tab-bar {
    bottom: 8px;
    border-radius: 20px;
  }

  .tab-bar button {
    min-height: 50px;
  }

  .tab-bar b {
    font-size: 0.6rem;
  }
}
