/* ==========================================================================
   TYPE & PLAY - INTERACTIVE KEYBOARD STYLING
   ========================================================================== */

.tp-keyboard-wrapper {
  width: 100%;
  max-width: 960px;
  margin: 1.5rem auto 0 auto;
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(0, 240, 255, 0.12);
  transition: all var(--transition-normal);
}

.tp-keyboard-wrapper.hidden {
  display: none !important;
}

/* Finger Guide Banner */
.tp-finger-guide-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
}

.tp-guide-indicator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.guide-dot {
  width: 10px;
  height: 10px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan);
  animation: dotBlink 1.5s infinite;
}

.tp-guide-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.legend-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #fff;
  opacity: 0.9;
}

/* Finger Color Codes */
.finger-lp { background: rgba(236, 72, 153, 0.2); border-color: rgba(236, 72, 153, 0.6); }
.finger-lr { background: rgba(168, 85, 247, 0.2); border-color: rgba(168, 85, 247, 0.6); }
.finger-lm { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.6); }
.finger-li { background: rgba(6, 182, 212, 0.2); border-color: rgba(6, 182, 212, 0.6); }
.finger-thumb { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.6); }
.finger-ri { background: rgba(6, 182, 212, 0.2); border-color: rgba(6, 182, 212, 0.6); }
.finger-rm { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.6); }
.finger-rr { background: rgba(168, 85, 247, 0.2); border-color: rgba(168, 85, 247, 0.6); }
.finger-rp { background: rgba(236, 72, 153, 0.2); border-color: rgba(236, 72, 153, 0.6); }

.legend-chip.finger-lp, .legend-chip.finger-rp { background: #ec4899; color: #fff; }
.legend-chip.finger-lr, .legend-chip.finger-rr { background: #a855f7; color: #fff; }
.legend-chip.finger-lm, .legend-chip.finger-rm { background: #3b82f6; color: #fff; }
.legend-chip.finger-li, .legend-chip.finger-ri { background: #06b6d4; color: #fff; }
.legend-chip.finger-thumb { background: #10b981; color: #000; }

.highlight-finger {
  font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
}

/* Keyboard Rows & Keys */
.tp-keyboard-board {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tp-keyboard-row {
  display: flex;
  gap: 7px;
  justify-content: center;
}

.tp-key {
  height: 48px;
  min-width: 44px;
  flex: 1;
  background: #141c2c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #070b13, 0 6px 12px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.08s ease;
  user-select: none;
  touch-action: manipulation;
}

.tp-key:hover {
  background: #1e2a42;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Key Width Modifiers */
.tp-key.width-medium { flex: 1.4; font-size: 0.8rem; }
.tp-key.width-wide { flex: 1.7; font-size: 0.82rem; }
.tp-key.width-extra-wide { flex: 2.2; font-size: 0.85rem; }
.tp-key.width-spacebar { flex: 6.5; }

.key-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 2px;
}

.key-main {
  line-height: 1;
}

/* Tactile Bumps for F & J */
.tactile-bump {
  position: absolute;
  bottom: 5px;
  width: 14px;
  height: 2px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}

/* Target Key Pulsing Glow */
.tp-key.key-target {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.35), rgba(16, 185, 129, 0.35)) !important;
  border-color: var(--cyan) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 0 #007780, 0 0 20px var(--cyan-glow) !important;
  animation: keyGlowPulse 1.2s infinite alternate;
}

/* Pressed Animation */
.tp-key.key-pressed {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #070b13, 0 0 15px var(--cyan-glow) !important;
  background: var(--cyan) !important;
  color: #000 !important;
}

/* Error Key Animation */
.tp-key.key-error {
  background: var(--crimson) !important;
  border-color: #ff8888 !important;
  color: #fff !important;
  box-shadow: 0 2px 0 #880000, 0 0 20px var(--crimson-glow) !important;
  animation: keyShake 0.15s ease;
}

@keyframes keyGlowPulse {
  0% {
    box-shadow: 0 4px 0 #007780, 0 0 10px rgba(0, 240, 255, 0.3);
  }
  100% {
    box-shadow: 0 4px 0 #007780, 0 0 25px rgba(0, 240, 255, 0.85);
  }
}

@keyframes keyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}
