* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Bricolage Grotesque', sans-serif; }

.app-root {
  transition: background .3s;
  padding: 0 16px 40px;
  max-width: 1100px;
  margin: 0 auto;
  cursor: default;
}

.hidden-input {
  position: fixed; opacity: 0; pointer-events: none;
  width: 1px; height: 1px; top: 0; left: 0;
}

/* Header */
.hdr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 4px; border-bottom: 1px solid; flex-wrap: wrap; gap: 12px;
}
.logo { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 6px; }
.logo-ico { font-size: 1.4rem; }
.logo-10 { color: #f59e0b; }
.tagline { font-size: 0.8rem; margin-top: 2px; }
.hdr-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 0.75rem; background: rgba(245,158,11,0.12);
  padding: 6px 10px; border-radius: 20px; white-space: nowrap;
}
.badge b { color: #f59e0b; }
.icon-btn {
  background: none; border: none; font-size: 1.1rem; cursor: pointer;
  padding: 4px 6px; border-radius: 8px; transition: transform .15s;
}
.icon-btn:hover { transform: scale(1.15); }

/* Lesson strip */
.lesson-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 16px 2px;
  scrollbar-width: thin;
}
.lesson-tile {
  flex: 0 0 auto; width: 130px; text-align: left; border: 2px solid;
  border-radius: 14px; padding: 10px 12px; cursor: pointer; position: relative;
  transition: transform .15s, border-color .2s; font-family: inherit;
}
.lesson-tile:not(:disabled):hover { transform: translateY(-3px); }
.lt-active { transform: translateY(-3px); }
.lt-emoji { font-size: 1.3rem; }
.lt-stage { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; font-weight: 700; }
.lt-name { font-size: 0.82rem; font-weight: 700; margin-top: 2px; line-height: 1.15; }
.lt-check {
  position: absolute; top: 8px; right: 10px; color: #22c55e; font-weight: 800; font-size: 1rem;
}

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 12px; }
.stat-card {
  background: rgba(148,163,184,0.08); border-radius: 14px; padding: 12px;
  text-align: center;
}
.stat-val { font-family: 'JetBrains Mono', monospace; font-size: 1.9rem; font-weight: 700; line-height: 1; }
.stat-lbl { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 6px; opacity: 0.7; }
.mascot-card { display: flex; flex-direction: column; justify-content: center; }
.mascot-e { font-size: 1.7rem; }

/* Progress */
.prog-outer { height: 6px; border-radius: 3px; overflow: hidden; margin-bottom: 16px; }
.prog-inner { height: 100%; background: linear-gradient(90deg,#f59e0b,#22c55e); transition: width .2s; }

/* Text panel */
.text-wrap {
  border: 1px solid; border-radius: 18px; padding: 28px 24px; margin-bottom: 14px;
  min-height: 120px; box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.text-panel {
  font-family: 'JetBrains Mono', monospace; font-size: 1.5rem; line-height: 2;
  letter-spacing: 0.03em; word-break: break-word;
}
.tc { transition: color .1s; opacity: 0.45; }
.tc-ok { color: #22c55e; opacity: 1; }
.tc-bad { color: #ef4444; opacity: 1; background: rgba(239,68,68,0.18); border-radius: 3px; }
.tc-cur {
  opacity: 1; background: #f59e0b; color: #fff; border-radius: 3px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { background: rgba(245,158,11,0.4); } }
.hint { font-family: 'Bricolage Grotesque'; font-size: 0.85rem; margin-top: 16px; }

/* KB toggle */
.kb-toggle-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.toggle-lbl { font-size: 0.8rem; display: flex; align-items: center; gap: 6px; cursor: pointer; opacity: 0.8; }
.redo-btn {
  background: rgba(245,158,11,0.12); color: #f59e0b; border: none;
  padding: 7px 14px; border-radius: 20px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.8rem;
}
.redo-btn:hover { background: rgba(245,158,11,0.25); }

/* Keyboard */
.vk-wrap { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.vk-row { display: flex; gap: 6px; justify-content: center; }
.vk-key {
  height: 44px; border-radius: 8px; border: 1px solid rgba(148,163,184,0.2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 0.85rem;
  position: relative; transition: all .12s; padding: 0 2px;
}
.vk-next { animation: pulse .8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: translateY(-2px) scale(1.04); } }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-bottom: 20px; }
.leg-item { display: flex; align-items: center; gap: 5px; }
.leg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Footer */
.ftr { text-align: center; font-size: 0.75rem; padding: 14px 0; }
.ftr a { text-decoration: none; font-weight: 700; }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
  animation: fade .25s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  border-radius: 22px; padding: 32px 28px; max-width: 400px; width: 100%;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: pop .35s cubic-bezier(.2,1.3,.4,1);
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.modal-emoji { font-size: 3rem; }
.modal-title { font-size: 1.6rem; font-weight: 800; margin: 8px 0; letter-spacing: -0.02em; }
.modal-praise { font-size: 0.9rem; margin-bottom: 18px; }
.modal-stats { display: flex; justify-content: space-around; margin-bottom: 18px; }
.ms-v { font-family: 'JetBrains Mono', monospace; font-size: 1.7rem; font-weight: 700; }
.ms-l { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.6; }
.modal-note { font-size: 0.8rem; color: #f59e0b; margin-bottom: 14px; }
.modal-btns { display: flex; gap: 10px; justify-content: center; }
.mbtn {
  padding: 11px 22px; border-radius: 24px; border: none; font-weight: 700;
  cursor: pointer; font-family: inherit; font-size: 0.9rem; transition: transform .15s;
}
.mbtn:hover { transform: translateY(-2px); }
.mbtn-primary { background: #f59e0b; color: #fff; }
.mbtn-ghost { background: rgba(148,163,184,0.18); color: inherit; }
.modal-next { margin-top: 12px; width: 100%; }

/* Responsive */
@media (max-width: 640px) {
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .text-panel { font-size: 1.1rem; line-height: 1.9; }
  .vk-key { height: 34px; font-size: 0.65rem; }
  .vk-row { gap: 3px; }
  .vk-wrap { gap: 3px; }
  .tagline { display: none; }
  .hdr-right .badge { font-size: 0.65rem; padding: 4px 8px; }
  .stat-val { font-size: 1.4rem; }
}
</style>