:root {
  --space: #07111f;
  --space-soft: #0d1b2d;
  --panel: #11243a;
  --panel-light: #17314c;
  --paper: #f4f0e6;
  --paper-deep: #ddd7c9;
  --ink: #102033;
  --ink-soft: #415166;
  --cyan: #4fdcff;
  --cyan-deep: #087f9f;
  --mint: #8ae7b4;
  --amber: #ffc857;
  --coral: #ff6f61;
  --success: #63e69b;
  --white: #fffdf7;
  --line: rgba(169, 218, 234, 0.2);
  --key-unit: 48px;
  --key-height: 48px;
  --key-gap: 5px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--space);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(7, 17, 31, 0.1), rgba(7, 17, 31, 0.94)),
    var(--space);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-result-open {
  overflow: hidden;
}

button {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.space-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 0 1px, transparent 1.5px),
    linear-gradient(rgba(79, 220, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 220, 255, 0.035) 1px, transparent 1px);
  background-position:
    0 0,
    0 0,
    0 0;
  background-size:
    72px 72px,
    96px 96px,
    96px 96px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), transparent 88%);
}

.app-shell {
  width: min(calc(100% - 48px), 1440px);
  margin: 0 auto;
  padding: 22px 0 40px;
}

.mission-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  gap: 24px;
  align-items: center;
  min-height: 66px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  justify-self: start;
  color: var(--white);
  text-decoration: none;
}

.brand-key {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 7px;
  background: var(--paper);
  box-shadow:
    0 5px 0 #9f988b,
    0 9px 18px rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.28;
}

.brand-copy strong {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.brand-copy span {
  font-size: 18px;
  font-weight: 750;
}

.mission-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  color: #b6cad8;
  font-size: 13px;
}

.mission-id {
  font-family: var(--mono);
  letter-spacing: 0.08em;
}

.mission-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid rgba(138, 231, 180, 0.28);
  border-radius: 999px;
  background: rgba(138, 231, 180, 0.08);
  color: var(--mint);
}

.status-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 12px rgba(138, 231, 180, 0.85);
  animation: status-pulse 2.4s ease-in-out infinite;
}

.restart-button,
.home-button,
.play-again-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: rgba(17, 36, 58, 0.84);
  color: var(--white);
  font-weight: 700;
}

.restart-button,
.home-button {
  padding: 9px 14px;
}

.restart-button:hover,
.home-button:hover,
.play-again-button:hover {
  border-color: var(--cyan);
  background: var(--panel-light);
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.main-content {
  min-width: 0;
}

.training-console {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(79, 220, 255, 0.06), transparent 30%),
    rgba(13, 27, 45, 0.9);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.training-console:focus {
  outline: none;
}

.console-heading {
  display: flex;
  gap: 28px;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 24px;
}

.eyebrow,
.panel-label {
  margin: 0;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.title-block h1 {
  margin: 2px 0 0;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: 0;
}

.console-subtitle {
  margin: 7px 0 0;
  color: #aec2d0;
  font-size: 15px;
}

.console-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.practice-toggle {
  min-height: 46px;
  padding: 9px 18px;
  border: 1px solid #9a6500;
  border-radius: 7px;
  background: var(--amber);
  box-shadow: 0 4px 0 #8c5c00;
  color: #2c220d;
  font-size: 15px;
  font-weight: 850;
  white-space: nowrap;
}

.practice-toggle:hover {
  background: #ffda7b;
}

.practice-toggle[aria-pressed="true"] {
  border-color: rgba(255, 111, 97, 0.76);
  background: rgba(255, 111, 97, 0.14);
  box-shadow: none;
  color: #ff9b91;
}

.practice-toggle[aria-pressed="true"]:hover {
  background: rgba(255, 111, 97, 0.24);
}

.mission-instruction {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 11px 16px;
  border: 1px solid rgba(255, 200, 87, 0.32);
  border-radius: 7px;
  background: rgba(255, 200, 87, 0.09);
  color: var(--amber);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.mission-instruction span {
  font-family: var(--mono);
  font-size: 22px;
  animation: instruction-bounce 1.2s ease-in-out infinite;
}

.mission-dashboard {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(460px, 1.2fr);
  gap: 14px;
  margin-bottom: 18px;
}

.target-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 104px;
  padding: 14px 18px;
  border: 1px solid rgba(79, 220, 255, 0.3);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.64);
}

.target-copy {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.target-text {
  min-width: 0;
}

.target-name {
  margin: 7px 0 0;
  color: var(--white);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.2;
}

.finger-guide {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid rgba(169, 218, 234, 0.18);
}

.hand-pair {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.hand-unit {
  display: grid;
  min-width: 42px;
  justify-items: center;
  gap: 1px;
  color: #6e8798;
  opacity: 0.34;
  transition:
    color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.hand-unit.is-active {
  color: var(--cyan);
  opacity: 1;
  transform: translateY(-2px);
}

.hand-unit > span {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.hand-svg {
  width: 42px;
  height: 44px;
}

.hand-unit--left .hand-art {
  transform: scaleX(-1);
  transform-origin: 50px 50px;
}

.hand-palm {
  fill: currentColor;
  opacity: 0.44;
}

.finger {
  fill: currentColor;
  stroke: var(--space-soft);
  stroke-width: 1.5;
  opacity: 0.86;
  transition:
    fill 180ms ease,
    opacity 180ms ease,
    filter 180ms ease;
}

.finger.is-active {
  fill: var(--amber);
  opacity: 1;
  stroke: #704700;
  filter: drop-shadow(0 0 4px rgba(255, 200, 87, 0.9));
}

.finger-readout {
  min-width: 68px;
}

.finger-readout .panel-label {
  font-size: 10px;
  white-space: nowrap;
}

.finger-instruction {
  display: flex;
  gap: 5px;
  align-items: baseline;
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
}

.finger-instruction strong {
  color: var(--cyan);
  font-size: 17px;
}

.finger-instruction b {
  color: var(--amber);
  font-size: 16px;
}

.target-glyph {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid rgba(79, 220, 255, 0.8);
  border-radius: 7px;
  background: rgba(79, 220, 255, 0.14);
  box-shadow: 0 5px 0 rgba(5, 55, 72, 0.95);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  word-break: break-all;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.42);
}

.scoreboard > div {
  padding: 17px 20px;
}

.scoreboard > div + div {
  border-left: 1px solid var(--line);
}

.scoreboard dt,
.result-stats dt {
  color: #9db6c7;
  font-size: 13px;
}

.scoreboard dd {
  margin: 3px 0 0;
  color: var(--white);
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.2;
}

.keyboard-deck {
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: var(--paper);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 var(--white);
  color: var(--ink);
}

.deck-heading {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
  color: var(--ink-soft);
  font-size: 12px;
}

.deck-heading > div {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  font-weight: 750;
}

.deck-index {
  display: inline-grid;
  min-width: 38px;
  height: 26px;
  place-items: center;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
}

.deck-heading p {
  margin: 0;
  text-align: right;
}

.keyboard-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 9px;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--cyan-deep) rgba(16, 32, 51, 0.1);
  scrollbar-width: thin;
}

.keyboard-scroll::-webkit-scrollbar {
  height: 8px;
}

.keyboard-scroll::-webkit-scrollbar-track {
  border-radius: 8px;
  background: rgba(16, 32, 51, 0.08);
}

.keyboard-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: var(--cyan-deep);
}

.keyboard-board {
  min-width: 1160px;
  padding: 15px 15px 17px;
  border: 1px solid #b7b0a2;
  border-radius: 8px;
  background: #ddd7c9;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 -3px 0 #bdb5a7;
}

.function-area {
  margin-bottom: 13px;
}

.cluster-label {
  display: block;
  min-height: 18px;
  margin-bottom: 4px;
  color: #6c746f;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

.keyboard-body {
  display: block;
}

.key-row {
  display: flex;
  gap: var(--key-gap);
}

.key-row + .key-row {
  margin-top: var(--key-gap);
}

.function-row {
  gap: var(--key-gap);
}

.function-row .key {
  flex: 1 1 0;
  min-width: 42px;
}

.key {
  position: relative;
  display: flex;
  flex: var(--units, 1) 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: var(--key-height);
  padding: 3px 5px 4px;
  border: 1px solid #b9b2a4;
  border-bottom: 4px solid #aaa294;
  border-radius: 6px;
  background: var(--white);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.72) inset,
    0 2px 4px rgba(16, 32, 51, 0.08);
  color: var(--ink);
  font-family: var(--mono);
  line-height: 1;
  text-align: center;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    transform 100ms ease;
}

.key-spacer {
  flex: var(--units) 1 0;
  min-width: 0;
}

.key[data-height="2"] {
  height: calc(var(--key-height) * 2 + var(--key-gap));
}

.key:hover {
  border-color: #7f9aa4;
  background: #fff;
}

.key:active,
.key.is-pressed {
  border-bottom-width: 1px;
  transform: translateY(3px);
}

.key-main {
  overflow: hidden;
  max-width: 100%;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-sub {
  overflow: hidden;
  max-width: 100%;
  margin-top: 4px;
  color: #6a756e;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 650;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key--system {
  background: #e5e1d7;
}

.key--modifier {
  background: #dce9e8;
}

.key--navigation {
  background: #e1eee2;
}

.key--numeric {
  background: #f3e6c7;
}

.key--danger .key-main {
  color: #b5453b;
}

.key[data-practice="false"]:not(.is-target) {
  color: #53605e;
}

.key.is-target {
  z-index: 3;
  border-color: #167f9c;
  border-bottom-color: #075b70;
  background: var(--cyan);
  box-shadow:
    0 0 0 3px rgba(79, 220, 255, 0.38),
    0 0 24px rgba(79, 220, 255, 0.76),
    0 5px 0 #075b70;
  color: #061520;
  animation: target-pulse 1.35s ease-in-out infinite;
}

.key.is-target .key-main {
  font-size: 14px;
}

.key.is-target .key-sub {
  color: #0c4c5e;
}

.keyboard-board.is-guiding .key:not(.is-target) {
  opacity: 0.26;
  filter: grayscale(0.7);
}

.keyboard-board.is-guiding .key.is-target {
  border-color: #a65f00;
  border-bottom-color: #744300;
  background: var(--amber);
  box-shadow:
    0 0 0 4px rgba(255, 200, 87, 0.45),
    0 0 28px rgba(255, 200, 87, 0.8),
    0 5px 0 #744300;
  color: #2c220d;
  animation: guide-target-pulse 900ms ease-in-out infinite;
}

.key-guide {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 4;
  display: none;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid #7d4c00;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 4px 0 #8f5700;
  color: #2c220d;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 900;
  transform: translateX(-50%);
}

.keyboard-board.is-guiding .key.is-target .key-guide {
  display: grid;
  animation: guide-arrow-bounce 700ms ease-in-out infinite;
}

.mission-footer {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 18px;
}

.progress-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.progress-dot {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(182, 202, 216, 0.35);
  border-radius: 2px;
  background: rgba(182, 202, 216, 0.1);
}

.progress-dot.is-current {
  border-color: var(--cyan);
  background: rgba(79, 220, 255, 0.34);
  box-shadow: 0 0 10px rgba(79, 220, 255, 0.5);
}

.progress-dot.is-complete {
  border-color: var(--mint);
  background: var(--mint);
}

.progress-dot.is-assisted {
  border-color: var(--amber);
  background: var(--amber);
}

.encouragement {
  margin: 0;
  color: #a9bdca;
  font-size: 13px;
  text-align: right;
}

.feedback-overlay,
.result-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 9, 17, 0.74);
  backdrop-filter: blur(8px);
}

.feedback-overlay {
  pointer-events: none;
}

.feedback-card {
  display: grid;
  width: min(430px, 100%);
  place-items: center;
  padding: 28px 34px 26px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: var(--space-soft);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: feedback-pop 260ms cubic-bezier(0.22, 0.8, 0.32, 1.2);
}

.feedback-card-success {
  border-color: rgba(99, 230, 155, 0.62);
  box-shadow:
    0 0 70px rgba(99, 230, 155, 0.18),
    0 26px 80px rgba(0, 0, 0, 0.5);
}

.feedback-card-wrong {
  border-color: rgba(255, 111, 97, 0.72);
  box-shadow:
    0 0 70px rgba(255, 111, 97, 0.2),
    0 26px 80px rgba(0, 0, 0, 0.5);
}

.feedback-icon {
  display: grid;
  width: 122px;
  height: 122px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
}

.feedback-icon svg {
  width: 82px;
  height: 82px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.success-icon {
  background: var(--success);
  box-shadow:
    0 0 0 10px rgba(99, 230, 155, 0.12),
    0 0 34px rgba(99, 230, 155, 0.52);
  color: #062a17;
}

.wrong-icon {
  background: var(--coral);
  box-shadow:
    0 0 0 10px rgba(255, 111, 97, 0.12),
    0 0 34px rgba(255, 111, 97, 0.55);
  color: #3f0c08;
}

.feedback-kicker {
  margin: 0 0 3px;
  color: #a9bdca;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.feedback-title {
  margin: 0;
  font-size: 32px;
  font-weight: 850;
  line-height: 1.25;
}

.feedback-card-success .feedback-title {
  color: var(--success);
}

.feedback-card-wrong .feedback-title {
  color: var(--coral);
}

.feedback-detail {
  margin: 8px 0 0;
  color: #c5d4dd;
  font-size: 14px;
}

.feedback-detail strong {
  color: var(--amber);
}

.app-shell.is-shaking {
  animation: console-shake 280ms ease-out;
}

.result-dialog {
  overflow-y: auto;
}

.result-card {
  display: grid;
  width: min(560px, 100%);
  justify-items: center;
  padding: 34px;
  border: 1px solid rgba(79, 220, 255, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(79, 220, 255, 0.08), transparent 34%),
    var(--space-soft);
  box-shadow:
    0 0 80px rgba(79, 220, 255, 0.14),
    0 30px 100px rgba(0, 0, 0, 0.55);
  text-align: center;
  animation: feedback-pop 320ms cubic-bezier(0.22, 0.8, 0.32, 1.1);
}

.result-badge {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow:
    0 0 0 9px rgba(255, 200, 87, 0.12),
    0 0 30px rgba(255, 200, 87, 0.3);
  color: #4a3100;
}

.result-badge svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.result-card h2 {
  margin: 3px 0 5px;
  font-size: 36px;
  line-height: 1.2;
}

.result-message {
  margin: 0;
  color: #b8cbd7;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.5);
}

.result-stats > div {
  padding: 15px 12px;
}

.result-stats > div + div {
  border-left: 1px solid var(--line);
}

.result-stats dd {
  margin: 3px 0 0;
  color: var(--white);
  font-family: var(--mono);
  font-size: 23px;
  font-weight: 800;
}

.play-again-button {
  min-width: 180px;
  padding: 12px 22px;
  border-color: var(--cyan);
  background: var(--cyan);
  color: var(--space);
  font-size: 17px;
}

.play-again-button:hover {
  background: #7be7ff;
  color: var(--space);
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.66;
  }

  50% {
    opacity: 1;
  }
}

@keyframes instruction-bounce {
  0%,
  100% {
    transform: translateY(-1px);
  }

  50% {
    transform: translateY(4px);
  }
}

@keyframes target-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(79, 220, 255, 0.28),
      0 0 18px rgba(79, 220, 255, 0.55),
      0 5px 0 #075b70;
  }

  50% {
    box-shadow:
      0 0 0 6px rgba(79, 220, 255, 0.2),
      0 0 30px rgba(79, 220, 255, 0.88),
      0 5px 0 #075b70;
  }
}

@keyframes guide-target-pulse {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes guide-arrow-bounce {
  0%,
  100% {
    transform: translate(-50%, 0);
  }

  50% {
    transform: translate(-50%, 8px);
  }
}

@keyframes feedback-pop {
  from {
    opacity: 0;
    transform: scale(0.82) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes console-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  22% {
    transform: translateX(-7px);
  }

  44% {
    transform: translateX(6px);
  }

  66% {
    transform: translateX(-4px);
  }

  82% {
    transform: translateX(3px);
  }
}

@media (max-width: 1100px) {
  .mission-header {
    grid-template-columns: 1fr auto auto;
  }

  .mission-meta {
    display: none;
  }

  .mission-dashboard {
    grid-template-columns: minmax(390px, 1fr) minmax(340px, 0.9fr);
  }

  .target-panel {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 14px;
  }

  .target-copy {
    grid-column: 1;
    grid-row: 1;
  }

  .finger-guide {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    padding: 10px 0 0;
    border-top: 1px solid rgba(169, 218, 234, 0.18);
    border-left: 0;
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(calc(100% - 24px), 1440px);
    padding-top: 14px;
  }

  .mission-header {
    gap: 12px;
    margin-bottom: 12px;
  }

  .brand-key {
    width: 44px;
    height: 44px;
    font-size: 21px;
  }

  .brand-copy strong {
    font-size: 10px;
  }

  .brand-copy span {
    font-size: 16px;
  }

  .restart-button {
    padding: 8px 10px;
    font-size: 13px;
  }

  .training-console {
    padding: 18px 14px;
  }

  .console-heading {
    display: block;
    padding-bottom: 18px;
  }

  .title-block h1 {
    font-size: 34px;
  }

  .mission-instruction {
    margin-top: 0;
    font-size: 15px;
  }

  .console-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .mission-dashboard {
    grid-template-columns: 1fr;
  }

  .target-name {
    font-size: 20px;
  }

  .scoreboard > div {
    padding: 12px 10px;
  }

  .scoreboard dt {
    font-size: 11px;
  }

  .scoreboard dd {
    font-size: 20px;
  }

  .keyboard-deck {
    padding: 12px 8px;
  }

  .deck-heading {
    align-items: flex-start;
    padding: 0 4px;
  }

  .deck-heading p {
    max-width: 210px;
    font-size: 10px;
    line-height: 1.45;
  }

  .keyboard-board {
    min-width: 1160px;
  }

  .mission-footer {
    display: block;
  }

  .encouragement {
    margin-top: 12px;
    text-align: left;
  }

  .feedback-card,
  .result-card {
    padding: 24px 18px;
  }

  .feedback-icon {
    width: 100px;
    height: 100px;
  }

  .feedback-icon svg {
    width: 68px;
    height: 68px;
  }

  .feedback-title {
    font-size: 27px;
  }

  .result-card h2 {
    font-size: 30px;
  }

  .result-stats dd {
    font-size: 19px;
  }
}

@media (max-width: 430px) {
  .restart-button span {
    display: none;
  }

  .restart-button {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .home-button {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .home-button span {
    display: none;
  }

  .title-block h1 {
    font-size: 31px;
  }

  .deck-heading p {
    display: none;
  }

  .target-glyph {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    font-size: 17px;
  }

  .hand-pair {
    gap: 5px;
  }

  .hand-svg {
    width: 38px;
    height: 40px;
  }

  .finger-readout {
    min-width: 74px;
  }

  .finger-instruction {
    font-size: 14px;
  }

  .finger-instruction strong {
    font-size: 16px;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .result-stats > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
  }

  .result-stats > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .result-stats dd {
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .status-light,
  .mission-instruction span {
    animation: none;
  }
}
