/* ── CODE BREAKER: spielspezifisch ── */
.overlay { background: rgba(6,8,18,0.88) !important; }

main {
  flex: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px 24px;
}

/* ── SCORE BAR ── */
.score-bar {
  display: flex;
  width: 100%;
  max-width: 500px;
  margin-bottom: 12px;
  gap: 8px;
}
.score-box label { font-size: 0.62rem; letter-spacing: 2px; }
.score-box span  { font-size: 1.5rem; }

/* ── CANVAS WRAP ── */
.canvas-wrap {
  width: 500px;
  max-width: calc(100vw - 32px);
  min-height: 480px;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0,245,255,0.08), 0 0 0 1px rgba(0,245,255,0.04);
  background: var(--bg2);
}

/* ── OVERLAY ── */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 32px 24px;
}
.overlay.hidden { display: none; }

#demoCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── GAME BOARD ── */
#gameBoard {
  width: 100%;
  padding: 10px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── ATTEMPT ROWS ── */
.attempt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s;
  border: 1px solid transparent;
}
.attempt-row.active-row {
  background: rgba(0,245,255,0.05);
  border-color: rgba(0,245,255,0.18);
}
.attempt-row.inactive { opacity: 0.4; }
.attempt-row.played   { opacity: 1; }

.row-num {
  font-family: 'Orbitron', monospace;
  font-size: 0.55rem;
  color: var(--muted);
  width: 16px;
  text-align: right;
  flex-shrink: 0;
}

/* ── GUESS PEGS ── */
.guess-pegs {
  display: flex;
  gap: 6px;
  flex: 1;
}
.peg-slot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
}
.peg-slot.active-slot  { border-color: var(--neon1); box-shadow: 0 0 8px rgba(0,245,255,0.3); }
.peg-slot.inactive-slot{ cursor: default; pointer-events: none; }

/* ── FEEDBACK BLOCK ── */
.feedback-block {
  flex-shrink: 0;
  display: grid;
  gap: 3px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 5px;
  align-items: center;
  justify-items: center;
}
/* Easy: 1×4 Reihe */
.feedback-block.easy-fb {
  grid-template-columns: repeat(4, 14px);
  grid-template-rows: 14px;
  width: 74px;
  height: 26px;
}
/* Hard: 2×2 Block */
.feedback-block.hard-fb {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 38px;
  height: 38px;
}
.feedback-pin {
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}
.easy-fb .feedback-pin { width: 13px; height: 13px; }
.hard-fb .feedback-pin { width: 13px; height: 13px; }

.feedback-pin.black {
  background: #0d0d0d;
  border: 2px solid #666;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 0 4px rgba(0,0,0,0.9);
}
.feedback-pin.white {
  background: #ddd;
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(255,255,255,0.55);
}

/* ── COLOR PALETTE ── */
#colorPalette {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0,0,0,0.25);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.color-choice {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}
.color-choice:hover  { transform: scale(1.15); box-shadow: 0 0 14px rgba(255,255,255,0.3); }
.color-choice.selected { border-color: #fff; transform: scale(1.2); box-shadow: 0 0 18px rgba(255,255,255,0.6); }
.color-choice::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  pointer-events: none;
}

/* ── ACTION BAR ── */
#actionBar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.25);
  border-top: 1px solid var(--border);
  justify-content: space-between;
  align-items: center;
}

/* CONFIRM — gefüllt wenn aktiv */
.btn-confirm {
  background: var(--neon1);
  color: var(--bg);
  border: 1px solid var(--neon1);
  border-radius: 4px;
  padding: 10px 20px;
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 16px rgba(0,245,255,0.4);
}
.btn-confirm:hover { background: #fff; border-color: #fff; box-shadow: 0 0 24px rgba(0,245,255,0.6); }
.btn-confirm:disabled {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.4;
}

/* CLEAR */
.btn-clear {
  background: transparent;
  color: var(--neon1);
  border: 1px solid var(--neon1);
  border-radius: 4px;
  padding: 10px 14px;
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-clear:hover { background: rgba(0,245,255,0.10); box-shadow: 0 0 12px rgba(0,245,255,0.25); }

/* NEW */
.btn-new {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-new:hover { color: var(--neon3); border-color: var(--neon3); box-shadow: 0 0 10px rgba(123,47,255,0.25); }

/* Try counter */
.attempts-info {
  font-family: 'Orbitron', monospace;
  letter-spacing: 1px;
  white-space: nowrap;
}
.try-current { color: var(--neon1); font-size: 1rem; font-weight: 900; }
.try-total   { color: var(--muted); font-size: 0.7rem; }

/* ── SECRET CODE ROW ── */
.secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.secret-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.52rem;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  width: 16px;
  text-align: right;
}
.secret-peg {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px dashed var(--border);
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.4s;
  flex-shrink: 0;
}
.secret-peg.revealed {
  border-style: solid;
  animation: revealPeg 0.4s ease-out;
}
@keyframes revealPeg {
  from { transform: scale(0.5) rotateY(90deg); opacity: 0; }
  to   { transform: scale(1) rotateY(0); opacity: 1; }
}

/* ── RESULT OVERLAY ── */
.result-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 32px;
  background: rgba(6,8,18,0.93);
}
.result-overlay.hidden { display: none; }

.result-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 3px;
}
.result-title.win  { color: var(--neon4); text-shadow: 0 0 30px rgba(0,255,136,0.6); }
.result-title.lose { color: var(--neon2); text-shadow: 0 0 30px rgba(255,0,110,0.6); }

.result-sub { font-family: 'Exo 2', sans-serif; font-size: 0.9rem; color: var(--muted); }
.result-sub strong { color: var(--neon1); }

.result-solution { display: flex; gap: 10px; margin: 4px 0; }
.result-peg {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
}

.result-btns { display: flex; gap: 10px; margin-top: 6px; }
