:root {
  --background: #f7fbfc;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.78);
  --text: #344155;
  --subtext: #6f7e90;
  --blue: #a9dfee;
  --blue-light: #e8f7fb;
  --blue-dark: #397f96;
  --orange: #ffb88d;
  --orange-light: #fff0e7;
  --orange-dark: #c96c3e;
  --purple: #c8baed;
  --purple-light: #f1edfb;
  --green: #78bca4;
  --green-light: #e9f7f1;
  --red: #dd6b6b;
  --red-light: #fff0f0;
  --border: rgba(66, 93, 111, 0.14);
  --shadow: 0 24px 70px rgba(75, 104, 120, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(232, 247, 251, 0.82), transparent 42%),
    linear-gradient(315deg, rgba(255, 240, 231, 0.78), transparent 43%),
    var(--background);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    "Hiragino Sans",
    "Yu Gothic",
    sans-serif;
  line-height: 1.75;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--text);
  border-radius: 10px;
  transform: translateY(-150%);
}

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

/* Header */

.play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 18px auto 0;
  padding: 13px 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  box-shadow: 0 10px 35px rgba(75, 103, 119, 0.07);
  backdrop-filter: blur(16px);
}

.play-header > a {
  color: var(--subtext);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.play-header > a:hover {
  color: var(--text);
}

.play-header > p {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
}

.play-header > p span {
  padding: 3px 9px;
  color: var(--orange-dark);
  background: var(--orange-light);
  border-radius: 99px;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Shared layout */

.app-container {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 90px;
}

.screen {
  padding: clamp(28px, 5vw, 62px);
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.eyebrow,
.mini-label {
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.mini-label {
  font-size: 9px;
}

.screen > h1 {
  margin-top: 8px;
  font-size: clamp(38px, 6vw, 62px);
  letter-spacing: -0.055em;
  line-height: 1.12;
}

.lead {
  max-width: 720px;
  margin-top: 20px;
  color: var(--subtext);
  font-size: 16px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 48px;
  padding: 12px 22px;
  color: var(--text);
  border: 0;
  border-radius: 99px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.primary-button {
  background: var(--blue);
}

.secondary-button {
  background: var(--orange-light);
  border: 1px solid rgba(201, 108, 62, 0.12);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(72, 112, 131, 0.17);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
a:focus-visible,
input:focus-visible,
.stimulus-stage:focus-visible {
  outline: 3px solid rgba(57, 127, 150, 0.38);
  outline-offset: 4px;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

/* Welcome */

.information-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 34px;
}

.information-grid article {
  min-height: 158px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.information-grid article:nth-child(2),
.information-grid article:nth-child(4) {
  background: var(--blue-light);
}

.information-grid article > span {
  color: var(--orange-dark);
  font-size: 10px;
  font-weight: 800;
}

.information-grid h2 {
  margin-top: 24px;
  font-size: 15px;
}

.information-grid p {
  margin-top: 5px;
  color: var(--subtext);
  font-size: 12px;
}

.demo-notice,
.environment-message,
.instruction-note,
.result-notice {
  margin-top: 22px;
  padding: 23px 25px;
  border-radius: 20px;
}

.demo-notice {
  background: var(--purple-light);
}

.demo-notice strong,
.result-notice strong {
  font-size: 14px;
}

.demo-notice ul {
  margin-top: 9px;
  padding-left: 19px;
  color: var(--subtext);
  font-size: 13px;
}

.environment-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--green-light);
  border: 1px solid rgba(120, 188, 164, 0.22);
}

.environment-message.warning {
  background: var(--red-light);
  border-color: rgba(221, 107, 107, 0.24);
}

.environment-message strong {
  font-size: 13px;
}

.environment-message p {
  color: var(--subtext);
  font-size: 12px;
  text-align: right;
}

.key-check {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  margin-top: 22px;
  padding: 24px 25px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.key-check h2 {
  margin-top: 3px;
  font-size: 17px;
}

.key-check > div > p:last-child {
  margin-top: 5px;
  color: var(--subtext);
  font-size: 12px;
}

.key-check-buttons {
  display: flex;
  gap: 10px;
}

.key-check-item {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 74px;
  padding: 12px 13px 9px;
  color: var(--subtext);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 15px;
}

.key-check-item kbd,
.mapping-card kbd,
.category-side kbd {
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: #ffffff;
  border: 1px solid rgba(52, 65, 85, 0.16);
  border-bottom-width: 3px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(52, 65, 85, 0.08);
  font-family: inherit;
  font-weight: 850;
}

.key-check-item kbd {
  width: 39px;
  height: 39px;
  font-size: 15px;
}

.key-check-item span {
  font-size: 10px;
  font-weight: 700;
}

.key-check-item.confirmed {
  color: var(--green);
  background: var(--green-light);
  border-color: rgba(120, 188, 164, 0.28);
}

.key-check-item.confirmed kbd {
  color: #347760;
  border-color: rgba(52, 119, 96, 0.28);
}

.acknowledgement {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 25px;
  padding: 17px 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
}

.acknowledgement input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blue-dark);
}

#continue-button,
#begin-block-button {
  margin-top: 24px;
}

.research-note {
  max-width: 760px;
  margin-top: 16px;
  color: var(--subtext);
  font-size: 11px;
}

/* Block introduction */

.mapping-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 36px;
}

.mapping-card {
  display: grid;
  justify-items: center;
  min-height: 210px;
  padding: 28px;
  border-radius: 24px;
  text-align: center;
}

.left-mapping {
  background: var(--blue-light);
}

.right-mapping {
  background: var(--orange-light);
}

.mapping-card kbd {
  width: 47px;
  height: 47px;
  font-size: 18px;
}

.mapping-card > p {
  margin-top: 10px;
  color: var(--subtext);
  font-size: 11px;
}

.mapping-card > div {
  align-self: end;
  margin-top: 20px;
  font-size: clamp(18px, 3vw, 25px);
  line-height: 1.35;
}

.instruction-note {
  display: grid;
  gap: 5px;
  background: var(--surface);
  border-left: 4px solid var(--purple);
  color: var(--subtext);
  font-size: 12px;
}

/* Test */

.test-screen {
  min-height: calc(100vh - 155px);
  padding: clamp(18px, 3vw, 34px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.test-status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  color: var(--subtext);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  background: #edf1f3;
  border-radius: 99px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  border-radius: inherit;
  transition: width 0.16s ease;
}

.category-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  margin-top: 25px;
}

.category-side {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-height: 94px;
  padding: 17px;
  border-radius: 18px;
}

.category-left {
  background: var(--blue-light);
}

.category-right {
  justify-content: flex-end;
  background: var(--orange-light);
  text-align: right;
}

.category-side kbd {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.category-side div p:first-child {
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 850;
  line-height: 1.35;
}

.category-side div p:last-child {
  margin-top: 4px;
  color: var(--subtext);
  font-size: clamp(11px, 1.7vw, 14px);
  font-weight: 700;
}

.classification-label {
  align-self: center;
  color: var(--subtext);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-align: center;
}

.stimulus-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(330px, 49vh, 480px);
  margin-top: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.stage-caption {
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  color: var(--subtext);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-align: center;
}

.stimulus-stage h1 {
  padding: 30px;
  font-size: clamp(44px, 8vw, 76px);
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-align: center;
}

.error-feedback {
  position: absolute;
  bottom: 22px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #ffffff;
  background: var(--red);
  border-radius: 50%;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.test-instruction {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  color: var(--subtext);
  font-size: 10px;
  font-weight: 750;
}

/* Result */

.score-panel {
  display: grid;
  justify-items: center;
  margin-top: 34px;
  padding: 35px 28px;
  background: linear-gradient(135deg, var(--blue-light), var(--purple-light));
  border-radius: 25px;
  text-align: center;
}

.score-panel > p {
  color: var(--subtext);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.score-panel > strong {
  margin-top: 4px;
  font-size: clamp(58px, 9vw, 88px);
  letter-spacing: -0.06em;
  line-height: 1.15;
}

.score-panel > span {
  max-width: 620px;
  margin-top: 7px;
  color: var(--subtext);
  font-size: 13px;
}

.quality-panel {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 25px;
  margin-top: 18px;
  padding: 22px 24px;
  background: var(--green-light);
  border: 1px solid rgba(120, 188, 164, 0.22);
  border-radius: 19px;
}

.quality-panel.warning {
  background: var(--red-light);
  border-color: rgba(221, 107, 107, 0.2);
}

.quality-panel strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
}

.quality-panel ul {
  align-self: center;
  padding-left: 18px;
  color: var(--subtext);
  font-size: 12px;
}

.result-explanation {
  margin-top: 24px;
  color: var(--subtext);
  font-size: 15px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-top: 24px;
}

.result-grid article {
  min-height: 128px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 19px;
}

.result-grid article:nth-child(2) {
  background: var(--blue-light);
}

.result-grid article:nth-child(3) {
  background: var(--orange-light);
}

.result-grid p {
  color: var(--subtext);
  font-size: 11px;
}

.result-grid strong {
  display: block;
  margin-top: 16px;
  font-size: clamp(20px, 3vw, 27px);
}

.result-notice {
  background: var(--orange-light);
}

.result-notice p {
  margin-top: 6px;
  color: var(--subtext);
  font-size: 12px;
}

.result-research-note {
  padding-left: 2px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 27px;
}

.result-actions > a {
  margin-left: 5px;
  color: var(--subtext);
  font-size: 12px;
  text-underline-offset: 4px;
}

/* Pause */

.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(35, 46, 62, 0.45);
  backdrop-filter: blur(10px);
}

.pause-card {
  width: min(520px, 100%);
  padding: 36px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 27px;
  box-shadow: 0 30px 90px rgba(35, 46, 62, 0.24);
}

.pause-card h2 {
  margin-top: 5px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.pause-card > p:not(.eyebrow) {
  margin-top: 12px;
  color: var(--subtext);
  font-size: 13px;
}

.pause-card .primary-button {
  margin-top: 22px;
}

.pause-card > a {
  display: block;
  width: fit-content;
  margin-top: 15px;
  color: var(--subtext);
  font-size: 12px;
  text-underline-offset: 4px;
}

/* Narrow screens */

@media (max-width: 780px) {
  .play-header {
    width: min(100% - 24px, 1180px);
  }

  .play-header > p span {
    display: none;
  }

  .app-container {
    width: min(100% - 24px, 980px);
    padding-top: 24px;
  }

  .screen {
    border-radius: 24px;
  }

  .information-grid,
  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .key-check,
  .quality-panel {
    grid-template-columns: 1fr;
  }

  .key-check-buttons {
    justify-self: start;
  }

  .environment-message {
    display: block;
  }

  .environment-message p {
    margin-top: 4px;
    text-align: left;
  }

  .category-header {
    grid-template-columns: 1fr 1fr;
  }

  .classification-label {
    display: none;
  }

  .category-side {
    min-height: 112px;
  }

  .stimulus-stage {
    min-height: 340px;
  }
}

@media (max-width: 520px) {
  .play-header > p {
    display: none;
  }

  .information-grid,
  .mapping-preview,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .information-grid article {
    min-height: 125px;
  }

  .information-grid h2 {
    margin-top: 15px;
  }

  .test-screen {
    padding: 13px;
    border-radius: 20px;
  }

  .category-side {
    display: grid;
    min-height: 130px;
    padding: 13px;
  }

  .category-right {
    justify-items: end;
  }

  .category-right kbd {
    grid-row: 1;
  }

  .test-instruction span:nth-child(2) {
    display: none;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions button {
    width: 100%;
  }

  .result-actions > a {
    margin: 4px auto 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
