/* Morse Practice · Main stylesheet (LIGHT theme) */

:root {
  --bg: #f7f8fc;
  --bg-2: #eef0f5;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --border: #d8dce5;
  --border-strong: #c0c5d1;
  --text: #1a1f36;
  --text-dim: #5a607a;
  --text-mute: #8b91a8;
  --accent: #6c5ce7;
  --accent-2: #0984e3;
  --accent-soft: #ece9ff;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --green-bg: #ecfdf5;
  --red-bg: #fef2f2;
  --yellow-bg: #fffbeb;
  --green-border: #a7f3d0;
  --red-border: #fecaca;
  --yellow-border: #fde68a;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.10);
}

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

/* Global "hidden" class — any element with this class is display:none.
 * Specific overrides (e.g. .prompt-morse.hidden) come later in the file. */
.hidden { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(at 20% 0%, rgba(108, 92, 231, 0.06) 0%, transparent 50%),
    radial-gradient(at 80% 100%, rgba(9, 132, 227, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
}
.lang-switch {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  font-family: inherit;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.lang-switch:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.app-header h1 {
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.app-header .tagline {
  color: var(--text-dim);
  font-size: 14px;
}

/* Direction bar */
.direction-bar {
  display: flex;
  gap: 8px;
  background: var(--surface);
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.direction-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.direction-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}
.direction-btn.active {
  background: linear-gradient(135deg, #ff7c5c 0%, #ff4ecd 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 124, 92, 0.3);
}

/* Mode bar */
.mode-bar {
  display: flex;
  gap: 8px;
  background: var(--surface);
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.mode-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.mode-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}
.mode-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.25);
}

/* Prompt area */
.prompt-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.prompt-label {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 16px;
}
.prompt-morse {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Consolas', monospace;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0;
  word-break: break-all;
  margin-bottom: 16px;
  padding: 20px 16px;
  background: var(--bg-2);
  border-radius: 12px;
  border: 1px solid var(--border);
  line-height: 1.8;
}
.prompt-morse.hidden { display: none; }
.prompt-morse .dit {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.1em;
  margin: 0 1px;
}
.prompt-morse .dah {
  color: var(--accent-2);
  font-weight: 800;
  font-size: 1.05em;
  margin: 0 1px;
}
.prompt-morse .letter {
  display: inline-block;
  padding: 2px 4px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 2px 0;
  white-space: nowrap;
}
.prompt-morse .letter-gap {
  display: inline-block;
  width: 10px;
  color: var(--text-mute);
  font-size: 0.5em;
  vertical-align: middle;
}
.prompt-morse .word-gap {
  display: inline-block;
  color: var(--text-mute);
  font-size: 0.8em;
  margin: 0 4px;
  font-weight: 600;
}
.morse-reveal {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Consolas', monospace;
  font-size: 18px;
  margin-top: 12px;
  letter-spacing: 0;
  padding: 12px 16px;
  background: var(--bg-2);
  border-radius: 8px;
  border: 1px solid var(--border);
  line-height: 1.8;
}
.morse-reveal .dit { color: var(--accent); font-weight: 700; margin: 0 1px; }
.morse-reveal .dah { color: var(--accent-2); font-weight: 700; margin: 0 1px; }
.morse-reveal .letter {
  display: inline-block;
  padding: 1px 4px;
  background: var(--surface);
  border-radius: 4px;
  border: 1px solid var(--border);
  margin: 1px 0;
  white-space: nowrap;
}
.morse-reveal-label {
  font-size: 12px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
  font-family: -apple-system, sans-serif;
}
.prompt-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  flex-wrap: wrap;
}
.prompt-hint.hidden-by-toggle { display: none; }
.hint-text {
  color: var(--text-mute);
}
.hint-dim { font-size: 12px; }
.prompt-item {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
  padding: 2px 8px;
  background: var(--surface-2);
  border-radius: 4px;
  border: 1px solid var(--border);
  letter-spacing: 1px;
}
.prompt-item.hidden-by-toggle {
  display: inline-block;
  /* Mask the answer with a placeholder so the row layout is stable */
  visibility: hidden;
  position: relative;
}
.prompt-item.hidden-by-toggle::after {
  content: '?';
  visibility: visible;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-mute);
}

/* ─── Toggle hint button ─── */
.prompt-hint-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.toggle-hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.toggle-hint-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}
.toggle-hint-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.toggle-hint-btn .toggle-icon {
  font-size: 14px;
  line-height: 1;
}
.toggle-hint-btn .toggle-label {
  line-height: 1;
}

/* Input area */
.input-area {
  margin-bottom: 20px;
}
.answer-input {
  width: 100%;
  padding: 18px 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 2px;
  text-align: center;
  font-family: 'SF Mono', Monaco, monospace;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.answer-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.answer-input::placeholder {
  color: var(--text-mute);
  font-weight: 400;
  letter-spacing: 0;
}

/* Feedback */
.feedback {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
.feedback.hidden { display: none; }
.feedback.correct {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: #065f46;
}
.feedback.wrong {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: #991b1b;
}
.feedback.partial {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  color: #92400e;
}
.feedback.empty {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  color: var(--text-dim);
  font-weight: 500;
}
.feedback .expected, .feedback .actual {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 400;
}
.feedback code {
  font-family: 'SF Mono', Monaco, monospace;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
}
.feedback .char-diff {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.feedback .char {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 32px;
  font-family: 'SF Mono', Monaco, monospace;
  font-weight: 700;
  border-radius: 4px;
}
.feedback .char.ok {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.feedback .char.bad {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
  text-decoration: line-through;
}

/* Action bar */
.action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.secondary-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.secondary-btn {
  padding: 10px 20px;
  background: transparent;
  color: var(--text-dim);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.secondary-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
}
.action-btn {
  padding: 14px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}
.action-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.action-btn:active { transform: translateY(0); }
.action-btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: transparent;
  color: white;
}
.action-btn.primary:hover {
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.35);
}

/* Result panel / shortcuts */
.result-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.result-panel h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.result-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.result-panel-header h3 {
  margin-bottom: 0;
}
.reset-stats-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-mute);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 0.3px;
}
.reset-stats-btn:hover {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: #991b1b;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}
.stat-item {
  padding: 14px 8px;
  background: var(--bg-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  font-family: 'SF Mono', Monaco, monospace;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-lbl {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Shortcuts */
.shortcuts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.shortcuts li {
  font-size: 14px;
  color: var(--text-dim);
}
kbd {
  display: inline-block;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: var(--text);
  margin-right: 4px;
}

/* Responsive */
@media (max-width: 640px) {
  .app { padding: 20px 16px 60px; }
  .app-header h1 { font-size: 22px; }
  .prompt-morse { font-size: 24px; padding: 16px 12px; }
  .answer-input { font-size: 18px; }
  .action-bar {
    grid-template-columns: 1fr 1fr;
  }
  .shortcuts { grid-template-columns: 1fr; }
  .stats-grid { gap: 8px; }
  .stat-num { font-size: 22px; }
}

/* ─── Modal ─── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open {
  display: flex;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-mute);
  font-size: 28px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}
.modal-hint {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 16px;
}

/* Chart grid */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.chart-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.chart-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.chart-card.playing {
  border-color: var(--accent-2);
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(9, 132, 227, 0.1) 100%);
  transform: scale(0.95);
}
.chart-char {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  font-family: 'SF Mono', Monaco, monospace;
}
.chart-code {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0;
  font-weight: 600;
}

/* ─── Generic page container ─── */
.page {
  margin-top: 16px;
}
.page.hidden { display: none; }
.page h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.page-hint {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.page-hint kbd {
  font-size: 11px;
}

/* ─── Translator page ─── */
.translator-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.translator-side {
  display: flex;
  flex-direction: column;
}
.translator-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  font-weight: 700;
}
.translator-textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 18px;
  font-family: 'SF Mono', Monaco, monospace;
  letter-spacing: 1px;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.translator-textarea.morse {
  color: var(--accent);
  font-weight: 600;
}
.translator-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.translator-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  justify-content: center;
}
.translator-legend {
  margin-top: 8px;
}
.translator-legend ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.translator-legend li {
  font-size: 13px;
  color: var(--text-dim);
}
.translator-legend code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
}

@media (max-width: 640px) {
  .translator-row { grid-template-columns: 1fr; }
}

/* ─── Straight-key page ─── */
.sub-mode-bar {
  display: flex;
  gap: 8px;
  background: var(--surface);
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.sk-mode-btn, .sk-submode-btn {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.sk-mode-btn:hover, .sk-submode-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}
.sk-mode-btn.active, .sk-submode-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.25);
}

.sk-practice-only {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sk-practice-only.hidden { display: none; }
.sk-target-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}
.sk-target {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 0;
  flex: 1;
}
.sk-answer-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-left: 8px;
}
.sk-target-morse {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 18px;
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 1.5px;
  padding: 4px 0;
  flex: 1;
  min-width: 0;
}
.sk-target-morse.hidden-by-toggle {
  display: none;
}
.sk-target-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.sk-toggle-target {
  flex-shrink: 0;
}
.sk-submode {
  margin-bottom: 0;
}

.sk-display {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sk-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sk-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  min-width: 48px;
}
.sk-recognized, .sk-current, .sk-possible {
  flex: 1;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 20px;
  color: var(--text);
  letter-spacing: 1px;
  font-weight: 600;
  min-height: 28px;
  word-break: break-all;
}
.sk-recognized { color: var(--accent); }
.sk-current { color: var(--accent-2); }
.sk-possible { color: var(--text-mute); font-size: 16px; font-weight: 500; }
.sk-recognized .placeholder, .sk-current .placeholder, .sk-possible .placeholder {
  color: var(--text-mute);
  font-weight: 400;
  font-style: italic;
}
.sk-recognized .sk-letter {
  display: inline-block;
  padding: 2px 6px;
  background: var(--accent-soft);
  border-radius: 4px;
  color: var(--accent);
  margin-right: 2px;
}

.sk-progress-wrap {
  margin-bottom: 16px;
  text-align: center;
}
.sk-progress {
  width: 100%;
  height: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  margin-bottom: 4px;
}
.sk-progress::before {
  content: '';
  display: block;
  height: 100%;
  width: 100%;
  background: var(--bg-2);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.05s linear, background 0.15s;
}
.sk-progress.active::before {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
}
.sk-progress-labels {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.5px;
}

.sk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}
.sk-actions-free {
  grid-template-columns: 2fr 1fr 1fr;  /* hold dominant in free mode */
}
.sk-actions.hidden { display: none; }

.sk-nav {
  grid-template-columns: 1fr 1fr 1fr;  /* 3 buttons, equal width */
  margin-top: 8px;
  margin-bottom: 16px;
}

.sk-hold-btn {
  padding: 18px 20px;
  font-size: 16px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.sk-hold-btn.active {
  background: linear-gradient(135deg, var(--red) 0%, #dc2626 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
}
.sk-submit-btn {
  padding: 18px 20px;
  font-size: 16px;
}
.sk-submit-btn:disabled {
  cursor: not-allowed;
  background: var(--surface);
  color: var(--text-dim);
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

@media (max-width: 640px) {
  .sk-actions { grid-template-columns: 1fr 1fr; }
  .sk-actions-free { grid-template-columns: 1fr 1fr 1fr; }
}

.sk-feedback {
  padding: 16px 20px;
  border-radius: 12px;
  margin-top: 12px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
.sk-feedback.hidden { display: none; }
.sk-feedback.correct {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: #065f46;
}
.sk-feedback.wrong {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: #991b1b;
}
.sk-feedback.partial {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  color: #92400e;
}
