/* On-screen keyboard — big friendly keys with a 3D press. */

mk-keyboard {
  display: block;
  margin: 0 auto;
  max-width: 900px;
  padding: 0.5rem;
  touch-action: manipulation;
  width: 100%;
}

.mk-keyboard__row {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.mk-keyboard__key {
  align-items: center;
  background: var(--mk-key);
  border: 0;
  border-bottom: 5px solid var(--mk-key-edge);
  border-radius: 12px;
  color: #333;
  cursor: pointer;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  font-size: 1.4rem;
  font-weight: 700;
  max-width: 76px;
  min-height: 58px;
  padding: 0.3rem 0;
  transition: transform 0.06s ease, background-color 0.15s ease;
}

.mk-keyboard__key--wide {
  max-width: 420px;
}

.mk-keyboard__key.is-pressed {
  border-bottom-width: 2px;
  transform: translateY(3px) scale(0.97);
}

.mk-keyboard__key.is-lit {
  background: var(--mk-lit);
  box-shadow: 0 0 18px var(--mk-lit);
}

.mk-keyboard__key.is-target {
  animation: mk-target-pulse 1.1s ease-in-out infinite;
  background: var(--mk-lit);
}

.mk-keyboard__key.is-hit {
  background: #7ed957;
  box-shadow: 0 0 18px #7ed957;
}

.mk-keyboard__key.is-miss {
  animation: mk-shake 0.3s ease;
  background: #ff8a8a;
}

@keyframes mk-target-pulse {
  0%, 100% { box-shadow: 0 0 6px var(--mk-lit); }
  50% { box-shadow: 0 0 22px var(--mk-lit); }
}

@keyframes mk-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
  .mk-keyboard__key.is-target,
  .mk-keyboard__key.is-miss {
    animation: none;
  }
}

.mk-keyboard__emoji {
  font-size: 0.85rem;
  line-height: 1;
}

.mk-keyboard__label {
  line-height: 1.1;
}

@media (max-width: 700px) {
  .mk-keyboard__key {
    font-size: 1.05rem;
    min-height: 44px;
  }
}
