/* Extra styles for the practice page (design tokens copied from the mockup) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

* { -webkit-font-smoothing: antialiased; }

body { margin: 0; }

.mono { font-family: "IBM Plex Mono", monospace; }

/* ---------- typing area ---------- */
#linesArea { max-height: 110px; overflow-y: auto; padding-right: 4px; width: 100%; }

.line-block { margin-bottom: 4px; width: 100%; }

.src-line, .type-line {
  white-space: pre;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  width: 100%;
  display: block;
}

.src-line { color: #475467; }
.src-line.done { color: #98A2B3; }
.src-line .sc.active { background: #FFF4E5; border-bottom: 2.5px solid #8B6A3B; color: #8B5A2B; }

.type-line { color: #1D2939; min-height: 1.7em; }
.type-line .tc { display: inline-block; }
.type-line .tc.pending { color: #D0D5DD; }
.type-line .tc.ok { color: #12B76A; background: #D9F0E0; border-radius: 4px; }
.type-line .tc.bad { color: #F04438; background: #FEE4E2; border-radius: 4px; }
.type-line .tc.cursor { position: relative; }
.type-line .tc.cursor::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: #8B6A3B;
  animation: blinkbar 1s steps(2, start) infinite;
}
@keyframes blinkbar { to { visibility: hidden; } }

/* ---------- 3D keyboard ---------- */
#kbCanvas { width: 100%; }
#kbCanvas canvas { border-radius: 12px; }

/* ---------- level modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 24, 40, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  background: #fff; border-radius: 18px; padding: 28px;
  width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
  font-family: Inter, system-ui, sans-serif;
}
.modal-card h2 { font-size: 22px; font-weight: 800; color: #101828; margin: 0; }
.modal-card p.sub { font-size: 14px; color: #475467; margin: 6px 0 20px; }
.level-list { display: flex; flex-direction: column; gap: 12px; }
.level-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid #E5E7EB; background: #fff; cursor: pointer;
  transition: all .15s ease;
}
.level-btn:hover { border-color: #1570FF; background: #EAF2FF; }
.level-btn.selected { border-color: #1570FF; background: #D6E7FF; }
.level-btn .lv-title { font-size: 15px; font-weight: 700; color: #101828; }
.level-btn .lv-desc { font-size: 12px; color: #475467; margin-top: 2px; }
.level-btn .lv-badge {
  font-size: 11px; font-weight: 600; color: #1570FF;
  background: #EAF2FF; border: 1px solid #D6E7FF;
  padding: 4px 8px; border-radius: 999px; white-space: nowrap;
}
.start-btn {
  margin-top: 22px; width: 100%; padding: 12px;
  background: #1570FF; color: #fff; font-size: 14px; font-weight: 700;
  border: 0; border-radius: 10px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(21,112,255,.35);
}
.start-btn:disabled { background: #D0D5DD; box-shadow: none; cursor: not-allowed; }