#keyboard-container {
  margin-top: 16px;
  position: relative;
  overflow: visible;
}

.kb-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: #e2e8f0;
  border-radius: var(--radius);
  user-select: none;
}

.kb-row {
  display: flex;
  gap: 4px;
}

.kb-key {
  min-width: 40px;
  height: 40px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  cursor: default;
  transition: background 0.1s, transform 0.05s;
  box-shadow: 0 2px 0 #94a3b8;
}

.kb-key[data-key=" "] { min-width: 200px; }

/* Finger colors */
.kb-key[data-finger="left-pinky"]  { border-bottom: 3px solid #f43f5e; }
.kb-key[data-finger="left-ring"]   { border-bottom: 3px solid #f97316; }
.kb-key[data-finger="left-middle"] { border-bottom: 3px solid #eab308; }
.kb-key[data-finger="left-index"]  { border-bottom: 3px solid #22c55e; }
.kb-key[data-finger="right-index"] { border-bottom: 3px solid #3b82f6; }
.kb-key[data-finger="right-middle"]{ border-bottom: 3px solid #a855f7; }
.kb-key[data-finger="right-ring"]  { border-bottom: 3px solid #ec4899; }
.kb-key[data-finger="right-pinky"] { border-bottom: 3px solid #06b6d4; }
.kb-key[data-finger="thumb"]       { border-bottom: 3px solid #64748b; }

.kb-key.active {
  background: #fef3c7;
  border-color: #f59e0b;
  transform: translateY(1px);
  box-shadow: 0 1px 0 #f59e0b;
}

.kb-key.flash-correct {
  background: #dcfce7;
  border-color: #22c55e;
}

.kb-key.flash-error {
  background: #fee2e2;
  border-color: #f87171;
}

/* Modifier keys */
.kb-modifier {
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 500;
}

/* Width variants for modifier keys */
.w-backspace  { min-width: 80px; }
.w-tab        { min-width: 60px; }
.w-backslash  { min-width: 55px; }
.w-caps       { min-width: 72px; }
.w-enter      { min-width: 88px; }
.w-shift-l    { min-width: 90px; }
.w-shift-r    { min-width: 110px; }

/* Hand overlay — fingertips reach up to home row, palm extends below */
.hands-overlay {
  position: absolute;
  bottom: -265px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
  z-index: 2;
}

.hand-img {
  width: 500px;
  opacity: 0.45;
  transition: opacity 0.12s ease;
}

.hand-img.active {
  opacity: 1;
}

.hand-img.hand-left {
  transform: translateX(40px);
}

.hand-img.hand-right {
  transform: translateX(-120px);
}
