:root {
  --bg-start: #e3ecff;
  --bg-end: #f9fafb;
  --card-bg: #ffffff;
  --text: #111827;
  --text-light: #6b7280;
  --border: #d1d9e6;
  --border-strong: #b4c0dd;
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.2);
  --blue: #4f46e5;
  --blue-dark: #3730a3;
  --green: #10b981;
  --green-dark: #059669;
  --red: #ef4444;
  --red-dark: #b91c1c;
  --bg-input: #f9fafb;
  --bg-feedback: #eef2ff;
}

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: 'Segoe UI', Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79,70,229,0.25), transparent 55%),
    linear-gradient(135deg, var(--bg-start), var(--bg-end));
  color: var(--text);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}

.jspsych-content-wrapper {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

.jspsych-content {
  width: 98%; height: 97%;
  background: #fff;
  border-radius: 20px;
  padding: 10px clamp(12px, 2vw, 40px) clamp(52px, 8vh, 90px);
  box-shadow: var(--shadow-soft);
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: clamp(1.4rem, 8.2vh, 2.2rem) !important;
  overflow: hidden;
  box-sizing: border-box;
}

.jspsych-content.apm-screen { justify-content: flex-start; padding-top: 4px; }

#jspsych-progressbar-container, .jspsych-progressbar-container { display: none !important; }

.jspsych-content p { line-height: 1.6; color: var(--text); margin: 0.5rem 0; }

h1, h2, h3, h4 { color: var(--text); margin: 0; font-weight: 700; text-align: center; }
h1 { font-size: clamp(2.2rem, 5.5vh, 3.4rem) !important; }
h2 { font-size: clamp(2rem, 5vh, 3rem) !important; }
h3 { font-size: clamp(1.8rem, 4.5vh, 2.6rem) !important; }
h4 { font-size: clamp(1.5rem, 4vh, 2.2rem) !important; }

button, .jspsych-btn {
  padding: 0.7rem 1.8rem !important;
  font-size: clamp(1rem, 2.2vh, 1.4rem) !important;
  border-radius: 12px; font-weight: 600; border: none; cursor: pointer;
  color: white; background: var(--blue);
  min-width: 180px; margin: 1rem auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: filter 0.15s, transform 0.15s;
}
button:hover, .jspsych-btn:hover { filter: brightness(1.12); transform: translateY(-2px); }
button:active, .jspsych-btn:active { transform: translateY(0); filter: brightness(0.93); }

.btn-green { background: var(--green); }
.btn-red   { background: var(--red); }

.btn-row { display: flex; justify-content: center; gap: 25px; margin: 20px 0; flex-wrap: wrap; }

#jspsych-html-button-response-btngroup {
  position: absolute !important; bottom: 20px !important;
  left: 0 !important; right: 0 !important;
  display: flex !important; justify-content: center !important;
  gap: 20px !important; background: none !important;
}

#jspsych-html-button-response-stimulus {
  width: 100%; flex: 1 1 0; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}

.apm-screen #jspsych-html-button-response-stimulus { align-items: stretch; justify-content: stretch; }

.btn-apm-left {
  position: absolute !important; bottom: 20px !important; left: 300px !important;
  z-index: 600 !important; min-width: 160px !important; margin: 0 !important;
}
.btn-apm-right {
  position: absolute !important; bottom: 20px !important; right: 300px !important;
  z-index: 600 !important; min-width: 160px !important; margin: 0 !important;
}

.custom-form-container {
  width: 90%; margin: 0 auto; padding: 20px; text-align: center;
  height: 100%; display: flex; flex-direction: column; justify-content: center; overflow-y: auto;
}

.form-progress { margin-bottom: 30px; text-align: center; }

.progress-bar-track {
  height: 10px; background: #e5e7f5; border-radius: 999px; overflow: hidden; margin-bottom: 10px;
}
.progress-bar-fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width 0.3s ease; }
.progress-text { color: var(--text-light); font-size: clamp(1rem, 2.2vh, 1.4rem); }

.form-title { color: var(--text); font-size: clamp(1.6rem, 3.5vh, 2.2rem); font-weight: 700; margin-bottom: 30px; }

.form-field { position: relative; margin: 24px 0; }

.form-input {
  width: 100%; padding: 0.9rem 1.2rem; font-size: clamp(1rem, 2.2vh, 1.4rem);
  background: var(--bg-input); border: 2px solid var(--border); border-radius: 12px;
  color: var(--text); outline: none; box-sizing: border-box; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--blue); background: #fff; }

.form-options { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }

.form-radio-label {
  display: flex; align-items: center; padding: 0.9rem 1.2rem;
  background: var(--bg-input); border: 2px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.form-radio-label:hover { border-color: var(--blue); background: #fff; }
.form-radio-label.checked { border-color: var(--blue); background: rgba(79,70,229,0.06); }
.form-radio-input { position: absolute; opacity: 0; }

.radio-custom {
  width: 24px; height: 24px; border: 2px solid var(--border); border-radius: 50%;
  margin-right: 14px; background: var(--card-bg); flex-shrink: 0; position: relative;
  transition: border-color 0.2s;
}
.form-radio-input:checked + .radio-custom { border-color: var(--blue); }
.form-radio-input:checked + .radio-custom::after {
  content: ''; position: absolute; inset: 5px; background: var(--blue); border-radius: 50%;
}

.radio-text { color: var(--text); font-size: clamp(1rem, 2.2vh, 1.4rem); font-weight: 500; flex: 1; }

.form-navigation {
  position: absolute !important; bottom: 20px !important; left: 0 !important; right: 0 !important;
  display: flex !important; justify-content: center !important; gap: 25px !important;
  background: none !important; margin: 0 !important;
}

.btn-prev, .btn-next {
  padding: 0.8rem 1.8rem; font-size: clamp(1rem, 2.2vh, 1.4rem); border-radius: 12px; font-weight: 600;
  cursor: pointer; border: none; min-width: 150px;
}
.btn-prev { background: transparent; color: var(--text-light); border: 2px solid var(--border); }
.btn-prev:hover { border-color: var(--blue); color: var(--blue); }
.btn-next  { background: var(--blue); color: white; }
.btn-submit { background: var(--green); }

.exp-layout-vertical {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  width: 100%; height: 100%; gap: 8px; overflow: visible; box-sizing: border-box;
  padding-top: 10px; padding-bottom: 20px;
}

.problem-section { flex: 1 1 0; min-height: 0; width: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.problem-section .problem-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 12px; clip-path: inset(20% 0 0 0); }

.answer-section { width: 100%; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }

.responses-grid-apm { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 760px; margin: 0 auto; }
.responses-grid-apm .resp-img { width: 100%; border-radius: 8px; cursor: pointer; background: #fff; box-shadow: 0 10px 24px rgba(15,23,42,0.28); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.responses-grid-apm .resp-img:hover { transform: scale(1.03); box-shadow: 0 16px 40px rgba(15,23,42,0.35); }
.resp-img.selected { outline: 4px solid var(--blue) !important; outline-offset: 2px; }

.fake-popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.fake-popup-card {
  background: var(--card-bg); border-radius: 12px; padding: 32px 36px 24px;
  max-width: 480px; width: 90%; box-shadow: 0 16px 48px rgba(0,0,0,0.2); text-align: center;
}
.fake-popup-message { font-size: clamp(1.2rem, 2.8vh, 1.6rem); color: var(--text); line-height: 1.5; margin-bottom: 20px; }
.fake-popup-ok {
  background: var(--blue) !important; color: white !important; border: none !important;
  padding: 0.7rem 2rem !important; font-size: clamp(1rem, 2.2vh, 1.4rem) !important;
  border-radius: 8px !important; cursor: pointer !important; font-weight: 600 !important;
  min-width: 100px !important; margin: 0 !important;
}

.apm-feedback-popup {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 10000; pointer-events: none;
}
.apm-feedback-card {
  padding: clamp(18px, 5vh, 64px) clamp(24px, 8vw, 128px); border-radius: 20px;
  font-size: clamp(2.5rem, 9vh, 5rem); font-weight: bold;
  text-align: center; animation: apmFeedbackFade 0.5s ease forwards;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2); white-space: nowrap;
}
.apm-feedback-card.correct  { background: var(--green); color: white; }
.apm-feedback-card.incorrect { background: var(--red); color: white; }

@keyframes apmFeedbackFade {
  0%   { opacity: 0; transform: scale(0.9); }
  15%  { opacity: 1; transform: scale(1); }
  85%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); visibility: hidden; }
}

.fixation { font-size: clamp(10rem, 35vh, 18rem) !important; font-weight: 600; text-align: center; margin: 20px 0; }
.letters-display { font-size: clamp(6rem, 20vh, 12rem) !important; font-weight: 600; letter-spacing: 0.2em; color: var(--text); text-align: center; }
.digit-display   { font-size: clamp(7rem, 22vh, 14rem) !important; font-weight: 700; color: var(--text); text-align: center; line-height: 1.05; }
.rappel-container { font-size: clamp(6rem, 20vh, 12rem) !important; font-weight: bold; color: var(--blue); margin: clamp(10px, 2vh, 40px) 0; text-align: center; }

.feedback-correct, .feedback-incorrect {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  padding: clamp(18px, 5vh, 64px) clamp(24px, 8vw, 128px); border-radius: 20px;
  font-size: clamp(2.5rem, 9vh, 5rem); font-weight: bold;
  text-align: center; animation: lcsFeedbackFade 0.5s ease forwards;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2); z-index: 10001; white-space: nowrap;
}
.feedback-correct  { background: var(--green); color: white; }
.feedback-incorrect { background: var(--red); color: white; }

@keyframes lcsFeedbackFade {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  85%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); visibility: hidden; }
}

.instruction-page {
  margin: 0 auto; padding: 20px; text-align: center;
  height: 100%; display: flex; flex-direction: column; position: relative;
  justify-content: center;
}

.instruction-title {
  position: fixed; top: clamp(40px, 8vh, 80px); left: 50%; transform: translateX(-50%);
  font-size: clamp(2rem, 5vh, 2.9rem); font-weight: 700; color: var(--text);
  padding-bottom: 8px; border-bottom: 4px solid var(--blue);
  display: inline-block; text-align: center; background: transparent;
  z-index: 100; white-space: nowrap;
}

.instruction-content {
  font-size: clamp(1.5rem, 3.6vh, 2.2rem); line-height: 1.4; color: var(--text);
  margin-top: clamp(50px, 8vh, 90px); flex: 1; display: flex; flex-direction: column; justify-content: center;
}
.instruction-content p { margin: clamp(0.3rem, 1vh, 0.8rem) 0; }
.instruction-content strong { font-weight: 700; color: var(--blue); }

.instruction-visual { width: 100%; margin-top: 16px; display: flex; justify-content: center; align-items: center; }

.fixed-hint {
  position: fixed; bottom: clamp(8px, 5vh, 45px); left: 50%; transform: translateX(-50%);
  text-align: center; font-size: clamp(0.9rem, 2vh, 1.2rem); font-weight: 600; color: var(--text);
  background: rgba(0,0,0,0.1); padding: 6px 16px; z-index: 1000;
  pointer-events: none; border-radius: 50px; white-space: nowrap;
  backdrop-filter: blur(5px);
}

.recall-input-container { margin: 30px auto; text-align: center; }

.recall-single-input {
  width: 800px; padding: 1rem 1.2rem;
  font-size: clamp(1.5rem, 3.5vh, 2.2rem) !important; font-family: monospace; text-align: center;
  letter-spacing: 10px; background: var(--bg-input);
  border: 3px solid var(--border); border-radius: 20px;
  color: var(--text); font-weight: 600; transition: all 0.2s ease;
}
.recall-single-input:focus {
  border-color: var(--blue); outline: none; background: white;
  box-shadow: 0 0 0 4px rgba(79,70,229,0.2);
}

.recall-hint { font-size: clamp(0.9rem, 2vh, 1.2rem); color: var(--text-light); margin-top: 20px; line-height: 1.6; }
.recall-hint .key {
  display: inline-block; padding: 4px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 8px;
  font-family: monospace; font-weight: 600; margin: 0 4px; font-size: clamp(0.8rem, 1.8vh, 1rem);
}

.lcs-keyboard-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.lcs-keyboard-simple { transform: scale(0.92); transform-origin: top center; margin-top: 6px; }
.lcs-kb-row { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }

.lcs-key {
  position: relative; min-width: clamp(40px, 4.5vw, 56px); height: clamp(38px, 5vh, 52px); padding: 0 8px;
  border-radius: 10px; background: #f5f5f7; border: 2px solid var(--border);
  box-shadow: 0 3px 0 rgba(15,23,42,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: clamp(0.9rem, 2vh, 1.2rem); font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.lcs-key span { position: relative; z-index: 2; }
.lcs-key-active { transform: translateY(-1px); box-shadow: 0 5px 0 rgba(15,23,42,0.18); }
.lcs-key-wide  { min-width: 100px; }
.lcs-key-space { min-width: 220px; }

.lcs-purple { background: #5b4dd7; color: #fff; border-color: #4b3fc0; }
.lcs-blue   { background: #3b82f6; color: #fff; border-color: #2563eb; }
.lcs-gold   { background: #facc15; color: #3b2f00; border-color: #eab308; }
.lcs-green  { background: #10b981; color: #fff; border-color: #059669; }
.lcs-red    { background: #ef4444; color: #fff; border-color: #dc2626; }

.lcs-hand {
  position: absolute; top: 35px; left: 50%; transform: translateX(-50%);
  font-size: 20px; opacity: 0; pointer-events: none; z-index: 999;
}
.lcs-hand-active { opacity: 1; animation: lcsHandPulse 1s ease-in-out infinite; }
@keyframes lcsHandPulse {
  0%, 100% { transform: translateX(-50%) translateY(-2px); }
  50%       { transform: translateX(-50%) translateY(2px); }
}

.lcs-keyboard-mini { transform: scale(0.88); transform-origin: top center; }

.lcs-example-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }

.lcs-example-card {
  padding: 14px 18px; border-radius: 12px;
  background: rgba(255,255,255,0.9); border: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(15,23,42,0.10);
  display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 520px;
}

.lcs-example-title  { font-size: clamp(1.2rem, 2.5vh, 1.6rem); font-weight: 600; color: var(--text-light); text-align: center; }
.lcs-example-arrow  { font-size: clamp(1.4rem, 3vh, 1.8rem); color: var(--text-light); }
.lcs-example-answer { font-size: clamp(1.2rem, 2.5vh, 1.6rem); font-weight: 600; color: var(--text); text-align: center; }

.lcs-decision-key {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; height: 48px; padding: 0 14px; margin-left: 6px;
  border-radius: 8px; background: var(--blue); color: #fff;
  font-weight: 800; box-shadow: 0 4px 0 var(--blue-dark);
}

.lcs-recall-big    { font-size: clamp(2rem, 5.5vh, 3rem); font-weight: 700; color: var(--text); }
.lcs-recall-seq-big { font-size: clamp(1.6rem, 4.5vh, 2.4rem); font-weight: 700; color: var(--text); letter-spacing: 0.12em; }

.lcs-letters-display {
  font-size: clamp(2.5rem, 8vh, 4rem) !important;
  letter-spacing: 0.1em;
}

.apm-global-timer {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: min(920px, calc(100% - 120px)); z-index: 1200; pointer-events: none;
}
.apm-global-timer-track {
  width: 100%; height: clamp(8px, 2vh, 16px); border-radius: 999px;
  background: rgba(255,255,255,0.62); border: 1px solid rgba(180,192,221,0.85);
  overflow: hidden; box-shadow: inset 0 2px 4px rgba(15,23,42,0.08), 0 8px 20px rgba(15,23,42,0.08);
}
.apm-global-timer-fill {
  height: 100%; width: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
  transition: width 0.2s linear, background 0.2s ease;
}
.apm-global-timer-fill.warning { background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%); }
.apm-global-timer-fill.danger  { background: linear-gradient(90deg, #ef4444 0%, #f87171 100%); }
.timer-bar-container { display: none !important; }

.results-page {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden; border-radius: 12px;
}

.results-title {
  text-align: center;
  font-size: clamp(1.8rem, 3.8vh, 2.4rem) !important;
  font-weight: 700; color: #1f2937;
  padding: clamp(4px, 0.8vh, 10px) 20px;
  margin: 0; border-bottom: 3px solid var(--blue); flex-shrink: 0;
}

.results-scrollable {
  flex: 1; min-height: 0; overflow: hidden;
  padding: clamp(4px, 0.7vh, 10px) 14px;
  display: flex; align-items: stretch;
}

.results-section {
  width: 100%; display: flex; flex-direction: column;
  gap: clamp(4px, 0.7vh, 8px);
}

.results-section-title { display: none; }

.result-card {
  flex: 1; min-height: 0;
  background: white; border-radius: 10px;
  padding: clamp(6px, 0.8vh, 10px) clamp(10px, 1.2vw, 16px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}

.result-card-apm    { border-left: 4px solid #4f46e5; }
.result-card-lcs    { border-left: 4px solid #8b5cf6; }
.result-card-global { border-left: 4px solid #10b981; text-align: center; }

.result-card-title {
  font-size: clamp(1.2rem, 2.4vh, 1.6rem); font-weight: 700; margin: 0 0 2px 0; color: #1f2937;
}
.result-card-subtitle { font-size: clamp(1rem, 2vh, 1.3rem); color: #6b7280; margin: 0 0 4px 0; }

.result-score { text-align: center; margin: 3px 0; }
.result-score-value    { font-size: clamp(1.8rem, 4.2vh, 2.6rem); font-weight: 800; color: #4f46e5; }
.result-score-separator { font-size: clamp(1.2rem, 2.6vh, 1.8rem); font-weight: 600; color: #9ca3af; margin: 0 3px; }
.result-score-max      { font-size: clamp(1.2rem, 2.6vh, 1.8rem); font-weight: 600; color: #9ca3af; }

.result-percent { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.result-percent-bar { flex: 1; height: 8px; background: #e5e7eb; border-radius: 10px; overflow: hidden; }
.result-percent-fill { height: 100%; border-radius: 10px; }
.result-percent-text { font-size: clamp(0.8rem, 1.6vh, 1rem); font-weight: 700; min-width: 40px; color: #4f46e5; }

.result-subcard {
  background: #f9fafb; border-radius: 7px;
  padding: clamp(4px, 0.6vh, 7px) 10px; margin-bottom: 3px;
}
.result-subcard:last-child { margin-bottom: 0; }
.result-subcard-title { font-size: clamp(1rem, 2vh, 1.3rem); font-weight: 600; color: #4b5563; margin-bottom: 2px; }
.result-score-small   { font-size: clamp(1.1rem, 2.2vh, 1.5rem); font-weight: 700; color: #1f2937; margin-bottom: 2px; }
.result-percent-small { font-size: 0.95rem; font-weight: 600; color: #6b7280; margin-left: 5px; }
.result-percent-bar-small { height: 5px; background: #e5e7eb; border-radius: 10px; overflow: hidden; }
.result-percent-fill-small { height: 100%; border-radius: 10px; }

.result-score-global { margin: 3px 0; }
.result-score-global-value    { font-size: clamp(2rem, 5vh, 3rem); font-weight: 800; color: #1f2937; }
.result-score-global-separator { font-size: clamp(1.3rem, 3vh, 1.9rem); font-weight: 600; color: #9ca3af; margin: 0 4px; }
.result-score-global-max      { font-size: clamp(1.3rem, 3vh, 1.9rem); font-weight: 600; color: #9ca3af; }

.result-percent-global { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.result-percent-bar-global { flex: 1; height: 10px; background: #e5e7eb; border-radius: 10px; overflow: hidden; }
.result-percent-fill-global { height: 100%; border-radius: 10px; }
.result-percent-global-text { font-size: clamp(1.1rem, 2.2vh, 1.5rem); font-weight: 700; min-width: 44px; color: #1f2937; }

.results-footer {
  background: white; padding: clamp(6px, 0.8vh, 12px) 16px;
  text-align: center; border-top: 1px solid #e5e7eb; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
}

.results-btn {
  padding: clamp(8px, 1.2vh, 14px) clamp(16px, 2vw, 26px) !important;
  font-size: clamp(1rem, 2vh, 1.3rem) !important;
  font-weight: 600 !important; border: none !important; border-radius: 8px !important;
  cursor: pointer !important; min-width: unset !important; margin: 0 !important;
}
.results-btn-download { background: var(--blue) !important; color: white !important; }
.results-btn-download:hover { background: var(--blue-dark) !important; }
.results-btn-finish { background: var(--green) !important; color: white !important; }
.results-btn-finish:hover { background: var(--green-dark) !important; }
.results-thanks { font-size: clamp(0.95rem, 1.8vh, 1.2rem); color: #6b7280; margin: 0; width: 100%; text-align: center; }

.keyboard-diagram { display: flex; gap: 60px; align-items: center; justify-content: center; margin: 20px 0; }
.key-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.key-visual {
  width: 80px; height: 80px; border: 3px solid var(--border-strong); border-radius: 10px;
  background: var(--bg-input); display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 800; color: var(--text); box-shadow: 0 4px 0 var(--border-strong);
}
.key-label { font-size: clamp(0.9rem, 2vh, 1.1rem); color: var(--text-light); text-align: center; line-height: 1.3; max-width: 120px; }

@media (max-width: 1200px) {
  .lcs-keyboard-simple { transform: scale(0.85); }
  .lcs-key { min-width: 44px; height: 40px; font-size: 0.9rem; }
  .lcs-key-wide { min-width: 90px; }
  .lcs-key-space { min-width: 190px; }
}

@media (max-width: 768px) {
  .lcs-keyboard-simple, .lcs-keyboard-mini { transform: scale(0.72); }
  .lcs-kb-row { gap: 5px; }
  .lcs-key { min-width: 38px; height: 36px; font-size: 0.8rem; border-radius: 8px; }
  .lcs-key-wide { min-width: 75px; }
  .lcs-key-space { min-width: 150px; }
  .apm-global-timer { width: calc(100% - 40px); top: 8px; }
  .apm-global-timer-track { height: 10px; }
}

@media (max-height: 720px) {
  .instruction-title { top: 40px !important; font-size: 1.6rem !important; }
  .instruction-content { margin-top: 50px; font-size: 1rem; }
  .instruction-content p { margin: 0.2rem 0; }
  .fixed-hint { bottom: 6px; font-size: 0.8rem; padding: 4px 12px; }
  .lcs-keyboard-simple { transform: scale(0.78); }
  .lcs-example-card { padding: 6px 10px; gap: 4px; }
  .lcs-example-title { font-size: 0.9rem; }
  .lcs-example-answer { font-size: 0.9rem; }
  .lcs-recall-big { font-size: 1.4rem; }
  .recall-hint { font-size: 0.8rem; margin-top: 8px; }
}

@media (max-height: 560px) {
  .instruction-title { top: 30px !important; font-size: 1.3rem !important; }
  .instruction-content { margin-top: 40px; font-size: 0.9rem; }
  .lcs-keyboard-simple { transform: scale(0.62); }
  .fixed-hint { display: none; }
}

.lcs-hand-img {
  max-width: 36px;
  max-height: 36px;
  width: auto;
  height: auto;
}
.lcs-hand-flip {
  transform: scaleX(-1);
}