:root {
  --bg: #07111c;
  --panel: #0d1b29;
  --line: #1d3449;
  --cyan: #43d9ff;
  --text: #e8f3f8;
  --muted: #8ba1b4;
  --green: #39dfaa;
  --red: #ff6d7e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 85% 10%, #12334a 0, transparent 35%), var(--bg);
  color: var(--text);
  font-family: 'Noto Sans SC', sans-serif;
}

.shell { display: flex; min-height: 100vh; }

aside {
  width: 250px;
  flex: 0 0 auto;
  border-right: 1px solid var(--line);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  background: rgba(5, 15, 25, .75);
}

.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 42px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--cyan); color: var(--cyan); font: 700 21px Rajdhani; box-shadow: 0 0 18px #43d9ff55; }
.brand b { display: block; font: 700 23px Rajdhani; letter-spacing: 2px; }
.brand small { color: var(--muted); font-size: 11px; }
.side-title { font-size: 11px; color: #638099; letter-spacing: 2px; margin: 18px 10px 8px; }

.nav,
.filter {
  border: 0;
  background: none;
  color: #9db3c4;
  text-align: left;
  padding: 12px 13px;
  border-radius: 5px;
  margin: 2px 0;
  font-size: 13px;
  cursor: pointer;
}

.nav em { float: right; font-style: normal; color: #577186; }
.nav.active,
.nav:hover,
.filter.active { color: var(--cyan); background: #102839; }
.filter span { float: right; color: #577186; }
.side-foot { margin-top: auto; font-size: 11px; color: #526b7e; line-height: 1.7; padding: 12px; }
.side-foot span { font-size: 10px; }

main { flex: 1; min-width: 0; padding: 34px 48px; max-width: 1400px; margin: auto; width: 100%; }
header { display: flex; justify-content: space-between; align-items: flex-start; }
.eyebrow { color: var(--cyan); font: 600 11px Rajdhani; letter-spacing: 3px; }
h1 { font-size: 29px; margin: 8px 0 30px; letter-spacing: 1px; }
.top-stats { display: flex; gap: 30px; align-items: center; }
.top-stats div span { display: block; font: 700 27px Rajdhani; }
.top-stats small { color: var(--muted); font-size: 11px; }
.streak { color: var(--green); font-size: 12px !important; }

.progress { border-top: 1px solid var(--line); padding-top: 16px; margin-bottom: 24px; }
.progress > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.progress b { color: var(--text); font-weight: 500; }
.bar { height: 4px; background: #14293a; margin-top: 10px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); width: 5%; transition: .3s; }

.content { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
.question-card,
.panel-block { background: rgba(13, 27, 41, .88); border: 1px solid var(--line); border-radius: 6px; }
.question-card { padding: 30px; min-height: 540px; }
.q-meta { display: flex; justify-content: space-between; color: var(--cyan); font: 600 12px Rajdhani; letter-spacing: 1px; }
.q-meta span:last-child { color: #60788a; }
h2 { font-size: 21px; line-height: 1.7; font-weight: 500; margin: 26px 0 8px; max-width: 850px; overflow-wrap: anywhere; }
.hint { color: var(--muted); font-size: 12px; margin-bottom: 25px; }
.options { display: grid; gap: 12px; }
.option { display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid #234057; border-radius: 5px; color: #c7d8e2; cursor: pointer; transition: .2s; overflow-wrap: anywhere; }
.option:hover { border-color: var(--cyan); background: #102b3d; }
.option.selected { border-color: var(--cyan); background: #103447; color: #fff; }
.option.correct { border-color: var(--green); background: #10382f; }
.option.incorrect { border-color: var(--red); background: #3b1d2a; }
.key { display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px; border: 1px solid #52728a; border-radius: 50%; font: 600 13px Rajdhani; }
.selected .key { background: var(--cyan); color: #06202c; border-color: var(--cyan); }
.result { min-height: 30px; margin-top: 18px; font-size: 13px; }
.result.ok { color: var(--green); }
.result.bad { color: var(--red); }
.actions { display: flex; justify-content: space-between; margin-top: 18px; }
.actions button { padding: 11px 18px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.ghost,
.text-btn { border: 1px solid #2b475e; background: transparent; color: #9db3c4; }
.primary { border: 0; background: var(--cyan); color: #06202c; font-weight: 700; }
.primary span { opacity: .7; margin-left: 8px; }

.right-panel { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel-block { padding: 20px; }
.panel-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 17px; }
.panel-head small { color: var(--muted); }
.answer-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.answer-grid button { height: 36px; min-width: 0; background: #122536; border: 1px solid #203d53; color: #87a0b1; border-radius: 3px; cursor: pointer; }
.answer-grid button.current { border-color: var(--cyan); color: var(--cyan); }
.answer-grid button.done { background: #155143; color: var(--green); }
.answer-grid button.wrong { background: #542633; color: var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 10px; margin-top: 16px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #29465b; margin-right: 4px; }
.dot.current { background: var(--cyan); }
.dot.done { background: var(--green); }
.dot.wrong { background: var(--red); }
.tips p { font-size: 12px; color: var(--muted); line-height: 1.7; }
.spark { color: var(--cyan); }
.text-btn { border: 0; padding: 0; font-size: 12px; color: var(--cyan); cursor: pointer; }

@media (max-width: 900px) {
  aside { width: 190px; }
  main { padding: 24px; }
  .content { grid-template-columns: 1fr; }
  .right-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .top-stats { gap: 12px; }
}

@media (max-width: 620px) {
  body { overflow-x: hidden; }
  .shell { display: block; }
  aside {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 5px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 15, 25, .97);
    backdrop-filter: blur(10px);
  }

  .brand,
  .side-title,
  .side-foot { display: none; }

  .nav,
  .filter {
    min-width: 0;
    margin: 0;
    padding: 9px 3px;
    border: 1px solid transparent;
    text-align: center;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav { grid-column: span 4; }
  .filter { grid-column: span 3; }
  .nav em,
  .filter span { float: none; margin-left: 2px; }

  main { padding: 16px 12px 24px; }
  header { display: block; }
  .eyebrow { font-size: 10px; letter-spacing: 2px; }
  h1 { font-size: 22px; margin: 7px 0 16px; }
  .top-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
  .top-stats div { min-width: 0; }
  .top-stats div span { font-size: 22px; }
  .top-stats small,
  .streak { font-size: 10px !important; }
  .progress { padding-top: 12px; margin-bottom: 14px; }
  .content { display: block; }
  .question-card { min-height: 0; padding: 18px 14px; }
  h2 { font-size: 17px; line-height: 1.55; margin-top: 20px; }
  .hint { margin-bottom: 18px; }
  .options { gap: 9px; }
  .option { align-items: flex-start; gap: 10px; padding: 13px 11px; font-size: 14px; line-height: 1.55; }
  .actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .actions button { min-width: 0; padding: 11px 4px; font-size: 12px; white-space: nowrap; }
  .primary span { display: none; }
  .right-panel { display: block; margin-top: 14px; }
  .panel-block { padding: 16px 12px; }
  .tips { margin-top: 14px; }
  .answer-grid { gap: 6px; }
  .answer-grid button { height: 34px; font-size: 12px; }
}

@media (max-width: 380px) {
  .nav,
  .filter { font-size: 10px; }
  .nav em,
  .filter span { display: none; }
  .actions button { font-size: 11px; }
}
