:root {
  --bg: #f3f3ef;
  --paper: #fbfbf8;
  --ink: #0b0c0e;
  --muted: #6e706f;
  --line: #d9d9d3;
  --line-dark: #bdbdb6;
  --soft: #e9e9e4;
  --charcoal: #232528;
  --black: #090a0b;
  --white: #fff;
  --danger: #8f2e2e;
  --success: #1d4932;
  --board-light: #ecece5;
  --board-dark: #4b4e50;
  --board-dark-2: #3f4244;
  --shadow: 0 22px 60px rgba(20, 22, 24, .10);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body.skills-app {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 14%, rgba(255,255,255,.95) 0, rgba(255,255,255,.3) 28%, transparent 48%),
    linear-gradient(180deg, #f6f6f3 0%, #efefeb 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
[hidden] { display: none !important; }

.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(17,17,17,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

.skills-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  padding: 22px 24px 0;
  pointer-events: none;
}
.nav-shell {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 64px;
  padding: 10px 14px 10px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  border: 1px solid rgba(20,20,20,.07);
  border-radius: 999px;
  background: rgba(255,255,252,.93);
  backdrop-filter: blur(24px);
  box-shadow: 0 10px 38px rgba(0,0,0,.055);
  pointer-events: auto;
}
.brand-link { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; }
.brand-link img { width: 34px; height: 34px; object-fit: contain; transition: transform .2s ease; }
.brand-link:hover img { transform: translateY(-1px) scale(1.04); }
.main-nav { display: flex; align-items: center; justify-content: center; gap: 30px; font-size: 13px; color: #666967; white-space: nowrap; }
.main-nav a { position: relative; padding: 10px 0; }
.main-nav a:hover, .main-nav a.active { color: #080909; }
.main-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: #111; }
.nav-actions { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.portal-link { padding: 10px 4px; color: #555856; }
.arena-link { background: #0b0c0d; color: #fff; border-radius: 999px; padding: 12px 16px; transition: transform .18s ease, background .18s ease; }
.arena-link:hover { transform: translateY(-1px); background: #252628; }

main { position: relative; z-index: 1; }
.landing-section {
  min-height: 100vh;
  padding: 150px 7vw 62px;
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: .86fr 1.34fr;
  gap: clamp(44px, 6vw, 110px);
  align-items: center;
}
.landing-copy { align-self: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #696b69;
  font-size: 10px;
  line-height: 1;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow-mark { width: 18px; height: 1px; background: #191a1b; display: inline-block; }
.landing-copy h1 {
  margin: 24px 0 24px;
  font-size: clamp(66px, 8.5vw, 136px);
  line-height: .78;
  letter-spacing: -.07em;
  font-weight: 900;
  text-transform: uppercase;
}
.landing-copy h1 span { display: block; }
.landing-copy p { margin: 0; max-width: 430px; color: #5f625f; font-size: clamp(16px, 1.45vw, 21px); line-height: 1.55; }

.discipline-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; min-height: 585px; border: 1px solid var(--line-dark); background: rgba(255,255,255,.25); }
.discipline { position: relative; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; isolation: isolate; }
.discipline + .discipline { border-left: 1px solid var(--line-dark); }
.discipline::before { content: ""; position: absolute; width: 260px; height: 260px; border: 1px solid currentColor; border-radius: 50%; opacity: .07; right: -92px; top: 76px; z-index: -1; }
.discipline::after { content: ""; position: absolute; width: 130px; height: 130px; border: 1px solid currentColor; transform: rotate(45deg); opacity: .06; right: 20px; top: 42px; z-index: -1; }
.discipline-light { background: rgba(252,252,249,.9); }
.discipline-dark { background: #151719; color: #f7f7f4; }
.discipline-number { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; letter-spacing: .15em; opacity: .72; }
.discipline-body { margin: auto 0; padding: 42px 0; }
.discipline-label { margin-bottom: 18px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; letter-spacing: .15em; opacity: .56; }
.discipline h2 { margin: 0; font-size: clamp(42px, 4.8vw, 74px); line-height: .91; letter-spacing: -.055em; font-weight: 850; }
.discipline p { max-width: 390px; margin: 24px 0 0; font-size: 14px; line-height: 1.65; opacity: .68; }
.discipline-meta { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; letter-spacing: .12em; opacity: .55; }
.launch-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-top: 1px solid var(--line-dark);
  background: transparent;
  padding: 20px 0 2px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: left;
}
.launch-button span { font-size: 18px; transition: transform .18s ease; }
.launch-button:hover span { transform: translateX(5px); }
.launch-button-invert { color: #fff; border-color: rgba(255,255,255,.24); }
.landing-footnote { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 20px; color: #7b7d7b; font-size: 9px; font-family: "SFMono-Regular", Consolas, monospace; letter-spacing: .13em; }

.training-section { min-height: 100vh; max-width: 1400px; margin: 0 auto; padding: 125px 5vw 60px; animation: sectionIn .42s cubic-bezier(.2,.8,.2,1); }
.training-topline { display: grid; grid-template-columns: 1fr auto 1fr; gap: 22px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.text-button, .icon-button, .mode-switcher button { border: 0; background: none; cursor: pointer; }
.text-button { justify-self: start; padding: 7px 0; color: #616361; font-size: 10px; font-family: "SFMono-Regular", Consolas, monospace; letter-spacing: .1em; }
.text-button:hover { color: #111; }
.mode-switcher { justify-self: center; display: inline-flex; padding: 4px; border: 1px solid var(--line-dark); border-radius: 999px; background: rgba(255,255,255,.55); }
.mode-switcher button { min-width: 160px; padding: 10px 16px; border-radius: 999px; font-size: 10px; letter-spacing: .08em; color: #6f716f; font-weight: 700; transition: .18s ease; }
.mode-switcher button.active { background: #0d0e0f; color: white; box-shadow: 0 5px 16px rgba(0,0,0,.12); }
.utility-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.icon-button { padding: 8px 0 8px 14px; color: #656765; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; letter-spacing: .08em; }
.icon-button:hover { color: #111; }
.training-heading { margin: 36px 0 25px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.training-heading h2 { margin: 9px 0 0; font-size: clamp(38px, 5vw, 72px); line-height: .92; letter-spacing: -.055em; font-weight: 900; }
.position-counter { font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(26px, 3vw, 42px); letter-spacing: -.06em; color: #a2a29d; }
.training-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 330px); gap: clamp(28px, 5vw, 78px); align-items: start; }
.board-column { min-width: 0; }
.board-frame { width: min(100%, 760px); margin: 0 auto; padding: 10px; background: #1d1f21; box-shadow: var(--shadow); }
.board-rail { display: flex; justify-content: space-between; gap: 14px; color: rgba(255,255,255,.62); font-family: "SFMono-Regular", Consolas, monospace; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.board-rail-top { padding: 4px 4px 10px; }
.board-rail-bottom { padding: 10px 4px 4px; }
.chessboard { width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); overflow: hidden; background: #444; touch-action: none; user-select: none; -webkit-user-select: none; position: relative; }
.square { position: relative; display: grid; place-items: center; overflow: hidden; }
.square.light { background: var(--board-light); }
.square.dark { background: linear-gradient(145deg, var(--board-dark), var(--board-dark-2)); }
.square.selected::after { content: ""; position: absolute; inset: 5px; border: 1.5px solid rgba(10,10,10,.62); pointer-events: none; }
.square.last-from::before, .square.last-to::before { content: ""; position: absolute; inset: 0; background: rgba(205, 189, 134, .24); pointer-events: none; }
.square.check::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(143,46,46,.42), rgba(143,46,46,.08) 65%, transparent 70%); pointer-events: none; }
.square.legal::after { content: ""; width: 16%; aspect-ratio: 1; border-radius: 50%; background: rgba(9,10,11,.28); position: absolute; z-index: 1; pointer-events: none; }
.square.legal.capture::after { width: auto; aspect-ratio: auto; inset: 9%; border: 2px solid rgba(9,10,11,.32); border-radius: 50%; background: transparent; }
.square .coord { position: absolute; z-index: 2; font: 700 clamp(7px, .78vw, 10px)/1 "SFMono-Regular", Consolas, monospace; opacity: .52; pointer-events: none; }
.square.dark .coord { color: #f2f2ee; }
.square.light .coord { color: #303234; }
.coord-file { right: 5px; bottom: 4px; }
.coord-rank { left: 5px; top: 4px; }
.piece { width: 84%; height: 84%; object-fit: contain; z-index: 3; cursor: grab; -webkit-user-drag: none; filter: drop-shadow(0 6px 8px rgba(0,0,0,.13)); transition: transform .1s ease, opacity .1s ease; }
.piece:hover { transform: translateY(-1px); }
.piece.drag-source { opacity: .18; }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; object-fit: contain; filter: drop-shadow(0 16px 16px rgba(0,0,0,.25)); transform: scale(1.06); }
.move-clone { position: fixed; z-index: 999; pointer-events: none; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0,0,0,.2)); }
.progress-rail { width: min(100%, 760px); margin: 18px auto 0; display: grid; grid-template-columns: repeat(22, 1fr); gap: 3px; }
.progress-node { height: 3px; background: #d1d1cb; transition: background .2s ease, transform .2s ease; }
.progress-node.current { background: #111; transform: scaleY(2); }
.progress-node.solved { background: #747672; }

.challenge-panel { position: sticky; top: 120px; min-height: 560px; display: flex; flex-direction: column; gap: 30px; padding-top: 8px; }
.challenge-index { color: #969894; font: 600 11px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .12em; }
.mini-label { color: #8a8c89; font: 600 9px/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing: .13em; text-transform: uppercase; }
.challenge-panel h3 { margin: 10px 0 0; font-size: clamp(28px, 2.4vw, 38px); line-height: 1; letter-spacing: -.04em; }
.metric-stack { border-top: 1px solid var(--line-dark); }
.metric-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 15px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.metric-row strong { font-size: 11px; letter-spacing: .08em; text-align: right; }
.instruction-block { margin-top: auto; }
.instruction-line { width: 40px; height: 2px; background: #111; margin-bottom: 16px; }
.instruction-block p { margin: 0; font-size: 18px; line-height: 1.48; letter-spacing: -.015em; }
.status-message { min-height: 18px; margin-top: 18px; color: #6c6e6b; font: 700 10px/1.4 "SFMono-Regular", Consolas, monospace; letter-spacing: .12em; }
.status-message.success { color: var(--success); }
.status-message.failure { color: var(--danger); }
.panel-actions { display: grid; gap: 9px; }
.primary-action, .secondary-action { min-height: 46px; border: 1px solid #101112; border-radius: 2px; padding: 0 16px; cursor: pointer; font-size: 10px; font-weight: 800; letter-spacing: .1em; transition: transform .14s ease, background .14s ease, color .14s ease; }
.primary-action { background: #0d0e0f; color: white; }
.primary-action:hover, .secondary-action:hover { transform: translateY(-1px); }
.secondary-action { background: transparent; color: #111; }
.session-stats { display: flex; gap: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: #8a8c89; font: 600 8px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .1em; }
.session-stats b { color: #333533; font-size: 11px; margin-right: 3px; }

.completion-section { min-height: 100vh; padding: 160px 7vw 70px; max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; animation: sectionIn .42s ease; }
.completion-code { color: #747674; font: 600 10px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .14em; }
.completion-section h2 { margin: 24px 0 22px; font-size: clamp(70px, 11vw, 150px); line-height: .77; letter-spacing: -.075em; }
.completion-section > p { margin: 0 0 42px; color: #666865; font-size: 19px; }
.completion-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.completion-metrics div { padding: 26px 0; display: flex; flex-direction: column; gap: 6px; }
.completion-metrics div + div { border-left: 1px solid var(--line); padding-left: 28px; }
.completion-metrics strong { font-size: 40px; line-height: 1; }
.completion-metrics span { color: #7c7e7a; font: 600 9px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .12em; }
.completion-actions { display: flex; gap: 12px; margin-top: 30px; max-width: 560px; }
.completion-actions button { flex: 1; }

.promotion-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; background: rgba(10,10,10,.36); backdrop-filter: blur(8px); }
.promotion-card { width: min(92vw, 430px); padding: 26px; background: #f8f8f5; border: 1px solid #aaa; box-shadow: 0 35px 90px rgba(0,0,0,.24); }
.promotion-card h2 { margin: 10px 0 20px; font-size: 31px; letter-spacing: -.04em; }
.promotion-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.promotion-choice { aspect-ratio: 1; border: 1px solid var(--line-dark); background: #fff; cursor: pointer; }
.promotion-choice:hover { background: #ecece7; }
.promotion-choice img { width: 78%; height: 78%; object-fit: contain; }

.skills-footer { max-width: 1400px; margin: 0 auto; padding: 0 5vw 26px; display: flex; justify-content: space-between; color: #8c8e8a; font: 600 8px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .12em; }

@keyframes sectionIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulseSuccess { 0% { box-shadow: 0 0 0 rgba(29,73,50,0); } 35% { box-shadow: inset 0 0 0 3px rgba(29,73,50,.26); } 100% { box-shadow: 0 0 0 rgba(29,73,50,0); } }
@keyframes nudgeFail { 0%,100%{transform:none} 35%{transform:translateX(-4px)} 70%{transform:translateX(4px)} }
.chessboard.success-flash { animation: pulseSuccess .48s ease; }
.chessboard.failure-flash { animation: nudgeFail .22s ease; }

@media (max-width: 1120px) {
  .main-nav { gap: 18px; }
  .landing-section { grid-template-columns: 1fr; padding-top: 135px; }
  .landing-copy { max-width: 800px; }
  .landing-copy h1 { font-size: clamp(72px, 14vw, 128px); }
  .discipline-grid { min-height: 520px; }
  .training-layout { gap: 34px; grid-template-columns: minmax(0, 1fr) minmax(250px, 290px); }
}

@media (max-width: 900px) {
  .skills-header { padding: 14px 12px 0; }
  .nav-shell { min-height: 58px; padding: 7px 9px 7px 12px; gap: 8px; }
  .brand-link { width: 38px; height: 38px; }
  .brand-link img { width: 30px; height: 30px; }
  .main-nav { display: none; }
  .nav-shell { grid-template-columns: auto 1fr; }
  .nav-actions { justify-self: end; }
  .portal-link { display: none; }
  .landing-section { padding: 120px 18px 48px; }
  .discipline-grid { grid-template-columns: 1fr; min-height: auto; }
  .discipline { min-height: 440px; }
  .discipline + .discipline { border-left: 0; border-top: 1px solid var(--line-dark); }
  .training-section { padding: 100px 16px 48px; }
  .training-topline { grid-template-columns: 1fr auto; }
  .mode-switcher { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .mode-switcher button { flex: 1; min-width: 0; }
  .utility-actions { grid-column: 2; grid-row: 1; }
  .training-layout { grid-template-columns: 1fr; }
  .board-frame { width: min(100%, 720px); }
  .challenge-panel { position: static; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px 28px; padding-top: 6px; }
  .challenge-index { grid-column: 1 / -1; }
  .metric-stack { grid-row: span 2; }
  .instruction-block { margin: 0; }
  .panel-actions, .session-stats { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .arena-link { padding: 11px 14px; }
  .landing-section { padding-left: 14px; padding-right: 14px; }
  .landing-copy h1 { margin-top: 18px; font-size: clamp(64px, 22vw, 96px); }
  .landing-copy p { font-size: 16px; }
  .discipline { min-height: 400px; padding: 22px; }
  .discipline h2 { font-size: 50px; }
  .landing-footnote { flex-direction: column; gap: 8px; }
  .training-topline { gap: 10px; }
  .icon-button { padding-left: 8px; font-size: 8px; }
  .utility-actions { gap: 4px; }
  .training-heading { margin-top: 26px; }
  .training-heading h2 { font-size: 44px; }
  .position-counter { font-size: 24px; }
  .training-layout { gap: 24px; }
  .board-frame { padding: 5px; box-shadow: 0 15px 35px rgba(20,22,24,.11); }
  .board-rail { font-size: 7px; }
  .board-rail-top { padding: 3px 3px 7px; }
  .board-rail-bottom { padding: 7px 3px 3px; }
  .piece { width: 88%; height: 88%; }
  .progress-rail { margin-top: 12px; gap: 2px; }
  .challenge-panel { display: flex; gap: 22px; }
  .challenge-panel h3 { font-size: 30px; }
  .metric-row { padding: 14px 0; }
  .instruction-block p { font-size: 17px; }
  .session-stats { justify-content: space-between; gap: 6px; flex-wrap: wrap; }
  .completion-section { padding: 125px 18px 48px; }
  .completion-section h2 { font-size: clamp(64px, 21vw, 96px); }
  .completion-metrics { grid-template-columns: 1fr; }
  .completion-metrics div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .completion-actions { flex-direction: column; }
  .skills-footer { padding: 0 16px 20px; flex-direction: column; gap: 6px; }
}

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

/* ==========================================================
   PROFESSIONAL BOARD INTERACTION PASS
   Scoped to Test Your Skills only.
   ========================================================== */
:root {
  --motion-fast: 105ms;
  --motion-standard: 165ms;
  --motion-panel: 260ms;
  --motion-page: 420ms;
  --ease-piece: cubic-bezier(.16,.84,.24,1);
  --ease-ui: cubic-bezier(.2,.75,.25,1);
  --board-light: #edece5;
  --board-dark: #55585a;
  --board-dark-2: #4b4e50;
}

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

body.training-active .ambient-grid { opacity: .12; }
body.training-active .skills-header { opacity: .88; transition: opacity var(--motion-panel) var(--ease-ui); }
body.training-active .skills-header:hover { opacity: 1; }
body.piece-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }

.training-section {
  padding-top: 112px;
  padding-bottom: 38px;
}
.training-heading { margin: 24px 0 18px; }
.training-heading h2 { font-size: clamp(36px, 4vw, 58px); }
.position-counter { font-size: clamp(24px, 2.4vw, 34px); }
.training-layout {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 320px);
  gap: clamp(30px, 4.5vw, 66px);
  align-items: start;
}

.board-column { min-width: 0; display: flex; flex-direction: column; align-items: center; }
.board-frame {
  width: min(100%, 680px, calc(100dvh - 345px));
  min-width: 360px;
  margin: 0 auto;
  padding: 8px;
  background: #252729;
  border: 1px solid #1d1f20;
  box-shadow: 0 18px 44px rgba(20,22,24,.105), 0 1px 0 rgba(255,255,255,.14) inset;
}
.board-rail { min-height: 18px; align-items: center; }
.board-rail-top { padding: 3px 3px 7px; }
.board-rail-bottom { padding: 7px 3px 3px; }

.chessboard {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  overflow: hidden;
  position: relative;
  isolation: isolate;
  background: var(--board-dark);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  contain: layout paint style;
}
.square {
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  transition: box-shadow var(--motion-fast) ease, filter var(--motion-fast) ease;
}
.square.light { background: var(--board-light); }
.square.dark { background: linear-gradient(145deg, #56595b 0%, #4c4f51 100%); }

.square.selected {
  box-shadow: inset 0 0 0 2px rgba(10,11,12,.62), inset 0 0 0 5px rgba(255,255,255,.12);
}
.square.selected::after { content: none; }
.square.last-from::before,
.square.last-to::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(115,117,116,.19);
  box-shadow: inset 0 0 0 1px rgba(18,19,20,.08);
  pointer-events: none;
  z-index: 0;
}
.square.last-to::before { background: rgba(82,84,84,.23); }
.square.check::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 52%, rgba(129,43,43,.38) 0%, rgba(129,43,43,.16) 42%, rgba(129,43,43,.04) 69%, transparent 72%);
  box-shadow: inset 0 0 0 1px rgba(128,43,43,.42);
  pointer-events: none;
  z-index: 1;
}
.square.checkmate::before { box-shadow: inset 0 0 0 2px rgba(116,34,34,.58); }

.square.legal::after {
  content: "";
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(10,11,12,.30);
  position: absolute;
  z-index: 2;
  pointer-events: none;
  transition: transform var(--motion-fast) ease, background var(--motion-fast) ease;
}
.square.legal.capture::after {
  width: auto;
  aspect-ratio: auto;
  inset: 8%;
  border: 2px solid rgba(10,11,12,.27);
  border-radius: 50%;
  background: transparent;
}
@media (hover:hover) {
  .square.legal:hover::after,
  .square.drag-target::after { transform: scale(1.22); background: rgba(8,9,10,.42); }
  .square.legal.capture:hover::after,
  .square.drag-target.capture::after { background: transparent; border-color: rgba(8,9,10,.46); transform: scale(.98); }
}
.square.drag-target { box-shadow: inset 0 0 0 2px rgba(10,11,12,.48); }

.square .coord {
  z-index: 4;
  font-size: clamp(6px, .55vw, 8px);
  opacity: .48;
  letter-spacing: 0;
}
.coord-file { right: 4px; bottom: 3px; }
.coord-rank { left: 4px; top: 3px; }

.piece {
  width: 78%;
  height: 78%;
  object-fit: contain;
  z-index: 3;
  cursor: default;
  -webkit-user-drag: none;
  user-select: none;
  touch-action: none;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.14));
  transition: transform var(--motion-fast) var(--ease-piece), opacity var(--motion-fast) ease, filter var(--motion-fast) ease;
  transform-origin: 50% 62%;
  will-change: transform;
}
.piece-p { width: 72%; height: 72%; }
.piece-r { width: 74%; height: 74%; }
.piece-n, .piece-b { width: 77%; height: 77%; }
.piece-q, .piece-k { width: 80%; height: 80%; }
.piece.movable { cursor: grab; }
@media (hover:hover) {
  .piece.movable:hover { transform: translateY(-1px); filter: drop-shadow(0 5px 5px rgba(0,0,0,.16)); }
}
.square.selected .piece { transform: translateY(-2px); filter: drop-shadow(0 6px 7px rgba(0,0,0,.17)); }
.piece.drag-source { opacity: 0 !important; }

.drag-ghost,
.move-clone,
.capture-clone {
  position: fixed;
  z-index: 220;
  pointer-events: none;
  object-fit: contain;
  transform-origin: 50% 62%;
  will-change: transform, opacity;
  -webkit-user-drag: none;
}
.drag-ghost { z-index: 240; filter: drop-shadow(0 10px 9px rgba(0,0,0,.22)); }
.move-clone { filter: drop-shadow(0 5px 6px rgba(0,0,0,.18)); }
.capture-clone { z-index: 215; filter: drop-shadow(0 3px 4px rgba(0,0,0,.12)); }
.rook-clone { z-index: 218; }

.chessboard.motion-active .square.last-from::before,
.chessboard.motion-active .square.last-to::before,
.chessboard.motion-active .square.check::before { opacity: 0; }

.chessboard.position-leave .piece { opacity: .12; transform: scale(.97); }
.chessboard.position-enter .piece { animation: piecePositionIn 180ms var(--ease-ui) both; }
.chessboard.flip-settle .piece { animation: flipSettle 150ms var(--ease-piece) both; }
@keyframes piecePositionIn { from { opacity: .05; transform: scale(.975); } to { opacity: 1; transform: scale(1); } }
@keyframes flipSettle { from { opacity: .45; } to { opacity: 1; } }

.progress-rail { width: min(100%, 680px, calc(100dvh - 345px)); }
.progress-node {
  appearance: none;
  border: 0;
  padding: 0;
  cursor: default;
  height: 3px;
  background: #d1d1cb;
}
.progress-node.current { background: #111; transform: scaleY(1.8); }
.progress-node.solved { background: #737571; }
.progress-node:focus-visible { outline: 1px solid #111; outline-offset: 3px; }

.challenge-panel {
  position: sticky;
  top: 108px;
  min-height: 0;
  gap: 24px;
  padding-top: 3px;
}
.challenge-panel h3 { font-size: clamp(27px, 2.1vw, 34px); }
.metric-row { padding: 14px 0; }
.instruction-block { margin-top: 2px; min-height: 92px; }
.status-message { min-height: 32px; display: flex; align-items: flex-start; }
.status-message.status-pop { animation: statusIn 150ms var(--ease-ui); }
@keyframes statusIn { from { opacity: .35; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.metric-tick { animation: metricTick 145ms var(--ease-piece); }
@keyframes metricTick { 50% { opacity: .35; transform: translateY(-1px); } }
.primary-action:disabled,
.secondary-action:disabled,
.icon-button:disabled,
.mode-switcher button:disabled { opacity: .38; cursor: default; transform: none !important; }

/* Restrained feedback: no screen shake, no arcade flash. */
.chessboard.failure-flash { animation: failureEdge 240ms ease; }
.chessboard.success-flash { animation: solvedEdge 360ms ease; }
@keyframes failureEdge { 40% { box-shadow: inset 0 0 0 2px rgba(116,55,55,.28); } }
@keyframes solvedEdge { 40% { box-shadow: inset 0 0 0 2px rgba(35,39,37,.24); } }

/* Board-attached promotion picker instead of a page-blocking modal. */
.promotion-popover {
  position: fixed;
  z-index: 310;
  width: auto;
  height: auto;
  background: transparent;
}
.promotion-popover .promotion-card {
  width: min(330px, calc(100vw - 20px));
  padding: 13px;
  background: #f8f8f4;
  border: 1px solid #9c9e9a;
  box-shadow: 0 18px 42px rgba(0,0,0,.18);
}
.promotion-popover .promotion-card h2 { margin: 6px 0 10px; font-size: 18px; letter-spacing: -.025em; }
.promotion-choices { grid-template-columns: repeat(4, 1fr); gap: 5px; }
.promotion-choice {
  position: relative;
  min-width: 56px;
  aspect-ratio: 1;
  border: 1px solid #c5c5be;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.promotion-choice:hover,
.promotion-choice:focus-visible { background: #e9e9e4; }
.promotion-choice img { width: 72%; height: 72%; object-fit: contain; }
.promotion-choice span { position: absolute; right: 4px; bottom: 3px; font: 700 7px/1 monospace; color: #777; }

@media (max-height: 820px) and (min-width: 901px) {
  .training-section { padding-top: 100px; }
  .training-topline { padding-bottom: 10px; }
  .training-heading { margin: 15px 0 12px; }
  .training-heading h2 { font-size: clamp(32px, 3.2vw, 46px); }
  .board-frame { width: min(100%, 630px, calc(100dvh - 300px)); }
  .progress-rail { width: min(100%, 630px, calc(100dvh - 300px)); margin-top: 11px; }
  .challenge-panel { gap: 17px; }
  .metric-row { padding: 10px 0; }
  .instruction-block { min-height: 72px; }
  .session-stats { padding-top: 10px; }
}

@media (max-width: 900px) {
  body.training-active .skills-header { opacity: 1; }
  .training-section { padding-top: 94px; }
  .training-heading { margin: 22px 0 16px; }
  .training-heading h2 { font-size: clamp(38px, 8vw, 54px); }
  .training-layout { grid-template-columns: 1fr; gap: 22px; }
  .board-column { width: 100%; min-width: 0; }
  .board-frame { width: min(100%, 680px); min-width: 0; }
  .progress-rail { width: min(100%, 680px); }
  .challenge-panel { position: static; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; padding-top: 4px; }
  .challenge-index { grid-column: 1 / -1; }
  .metric-stack { grid-row: span 2; }
  .instruction-block { margin: 0; }
  .panel-actions, .session-stats { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .training-section { padding: 90px 10px 38px; }
  .training-topline { padding-inline: 2px; }
  .training-heading { margin: 19px 2px 13px; align-items: end; }
  .training-heading h2 { font-size: clamp(34px, 11vw, 46px); }
  .position-counter { font-size: 20px; }
  .board-frame { width: 100%; padding: 4px; }
  .board-rail { font-size: 6.5px; min-height: 15px; letter-spacing: .09em; }
  .board-rail-top { padding: 2px 2px 5px; }
  .board-rail-bottom { padding: 5px 2px 2px; }
  .square .coord { font-size: 6px; }
  .coord-file { right: 3px; bottom: 2px; }
  .coord-rank { left: 3px; top: 2px; }
  .piece { width: 77%; height: 77%; }
  .piece-p { width: 71%; height: 71%; }
  .piece-r { width: 73%; height: 73%; }
  .piece-n, .piece-b { width: 76%; height: 76%; }
  .piece-q, .piece-k { width: 79%; height: 79%; }
  .progress-rail { margin-top: 9px; }
  .challenge-panel { position: static; display: flex; grid-template-columns: none; gap: 17px; padding-inline: 2px; }
  .challenge-index { margin-top: 2px; }
  .challenge-panel h3 { font-size: 28px; }
  .instruction-block { min-height: 84px; }
  .panel-actions { gap: 7px; }
  .primary-action, .secondary-action { min-height: 44px; }
  .promotion-popover .promotion-card { width: min(292px, calc(100vw - 16px)); padding: 10px; }
  .promotion-choice { min-width: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .chessboard.position-enter .piece,
  .chessboard.flip-settle .piece,
  .status-message.status-pop,
  .metric-tick { animation: none !important; }
}

/* ==========================================================
   WALKERBEX CHESS VISUAL MASTER — MONOCHROME BOARD DNA
   Exact visual language from the supplied WalkerBex Monochrome world.
   Puzzle/mate data, layout and chess mechanics remain untouched.
   ========================================================== */
.board-frame {
  width: min(100%, 560px, calc(100dvh - 238px));
  min-width: 0;
  padding: 0;
  background: #f7f7f5;
  border: 1px solid rgba(23,23,23,.16);
  box-shadow: 0 18px 44px rgba(18,18,18,.13), 0 1px 0 rgba(255,255,255,.92) inset;
}
.board-rail {
  min-height: 24px;
  padding-inline: 10px;
  color: rgba(23,23,23,.62);
  background: #f7f7f5;
  font-size: 7px;
  letter-spacing: .13em;
}
.board-rail-top { padding-top: 7px; padding-bottom: 5px; }
.board-rail-bottom { padding-top: 5px; padding-bottom: 7px; }
.board-art-shell {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 6.666667%;
  display: grid;
  place-items: stretch;
  background: #f7f7f5 url('../assets/monochrome/board.svg') center / 100% 100% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(23,23,23,.10);
}
.chessboard {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  overflow: visible;
  background: #e7e6e2;
  box-shadow: 0 0 0 1px rgba(23,23,23,.22), 0 3px 12px rgba(0,0,0,.12);
}
.square {
  display: block;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-repeat: no-repeat !important;
  border: 0;
}
.square.light { background-color: #F3F2EF; }
.square.dark { background-color: #C9C8C4; }
.square::before { z-index: 0; }
.square.last-from::before,
.square.last-to::before {
  background: rgba(83,83,83,.10);
  box-shadow: inset 0 0 0 1px rgba(23,23,23,.12);
}
.square.last-to::before { background: rgba(83,83,83,.13); }
.square.selected {
  box-shadow: inset 0 0 0 2px rgba(23,23,23,.88);
}
.square.selected::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.38);
  box-shadow: inset 0 0 0 2px rgba(23,23,23,.88);
  pointer-events: none;
  z-index: 1;
}
.square.check::before {
  background: rgba(156,49,49,.28);
  box-shadow: inset 0 0 0 2px rgba(125,39,39,.55);
}
.square.checkmate::before {
  background: radial-gradient(circle at 50% 52%, rgba(156,49,49,.34), rgba(156,49,49,.12) 55%, rgba(156,49,49,.03) 74%);
  box-shadow: inset 0 0 0 2px rgba(125,39,39,.62);
}
.square.legal::after {
  width: 17%;
  background: rgba(23,23,23,.30);
  box-shadow: none;
  z-index: 4;
}
.square.legal.capture::after {
  inset: 7%;
  width: auto;
  border: 2px solid rgba(23,23,23,.34);
  background: transparent;
  box-shadow: none;
}
.square.drag-target { box-shadow: inset 0 0 0 2px rgba(23,23,23,.68); }
@media (hover:hover) {
  .square.legal:hover::after,
  .square.drag-target::after { background: rgba(23,23,23,.42); }
  .square.legal.capture:hover::after,
  .square.drag-target.capture::after { background: transparent; border-color: rgba(23,23,23,.52); }
}
.square .coord {
  z-index: 6;
  color: #171717 !important;
  opacity: .64;
  font: 600 clamp(6px,.52vw,8px)/1 "SFMono-Regular", Consolas, monospace;
  text-shadow: 0 1px 2px rgba(255,255,255,.90);
}
.coord-rank { left: 2px; top: 2px; }
.coord-file { right: 2px; bottom: 2px; }
.square .piece {
  position: absolute;
  left: 9%;
  bottom: 6%;
  width: 82%;
  height: 82%;
  max-width: 82%;
  max-height: 82%;
  margin: 0;
  object-fit: contain;
  object-position: center;
  z-index: 3;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.38));
  transform-origin: 50% 70%;
}
.square .piece-p,
.square .piece-r,
.square .piece-n,
.square .piece-b,
.square .piece-q,
.square .piece-k { width: 82%; height: 82%; }
@media (hover:hover) {
  .square .piece.movable:hover { transform: translateY(-1px); filter: drop-shadow(0 4px 3px rgba(0,0,0,.40)); }
}
.square.selected .piece { transform: translateY(-2px); filter: drop-shadow(0 5px 4px rgba(0,0,0,.42)); }
.drag-ghost,
.move-clone,
.capture-clone {
  object-position: center;
  filter: drop-shadow(0 5px 4px rgba(0,0,0,.35));
}
.drag-ghost { filter: drop-shadow(0 9px 8px rgba(0,0,0,.32)); }
.progress-rail { width: min(100%, 560px, calc(100dvh - 238px)); }
.promotion-choice { background: #f7f7f5; border-color: rgba(23,23,23,.18); }
.promotion-choice:hover,
.promotion-choice:focus-visible { background: #ecebe7; }
.promotion-choice img { width: 78%; height: 78%; object-fit: contain; }

@media (max-height: 820px) and (min-width: 901px) {
  .board-frame,
  .progress-rail { width: min(100%, 460px, calc(100dvh - 228px)); }
  .board-rail { min-height: 20px; }
  .board-rail-top { padding-top: 5px; padding-bottom: 4px; }
  .board-rail-bottom { padding-top: 4px; padding-bottom: 5px; }
}
@media (max-height: 720px) and (min-width: 901px) {
  .board-frame,
  .progress-rail { width: min(100%, 410px, calc(100dvh - 210px)); }
}
@media (max-width: 900px) {
  .board-frame,
  .progress-rail { width: min(100%, 600px); }
}
@media (max-width: 620px) {
  .board-frame { width: calc(100% + 20px); max-width: 100vw; margin-left: -10px; margin-right: -10px; }
  .board-rail { min-height: 20px; padding-inline: 7px; font-size: 6px; }
  .board-art-shell { padding: 6.666667%; }
  .square .coord { font-size: 5.5px; }
  .progress-rail { width: 100%; }
}

/* ==========================================================
   FINAL PAGE SHELL + GAMEPLAY UX CORRECTION
   Landing uses the supplied WalkerBex atmosphere.
   Active training stays clean, compact and board-first.
   ========================================================== */

/* Real WalkerBex floating-nav language from the supplied project. */
.skills-header {
  padding: 20px 16px 0;
}
.nav-shell {
  max-width: 1140px;
  min-height: 60px;
  padding: 8px 14px 8px 18px;
  gap: 22px;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 25px rgba(0,0,0,.04);
}
.brand-link { width: 42px; height: 42px; border-radius: 999px; }
.brand-link img { width: 36px; height: 36px; }
.main-nav { gap: 32px; font-size: 13.5px; font-weight: 500; color: #626365; }
.main-nav a { padding: 11px 0 10px; }
.main-nav a.active::after { left: 2px; right: 2px; bottom: 5px; height: 1px; background: #0a0a0b; }
.nav-actions { gap: 14px; font-size: 13px; }
.portal-link { padding: 9px 4px; color: #55575a; }
.arena-link { padding: 11px 17px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* Supplied image belongs ONLY to the landing / mode-selection surface. */
.landing-section {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: 142px;
}
.landing-section::before,
.landing-section::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  pointer-events: none;
}
.landing-section::before {
  z-index: -2;
  background: #edf1f4 url('../assets/landing/test-your-skills-bg.png') 52% center / cover no-repeat;
}
.landing-section::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(248,248,245,.95) 0%, rgba(248,248,245,.90) 29%, rgba(248,248,245,.72) 52%, rgba(248,248,245,.48) 76%, rgba(248,248,245,.30) 100%),
    linear-gradient(180deg, rgba(250,250,247,.36) 0%, rgba(246,246,243,.10) 55%, rgba(244,244,241,.76) 100%);
}
.landing-copy,
.discipline-grid,
.landing-footnote { position: relative; z-index: 1; }
.landing-copy p { color: #444746; text-shadow: 0 1px 0 rgba(255,255,255,.55); }
.discipline-grid {
  background: rgba(251,251,248,.48);
  border-color: rgba(24,25,26,.24);
  -webkit-backdrop-filter: blur(10px) saturate(.92);
  backdrop-filter: blur(10px) saturate(.92);
  box-shadow: 0 18px 55px rgba(30,36,42,.10);
}
.discipline-light { background: rgba(254,254,251,.82); }
.discipline-dark { background: rgba(19,20,22,.91); }

/* Curved WalkerBex action system. */
.launch-button,
.primary-action,
.secondary-action,
.text-button.focus-back {
  border-radius: 999px;
  transition: transform 140ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.launch-button {
  width: auto;
  align-self: flex-start;
  justify-content: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid #0c0d0e;
  background: #0c0d0e;
  color: #fff;
  box-shadow: 0 5px 16px rgba(0,0,0,.10);
}
.launch-button span { font-size: 15px; }
.launch-button:hover { transform: translateY(-1px); background: #242628; }
.launch-button:active { transform: translateY(0) scale(.985); }
.launch-button-invert {
  background: #fff;
  color: #111214;
  border-color: rgba(255,255,255,.76);
  box-shadow: 0 5px 18px rgba(0,0,0,.20);
}
.launch-button-invert:hover { background: #f0f0ed; color: #0b0c0d; }

.primary-action,
.secondary-action {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #111214;
  font-size: 10px;
  letter-spacing: .09em;
  font-weight: 800;
}
.primary-action { background: #0c0d0e; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.primary-action:hover { background: #242628; }
.secondary-action { background: rgba(255,255,255,.72); color: #111214; }
.secondary-action:hover { background: #fff; }
.primary-action:active,
.secondary-action:active { transform: translateY(0) scale(.985); }

/* Focus mode: the homepage pill nav disappears completely during play. */
body.training-active .skills-header { display: none; }
body.training-active .ambient-grid { opacity: .10; }
.training-section {
  min-height: 100dvh;
  padding: 22px 5vw 46px;
  max-width: 1400px;
}
.training-topline.focus-header {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid #d6d6d1;
}
.focus-breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #777976;
  font: 650 9px/1.25 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .105em;
  white-space: nowrap;
}
.focus-breadcrumb strong { color: #171819; font-weight: 800; }
.focus-slash { color: #b1b2ae; }
.position-counter {
  justify-self: center;
  color: #696b69;
  font: 700 11px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .08em;
}
.focus-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.icon-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #d3d4cf;
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  color: #626461;
  font-size: 8px;
  letter-spacing: .075em;
}
.icon-button:hover { color: #111; background: #fff; border-color: #bdbeba; }
.text-button.focus-back {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #bdbeba;
  background: #fff;
  color: #171819;
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: .075em;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.text-button.focus-back:hover { background: #f3f3f0; border-color: #9fa09c; }
.text-button.focus-back:active { transform: scale(.985); }
.training-heading { display: none !important; }
.training-layout { margin-top: 18px; align-items: start; }
.challenge-panel { top: 22px; min-height: 0; gap: 22px; padding-top: 2px; }
.instruction-block { min-height: 86px; margin-top: 6px; }
.status-message { min-height: 18px; }
.panel-actions { gap: 8px; }

/* With the large navbar/title removed, use the recovered vertical room for the board. */
.board-frame,
.progress-rail {
  width: min(100%, 548px, calc(100dvh - 150px));
}
.progress-rail { margin-top: 11px; }

/* Short-laptop guard: full frame remains visible without a board-only scroll. */
@media (max-height: 820px) and (min-width: 901px) {
  .training-section { padding-top: 16px; padding-bottom: 28px; }
  .training-topline.focus-header { min-height: 46px; padding-bottom: 9px; }
  .training-layout { margin-top: 13px; }
  .board-frame,
  .progress-rail { width: min(100%, 520px, calc(100dvh - 135px)); }
  .challenge-panel { gap: 15px; }
  .metric-row { padding: 9px 0; }
  .instruction-block { min-height: 68px; }
  .session-stats { padding-top: 9px; }
}
@media (max-height: 720px) and (min-width: 901px) {
  .board-frame,
  .progress-rail { width: min(100%, 475px, calc(100dvh - 122px)); }
}

@media (max-width: 900px) {
  .skills-header { padding: 14px 12px 0; }
  .nav-shell { min-height: 58px; padding: 7px 10px 7px 13px; }
  .main-nav { display: flex; gap: 22px; font-size: 12px; }
  .portal-link { display: none; }
  .landing-section { padding-top: 118px; }
  .landing-section::before { background-position: 58% center; }
  .landing-section::after {
    background:
      linear-gradient(180deg, rgba(248,248,245,.91) 0%, rgba(248,248,245,.74) 47%, rgba(245,245,242,.72) 100%),
      linear-gradient(90deg, rgba(248,248,245,.82), rgba(248,248,245,.44));
  }
  .training-section { padding: 14px 16px 42px; }
  .training-topline.focus-header {
    grid-template-columns: 1fr auto;
    grid-template-areas: "crumb count" "actions actions";
    gap: 9px 12px;
  }
  .focus-breadcrumb { grid-area: crumb; }
  .position-counter { grid-area: count; justify-self: end; }
  .focus-actions { grid-area: actions; justify-self: stretch; justify-content: flex-start; }
  .focus-back { margin-left: auto; }
  .training-layout { margin-top: 14px; grid-template-columns: 1fr; }
  .board-frame,
  .progress-rail { width: min(100%, 600px); }
  .challenge-panel { position: static; }
}

@media (max-width: 620px) {
  .skills-header { padding: 10px 9px 0; }
  .nav-shell { grid-template-columns: auto 1fr auto; gap: 8px; padding: 6px 8px 6px 10px; }
  .brand-link { width: 36px; height: 36px; }
  .brand-link img { width: 31px; height: 31px; }
  .main-nav { display: none; }
  .arena-link { padding: 10px 13px; font-size: 11px; }
  .landing-section { padding-top: 92px; }
  .landing-section::before { background-position: 62% center; }
  .landing-copy h1 { text-shadow: 0 1px 0 rgba(255,255,255,.40); }
  .discipline-grid { box-shadow: 0 12px 36px rgba(30,36,42,.10); }
  .launch-button { min-height: 46px; padding-inline: 18px; }
  .training-section { padding: 10px 10px 36px; }
  .training-topline.focus-header { padding-bottom: 8px; }
  .focus-breadcrumb { font-size: 7.5px; gap: 5px; letter-spacing: .08em; }
  .position-counter { font-size: 9px; }
  .focus-actions { gap: 5px; flex-wrap: wrap; }
  .icon-button { min-height: 32px; padding: 0 9px; font-size: 7px; }
  .text-button.focus-back { min-height: 32px; padding: 0 10px; font-size: 7px; }
  .training-layout { margin-top: 10px; }
  .board-frame { width: calc(100% + 20px); max-width: 100vw; margin-left: -10px; margin-right: -10px; }
  .progress-rail { width: 100%; }
}

@media (min-width: 901px) {
  .discipline h2 { font-size: clamp(40px, 4vw, 66px); }
}
@media (min-width: 901px) {
  .discipline h2 { font-size: clamp(38px, 3.1vw, 56px); }
}

/* ==========================================================
   WALKERBEX TRAINING SYSTEM V2 — PRODUCT DEPTH LAYER
   Keeps the approved board + brand shell; enriches progression.
   ========================================================== */
.training-identity {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin-top: 8px;
  padding: 15px 18px 13px;
  border: 1px solid rgba(22,24,25,.13);
  border-radius: 22px;
  background: rgba(252,252,249,.70);
  backdrop-filter: blur(9px);
  box-shadow: 0 12px 30px rgba(35,40,43,.06);
}
.training-identity-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.training-identity-head strong,
.focus-profile,
.rank-progress-text { font: 650 9px/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing:.11em; }
.training-identity-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin-top:13px; }
.training-identity-grid > div { min-width:0; padding:0 15px; border-left:1px solid rgba(18,20,21,.10); }
.training-identity-grid > div:first-child { padding-left:0; border-left:0; }
.training-identity-grid span,
.result-grid span { display:block; color:#777a78; font:600 8px/1 "SFMono-Regular",Consolas,monospace; letter-spacing:.11em; }
.training-identity-grid strong { display:block; margin-top:6px; font-size:20px; line-height:1; letter-spacing:-.035em; }
.rank-progress { height:3px; margin-top:14px; overflow:hidden; border-radius:999px; background:rgba(12,13,14,.10); }
.rank-progress span { display:block; width:0; height:100%; background:#111214; transition:width .35s var(--ease-ui); }
.rank-progress-text { margin-top:8px; color:#6c6e6d; font-size:7.5px; }
.discipline-actions { display:flex; align-items:center; gap:10px; margin-top:auto; }
.discipline-actions .launch-button { flex:1; }
.quiet-action {
  min-height:38px;
  padding:0 14px;
  border:1px solid rgba(19,21,22,.18);
  border-radius:999px;
  background:rgba(255,255,255,.62);
  color:#161718;
  font:650 8px/1 "SFMono-Regular",Consolas,monospace;
  letter-spacing:.10em;
  cursor:pointer;
  transition:background var(--motion-fast) var(--ease-ui),transform var(--motion-fast) var(--ease-ui),border-color var(--motion-fast) var(--ease-ui);
}
.quiet-action:hover { background:#fff; border-color:rgba(19,21,22,.35); }
.quiet-action:active { transform:scale(.985); }
.discipline-dark .quiet-action { color:#f5f5f2; border-color:rgba(255,255,255,.24); background:rgba(255,255,255,.07); }
.recent-training {
  grid-column:1/-1;
  position:relative;
  z-index:1;
  max-width:820px;
  padding:13px 16px;
  border-top:1px solid rgba(20,22,23,.13);
  border-bottom:1px solid rgba(20,22,23,.13);
}
.recent-training-list { display:flex; gap:20px; margin-top:8px; flex-wrap:wrap; }
.recent-item { display:flex; align-items:baseline; gap:8px; color:#5e6160; font-size:11px; }
.recent-item strong { color:#111; font-size:12px; }
.recent-item span { font:600 7.5px/1 "SFMono-Regular",Consolas,monospace; letter-spacing:.08em; color:#868885; }

.focus-profile { display:flex; align-items:center; gap:9px; white-space:nowrap; color:#6e706e; }
.focus-profile strong { color:#111214; }
.training-topline.focus-header { grid-template-columns:minmax(0,1fr) auto auto auto; }
.metric-pair { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.metric-pair > div { min-width:0; }
.metric-pair strong { display:block; margin-top:5px; }
#positionTimeValue,#targetTimeValue,#attemptValue,#streakValue,#ratingValue { font-variant-numeric:tabular-nums; }
.hint-panel { min-height:42px; }
.hint-actions { display:flex; gap:8px; }
.hint-text { margin:9px 0 0; padding:10px 12px; border-left:2px solid #222; background:rgba(18,20,21,.035); color:#4e504f; font-size:12px; line-height:1.45; }
.move-history { padding-top:4px; }
.move-history-list { display:flex; flex-wrap:wrap; gap:5px 10px; margin-top:8px; min-height:18px; font:600 9px/1.25 "SFMono-Regular",Consolas,monospace; color:#4a4c4b; }
.move-history-list span:nth-child(even) { color:#7f817f; }
.result-card { padding:16px 0 2px; border-top:1px solid var(--line); animation:resultIn var(--motion-panel) var(--ease-ui); }
@keyframes resultIn { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:none} }
.result-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; }
.result-heading span { font-size:25px; line-height:1; font-weight:800; letter-spacing:-.04em; }
.result-heading strong { font-size:30px; line-height:1; letter-spacing:-.05em; font-variant-numeric:tabular-nums; }
.result-heading strong.points-pop { animation:pointsPop .38s var(--ease-ui); }
@keyframes pointsPop { 0%{opacity:0;transform:translateY(7px)} 100%{opacity:1;transform:none} }
.result-grid { display:grid; grid-template-columns:1fr 1fr; gap:13px 18px; margin-top:17px; }
.result-grid strong { display:block; margin-top:5px; font-size:13px; }
.result-idea { margin-top:18px; padding-top:15px; border-top:1px solid var(--line); }
.result-idea p { margin:8px 0 0; color:#565856; font-size:12px; line-height:1.55; }
.result-lifetime { min-height:16px; margin-top:12px; color:#737573; font:600 8px/1.35 "SFMono-Regular",Consolas,monospace; letter-spacing:.08em; }
.challenge-panel.is-result #metricStack,
.challenge-panel.is-result .instruction-block,
.challenge-panel.is-result #hintPanel,
.challenge-panel.is-result #moveHistory { display:none; }
.challenge-panel.is-result #resultCard { display:block; }
.progress-node.perfect { background:#202221; }
.progress-node.missed { background:#767874; }
.progress-node.assisted { background:transparent; box-shadow:inset 0 0 0 1px #4d4f4c; }
.progress-node.career-solved:not(.perfect):not(.missed):not(.assisted) { background:#a4a6a2; }
.session-stats { row-gap:7px; }
.session-stats b { font-variant-numeric:tabular-nums; }

.completion-metrics-wide { grid-template-columns:repeat(4,1fr); }
.completion-metrics-wide div:nth-child(5) { border-left:0; }
.completion-insight { display:grid; grid-template-columns:1fr 1fr; gap:1px; margin-top:22px; border:1px solid var(--line); background:var(--line); }
.completion-insight > div { padding:18px; background:#f7f7f4; }
.completion-insight strong { display:block; margin-top:7px; font-size:18px; }
.completion-actions { max-width:none; flex-wrap:wrap; }
.completion-actions button { min-width:180px; }

@media (max-width:1120px) {
  .training-identity { max-width:none; }
  .training-topline.focus-header { grid-template-columns:minmax(0,1fr) auto auto; grid-template-areas:"crumb count profile" "actions actions actions"; }
  .focus-profile { grid-area:profile; justify-self:end; }
  .focus-actions { grid-area:actions; }
  .completion-metrics-wide { grid-template-columns:repeat(2,1fr); }
  .completion-metrics-wide div:nth-child(odd) { border-left:0; }
}
@media (max-width:900px) {
  .training-identity-grid { grid-template-columns:repeat(2,1fr); row-gap:13px; }
  .training-identity-grid > div:nth-child(3) { border-left:0; padding-left:0; }
  .training-topline.focus-header { grid-template-columns:1fr auto; grid-template-areas:"crumb count" "profile profile" "actions actions"; }
  .focus-profile { justify-self:start; }
  .challenge-panel.is-result { display:flex; }
  .completion-metrics { grid-template-columns:repeat(2,1fr); }
  .completion-metrics div:nth-child(odd) { border-left:0; }
}
@media (max-width:620px) {
  .training-identity { padding:13px 14px 12px; border-radius:18px; }
  .training-identity-head { align-items:flex-start; flex-direction:column; gap:5px; }
  .training-identity-grid strong { font-size:17px; }
  .discipline-actions { align-items:stretch; flex-direction:column; }
  .quiet-action { min-height:42px; }
  .recent-training-list { display:grid; grid-template-columns:1fr; gap:8px; }
  .focus-profile { font-size:7.5px; }
  .metric-pair { gap:10px; }
  .result-heading span { font-size:22px; }
  .result-heading strong { font-size:25px; }
  .completion-metrics,
  .completion-metrics-wide,
  .completion-insight { grid-template-columns:1fr; }
  .completion-metrics div,
  .completion-metrics-wide div { border-left:0 !important; }
  .completion-actions button { min-width:0; width:100%; }
}
@media (orientation:landscape) and (max-height:560px) and (max-width:950px) {
  .training-section { padding:8px 10px 18px; }
  .training-layout { grid-template-columns:minmax(0,1fr) minmax(220px,280px); gap:18px; }
  .board-frame,.progress-rail { width:min(calc(100dvh - 86px),58vw); }
  .challenge-panel { display:flex; position:sticky; top:8px; gap:10px; max-height:calc(100dvh - 70px); overflow:auto; }
  .metric-row { padding:7px 0; }
  .instruction-block { min-height:52px; }
  .session-stats { display:none; }
}
@supports (padding: max(0px)) {
  .skills-header { padding-left:max(12px,env(safe-area-inset-left)); padding-right:max(12px,env(safe-area-inset-right)); }
  .training-section { padding-left:max(10px,env(safe-area-inset-left)); padding-right:max(10px,env(safe-area-inset-right)); padding-bottom:max(36px,env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion:reduce) {
  .rank-progress span,.result-card,.result-heading strong.points-pop { transition:none; animation:none; }
}

/* Keep the enriched landing composition in the original two-column rhythm. */
@media (min-width:1121px) {
  .landing-copy { grid-column:1; grid-row:1; align-self:end; }
  .training-identity { grid-column:1; grid-row:2; align-self:start; width:100%; max-width:520px; }
  .discipline-grid { grid-column:2; grid-row:1 / span 2; width:100%; min-width:0; }
  .recent-training { grid-column:1 / -1; }
  .landing-footnote { grid-column:1 / -1; }
}
@media (max-width:1120px) {
  .landing-copy,.training-identity,.discipline-grid,.recent-training,.landing-footnote { grid-column:1; grid-row:auto; }
}
@media (orientation:landscape) and (max-height:560px) and (max-width:950px) {
  .focus-profile { display:none; }
  .training-topline.focus-header { grid-template-columns:1fr auto; grid-template-areas:"crumb count" "actions actions"; }
  .focus-actions { gap:4px; }
  .icon-button,.text-button.focus-back { min-height:28px; padding-inline:8px; }
  .training-layout { margin-top:6px; }
  .board-frame,.progress-rail { width:min(calc(100dvh - 160px),44vw); }
}


/* ==========================================================
   COMPACT SHELL CORRECTION — 2026-10-03
   User-requested visual fix only. Keeps chess/data/board systems intact.
   ========================================================== */

.skills-header[hidden] { display: none !important; }
button { -webkit-appearance: none; appearance: none; }
button::-moz-focus-inner { border: 0; }

/* LANDING: one coherent, centered screen instead of a giant stacked hero. */
.landing-section {
  width: 100%;
  max-width: 1320px;
  min-height: 100svh;
  margin: 0 auto;
  padding: 112px clamp(18px, 4.5vw, 68px) 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.landing-copy {
  width: min(100%, 980px);
  align-self: auto;
  text-align: center;
}
.landing-copy .eyebrow { justify-content: center; }
.landing-copy h1 {
  margin: 13px auto 10px;
  max-width: 980px;
  font-size: clamp(48px, 6vw, 80px);
  line-height: .88;
  letter-spacing: -.065em;
}
.landing-copy h1 span { display: inline; }
.landing-copy h1 span + span { margin-left: .12em; }
.landing-copy p {
  max-width: 650px;
  margin: 0 auto;
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.45;
}

.training-identity {
  width: min(100%, 900px);
  max-width: 900px !important;
  margin: 0;
  padding: 11px 16px 10px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(30,36,42,.045);
}
.training-identity-grid { margin-top: 9px; }
.training-identity-grid strong { margin-top: 4px; font-size: 17px; }
.rank-progress { margin-top: 10px; }
.rank-progress-text { margin-top: 6px; }

/* Separate the two disciplines. They should read as two products, not one split card. */
.discipline-grid {
  width: min(100%, 900px);
  min-height: 0 !important;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 18px;
  align-items: stretch;
  border: 0 !important;
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}
.discipline {
  min-height: 300px;
  padding: 22px 24px 20px;
  border: 1px solid rgba(20,22,23,.18);
  border-radius: 26px;
  box-shadow: 0 14px 38px rgba(28,33,37,.075);
}
.discipline + .discipline { border-left: 1px solid rgba(20,22,23,.18); }
.discipline-dark { border-color: rgba(15,16,17,.92); }
.discipline::before { width: 190px; height: 190px; right: -72px; top: 55px; }
.discipline::after { width: 96px; height: 96px; right: 18px; top: 30px; }
.discipline-number { font-size: 10px; }
.discipline-body { margin: 0; padding: 17px 0 14px; }
.discipline-label { margin-bottom: 10px; font-size: 8px; }
.discipline h2 { font-size: clamp(31px, 3.1vw, 45px) !important; line-height: .92; }
.discipline p { max-width: 340px; margin-top: 13px; font-size: 12.5px; line-height: 1.48; }
.discipline-meta { gap: 8px 12px; margin-top: 13px; font-size: 7.5px; }
.discipline-actions { margin-top: auto; gap: 8px; flex-wrap: wrap; }

/* Strong, consistent pill controls. Prevent UA/browser button styling from leaking through. */
.launch-button,
.quiet-action,
.primary-action,
.secondary-action,
.text-button.focus-back,
.icon-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  border-radius: 999px !important;
  box-sizing: border-box;
  white-space: nowrap;
}
.launch-button {
  width: auto !important;
  min-width: 176px;
  min-height: 44px;
  padding: 0 18px !important;
  border: 1px solid #0c0d0e !important;
  background: #0c0d0e !important;
  color: #fff !important;
  line-height: 1;
  justify-content: space-between;
  text-align: left;
}
.launch-button:hover { background: #242628 !important; }
.discipline-dark .launch-button,
.launch-button-invert {
  background: #f8f8f5 !important;
  color: #111214 !important;
  border-color: rgba(255,255,255,.8) !important;
}
.discipline-dark .launch-button:hover,
.launch-button-invert:hover { background: #e9e9e5 !important; }
.quiet-action {
  min-width: 124px;
  min-height: 40px;
  padding: 0 15px !important;
  border: 1px solid rgba(20,22,23,.22) !important;
  background: rgba(255,255,255,.88) !important;
  color: #151617 !important;
  line-height: 1;
}
.quiet-action:hover { background: #fff !important; border-color: rgba(20,22,23,.42) !important; }
.quiet-action[hidden] { display: none !important; }

.recent-training {
  width: min(100%, 900px);
  max-width: 900px;
  padding: 9px 12px;
}
.landing-footnote {
  width: min(100%, 900px);
  margin-top: 0;
}

/* GAMEPLAY: compact focus workspace; keep the full board comfortably in view. */
body.training-active .skills-header { display: none !important; }
body.training-active .skills-footer { display: none; }
.training-section {
  width: 100%;
  max-width: 1160px;
  min-height: 100svh;
  padding: 12px 24px 22px !important;
}
.training-topline.focus-header {
  min-height: 44px;
  gap: 12px;
  padding-bottom: 8px;
}
.training-layout {
  width: 100%;
  margin-top: 12px !important;
  grid-template-columns: minmax(0, 500px) minmax(280px, 340px) !important;
  justify-content: center;
  gap: clamp(24px, 3vw, 40px) !important;
  align-items: start;
}
.board-column { min-width: 0; }
.board-frame,
.progress-rail {
  width: min(100%, 500px, calc(100dvh - 112px)) !important;
}
.progress-rail { margin-top: 8px; }
.challenge-panel {
  position: sticky;
  top: 10px !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 76px);
  overflow: auto;
  scrollbar-width: thin;
  gap: 13px !important;
  padding: 0 2px 5px 0 !important;
}
.challenge-panel h3 { margin-top: 7px; font-size: clamp(24px, 2vw, 31px) !important; }
.metric-row { padding: 7px 0 !important; }
.instruction-block { min-height: 58px !important; margin-top: 1px !important; }
.instruction-block p { margin-top: 10px; }
.hint-panel { min-height: 36px; }
.session-stats { padding-top: 8px !important; }
.panel-actions { gap: 7px !important; }
.primary-action,.secondary-action { min-height: 40px; padding-inline: 15px; }

/* Short laptop refinement. */
@media (min-width: 901px) and (max-height: 820px) {
  .landing-section { padding-top: 94px; padding-bottom: 20px; gap: 11px; }
  .landing-copy h1 { font-size: clamp(44px, 5.35vw, 67px); margin: 9px auto 6px; }
  .landing-copy p { font-size: 14px; }
  .training-identity { padding-top: 9px; padding-bottom: 8px; }
  .discipline-grid { gap: 16px; }
  .discipline { min-height: 260px; padding: 18px 21px 17px; }
  .discipline-body { padding: 11px 0 9px; }
  .discipline h2 { font-size: clamp(29px, 2.8vw, 39px) !important; }
  .discipline p { margin-top: 10px; font-size: 11.5px; line-height: 1.4; }
  .discipline-meta { margin-top: 10px; }
  .launch-button { min-height: 40px; }
  .quiet-action { min-height: 38px; }
  .landing-footnote { font-size: 7.5px; }

  .training-section { max-width: 1080px; padding: 9px 20px 14px !important; }
  .training-topline.focus-header { min-height: 40px; }
  .training-layout { margin-top: 8px !important; grid-template-columns: minmax(0, 455px) minmax(270px, 320px) !important; gap: 28px !important; }
  .board-frame,.progress-rail { width: min(100%, 455px, calc(100dvh - 105px)) !important; }
  .challenge-panel { max-height: calc(100dvh - 62px); gap: 10px !important; }
  .metric-row { padding: 5px 0 !important; }
  .instruction-block { min-height: 48px !important; }
  .challenge-panel h3 { font-size: 26px !important; }
}

/* Tablet / mobile: cards separate vertically and board remains the hero. */
@media (max-width: 900px) {
  .landing-section { justify-content: flex-start; padding: 96px 18px 28px; gap: 14px; }
  .landing-copy h1 { font-size: clamp(44px, 10vw, 70px); }
  .discipline-grid { grid-template-columns: 1fr; gap: 14px; width: min(100%, 650px); }
  .discipline { min-height: 0; padding: 20px 22px; }
  .training-identity { width: min(100%,650px); }
  .recent-training,.landing-footnote { width: min(100%,650px); }

  .training-section { padding: 10px 14px 28px !important; }
  .training-layout { grid-template-columns: 1fr !important; gap: 16px !important; }
  .board-frame,.progress-rail { width: min(100%, 570px) !important; }
  .challenge-panel { position: static; max-height: none; overflow: visible; }
}

@media (max-width: 620px) {
  .landing-section { padding: 84px 12px 24px; }
  .landing-copy h1 { font-size: clamp(40px, 14vw, 62px); line-height: .84; }
  .landing-copy h1 span { display: block; margin-left: 0 !important; }
  .landing-copy p { font-size: 13.5px; }
  .training-identity-grid { grid-template-columns: repeat(2,1fr); }
  .discipline { border-radius: 22px; padding: 18px; }
  .discipline h2 { font-size: 34px !important; }
  .discipline-actions { flex-direction: row; align-items: center; }
  .launch-button { min-width: 0; flex: 1; }
  .quiet-action { min-width: 0; }

  .training-section { padding: 8px 8px 22px !important; }
  .training-layout { margin-top: 8px !important; }
  .board-frame { width: calc(100% + 16px) !important; max-width: calc(100vw - 0px); margin-left: -8px; margin-right: -8px; }
  .progress-rail { width: 100% !important; }
}
