/* ============================================
   CODE ENTRY SCREEN — Custom pixel keyboard
   ============================================ */

#screen-code-entry {
  background: radial-gradient(ellipse at 50% 40%, #1a1a2a 0%, #0a0818 60%, #000 100%);
}

.code-entry-content {
  text-align: center;
  padding: 1.5rem;
  width: 90%;
  max-width: 500px;
}

.code-prompt {
  font-size: clamp(0.5rem, 1.5vw, 0.75rem);
  color: var(--gold-bright);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

/* Code display — shows entered letters */
.code-display {
  display: flex;
  justify-content: center;
  gap: clamp(0.25rem, 1vw, 0.5rem);
  margin-bottom: 1.5rem;
  min-height: 50px;
  flex-wrap: nowrap;
}

.code-letter {
  width: clamp(38px, 8vw, 56px);
  height: clamp(44px, 9vw, 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: clamp(0.9rem, 3vw, 1.4rem);
  color: var(--gold-bright);
  background: rgba(12, 16, 22, 0.9);
  border: 2px solid var(--gold-dark);
  border-bottom-width: 4px;
  border-radius: 3px;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

.code-letter.filled {
  border-color: var(--gold);
  background: rgba(58, 90, 42, 0.3);
  box-shadow: 0 0 8px rgba(218, 186, 106, 0.3);
}

.code-letter.active {
  border-color: var(--gold-bright);
  animation: cursor-blink 0.8s step-end infinite;
  box-shadow: 0 0 12px rgba(255, 232, 136, 0.4);
}

/* Pixel keyboard */
.pixel-keyboard {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.keyboard-row {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
}

.key {
  font-family: var(--font-pixel);
  font-size: clamp(0.55rem, 1.8vw, 0.8rem);
  width: clamp(32px, 7vw, 44px);
  height: clamp(36px, 8vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(42, 42, 60, 0.8);
  border: 2px solid #5a5a7a;
  border-bottom-width: 4px;
  border-radius: 3px;
  color: var(--text-light);
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
}

.key:active, .key.pressed {
  transform: translateY(2px);
  border-bottom-width: 2px;
  background: rgba(58, 90, 42, 0.6);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.key-wide {
  width: clamp(60px, 12vw, 80px);
  font-size: clamp(0.4rem, 1.2vw, 0.55rem);
}

.key-enter {
  background: rgba(58, 90, 42, 0.6);
  border-color: var(--success-green);
  color: var(--gold-bright);
}

.key-enter:active {
  background: rgba(88, 162, 72, 0.6);
}

.key-delete {
  background: rgba(80, 40, 40, 0.6);
  border-color: #8a5a5a;
}

.key-delete:active {
  background: rgba(120, 60, 60, 0.6);
}

/* Feedback message */
.code-feedback {
  font-size: clamp(0.4rem, 1.2vw, 0.55rem);
  min-height: 1.5em;
  margin-top: 1rem;
  line-height: 1.8;
  transition: color 0.2s ease;
}

.code-feedback.error {
  color: var(--error-red);
}

.code-feedback.success {
  color: var(--success-green);
}

.code-feedback.hint {
  color: var(--text-light);
  opacity: 0.7;
}
