:root {
  color-scheme: light;
  --ink: #172130;
  --ink-soft: #364154;
  --muted: #737d8e;
  --muted-light: #9aa4b4;
  --line: #e6e9f0;
  --surface: #ffffff;
  --background: #f6f7fa;
  --accent: #e96f45;
  --accent-deep: #d75b33;
  --accent-soft: #fff0ea;
  --teal: #1d9b86;
  --teal-deep: #137766;
  --teal-soft: #e8faf5;
  --danger: #d85c54;
  --danger-soft: #fdecea;
  --yellow: #bd871b;
  --shadow-lg: 0 24px 70px rgba(31, 42, 68, 0.1);
  --shadow-md: 0 12px 35px rgba(31, 42, 68, 0.08);
  --shadow-sm: 0 5px 16px rgba(31, 42, 68, 0.07);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --font-sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --arrow-width: clamp(2.65rem, 6.2vw, 5rem);
  --arrow-height: clamp(1.28rem, 2.8vw, 2.3rem);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: max(20px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 5%, rgba(233, 111, 69, 0.1), transparent 26rem),
    radial-gradient(circle at 95% 15%, rgba(29, 155, 134, 0.1), transparent 27rem),
    radial-gradient(circle at 70% 100%, rgba(189, 135, 27, 0.07), transparent 25rem),
    linear-gradient(180deg, #fbf9f8 0%, #f4f7f9 100%);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  opacity: 0.27;
  background-image:
    linear-gradient(rgba(79, 91, 122, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 91, 122, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button {
  font: inherit;
}

button,
.stimulus-frame {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid rgba(233, 111, 69, 0.27);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(18px);
}

.page-glow--one {
  top: -170px;
  left: 45%;
  background: rgba(233, 111, 69, 0.055);
}

.page-glow--two {
  right: -180px;
  bottom: -150px;
  background: rgba(29, 155, 134, 0.065);
}

.app-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 4px;
  width: 42px;
  height: 42px;
  place-content: center;
  border: 1px solid rgba(233, 111, 69, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.77);
  box-shadow: var(--shadow-sm);
}

.brand-mark i {
  display: block;
  border-radius: 3px;
  background: var(--accent);
}

.brand-mark i:nth-child(2) {
  background: var(--teal);
}

.brand-mark i:nth-child(3) {
  background: #d5a12f;
}

.brand-mark i:nth-child(4) {
  background: #5367e8;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.brand-copy small {
  color: var(--muted-light);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.best-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid rgba(22, 32, 51, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.75rem;
  box-shadow: 0 6px 20px rgba(31, 42, 68, 0.04);
  backdrop-filter: blur(12px);
}

.best-chip__icon {
  color: var(--accent);
  font-size: 1rem;
}

.best-chip strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.best-chip small {
  color: var(--muted-light);
  font-size: 0.61rem;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin: 52px 0 28px;
}

.hero-main {
  max-width: 720px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 15px;
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.09em;
}

.eyebrow > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(29, 155, 134, 0.1);
}

.hero h1 {
  display: flex;
  margin: 0;
  align-items: baseline;
  gap: 0.16em;
  font-size: clamp(2.7rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}

.title-en {
  color: var(--accent);
}

.title-cn {
  color: var(--ink);
}

.hero-copy {
  max-width: 600px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.8;
}

.hero-note {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 3px;
}

.hero-note > span {
  color: var(--muted-light);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.focus-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.focus-tags span {
  padding: 7px 11px;
  border: 1px solid rgba(22, 32, 51, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.play-card,
.guide-card {
  border: 1px solid rgba(22, 32, 51, 0.065);
  background: rgba(255, 255, 255, 0.89);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.play-card {
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-xl);
}

.play-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  margin: 0 2px 13px;
}

.live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b9c0cd;
  box-shadow: 0 0 0 4px rgba(185, 192, 205, 0.14);
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.status-dot.is-active {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(29, 155, 134, 0.12);
}

.status-dot.is-paused {
  background: #dfa02f;
  box-shadow: 0 0 0 4px rgba(223, 160, 47, 0.13);
}

.status-dot.is-complete {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(233, 111, 69, 0.12);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.ghost-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ghost-button:hover:not(:disabled) {
  border-color: #cfd4e2;
  background: #fafbfe;
}

.ghost-button:active:not(:disabled) {
  transform: translateY(1px);
}

.ghost-button:disabled {
  color: #b4bac7;
  cursor: not-allowed;
}

.session-strip {
  padding: 10px 12px 11px;
  border: 1px solid rgba(22, 32, 51, 0.055);
  border-radius: 14px;
  background: #f8f9fc;
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.67rem;
}

.session-label {
  margin-right: auto;
  color: var(--ink-soft);
  font-weight: 700;
}

.session-meta strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.time-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ebf2;
}

.time-track > span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #e1a543, var(--teal));
  transform: scaleX(1);
  transform-origin: left center;
  transition: background 180ms ease;
  will-change: transform;
}

.session-strip.is-warning .time-track > span {
  background: linear-gradient(90deg, #e6853e, var(--danger));
}

.session-strip.is-warning .session-meta strong {
  color: var(--danger);
}

.stimulus-frame {
  position: relative;
  min-height: clamp(320px, 34vh, 370px);
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgba(22, 32, 51, 0.06);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 15% 20%, rgba(233, 111, 69, 0.045), transparent 32%),
    radial-gradient(circle at 86% 75%, rgba(29, 155, 134, 0.05), transparent 33%),
    #fbfcfd;
  isolation: isolate;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.stimulus-frame::before,
.stimulus-frame::after {
  position: absolute;
  border: 1px solid rgba(233, 111, 69, 0.07);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.stimulus-frame::before {
  top: -105px;
  right: -75px;
  width: 250px;
  height: 250px;
}

.stimulus-frame::after {
  bottom: -115px;
  left: -80px;
  width: 260px;
  height: 260px;
}

.stimulus-frame.is-correct {
  border-color: rgba(29, 155, 134, 0.38);
  box-shadow: inset 0 0 0 2px rgba(29, 155, 134, 0.07);
  animation: frame-correct 260ms ease;
}

.stimulus-frame.is-wrong {
  border-color: rgba(216, 92, 84, 0.42);
  box-shadow: inset 0 0 0 2px rgba(216, 92, 84, 0.07);
  animation: frame-wrong 300ms ease;
}

.stimulus-stage {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: clamp(320px, 34vh, 370px);
  padding: 17px 20px 19px;
  align-items: center;
  flex-direction: column;
  transition: filter 220ms ease, transform 220ms ease;
}

.stimulus-stage.is-obscured {
  filter: blur(9px);
  transform: scale(1.015);
}

.stimulus-topline {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-light);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.arrow-display {
  position: relative;
  display: grid;
  flex: 1;
  width: 100%;
  min-height: 190px;
  place-items: center;
}

.focus-rail {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--arrow-width) + 1.7rem);
  height: calc(var(--arrow-height) + 2.5rem);
  border: 1px solid rgba(233, 111, 69, 0.115);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 240, 234, 0.36));
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.42);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.arrow-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.38rem, 1.15vw, 0.9rem);
}

.game-arrow {
  position: relative;
  width: var(--arrow-width);
  height: var(--arrow-height);
  flex: 0 1 auto;
  color: #a3acb9;
  opacity: 0.82;
  animation: arrow-in 170ms cubic-bezier(0.2, 0.78, 0.28, 1) both;
  animation-delay: calc(var(--arrow-index, 0) * 16ms);
}

.game-arrow::before {
  position: absolute;
  top: 38%;
  right: 3%;
  left: 15%;
  height: 24%;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.game-arrow::after {
  position: absolute;
  top: 0;
  right: 1%;
  width: 0;
  height: 0;
  border-top: calc(var(--arrow-height) / 2) solid transparent;
  border-bottom: calc(var(--arrow-height) / 2) solid transparent;
  border-left: calc(var(--arrow-width) * 0.31) solid currentColor;
  content: "";
}

.game-arrow--left {
  transform: scaleX(-1);
}

.game-arrow.is-target {
  color: var(--ink);
  opacity: 1;
  filter: drop-shadow(0 5px 8px rgba(23, 33, 48, 0.11));
}

.stimulus-frame.is-correct .game-arrow.is-target {
  color: var(--teal);
}

.stimulus-frame.is-wrong .game-arrow.is-target {
  color: var(--danger);
}

.stimulus-frame.is-correct .arrow-row {
  animation: row-correct 240ms cubic-bezier(0.2, 0.82, 0.28, 1);
}

.stimulus-frame.is-wrong .arrow-row {
  animation: row-wrong 280ms ease;
}

.feedback {
  min-height: 27px;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--muted-light);
  font-size: 0.71rem;
  font-weight: 650;
  line-height: 1.5;
}

.feedback.is-correct {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.feedback.is-wrong {
  background: var(--danger-soft);
  color: var(--danger);
}

.stimulus-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  padding: 18px;
  place-items: center;
  background: rgba(247, 249, 252, 0.57);
  backdrop-filter: blur(8px);
}

.overlay-content {
  display: flex;
  width: min(100%, 430px);
  padding: 19px 22px;
  align-items: center;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  box-shadow: 0 22px 55px rgba(31, 42, 68, 0.13);
  animation: overlay-in 260ms ease both;
}

.overlay-kicker,
.section-kicker {
  color: var(--accent-deep);
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.overlay-content h2 {
  margin: 8px 0 5px;
  font-size: clamp(1.22rem, 2.7vw, 1.55rem);
  letter-spacing: -0.035em;
}

.overlay-content p {
  max-width: 335px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.example-row {
  display: flex;
  min-height: 44px;
  margin: 11px 0;
  padding: 6px 11px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafc;
  color: var(--muted);
  font-size: 0.7rem;
}

.example-arrows {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.example-arrow {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 12px;
  color: #a8b0bd;
}

.example-arrow::before {
  position: absolute;
  top: 4px;
  right: 2px;
  left: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.example-arrow::after {
  position: absolute;
  top: 0;
  right: 1px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid currentColor;
  content: "";
}

.example-arrow--left {
  transform: scaleX(-1);
}

.example-arrow.is-target {
  color: var(--accent);
  transform: scale(1.16);
}

.example-arrow--left.is-target {
  transform: scaleX(-1) scale(1.16);
}

.example-answer {
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 700;
}

.primary-button {
  display: inline-flex;
  min-height: 45px;
  padding: 0 25px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #ef7a50, #d95d36);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(217, 93, 54, 0.24);
  cursor: pointer;
  transition: box-shadow 160ms ease, transform 160ms ease, filter 160ms ease;
}

.primary-button:hover {
  filter: brightness(1.04);
  box-shadow: 0 12px 28px rgba(217, 93, 54, 0.3);
}

.primary-button:active {
  transform: translateY(1px) scale(0.99);
}

.overlay-hint {
  margin-top: 9px;
  color: var(--muted-light);
  font-size: 0.62rem;
}

.answer-panel {
  margin-top: 12px;
}

.answer-heading {
  display: flex;
  margin: 0 3px 9px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.answer-heading > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.answer-heading strong {
  font-size: 0.8rem;
}

.answer-heading span {
  color: var(--muted-light);
  font-size: 0.65rem;
}

.keyboard-hint {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafbfe;
}

.direction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.direction-button {
  --direction-color: var(--accent);
  --direction-soft: var(--accent-soft);
  position: relative;
  display: flex;
  min-height: 76px;
  padding: 0 17px;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 14px rgba(31, 42, 68, 0.035);
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, transform 100ms ease, opacity 140ms ease;
}

.direction-button--left {
  --direction-color: var(--accent);
  --direction-soft: var(--accent-soft);
}

.direction-button--right {
  --direction-color: var(--teal);
  --direction-soft: var(--teal-soft);
}

.direction-icon {
  position: relative;
  width: 40px;
  height: 25px;
  flex: 0 0 auto;
  color: var(--direction-color);
}

.direction-icon::before {
  position: absolute;
  top: 9px;
  right: 1px;
  left: 11px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.direction-icon::after {
  position: absolute;
  top: 1px;
  right: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 15px solid currentColor;
  content: "";
}

.direction-button--left .direction-icon {
  transform: scaleX(-1);
}

.direction-copy {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.direction-copy strong {
  font-size: 0.92rem;
}

.direction-copy small {
  color: var(--muted-light);
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.direction-keys {
  display: flex;
  margin-left: auto;
  gap: 5px;
}

.direction-button kbd {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fafbfe;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 0.61rem;
}

@media (hover: hover) and (pointer: fine) {
  .direction-button:hover:not(:disabled) {
    border-color: var(--direction-color);
    background: var(--direction-soft);
    box-shadow: 0 7px 18px rgba(31, 42, 68, 0.07);
    transform: translateY(-1px);
  }
}

.direction-button:active:not(:disabled) {
  transform: scale(0.98);
}

.direction-button:disabled {
  cursor: default;
  opacity: 0.46;
}

.direction-button.is-correct-feedback {
  border-color: var(--teal);
  background: var(--teal-soft);
  opacity: 1;
  animation: direction-correct 240ms cubic-bezier(0.2, 0.82, 0.28, 1);
}

.direction-button.is-wrong-feedback {
  border-color: var(--danger);
  background: var(--danger-soft);
  opacity: 1;
  animation: direction-wrong 260ms cubic-bezier(0.18, 0.84, 0.34, 1);
}

.direction-button .touch-impact {
  --impact-color: var(--direction-color);
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 100% 0%, rgba(233, 111, 69, 0.4), transparent 57%),
    linear-gradient(145deg, #1a2432, #263545);
  color: #fff;
  box-shadow: 0 24px 60px rgba(31, 42, 68, 0.2);
}

.stats-card::after {
  position: absolute;
  right: -45px;
  bottom: -70px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  content: "";
}

.time-stat,
.score-line,
.best-line {
  position: relative;
  z-index: 1;
}

.time-stat {
  display: flex;
  flex-direction: column;
}

.stat-label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.time-value {
  display: flex;
  margin: 3px 0 0;
  align-items: baseline;
  gap: 4px;
}

.time-value strong {
  color: #fff;
  font-family: var(--font-mono);
  font-size: clamp(2.55rem, 5vw, 3.35rem);
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.time-value span {
  color: rgba(255, 255, 255, 0.52);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.stat-note {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.68rem;
}

.score-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.score-line > div {
  display: flex;
  min-width: 0;
  padding: 12px 10px;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
}

.score-line span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.61rem;
}

.score-line strong {
  overflow: hidden;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.best-line {
  display: flex;
  margin-top: 13px;
  padding-top: 13px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.65rem;
}

.best-line strong {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.67rem;
  font-weight: 600;
}

.best-line b {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.guide-card {
  padding: 23px;
  border-radius: var(--radius-xl);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-heading h2 {
  margin: 5px 0 0;
  font-size: 1.18rem;
  letter-spacing: -0.025em;
}

.guide-icon {
  display: grid;
  min-width: 46px;
  height: 42px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid rgba(233, 111, 69, 0.1);
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.steps {
  display: flex;
  margin: 22px 0;
  padding: 0;
  flex-direction: column;
  gap: 14px;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
}

.steps li > span {
  padding-top: 2px;
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.62;
}

.tip-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 14px;
  background: #f5f7fb;
}

.tip-box > span {
  color: var(--teal);
  font-size: 0.8rem;
}

.tip-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.6;
}

.page-footer {
  display: flex;
  margin-top: 22px;
  padding: 0 4px;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted-light);
  font-size: 0.65rem;
}

.result-dialog {
  width: min(calc(100% - 32px), 440px);
  max-height: calc(100svh - 32px);
  padding: 30px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(19, 27, 46, 0.3);
}

.result-dialog::backdrop {
  background: rgba(21, 29, 46, 0.48);
  backdrop-filter: blur(5px);
}

.result-dialog[open] {
  animation: dialog-in 240ms ease both;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f4f6fa;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.result-dialog h2 {
  margin: 8px 0 6px;
  font-size: 1.78rem;
  letter-spacing: -0.045em;
}

.result-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.result-tags {
  display: flex;
  margin-bottom: 11px;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.record-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 24px 0 13px;
}

.result-grid > div {
  display: flex;
  min-width: 0;
  padding: 14px 8px;
  align-items: center;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f9fc;
}

.result-grid span {
  color: var(--muted);
  font-size: 0.63rem;
}

.result-grid strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.result-best-line {
  display: flex;
  margin-bottom: 20px;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.7rem;
}

.result-best-line strong {
  font-size: 0.7rem;
}

.result-best-line b {
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.result-primary {
  width: 100%;
}

.text-button {
  display: block;
  margin: 10px auto 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  cursor: pointer;
}

.text-button:hover {
  color: var(--ink);
}

@keyframes arrow-in {
  from { opacity: 0; transform: translateY(5px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.game-arrow--left {
  animation-name: arrow-in-left;
}

@keyframes arrow-in-left {
  from { opacity: 0; transform: scaleX(-1) translateY(5px) scale(0.94); }
  to { opacity: 1; transform: scaleX(-1) translateY(0) scale(1); }
}

@keyframes frame-correct {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(29, 155, 134, 0.07); }
  42% { box-shadow: inset 0 0 0 3px rgba(29, 155, 134, 0.16), 0 0 0 5px rgba(29, 155, 134, 0.07); }
}

@keyframes frame-wrong {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(216, 92, 84, 0.07); }
  38% { box-shadow: inset 0 0 0 3px rgba(216, 92, 84, 0.17), 0 0 0 6px rgba(216, 92, 84, 0.075); }
}

@keyframes row-correct {
  0% { transform: scale(0.96); }
  52% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes row-wrong {
  0%, 100% { transform: translateX(0); }
  28% { transform: translateX(-4px); }
  58% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}

@keyframes direction-correct {
  0% { transform: scale(0.92); }
  52% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes direction-wrong {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-3px); }
  62% { transform: translateX(3px); }
  82% { transform: translateX(-2px); }
}

@keyframes overlay-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 941px) and (max-height: 1050px) {
  body {
    padding-top: 14px;
  }

  .hero {
    margin: 24px 0 18px;
    align-items: center;
  }

  .eyebrow {
    margin-bottom: 10px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 4.4vw, 3.65rem);
  }

  .hero-copy {
    margin-top: 10px;
    font-size: 0.86rem;
  }

  .play-card {
    padding: 14px;
  }

  .play-toolbar {
    margin-bottom: 10px;
  }

  .stimulus-frame,
  .stimulus-stage {
    min-height: 320px;
  }
}

@media (min-width: 941px) and (max-height: 800px) {
  .hero {
    margin: 12px 0 10px;
  }

  .eyebrow {
    margin-bottom: 8px;
  }

  .hero h1 {
    font-size: 2.85rem;
  }

  .hero-copy {
    display: none;
  }

  .play-card {
    padding: 12px;
  }

  .play-toolbar {
    margin-bottom: 8px;
  }

  .stimulus-frame,
  .stimulus-stage {
    min-height: 312px;
  }

  .direction-button {
    min-height: 68px;
  }
}

@media (max-width: 940px) {
  .hero {
    align-items: flex-start;
    margin-top: 38px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

@media (max-width: 680px) {
  body {
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .best-chip {
    min-height: 38px;
    padding: 7px 11px;
  }

  .best-chip > span:not(.best-chip__icon),
  .best-chip small {
    display: none;
  }

  .hero {
    display: block;
    margin: 32px 0 21px;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 12.7vw, 3.7rem);
  }

  .hero-copy {
    margin-top: 13px;
    font-size: 0.86rem;
  }

  .hero-note {
    display: none;
  }

  .play-card {
    padding: 12px;
    border-radius: 22px;
  }

  .play-toolbar {
    margin: 1px 2px 10px;
  }

  .ghost-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.69rem;
  }

  .session-strip {
    padding: 9px 10px 10px;
  }

  .session-meta {
    gap: 10px;
    font-size: 0.63rem;
  }

  .session-label {
    display: none;
  }

  .stimulus-frame,
  .stimulus-stage {
    min-height: 300px;
  }

  .stimulus-frame {
    margin-top: 10px;
    border-radius: 17px;
  }

  .stimulus-stage {
    padding: 14px 12px 16px;
  }

  :root {
    --arrow-width: clamp(2.3rem, 10vw, 3.1rem);
    --arrow-height: clamp(1.15rem, 5vw, 1.55rem);
  }

  .arrow-display {
    min-height: 165px;
  }

  .arrow-row {
    gap: 5px;
  }

  .focus-rail {
    border-radius: 17px;
  }

  .stimulus-overlay {
    padding: 12px;
  }

  .overlay-content {
    padding: 18px 15px;
    border-radius: 17px;
  }

  .overlay-content h2 {
    font-size: 1.2rem;
  }

  .overlay-content p {
    font-size: 0.72rem;
  }

  .example-row {
    margin: 10px 0;
    gap: 7px;
  }

  .direction-button {
    min-height: 64px;
    padding: 0 12px;
    gap: 9px;
    border-radius: 14px;
  }

  .direction-icon {
    width: 31px;
    height: 21px;
  }

  .direction-icon::before {
    top: 8px;
    left: 9px;
    height: 5px;
  }

  .direction-icon::after {
    border-top-width: 9px;
    border-bottom-width: 9px;
    border-left-width: 12px;
  }

  .direction-copy strong {
    font-size: 0.82rem;
  }

  .direction-copy small,
  .direction-keys {
    display: none;
  }

  .answer-heading strong {
    font-size: 0.76rem;
  }

  .keyboard-hint {
    display: none;
  }

  .side-column {
    display: flex;
  }

  .stats-card {
    padding: 21px;
    border-radius: 22px;
  }

  .time-value strong {
    font-size: 2.6rem;
  }

  .guide-card {
    padding: 21px;
    border-radius: 22px;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .result-dialog {
    padding: 25px 20px 22px;
    border-radius: 22px;
  }

  .result-grid {
    gap: 6px;
  }

  .result-grid > div {
    padding: 12px 6px;
  }

  .result-grid strong {
    font-size: 0.86rem;
  }
}

@media (max-width: 370px) {
  .brand-copy small {
    display: none;
  }

  .play-toolbar {
    align-items: flex-start;
  }

  .toolbar-actions {
    gap: 5px;
  }

  .ghost-button {
    padding: 0 8px;
  }

  .session-meta {
    flex-wrap: wrap;
    row-gap: 5px;
  }

  .direction-button {
    padding: 0 9px;
  }

  .direction-icon {
    width: 27px;
  }

  :root {
    --arrow-width: 2.1rem;
    --arrow-height: 1.05rem;
  }
}

@media (orientation: landscape) and (max-height: 620px) and (max-width: 940px) {
  body {
    padding-top: 12px;
  }

  .hero {
    margin: 16px 0 12px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-copy {
    display: none;
  }

  .eyebrow {
    margin-bottom: 8px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 14px;
  }

  .side-column {
    display: flex;
  }

  .play-card {
    padding: 10px;
  }

  .stimulus-frame,
  .stimulus-stage {
    min-height: 280px;
  }

  .direction-button {
    min-height: 58px;
  }

  .stats-card,
  .guide-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
