:root {
  color-scheme: dark;
  --bg: #06131b;
  --panel: #0b1e28;
  --panel-light: #102a36;
  --line: #254452;
  --text: #f3f7f8;
  --muted: #91a8b3;
  --cyan: #3ee7d1;
  --orange: #ff8b4c;
  --red: #ff5f68;
  --yellow: #ffd166;
  --blue: #46a8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, #153848 0, transparent 44%),
    linear-gradient(150deg, #071820, #030b10 72%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

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

.lesson-open {
  overflow: hidden;
}

.concept-lesson {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 60px);
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 35%, rgba(70, 168, 255, 0.18), transparent 32%),
    radial-gradient(circle at 78% 70%, rgba(62, 231, 209, 0.12), transparent 32%),
    #041017;
  transition:
    opacity 300ms ease,
    visibility 300ms ease;
}

.concept-lesson.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.lesson-backdrop-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(92, 152, 178, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 152, 178, 0.14) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}

.lesson-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(400px, 1.14fr);
  width: min(1050px, 100%);
  min-height: 610px;
  overflow: hidden;
  border: 1px solid rgba(90, 176, 202, 0.42);
  border-radius: 22px;
  background: rgba(7, 25, 34, 0.96);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.55),
    inset 0 1px rgba(255, 255, 255, 0.05);
}

.guide-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 610px;
  overflow: hidden;
  border-right: 1px solid rgba(91, 134, 153, 0.24);
  background:
    linear-gradient(160deg, rgba(70, 168, 255, 0.13), transparent 50%),
    linear-gradient(20deg, rgba(62, 231, 209, 0.08), transparent 55%),
    #081c26;
}

.guide-stage::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34%;
  content: "";
  background: linear-gradient(transparent, rgba(3, 12, 17, 0.78));
}

.guide-orbit {
  position: absolute;
  border: 1px solid rgba(62, 231, 209, 0.22);
  border-radius: 50%;
  animation: guide-spin 18s linear infinite;
}

.guide-orbit::before,
.guide-orbit::after {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
  content: "";
}

.guide-orbit::before {
  top: 20%;
  left: 4%;
}

.guide-orbit::after {
  right: 10%;
  bottom: 13%;
}

.orbit-one {
  width: 390px;
  height: 390px;
}

.orbit-two {
  width: 300px;
  height: 300px;
  animation-direction: reverse;
  animation-duration: 13s;
}

@keyframes guide-spin {
  to {
    transform: rotate(360deg);
  }
}

.anime-guide {
  position: relative;
  z-index: 2;
  width: 250px;
  height: 420px;
  animation: guide-float 3.5s ease-in-out infinite;
}

@keyframes guide-float {
  50% {
    transform: translateY(-8px);
  }
}

.guide-hair-back {
  position: absolute;
  z-index: 1;
  top: 36px;
  left: 34px;
  width: 184px;
  height: 238px;
  border-radius: 48% 48% 42% 42% / 34% 34% 66% 66%;
  background: linear-gradient(145deg, #253c87, #111b4a 62%, #060d28);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.guide-neck {
  position: absolute;
  z-index: 3;
  top: 246px;
  left: 103px;
  width: 47px;
  height: 62px;
  border-radius: 12px;
  background: #f1b49e;
}

.guide-face {
  position: absolute;
  z-index: 4;
  top: 68px;
  left: 55px;
  width: 142px;
  height: 190px;
  border-radius: 48% 48% 48% 48% / 38% 38% 62% 62%;
  background: linear-gradient(110deg, #ffd6bf, #efad98);
  box-shadow: inset -12px -8px rgba(181, 86, 95, 0.08);
}

.guide-bangs {
  position: absolute;
  top: -30px;
  left: -14px;
  width: 169px;
  height: 87px;
  border-radius: 55% 45% 48% 32%;
  background: linear-gradient(145deg, #344fa3, #17245f);
  clip-path: polygon(0 0, 100% 0, 92% 52%, 74% 82%, 67% 42%, 48% 94%, 39% 48%, 20% 83%, 7% 57%);
}

.guide-ear {
  position: absolute;
  top: 86px;
  width: 19px;
  height: 33px;
  border-radius: 50%;
  background: #efad98;
}

.guide-ear.left {
  left: -10px;
}

.guide-ear.right {
  right: -10px;
}

.guide-eye {
  position: absolute;
  top: 78px;
  width: 33px;
  height: 22px;
  overflow: hidden;
  border-top: 4px solid #29335f;
  border-radius: 52% 52% 45% 45%;
  background: white;
  animation: guide-blink 5s infinite;
}

.guide-eye.left {
  left: 25px;
}

.guide-eye.right {
  right: 25px;
}

.guide-eye span {
  position: absolute;
  top: 1px;
  left: 9px;
  width: 15px;
  height: 18px;
  border: 5px solid #2b5295;
  border-radius: 50%;
  background: #06101c;
}

@keyframes guide-blink {
  0%,
  46%,
  50%,
  100% {
    transform: scaleY(1);
  }
  48% {
    transform: scaleY(0.08);
  }
}

.guide-brow {
  position: absolute;
  top: 61px;
  width: 31px;
  border-top: 3px solid #755451;
  border-radius: 50%;
}

.guide-brow.left {
  left: 25px;
  transform: rotate(-6deg);
}

.guide-brow.right {
  right: 25px;
  transform: rotate(6deg);
}

.guide-nose {
  position: absolute;
  top: 106px;
  left: 69px;
  width: 8px;
  height: 13px;
  border-right: 2px solid rgba(150, 76, 74, 0.3);
  border-bottom: 2px solid rgba(150, 76, 74, 0.3);
  border-radius: 0 0 7px;
}

.guide-mouth {
  position: absolute;
  top: 137px;
  left: 55px;
  width: 34px;
  height: 14px;
  border-bottom: 4px solid #aa5360;
  border-radius: 0 0 50% 50%;
}

.guide-body {
  position: absolute;
  z-index: 2;
  top: 286px;
  left: 27px;
  width: 198px;
  height: 170px;
  border-radius: 48% 48% 8px 8px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(62, 231, 209, 0.28) 49%, rgba(62, 231, 209, 0.28) 51%, transparent 52%),
    linear-gradient(145deg, #193d52, #0b2432);
  clip-path: polygon(20% 0, 80% 0, 100% 32%, 92% 100%, 8% 100%, 0 32%);
}

.guide-collar {
  position: absolute;
  top: 0;
  left: 61px;
  width: 76px;
  height: 55px;
  border: 13px solid #e8f5f5;
  border-top: 0;
  clip-path: polygon(0 0, 50% 100%, 100% 0, 78% 0, 50% 58%, 22% 0);
}

.guide-badge {
  position: absolute;
  top: 63px;
  left: 82px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(62, 231, 209, 0.24);
}

.guide-headset {
  position: absolute;
  z-index: 5;
  top: 78px;
  left: 42px;
  width: 168px;
  height: 150px;
  pointer-events: none;
}

.headset-band {
  position: absolute;
  top: -15px;
  left: 7px;
  width: 155px;
  height: 132px;
  border: 6px solid var(--cyan);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  opacity: 0.64;
}

.headset-ear {
  position: absolute;
  top: 78px;
  left: 0;
  width: 18px;
  height: 45px;
  border-radius: 9px;
  background: var(--cyan);
}

.headset-mic {
  position: absolute;
  top: 111px;
  left: 5px;
  width: 50px;
  height: 32px;
  border-bottom: 4px solid var(--cyan);
  border-radius: 0 0 0 90%;
}

.headset-mic::after {
  position: absolute;
  right: -5px;
  bottom: -7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  content: "";
}

.guide-nameplate {
  position: absolute;
  z-index: 4;
  bottom: 28px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  padding: 10px 16px;
  border: 1px solid rgba(62, 231, 209, 0.35);
  border-radius: 999px;
  background: rgba(5, 20, 27, 0.84);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.guide-nameplate strong,
.guide-nameplate small {
  display: block;
}

.guide-nameplate small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.63rem;
}

.tommy-guide {
  position: relative;
  z-index: 3;
  width: 270px;
  height: 400px;
  animation: tommy-breathe 2.8s ease-in-out infinite;
}

@keyframes tommy-breathe {
  50% {
    transform: translateY(-5px) rotate(0.5deg);
  }
}

.tommy-body {
  position: absolute;
  bottom: 0;
  left: 38px;
  width: 194px;
  height: 176px;
  border-radius: 50% 50% 12px 12px;
  background: linear-gradient(120deg, #171a20, #080b0e 72%);
  clip-path: polygon(18% 4%, 82% 4%, 100% 36%, 92% 100%, 8% 100%, 0 36%);
}

.tommy-chest {
  position: absolute;
  top: 37px;
  left: 62px;
  width: 70px;
  height: 118px;
  border-radius: 50% 50% 30% 30%;
  background: linear-gradient(#a85c37, #71341f);
  clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
}

.tommy-collar {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 34px;
  width: 126px;
  height: 25px;
  border-radius: 6px;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(62, 231, 209, 0.35);
}

.tommy-collar span {
  position: absolute;
  top: 13px;
  left: 52px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 3px solid var(--cyan);
  border-radius: 50%;
  color: var(--cyan);
  background: #071118;
  font-size: 0.55rem;
  font-weight: 900;
}

.tommy-paw {
  position: absolute;
  z-index: 5;
  top: 58px;
  right: -16px;
  width: 51px;
  height: 92px;
  border-radius: 45% 45% 24px 24px;
  background: linear-gradient(100deg, #171a20, #090c0f);
  transform: rotate(-34deg);
  transform-origin: top;
  animation: tommy-point 1.6s ease-in-out infinite;
}

.tommy-paw::after {
  position: absolute;
  right: 4px;
  bottom: -5px;
  width: 43px;
  height: 27px;
  border-radius: 50%;
  background: #0b0e12;
  content: "";
}

@keyframes tommy-point {
  50% {
    transform: rotate(-44deg) translateY(-5px);
  }
}

.tommy-head {
  position: absolute;
  z-index: 4;
  top: 47px;
  left: 50px;
  width: 170px;
  height: 220px;
  border-radius: 44% 44% 48% 48% / 48% 48% 58% 58%;
  background: linear-gradient(110deg, #20242a, #080a0d 70%);
  box-shadow: inset -14px -8px rgba(0, 0, 0, 0.3);
}

.tommy-ear {
  position: absolute;
  z-index: -1;
  top: -71px;
  width: 58px;
  height: 105px;
  background: linear-gradient(120deg, #171b20, #06080a);
  clip-path: polygon(50% 0, 100% 100%, 0 87%);
}

.tommy-ear::after {
  position: absolute;
  inset: 17px 15px 10px;
  background: #6c3431;
  clip-path: polygon(50% 0, 100% 100%, 0 88%);
  content: "";
}

.tommy-ear.left {
  left: 4px;
  transform: rotate(-7deg);
}

.tommy-ear.right {
  right: 4px;
  transform: scaleX(-1) rotate(-7deg);
}

.tommy-face-mark {
  position: absolute;
  top: 61px;
  width: 44px;
  height: 42px;
  border-radius: 50%;
  background: #a85c37;
  opacity: 0.9;
}

.tommy-face-mark.left {
  left: 18px;
  transform: rotate(-18deg);
}

.tommy-face-mark.right {
  right: 18px;
  transform: rotate(18deg);
}

.tommy-brow {
  position: absolute;
  z-index: 3;
  top: 58px;
  width: 38px;
  height: 13px;
  border-radius: 50%;
  background: #c97848;
}

.tommy-brow.left {
  left: 26px;
  transform: rotate(10deg);
}

.tommy-brow.right {
  right: 26px;
  transform: rotate(-10deg);
}

.tommy-eye {
  position: absolute;
  z-index: 4;
  top: 78px;
  width: 22px;
  height: 27px;
  border: 5px solid #f4eee2;
  border-radius: 50%;
  background: #2f6e7e;
  box-shadow: inset 0 0 0 6px #071116;
  animation: tommy-blink 5s infinite;
}

.tommy-eye.left {
  left: 34px;
}

.tommy-eye.right {
  right: 34px;
}

@keyframes tommy-blink {
  0%,
  46%,
  50%,
  100% {
    transform: scaleY(1);
  }
  48% {
    transform: scaleY(0.1);
  }
}

.tommy-muzzle {
  position: absolute;
  z-index: 3;
  right: 25px;
  bottom: 24px;
  left: 25px;
  height: 96px;
  border-radius: 48% 48% 52% 52%;
  background: linear-gradient(#9b5434, #66301f);
}

.tommy-nose {
  position: absolute;
  z-index: 5;
  bottom: 76px;
  left: 56px;
  width: 58px;
  height: 42px;
  border-radius: 50% 50% 46% 46%;
  background: #030506;
  box-shadow: inset 8px 7px rgba(255, 255, 255, 0.05);
}

.tommy-mouth {
  position: absolute;
  z-index: 5;
  bottom: 43px;
  left: 62px;
  width: 48px;
  height: 23px;
  border-bottom: 5px solid #030506;
  border-radius: 0 0 50% 50%;
  animation: tommy-talk 700ms ease-in-out infinite;
}

@keyframes tommy-talk {
  50% {
    height: 29px;
    border-radius: 0 0 45% 45%;
  }
}

.tommy-headset {
  position: absolute;
  z-index: 7;
  top: 8px;
  left: 3px;
  width: 164px;
  height: 148px;
  border: 5px solid var(--cyan);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  opacity: 0.74;
}

.tommy-headset::before {
  position: absolute;
  top: 101px;
  left: -10px;
  width: 18px;
  height: 43px;
  border-radius: 7px;
  background: var(--cyan);
  content: "";
}

.tommy-headset::after {
  position: absolute;
  top: 125px;
  left: -4px;
  width: 55px;
  height: 30px;
  border-bottom: 4px solid var(--cyan);
  border-radius: 0 0 0 90%;
  content: "";
}

.tommy-talk-bubble {
  position: absolute;
  z-index: 8;
  top: 36px;
  right: 20px;
  width: 210px;
  padding: 13px 15px;
  border: 1px solid rgba(62, 231, 209, 0.46);
  border-radius: 14px 14px 14px 3px;
  color: #dcebed;
  background: rgba(8, 31, 40, 0.94);
  font-size: 0.76rem;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.concept-board {
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid #365966;
  border-radius: 12px;
  background: #06151d;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.25);
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 31px;
  padding: 0 11px;
  border-bottom: 1px solid #294550;
  color: #80a4b0;
  background: #0c252f;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
}

.board-header span {
  display: flex;
  gap: 5px;
}

.board-header i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #355762;
}

.board-header i:first-child {
  background: var(--red);
}

.board-header i:nth-child(2) {
  background: var(--yellow);
}

.board-header i:last-child {
  background: var(--cyan);
}

.board-canvas {
  position: relative;
  height: 250px;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(82, 130, 148, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 130, 148, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.board-die {
  position: absolute;
  top: 19px;
  right: 80px;
  left: 22px;
  height: 205px;
  border: 2px solid #7699a7;
  border-radius: 5px;
}

.board-die-label,
.board-core-label {
  position: absolute;
  top: 4px;
  left: 6px;
  color: #7896a2;
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.board-core {
  position: absolute;
  inset: 22px;
  border: 2px dashed rgba(62, 231, 209, 0.72);
  border-radius: 3px;
}

.board-core-label {
  color: var(--cyan);
}

.demo-macro {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 4px;
  color: #dff4fa;
  background: #163d53;
  font-size: 0.53rem;
  font-weight: 900;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.macro-a {
  top: 35px;
  left: 42px;
  width: 66px;
  height: 48px;
}

.macro-b {
  top: 29px;
  right: 42px;
  width: 72px;
  height: 54px;
}

.macro-c {
  right: 55px;
  bottom: 21px;
  width: 82px;
  height: 43px;
}

.macro-d {
  bottom: 23px;
  left: 30px;
  width: 54px;
  height: 38px;
}

.demo-blockage {
  position: absolute;
  z-index: 2;
  top: 66px;
  left: 47%;
  display: grid;
  width: 64px;
  height: 58px;
  place-items: center;
  border: 2px dashed var(--red);
  color: #ff9ca2;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 95, 104, 0.04),
    rgba(255, 95, 104, 0.04) 4px,
    rgba(255, 95, 104, 0.15) 4px,
    rgba(255, 95, 104, 0.15) 7px
  );
  font-size: 0.42rem;
  font-weight: 900;
}

.board-wires {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
}

.board-wires line {
  stroke: var(--orange);
  stroke-width: 3;
  stroke-dasharray: 7 5;
  opacity: 0.75;
}

.congestion-cloud {
  position: absolute;
  z-index: 4;
  top: 53px;
  left: 118px;
  display: grid;
  grid-template-columns: repeat(4, 8px);
  gap: 4px;
  opacity: 0;
}

.congestion-cloud span {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--red);
  box-shadow: 0 0 7px var(--red);
}

.blockage-types {
  position: absolute;
  z-index: 8;
  inset: 20px 72px 20px 20px;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.blockage-types div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid;
  border-radius: 7px;
  opacity: 0;
  transform: translateY(12px);
}

.blockage-types strong {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
}

.blockage-types span {
  margin-top: 4px;
  font-size: 0.52rem;
}

.blockage-types .hard {
  border-color: var(--red);
  color: #ffb0b5;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 95, 104, 0.05),
    rgba(255, 95, 104, 0.05) 5px,
    rgba(255, 95, 104, 0.17) 5px,
    rgba(255, 95, 104, 0.17) 8px
  );
}

.blockage-types .soft {
  border-color: var(--orange);
  color: #ffc4a4;
  background: rgba(255, 139, 76, 0.11);
}

.blockage-types .partial {
  border-color: var(--yellow);
  color: #ffe6a3;
  background:
    radial-gradient(circle, rgba(255, 209, 102, 0.28) 2px, transparent 3px)
    0 0 / 12px 12px;
}

.blockage-types .routing {
  border-color: var(--blue);
  color: #a8d5ff;
  background:
    linear-gradient(90deg, transparent 45%, rgba(70, 168, 255, 0.25) 45%, rgba(70, 168, 255, 0.25) 55%, transparent 55%)
    0 0 / 15px 15px;
}

.board-meter {
  position: absolute;
  top: 46px;
  right: 12px;
  display: flex;
  width: 55px;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #75939f;
  font-size: 0.43rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: center;
}

.board-meter div {
  position: relative;
  width: 8px;
  height: 112px;
  overflow: hidden;
  border-radius: 999px;
  background: #173540;
}

.board-meter i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 72%;
  border-radius: inherit;
  background: linear-gradient(var(--red), var(--yellow), var(--cyan));
  transform-origin: bottom;
  animation: meter-rise 1.4s ease both;
}

.board-meter strong {
  color: var(--cyan);
  font-size: 0.6rem;
}

@keyframes meter-rise {
  from {
    transform: scaleY(0);
  }
}

.concept-board.intro .board-die {
  animation: board-pulse 1.6s ease-in-out infinite;
}

.concept-board.intro .demo-macro {
  animation: macro-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes board-pulse {
  50% {
    border-color: var(--cyan);
    box-shadow: 0 0 18px rgba(62, 231, 209, 0.18);
  }
}

@keyframes macro-pulse {
  to {
    border-color: var(--cyan);
    transform: scale(1.06);
  }
}

.concept-board.core .board-core {
  animation: core-focus 1.5s ease-in-out infinite alternate;
}

.concept-board.core .congestion-cloud {
  opacity: 1;
  animation: congestion-flash 1.1s ease-in-out infinite alternate;
}

@keyframes core-focus {
  from {
    inset: 35px;
  }
  to {
    inset: 16px;
    box-shadow: inset 0 0 25px rgba(62, 231, 209, 0.16);
  }
}

@keyframes congestion-flash {
  to {
    opacity: 0.25;
  }
}

.concept-board.macro .demo-macro {
  animation: macro-arrive 1.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.concept-board.macro .macro-b {
  animation-delay: 120ms;
}

.concept-board.macro .macro-c {
  animation-delay: 240ms;
}

.concept-board.macro .macro-d {
  animation-delay: 360ms;
}

@keyframes macro-arrive {
  from {
    opacity: 0;
    transform: translate(90px, -55px) rotate(8deg);
  }
}

.concept-board.connect .board-wires line {
  animation: wire-flow 900ms linear infinite;
}

.concept-board.connect .macro-a {
  animation: connect-left 1.8s ease-in-out infinite alternate;
}

.concept-board.connect .macro-b {
  animation: connect-right 1.8s ease-in-out infinite alternate;
}

@keyframes wire-flow {
  to {
    stroke-dashoffset: -24;
  }
}

@keyframes connect-left {
  to {
    transform: translate(36px, 15px);
  }
}

@keyframes connect-right {
  to {
    transform: translate(-40px, 18px);
  }
}

.concept-board.blockage .macro-c {
  animation: avoid-blockage 2.4s ease-in-out infinite;
}

.concept-board.blockage .demo-blockage {
  animation: blockage-alert 1.2s ease-in-out infinite alternate;
}

.concept-board.blockage .board-die,
.concept-board.blockage .board-meter {
  opacity: 0.13;
}

.concept-board.blockage .blockage-types {
  display: grid;
}

.concept-board.blockage .blockage-types div {
  animation: blockage-type-arrive 450ms ease forwards;
}

.concept-board.blockage .blockage-types div:nth-child(2) {
  animation-delay: 130ms;
}

.concept-board.blockage .blockage-types div:nth-child(3) {
  animation-delay: 260ms;
}

.concept-board.blockage .blockage-types div:nth-child(4) {
  animation-delay: 390ms;
}

@keyframes blockage-type-arrive {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.concept-board.halo .demo-macro::after {
  position: absolute;
  inset: -10px;
  border: 2px dashed var(--orange);
  border-radius: 8px;
  content: "";
  animation: halo-breathe 1.2s ease-in-out infinite alternate;
}

.concept-board.halo .demo-blockage,
.concept-board.halo .board-wires {
  opacity: 0.2;
}

@keyframes halo-breathe {
  to {
    inset: -15px;
    box-shadow: 0 0 12px rgba(255, 139, 76, 0.35);
  }
}

.concept-board.congestion .macro-a {
  transform: translate(52px, 28px);
}

.concept-board.congestion .macro-b {
  transform: translate(-55px, 32px);
}

.concept-board.congestion .macro-c {
  transform: translate(-50px, -30px);
}

.concept-board.congestion .macro-d {
  transform: translate(55px, -28px);
}

.concept-board.congestion .congestion-cloud {
  opacity: 1;
  animation: congestion-flash 700ms ease-in-out infinite alternate;
}

.concept-board.congestion .board-wires line {
  stroke: var(--red);
  stroke-width: 5;
  animation: wire-flow 500ms linear infinite;
}

.concept-board.congestion .board-meter i {
  background: var(--red);
}

@keyframes avoid-blockage {
  0%,
  100% {
    transform: translate(0, 0);
  }
  45% {
    border-color: var(--red);
    transform: translate(-82px, -46px);
  }
  62% {
    border-color: var(--red);
    transform: translate(-82px, -46px);
  }
}

@keyframes blockage-alert {
  to {
    box-shadow: 0 0 22px rgba(255, 95, 104, 0.45);
  }
}

.concept-board.mission .demo-macro {
  border-color: var(--cyan);
  animation: mission-ready 1.8s ease-in-out infinite alternate;
}

.concept-board.mission .board-wires line {
  stroke: var(--cyan);
  animation: wire-flow 900ms linear infinite;
}

.concept-board.mission .demo-blockage {
  opacity: 0.45;
}

@keyframes mission-ready {
  to {
    box-shadow: 0 0 14px rgba(62, 231, 209, 0.45);
  }
}

.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.lesson-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 5vw, 68px);
}

.lesson-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 38px;
  color: #6f929f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.text-button {
  padding: 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.text-button:hover {
  color: var(--text);
}

.lesson-concept-icon {
  position: relative;
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid rgba(62, 231, 209, 0.4);
  border-radius: 16px;
  background: rgba(62, 231, 209, 0.08);
}

.lesson-concept-icon::before,
.lesson-concept-icon::after,
.lesson-concept-icon span {
  position: absolute;
  content: "";
  transition: all 220ms ease;
}

.lesson-concept-icon::before {
  width: 34px;
  height: 34px;
  border: 3px solid var(--cyan);
  border-radius: 3px;
}

.lesson-concept-icon::after {
  width: 18px;
  height: 18px;
  border: 2px dashed var(--orange);
}

.lesson-concept-icon span {
  width: 4px;
  height: 4px;
  background: var(--yellow);
  box-shadow:
    12px 0 var(--yellow),
    24px 0 var(--yellow),
    0 12px var(--yellow),
    24px 12px var(--yellow),
    0 24px var(--yellow),
    12px 24px var(--yellow),
    24px 24px var(--yellow);
}

.lesson-concept-icon.core::before {
  width: 39px;
  height: 39px;
  border-style: double;
  border-width: 5px;
}

.lesson-concept-icon.core::after {
  width: 9px;
  height: 9px;
  border: 0;
  background: var(--orange);
  box-shadow:
    14px 0 var(--blue),
    0 14px var(--blue),
    14px 14px var(--orange);
}

.lesson-concept-icon.macro::before {
  width: 39px;
  height: 25px;
  border: 3px solid var(--cyan);
  box-shadow:
    -8px -9px 0 -5px var(--orange),
    11px 12px 0 -5px var(--blue);
}

.lesson-concept-icon.macro::after {
  display: none;
}

.lesson-concept-icon.connect::before {
  width: 40px;
  height: 3px;
  border: 0;
  background: var(--orange);
  transform: rotate(-32deg);
}

.lesson-concept-icon.connect::after {
  width: 13px;
  height: 13px;
  border: 3px solid var(--cyan);
  border-radius: 3px;
  box-shadow: 28px -18px 0 -3px #0b222c, 28px -18px 0 0 var(--cyan);
  transform: translate(-14px, 9px);
}

.lesson-concept-icon.blockage::before {
  width: 40px;
  height: 34px;
  border-color: var(--red);
  border-style: dashed;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(255, 95, 104, 0.28) 4px,
    rgba(255, 95, 104, 0.28) 7px
  );
}

.lesson-concept-icon.blockage::after {
  display: none;
}

.lesson-concept-icon.mission::before {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.lesson-concept-icon.mission::after {
  width: 14px;
  height: 7px;
  border: 0;
  border-bottom: 4px solid var(--cyan);
  border-left: 4px solid var(--cyan);
  transform: rotate(-45deg);
}

.lesson-content h2 {
  max-width: 520px;
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.lesson-stage-text {
  min-height: 88px;
  margin-bottom: 24px;
  color: #b8cad1;
  font-size: 1rem;
  line-height: 1.7;
}

.lesson-takeaway {
  padding: 14px 16px;
  border-left: 3px solid var(--orange);
  border-radius: 0 7px 7px 0;
  background: rgba(255, 139, 76, 0.07);
}

.lesson-takeaway span {
  display: block;
  margin-bottom: 4px;
  color: var(--orange);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.lesson-takeaway p {
  margin: 0;
  color: #d9e4e7;
  font-size: 0.82rem;
  line-height: 1.5;
}

.lesson-progress {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.lesson-progress-dots {
  display: flex;
  flex: 1;
  gap: 7px;
}

.progress-dot {
  height: 4px;
  flex: 1;
  border: 0;
  border-radius: 999px;
  background: #193541;
  cursor: pointer;
}

.progress-dot.complete,
.progress-dot.active {
  background: var(--cyan);
}

.progress-dot.active {
  box-shadow: 0 0 10px rgba(62, 231, 209, 0.45);
}

.lesson-actions {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  margin-top: 20px;
}

.lesson-actions .button-primary {
  justify-self: end;
  min-width: 150px;
}

.voice-button {
  color: var(--muted);
}

.voice-button.active {
  border-color: var(--cyan);
  color: var(--cyan);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 18px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(108, 148, 167, 0.2);
  background: rgba(4, 16, 23, 0.82);
  backdrop-filter: blur(14px);
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.eyebrow,
.panel-kicker {
  margin-bottom: 5px;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

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

.button-primary {
  color: #03201d;
  background: var(--cyan);
}

.button-primary:hover {
  background: #70f2e2;
}

.button-secondary {
  border-color: var(--line);
  background: #0d2530;
}

.button-danger {
  border-color: rgba(255, 95, 104, 0.36);
  background: rgba(255, 95, 104, 0.08);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(500px, 1fr) minmax(220px, 280px);
  gap: 18px;
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.panel,
.workspace-card {
  border: 1px solid rgba(91, 134, 153, 0.24);
  border-radius: 12px;
  background: rgba(9, 27, 36, 0.9);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.panel-heading.compact {
  margin-bottom: 16px;
}

.step-number {
  display: grid;
  flex: 0 0 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 900;
}

.mission-copy {
  color: #b8c8cf;
  font-size: 0.88rem;
  line-height: 1.65;
}

.objective-list {
  display: grid;
  gap: 9px;
  margin: 24px 0;
}

.objective {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.02);
}

.objective-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #45616e;
  border-radius: 50%;
  color: transparent;
}

.objective.complete {
  border-color: rgba(62, 231, 209, 0.4);
  color: var(--text);
  background: rgba(62, 231, 209, 0.07);
}

.objective.complete .objective-icon {
  border-color: var(--cyan);
  color: #04221e;
  background: var(--cyan);
}

.lesson-card {
  margin-top: 26px;
  padding: 17px;
  border-left: 3px solid var(--orange);
  border-radius: 4px 8px 8px 4px;
  background: #122b36;
}

.lesson-card .panel-kicker {
  color: var(--orange);
}

.lesson-card p:last-child {
  margin-bottom: 0;
  color: #aabdc6;
  font-size: 0.78rem;
  line-height: 1.55;
}

.constraint-reference {
  margin-top: 18px;
  border: 1px solid rgba(255, 139, 76, 0.28);
  border-radius: 8px;
  background: rgba(255, 139, 76, 0.04);
}

.constraint-reference summary {
  padding: 11px 13px;
  color: #e8d0c1;
  font-size: 0.73rem;
  font-weight: 800;
  cursor: pointer;
}

.constraint-reference dl {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 4px 13px 14px;
}

.constraint-reference dl div {
  padding-top: 9px;
  border-top: 1px solid rgba(255, 139, 76, 0.14);
}

.constraint-reference dt {
  color: var(--orange);
  font-size: 0.68rem;
  font-weight: 850;
}

.constraint-reference dd {
  margin: 3px 0 0;
  color: #9fb4bc;
  font-size: 0.66rem;
  line-height: 1.45;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 0.7rem;
}

.legend div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.macro-swatch {
  background: var(--cyan);
}

.halo-swatch {
  border: 1px dashed var(--orange);
  background: rgba(255, 139, 76, 0.08);
}

.blockage-swatch {
  border: 1px solid var(--red);
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    var(--red) 2px,
    var(--red) 3px
  );
}

.legend-line {
  width: 16px;
  border-top: 2px dashed #7698a6;
}

.workspace-card {
  align-self: start;
  padding: 18px;
  overflow: hidden;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 16px;
}

.view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid rgba(91, 134, 153, 0.24);
  border-radius: 9px;
  background: #071820;
}

.view-tab {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.view-tab span {
  margin-left: 5px;
  color: var(--yellow);
  font-size: 0.61rem;
}

.view-tab.active {
  border-color: rgba(62, 231, 209, 0.34);
  color: var(--text);
  background: rgba(62, 231, 209, 0.09);
}

.status-pill {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.status-pill.ready {
  border-color: var(--cyan);
  color: var(--cyan);
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid #31505e;
  border-radius: 8px;
  background: #06151d;
}

#floorplan {
  display: block;
  width: 100%;
  aspect-ratio: 10 / 7;
  touch-action: none;
  user-select: none;
}

.core-background {
  fill: #091b24;
  stroke: #4c6c79;
  stroke-width: 3;
}

.blockage rect {
  fill: rgba(255, 95, 104, 0.07);
  stroke: rgba(255, 95, 104, 0.72);
  stroke-width: 2;
  stroke-dasharray: 9 7;
}

.blockage path {
  fill: none;
  stroke: rgba(255, 95, 104, 0.18);
  stroke-width: 9;
}

.blockage text {
  fill: #ff8d93;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-anchor: middle;
}

.blockage .blockage-subtitle {
  fill: #c8777c;
  font-size: 11px;
}

.connection {
  fill: none;
  stroke: #799aa7;
  stroke-dasharray: 8 6;
  opacity: 0.38;
  pointer-events: none;
  animation: signal-flow 1.1s linear infinite;
}

.connection.hot {
  stroke: var(--orange);
  opacity: 0.64;
}

.connection-label {
  pointer-events: none;
}

.connection-label rect {
  fill: rgba(5, 21, 29, 0.9);
  stroke: rgba(121, 154, 167, 0.55);
  stroke-width: 1.5;
}

.connection-label text {
  fill: #d9e8eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.channel-warning {
  stroke: var(--red);
  stroke-width: 10;
  stroke-linecap: round;
  opacity: 0.16;
  pointer-events: none;
  animation: channel-alert 850ms ease-in-out infinite alternate;
}

.channel-gap-label {
  pointer-events: none;
}

.channel-gap-label rect {
  fill: rgba(64, 20, 24, 0.94);
  stroke: var(--red);
  stroke-width: 1.5;
}

.channel-gap-label text {
  fill: #ffd8da;
  font-size: 11px;
  font-weight: 900;
}

@keyframes channel-alert {
  to {
    opacity: 0.36;
  }
}

@keyframes signal-flow {
  to {
    stroke-dashoffset: -28;
  }
}

.macro {
  cursor: grab;
  filter: url(#macroShadow);
  outline: none;
}

.macro:focus-visible .macro-body {
  stroke: white;
  stroke-width: 4;
}

.macro.dragging {
  cursor: grabbing;
}

.macro-body {
  stroke-width: 3;
  transition:
    fill 120ms ease,
    stroke 120ms ease;
}

.macro.valid .macro-body {
  fill: #123d48;
  stroke: var(--cyan);
}

.macro.warning .macro-body {
  fill: #4a2725;
  stroke: var(--red);
}

.macro.congested .macro-body {
  fill: #493522;
  stroke: var(--orange);
}

.macro-halo {
  fill: rgba(62, 231, 209, 0.025);
  stroke: rgba(62, 231, 209, 0.3);
  stroke-width: 2;
  stroke-dasharray: 7 6;
  pointer-events: none;
}

.macro.warning .macro-halo {
  stroke: rgba(255, 95, 104, 0.75);
}

.macro.congested .macro-halo {
  fill: rgba(255, 139, 76, 0.05);
  stroke: var(--orange);
}

.macro-label {
  fill: #ecffff;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-anchor: middle;
  pointer-events: none;
}

.macro-size {
  fill: #9fc1ca;
  font-size: 12px;
  text-anchor: middle;
  pointer-events: none;
}

.macro-grid {
  fill: none;
  stroke: rgba(62, 231, 209, 0.18);
  stroke-width: 1;
  pointer-events: none;
}

.macro-port {
  pointer-events: none;
}

.macro-port circle {
  fill: #06151d;
  stroke: var(--cyan);
  stroke-width: 3;
}

.macro-port text {
  fill: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.macro.warning .macro-port circle {
  stroke: var(--red);
}

.macro.warning .macro-port text {
  fill: #ff9da3;
}

.output-port circle {
  fill: var(--cyan);
}

.io-pin rect {
  fill: var(--yellow);
}

.io-pin circle {
  fill: #06151d;
  stroke: var(--yellow);
  stroke-width: 3;
}

.io-pin text {
  fill: var(--yellow);
  font-size: 12px;
  font-weight: 800;
}

.io-pin .io-net-name {
  fill: #f7e7a8;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.drag-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #c7d5da;
  background: rgba(3, 15, 21, 0.82);
  font-size: 0.72rem;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity 200ms ease;
}

.drag-hint.hidden {
  opacity: 0;
}

.best-result-badge {
  position: absolute;
  z-index: 8;
  top: 14px;
  left: 50%;
  min-width: 270px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 209, 102, 0.55);
  border-radius: 8px;
  background: rgba(5, 20, 27, 0.92);
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
}

.best-result-badge span,
.best-result-badge strong,
.best-result-badge small {
  display: block;
}

.best-result-badge span {
  color: var(--yellow);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.best-result-badge strong {
  margin: 2px 0;
  color: var(--text);
  font-size: 0.88rem;
}

.best-result-badge small {
  color: var(--muted);
  font-size: 0.65rem;
}

.macro.reference {
  pointer-events: none;
  animation: reference-arrive 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes reference-arrive {
  from {
    opacity: 0;
  }
}

.live-coach {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 13px;
  align-items: center;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(70, 168, 255, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(70, 168, 255, 0.08), transparent 42%),
    #0a202a;
}

.coach-avatar {
  position: relative;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 2px solid rgba(62, 231, 209, 0.6);
  border-radius: 50%;
  background: #102b3c;
  box-shadow: 0 0 18px rgba(62, 231, 209, 0.12);
}

.coach-dog-ear {
  position: absolute;
  z-index: 1;
  top: 2px;
  width: 17px;
  height: 27px;
  background: #090c0f;
  clip-path: polygon(50% 0, 100% 100%, 0 84%);
}

.coach-dog-ear.left {
  left: 9px;
  transform: rotate(-8deg);
}

.coach-dog-ear.right {
  right: 9px;
  transform: scaleX(-1) rotate(-8deg);
}

.coach-dog-head {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 10px;
  width: 38px;
  height: 42px;
  border-radius: 45% 45% 50% 50%;
  background: linear-gradient(110deg, #24282d, #07090b);
}

.coach-dog-mark {
  position: absolute;
  top: 13px;
  width: 10px;
  height: 7px;
  border-radius: 50%;
  background: #b2633c;
}

.coach-dog-mark.left,
.coach-dog-eye.left {
  left: 7px;
}

.coach-dog-mark.right,
.coach-dog-eye.right {
  right: 7px;
}

.coach-dog-eye {
  position: absolute;
  z-index: 3;
  top: 17px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #dffbff;
  box-shadow: inset 0 0 0 2px #1f6977;
  animation: coach-blink 5s infinite;
}

@keyframes coach-blink {
  0%,
  47%,
  50%,
  100% {
    transform: scaleY(1);
  }
  49% {
    transform: scaleY(0.1);
  }
}

.coach-dog-muzzle {
  position: absolute;
  right: 7px;
  bottom: 4px;
  left: 7px;
  height: 19px;
  border-radius: 50%;
  background: #8d492f;
}

.coach-dog-nose {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 15px;
  width: 10px;
  height: 7px;
  border-radius: 50%;
  background: #020304;
}

.coach-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: var(--cyan);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.coach-heading span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coach-heading i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.coach-heading button {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.6rem;
  font-weight: 800;
  cursor: pointer;
}

.coach-heading button.active {
  border-color: var(--cyan);
  color: var(--cyan);
}

.coach-message p {
  margin: 0;
  color: #c2d0d5;
  font-size: 0.78rem;
  line-height: 1.5;
  transition: color 150ms ease;
}

.live-coach.warning {
  border-color: rgba(255, 95, 104, 0.5);
}

.live-coach.warning .coach-message p {
  color: #ffb2b7;
}

.live-coach.positive {
  border-color: rgba(62, 231, 209, 0.58);
}

.live-coach.positive .coach-avatar {
  animation: coach-celebrate 400ms ease;
}

@keyframes coach-celebrate {
  50% {
    transform: translateY(-5px) rotate(-4deg);
  }
}

.score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px;
  border: 1px solid rgba(62, 231, 209, 0.22);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(62, 231, 209, 0.1), transparent);
}

.score-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

#scoreValue {
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.grade-ring {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 1.2rem;
  font-weight: 900;
}

.metric-list {
  display: grid;
  gap: 18px;
  margin: 26px 0;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.75rem;
}

.metric-row strong {
  color: var(--text);
}

.meter {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #183541;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
  transition: width 180ms ease;
}

.meter.danger span {
  background: var(--red);
}

.meter.congestion span {
  background: linear-gradient(90deg, var(--cyan), var(--yellow), var(--red));
}

.macro-list {
  padding-top: 4px;
  border-top: 1px solid rgba(91, 134, 153, 0.2);
}

.signal-list {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(91, 134, 153, 0.2);
}

.signal-list-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.signal-list-heading span {
  color: #6f8d99;
  font-size: 0.55rem;
}

#signalInventory {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.signal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  color: #a9bdc5;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.65rem;
}

.signal-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-item b {
  margin: 0 3px;
  color: var(--cyan);
}

.signal-item strong {
  color: var(--yellow);
  font-size: 0.67rem;
}

#macroInventory {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.inventory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #b4c5cc;
  font-size: 0.75rem;
}

.inventory-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

.inventory-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
}

.inventory-status {
  color: var(--cyan);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.inventory-status.warning {
  color: var(--red);
}

.check-button {
  width: 100%;
  margin-top: 25px;
}

dialog {
  width: min(480px, calc(100% - 30px));
  padding: 30px;
  border: 1px solid #355967;
  border-radius: 12px;
  color: var(--text);
  background: #0a202a;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

dialog::backdrop {
  background: rgba(0, 8, 12, 0.75);
  backdrop-filter: blur(5px);
}

dialog ol {
  display: grid;
  gap: 14px;
  margin: 22px 0;
  padding-left: 22px;
  color: #b8cbd2;
  line-height: 1.5;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 1.7rem;
  cursor: pointer;
}

.result-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 15px 18px;
  border: 1px solid var(--cyan);
  border-radius: 9px;
  color: var(--text);
  background: #0b2730;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.result-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.result-toast.failure {
  border-color: var(--orange);
}

@media (max-width: 1120px) {
  .game-layout {
    grid-template-columns: 240px minmax(480px, 1fr);
  }

  .metrics-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .metrics-panel .panel-heading,
  .metrics-panel .check-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .concept-lesson {
    display: block;
    padding: 10px;
  }

  .lesson-shell {
    display: block;
    min-height: 0;
  }

  .guide-stage {
    min-height: 270px;
    border-right: 0;
    border-bottom: 1px solid rgba(91, 134, 153, 0.24);
  }

  .anime-guide {
    transform: scale(0.58);
    animation: none;
  }

  .guide-nameplate {
    bottom: 15px;
  }

  .lesson-content {
    padding: 25px 22px;
  }

  .lesson-topline {
    margin-bottom: 20px;
  }

  .lesson-content h2 {
    font-size: 2rem;
  }

  .lesson-stage-text {
    min-height: 0;
  }

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

  .lesson-actions .button-primary {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: stretch;
  }

  .live-coach {
    grid-template-columns: 52px 1fr;
  }

  .coach-avatar {
    width: 48px;
    height: 48px;
    transform: scale(0.84);
    transform-origin: left center;
  }

  .topbar {
    align-items: flex-start;
    gap: 16px;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
    padding: 12px;
  }

  .workspace-card {
    order: -1;
  }

  .metrics-panel {
    display: block;
  }

  .metrics-panel > * + * {
    margin-top: 22px;
  }
}
