:root {
  color-scheme: dark;
  --bg: #050b0f;
  --panel: rgba(9, 20, 28, 0.86);
  --panel-strong: rgba(13, 28, 38, 0.94);
  --panel-soft: rgba(14, 33, 45, 0.72);
  --line: rgba(87, 220, 255, 0.26);
  --line-strong: rgba(67, 218, 255, 0.72);
  --text: #eefbff;
  --muted: #94aab5;
  --cyan: #26ddff;
  --cyan-soft: rgba(38, 221, 255, 0.16);
  --lime: #b9ff38;
  --lime-soft: rgba(185, 255, 56, 0.16);
  --coral: #ff6b5e;
  --amber: #ffba48;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --font: "Inter", "MiSans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    linear-gradient(90deg, rgba(38, 221, 255, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(38, 221, 255, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #03070b 0%, #07131a 52%, #020506 100%);
  background-size: 92px 92px, 92px 92px, auto;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  width: min(1440px, calc(100vw - 28px));
  min-height: calc(100svh - 28px);
  margin: 14px auto;
  overflow: hidden;
  border: 1px solid rgba(93, 221, 255, 0.3);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(7, 15, 22, 0.96), rgba(2, 8, 13, 0.98));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.side-rail {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px 14px 18px;
  border-right: 1px solid rgba(76, 211, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(14, 28, 38, 0.98), rgba(4, 10, 15, 0.98)),
    linear-gradient(90deg, rgba(38, 221, 255, 0.08), transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 18px;
  font-size: 25px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--cyan);
  filter: drop-shadow(0 0 12px rgba(38, 221, 255, 0.62));
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-mark path:first-child {
  fill: rgba(38, 221, 255, 0.12);
  stroke: currentColor;
  stroke-width: 3;
}

.brand-mark path:last-child {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.nav-stack {
  display: grid;
  gap: 10px;
}

.nav-item,
.bottom-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #b8ccd4;
  cursor: pointer;
  font-size: 19px;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(38, 221, 255, 0.62);
  background: linear-gradient(90deg, rgba(38, 221, 255, 0.22), rgba(38, 221, 255, 0.05));
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--cyan), 0 0 24px rgba(38, 221, 255, 0.16);
}

.nav-icon,
.bottom-nav span {
  position: relative;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  color: currentColor;
}

.target-icon::before,
.target-icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.target-icon::after {
  inset: 11px;
  background: currentColor;
  box-shadow:
    0 -12px 0 -6px currentColor,
    0 12px 0 -6px currentColor,
    12px 0 0 -6px currentColor,
    -12px 0 0 -6px currentColor;
}

.pulse-icon::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.pulse-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 13px;
  width: 15px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-38deg);
}

.bars-icon::before,
.bars-icon::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 3px;
  background: currentColor;
  box-shadow: 7px -7px 0 currentColor, 14px -13px 0 currentColor;
}

.bars-icon::before {
  left: 5px;
  height: 12px;
  opacity: 0.55;
}

.bars-icon::after {
  left: 5px;
  height: 20px;
  transform: translateX(21px);
  box-shadow: none;
}

.tool-toggles {
  display: grid;
  gap: 16px;
  margin-top: auto;
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-row {
  display: grid;
  grid-template-columns: 24px 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: #b7c8cf;
  font-size: 14px;
}

.toggle-row input {
  width: 44px;
  height: 24px;
  appearance: none;
  border: 1px solid rgba(38, 221, 255, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: 180ms ease;
}

.toggle-row input::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 2px;
  border-radius: 50%;
  background: #6f8790;
  transition: 180ms ease;
}

.toggle-row input:checked {
  background: rgba(38, 221, 255, 0.34);
}

.toggle-row input:checked::before {
  transform: translateX(20px);
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(38, 221, 255, 0.72);
}

.cube-mini,
.grid-mini {
  position: relative;
  width: 20px;
  height: 20px;
}

.cube-mini::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid #a9c4ce;
  transform: rotate(30deg) skew(-10deg);
}

.grid-mini {
  border: 1px solid #a9c4ce;
  background:
    linear-gradient(90deg, transparent 48%, #a9c4ce 48% 52%, transparent 52%),
    linear-gradient(0deg, transparent 48%, #a9c4ce 48% 52%, transparent 52%);
}

.profile-card {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(38, 221, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(3, 12, 18, 0.88);
}

.avatar-core {
  display: grid;
  width: 48px;
  height: 48px;
  grid-row: span 2;
  place-items: center;
  border: 1px solid rgba(38, 221, 255, 0.55);
  border-radius: 50%;
  background:
    conic-gradient(from 20deg, var(--cyan), #1262ff, var(--lime), var(--cyan));
}

.avatar-core span {
  width: 28px;
  height: 28px;
  background:
    linear-gradient(135deg, transparent 0 35%, rgba(0, 0, 0, 0.8) 36% 64%, transparent 65%),
    rgba(4, 16, 22, 0.95);
  clip-path: polygon(50% 0, 100% 28%, 100% 72%, 50% 100%, 0 72%, 0 28%);
}

.profile-card strong {
  display: block;
  font-size: 15px;
}

.profile-card span:not(.avatar-core span) {
  color: var(--cyan);
  font-size: 12px;
}

.level {
  grid-column: 1 / -1;
  font-weight: 700;
}

.level-track {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.level-track span {
  display: block;
  width: 58%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #80f5ff);
}

.profile-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.training-board {
  min-width: 0;
  padding: 20px 28px 18px;
  overflow: hidden;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.level-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 230px;
  height: 52px;
  border: 1px solid rgba(38, 221, 255, 0.68);
  border-radius: var(--radius);
  background: rgba(8, 29, 40, 0.78);
  color: var(--cyan);
  box-shadow: inset 0 0 22px rgba(38, 221, 255, 0.08);
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
}

.timer-card {
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  gap: 18px;
  min-width: 310px;
  padding: 9px 14px;
  border: 1px solid rgba(38, 221, 255, 0.7);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(8, 31, 42, 0.95), rgba(2, 11, 17, 0.96));
  box-shadow: 0 0 30px rgba(38, 221, 255, 0.12);
}

.timer-card span,
.timer-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.timer-card strong {
  display: block;
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 32px;
  line-height: 1;
  text-shadow: 0 0 18px rgba(38, 221, 255, 0.56);
}

.pause-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.pause-button span {
  width: 5px;
  height: 22px;
  border-radius: 99px;
  background: #d6f8ff;
}

.pause-button.is-paused span:first-child {
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #d6f8ff;
  border-radius: 0;
  background: transparent;
}

.pause-button.is-paused span:last-child {
  display: none;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: stretch;
}

.exercise-panel,
.insight-panel > section {
  border: 1px solid rgba(104, 232, 255, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(11, 24, 33, 0.92), rgba(5, 13, 19, 0.94)),
    rgba(9, 20, 28, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.exercise-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(218px, auto) auto auto auto;
  gap: 10px;
  min-height: 620px;
  padding: 18px;
  overflow: hidden;
}

.exercise-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-left: 2px solid rgba(38, 221, 255, 0.46);
  background:
    linear-gradient(90deg, rgba(38, 221, 255, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(185, 255, 56, 0.04), transparent 42%);
  opacity: 0.8;
}

.exercise-copy,
.scene-wrap,
.option-grid,
.hint-strip,
.exercise-actions {
  position: relative;
  z-index: 1;
}

.exercise-copy {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.exercise-copy p {
  max-width: 780px;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.55;
}

.exercise-copy b {
  color: var(--cyan);
}

.attempt-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(38, 221, 255, 0.34);
  border-radius: var(--radius);
  color: #bdeef7;
  background: rgba(38, 221, 255, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.scene-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 230px;
  overflow: hidden;
  border-radius: var(--radius);
}

.grid-layer {
  position: absolute;
  inset: 0;
  opacity: 1;
  background:
    linear-gradient(28deg, transparent 47%, rgba(38, 221, 255, 0.14) 48%, transparent 49%),
    linear-gradient(152deg, transparent 47%, rgba(38, 221, 255, 0.12) 48%, transparent 49%);
  background-size: 74px 74px;
  mask-image: linear-gradient(transparent, #000 24%, #000 76%, transparent);
}

.grid-layer.is-off {
  opacity: 0;
}

.axis-markers {
  position: absolute;
  right: 72px;
  top: 70px;
  width: 90px;
  height: 90px;
  color: var(--lime);
  font-size: 13px;
  font-weight: 800;
}

.axis-markers::before,
.axis-markers::after {
  content: "";
  position: absolute;
  left: 44px;
  top: 18px;
  width: 1px;
  height: 58px;
  background: var(--lime);
}

.axis-markers::after {
  transform: rotate(122deg);
  transform-origin: 50% 50%;
}

.axis-up,
.axis-front,
.axis-right {
  position: absolute;
}

.axis-up {
  left: 38px;
  top: 0;
}

.axis-front {
  left: 2px;
  bottom: 17px;
}

.axis-right {
  right: 0;
  bottom: 12px;
  color: #ff6057;
}

.cube-stage {
  width: min(350px, 86%);
  max-width: 370px;
  color: var(--cyan);
}

.scene-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 28px 34px rgba(0, 0, 0, 0.36));
}

.rotation-axis {
  stroke: rgba(238, 251, 255, 0.92);
  stroke-width: 4;
  stroke-dasharray: 10 12;
}

.rotation-arrow {
  fill: none;
  stroke: var(--cyan);
  stroke-linecap: round;
  stroke-width: 5;
}

.arrow-head,
.axis-head {
  fill: currentColor;
}

.angle-label {
  fill: var(--cyan);
  font-family: var(--font);
  font-size: 28px;
  font-weight: 900;
}

.assist-off .axis-markers,
.assist-off .rotation-axis,
.assist-off .rotation-arrow,
.assist-off .arrow-head,
.assist-off .axis-head,
.assist-off .angle-label {
  opacity: 0.08;
}

.face-top {
  fill: #b9ff55;
}

.face-front {
  fill: #f2f3f0;
}

.face-right {
  fill: #28c8ef;
}

.face-alt {
  fill: #9cff3e;
}

.face-shadow {
  fill: rgba(2, 7, 10, 0.22);
}

.cube-line {
  fill: none;
  stroke: #061017;
  stroke-linejoin: round;
  stroke-width: 4;
}

.ghost-line {
  fill: none;
  stroke: rgba(38, 221, 255, 0.2);
  stroke-dasharray: 7 8;
  stroke-width: 2;
}

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

.answer-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 118px;
  padding: 14px 12px 12px;
  border: 1px solid rgba(122, 196, 216, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(16, 31, 42, 0.95), rgba(9, 20, 28, 0.92));
  cursor: pointer;
  transition: 160ms ease;
}

.answer-card:hover {
  border-color: rgba(38, 221, 255, 0.64);
  transform: translateY(-2px);
}

.answer-card.is-selected {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(185, 255, 56, 0.74), 0 0 22px rgba(185, 255, 56, 0.18);
}

.answer-card.is-correct {
  border-color: var(--lime);
  background: linear-gradient(180deg, rgba(185, 255, 56, 0.18), rgba(9, 20, 28, 0.92));
}

.answer-card.is-wrong {
  border-color: var(--coral);
  background: linear-gradient(180deg, rgba(255, 107, 94, 0.16), rgba(9, 20, 28, 0.92));
}

.answer-card svg {
  align-self: center;
  justify-self: center;
  width: min(78px, 100%);
  height: auto;
}

.answer-card strong {
  justify-self: center;
  color: #c7d4da;
  font-size: 24px;
  line-height: 1;
}

.answer-card.is-selected strong,
.answer-card.is-correct strong {
  color: var(--lime);
}

.check-dot {
  position: absolute;
  top: 11px;
  right: 11px;
  display: none;
  width: 26px;
  height: 26px;
  border: 2px solid var(--lime);
  border-radius: 50%;
}

.answer-card.is-selected .check-dot,
.answer-card.is-correct .check-dot {
  display: block;
}

.check-dot::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 5px;
  width: 10px;
  height: 6px;
  border-left: 3px solid var(--lime);
  border-bottom: 3px solid var(--lime);
  transform: rotate(-45deg);
}

.hint-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 14px;
  border: 1px solid rgba(38, 221, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(38, 221, 255, 0.08);
  color: #c7dce2;
  font-size: 15px;
  font-weight: 700;
}

.hint-strip.is-success {
  border-color: rgba(185, 255, 56, 0.58);
  background: rgba(185, 255, 56, 0.11);
  color: #efffd1;
}

.hint-strip.is-error {
  border-color: rgba(255, 107, 94, 0.52);
  background: rgba(255, 107, 94, 0.1);
  color: #ffd7d3;
}

.hint-icon {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
}

.hint-icon::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 7px;
  width: 5px;
  height: 12px;
  border-radius: 99px;
  background: var(--cyan);
  box-shadow: 0 17px 0 -1px var(--cyan);
}

.exercise-actions {
  display: grid;
  grid-template-columns: 138px 1fr 178px;
  align-items: center;
  gap: 14px;
}

.secondary-button,
.primary-button,
.wide-button {
  min-height: 48px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #d3e4eb;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button {
  background: linear-gradient(180deg, #34e3ff, #12bdd8);
  color: #00161e;
  box-shadow: 0 0 22px rgba(38, 221, 255, 0.28);
  font-size: 17px;
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.68;
}

.step-meter {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.step-meter span {
  width: 28px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}

.step-meter span.is-active {
  background: var(--lime);
  box-shadow: 0 0 12px rgba(185, 255, 56, 0.42);
}

.insight-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.insight-panel > section {
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.score-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px 18px;
  align-items: center;
}

.score-card .section-title {
  grid-column: 1 / -1;
}

.score-card .section-title > span {
  color: var(--lime);
  font-size: 20px;
  font-weight: 900;
}

.score-ring {
  position: relative;
  width: 126px;
  height: 126px;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg,
.ring-progress {
  fill: none;
  stroke-width: 12;
}

.ring-bg {
  stroke: rgba(255, 255, 255, 0.12);
}

.ring-progress {
  stroke: var(--lime);
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 102;
  filter: drop-shadow(0 0 8px rgba(185, 255, 56, 0.55));
  transition: stroke-dashoffset 240ms ease;
}

.score-ring div {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.score-ring strong {
  font-size: 27px;
}

.score-ring span {
  color: var(--muted);
  font-size: 13px;
}

.mini-stats {
  display: grid;
  gap: 12px;
  margin: 0;
}

.mini-stats div {
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.mini-stats dt {
  color: var(--muted);
  font-size: 13px;
}

.mini-stats dd {
  margin: 4px 0 0;
  font-size: 23px;
  font-weight: 900;
}

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

.weak-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(38, 221, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(38, 221, 255, 0.06);
}

.weak-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(38, 221, 255, 0.42);
  border-radius: var(--radius);
  color: var(--cyan);
  background: rgba(38, 221, 255, 0.1);
}

.weak-icon svg {
  width: 28px;
  height: 28px;
}

.weak-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #d8edf3;
  font-size: 14px;
  font-weight: 800;
}

.bar {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime), #69efff);
}

.weak-badge {
  min-width: 32px;
  padding: 5px 8px;
  border-radius: var(--radius);
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.weak-badge.low {
  border: 1px solid rgba(255, 107, 94, 0.52);
  color: #ff8c82;
  background: rgba(255, 107, 94, 0.1);
}

.weak-badge.mid {
  border: 1px solid rgba(255, 186, 72, 0.52);
  color: #ffd179;
  background: rgba(255, 186, 72, 0.1);
}

.weak-badge.high {
  border: 1px solid rgba(185, 255, 56, 0.52);
  color: var(--lime);
  background: rgba(185, 255, 56, 0.1);
}

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

.queue-row {
  display: grid;
  grid-template-columns: 28px 36px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.queue-row span:first-child {
  color: #d8e9ef;
  font-weight: 900;
}

.queue-row svg {
  width: 34px;
  height: 28px;
}

.queue-row strong {
  color: #d9edf4;
  font-size: 13px;
}

.queue-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.wide-button {
  width: 100%;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #d6edf4;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  min-width: min(360px, calc(100vw - 40px));
  padding: 14px 18px;
  border: 1px solid rgba(38, 221, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(7, 20, 28, 0.96);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
  color: #e7fbff;
  text-align: center;
  transform: translate(-50%, 120px);
  opacity: 0;
  transition: 220ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.bottom-nav {
  display: none;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .brand {
    justify-content: center;
    padding-inline: 0;
  }

  .brand span:last-child,
  .nav-item span:last-child,
  .tool-toggles,
  .profile-card {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

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

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

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

@media (max-width: 850px) {
  body {
    background:
      linear-gradient(90deg, rgba(38, 221, 255, 0.04) 1px, transparent 1px),
      linear-gradient(0deg, rgba(38, 221, 255, 0.04) 1px, transparent 1px),
      linear-gradient(135deg, #03080d, #07151c 62%, #020506);
    background-size: 64px 64px, 64px 64px, auto;
  }

  .app-shell {
    display: block;
    width: min(100%, 390px);
    min-height: 100svh;
    margin: 0;
    padding-bottom: 80px;
    border: 0;
    border-radius: 0;
  }

  .side-rail {
    display: none;
  }

  .training-board {
    padding: 10px 14px;
  }

  .top-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    align-items: stretch;
    gap: 8px;
  }

  .level-select {
    min-width: 0;
    width: 100%;
    height: 44px;
    padding: 0 10px;
    font-size: 13px;
  }

  .timer-card {
    grid-template-columns: 1fr 44px;
    min-width: 0;
    width: 100%;
    padding: 7px 9px;
  }

  .timer-card strong {
    font-size: 24px;
  }

  .timer-card small {
    display: none;
  }

  .pause-button {
    width: 40px;
    height: 40px;
  }

  .workspace {
    gap: 14px;
  }

  .exercise-panel {
    grid-template-rows: auto minmax(190px, auto) auto auto auto;
    min-height: 0;
    gap: 8px;
    padding: 12px;
  }

  .exercise-copy {
    display: grid;
    gap: 8px;
  }

  .exercise-copy p {
    font-size: 15px;
    line-height: 1.45;
  }

  .attempt-pill {
    justify-self: start;
    font-size: 12px;
  }

  .scene-wrap {
    min-height: 198px;
  }

  .cube-stage {
    width: min(235px, 88%);
  }

  .axis-markers {
    right: 16px;
    top: 18px;
    transform: scale(0.8);
    transform-origin: top right;
  }

  .option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .answer-card {
    min-height: 92px;
    padding: 8px;
  }

  .answer-card svg {
    width: 58px;
  }

  .answer-card strong {
    font-size: 20px;
  }

  .hint-strip {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .exercise-actions {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .secondary-button {
    display: none;
  }

  .primary-button {
    width: 100%;
  }

  .step-meter {
    order: -1;
  }

  .step-meter span {
    width: 22px;
  }

  .insight-panel {
    grid-template-columns: 1fr;
  }

  .score-card {
    grid-template-columns: 130px 1fr;
    align-items: center;
  }

  .score-ring {
    width: 124px;
    height: 124px;
  }

  .mini-stats dd {
    font-size: 21px;
  }

  .queue-row {
    grid-template-columns: 24px 32px 1fr auto;
  }

  .bottom-nav {
    position: fixed;
    bottom: 10px;
    left: 12px;
    width: min(calc(100vw - 24px), 366px);
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(38, 221, 255, 0.26);
    border-radius: var(--radius);
    background: rgba(4, 14, 20, 0.94);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(18px);
  }

  .bottom-nav button {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 4px;
    color: #8ea5ae;
    font-size: 11px;
  }

  .bottom-nav button.is-active {
    color: var(--cyan);
  }

  .bottom-nav span {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }
}

@media (max-width: 430px) {
  .app-shell {
    width: 100%;
  }

  .training-board {
    padding-inline: 10px;
  }

  .top-bar {
    margin-bottom: 10px;
  }

  .timer-card {
    gap: 8px;
  }

  .timer-card strong {
    font-size: 23px;
  }

  .exercise-panel {
    gap: 12px;
  }

  .scene-wrap {
    min-height: 188px;
  }

  .option-grid {
    gap: 8px;
  }

  .answer-card {
    min-height: 88px;
  }

  .answer-card svg {
    width: 54px;
  }

  .score-card {
    grid-template-columns: 112px 1fr;
    gap: 10px;
  }

  .score-ring {
    width: 108px;
    height: 108px;
  }
}
