/* ── Code Breaker — game-specific layout (shell/buttons from playful.css) ── */

.game-shell { max-width: 480px; }

/* ── Secret code row (hidden until game over) ── */
.secret-wrap {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 12px;
}
.secret-label {
  font-size: 11px; font-weight: 700; letter-spacing: 2px; color: var(--muted);
}
.secret-row { display: flex; gap: 8px; }

/* ── Board of guesses ── */
.cb-board {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 5px;
  padding: 4px; margin-bottom: 8px;
}
.cb-board::-webkit-scrollbar { width: 6px; }
.cb-board::-webkit-scrollbar-thumb { background: var(--wood-deep); border-radius: 99px; }

.cb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 8px; border-radius: 14px;
}
.cb-row.active {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 2px var(--stroke);
}
.cb-idx {
  width: 20px; flex-shrink: 0; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.cb-pegs { display: flex; gap: 8px; flex: 1; }

.cb-feedback {
  display: grid; grid-template-columns: repeat(2, 9px);
  grid-auto-rows: 9px; gap: 4px; flex-shrink: 0;
  align-content: center;
}
.fb {
  width: 9px; height: 9px; border-radius: 50%;
  background: transparent; border: 1.5px solid rgba(28, 24, 20, 0.22);
}
.fb.black { background: var(--stroke); border-color: var(--stroke); }
.fb.white { background: var(--card); border-color: var(--stroke); }

/* feedback legend so the peg colours are understandable */
.cb-legend { display:flex; gap:16px; justify-content:center; flex-wrap:wrap; font-size:12px; font-weight:700; color:var(--muted); margin:8px 0 2px; }
.cb-legend span { display:flex; align-items:center; gap:6px; }
.cb-legend i { width:13px; height:13px; border-radius:50%; display:inline-block; flex-shrink:0; }
.cb-legend i.black { background:var(--stroke); }
.cb-legend i.white { background:var(--card); border:2px solid var(--stroke); }

/* ── Pegs ── */
.peg {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--stroke); position: relative; flex-shrink: 0;
  background: rgba(28, 24, 20, 0.07);
}
.peg.empty { box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.14); }
.peg.filled::before {
  content: ''; position: absolute; top: 16%; left: 22%;
  width: 36%; height: 30%; border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
.cb-row.active .peg { cursor: pointer; }
.cb-row.active .peg.filled:active { transform: scale(0.9); }

/* secret pegs */
.secret-row .peg {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px; color: var(--stroke);
  background: var(--wood-deep);
}
.secret-row .peg.covered::after { content: '?'; }

/* ── Palette of colour swatches ── */
.palette {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-bottom: 12px;
}
.swatch {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid var(--stroke); box-shadow: var(--sh);
  cursor: pointer; position: relative; padding: 0;
  transition: transform 0.12s var(--bounce), box-shadow 0.12s;
}
.swatch::before {
  content: ''; position: absolute; top: 16%; left: 22%;
  width: 34%; height: 28%; border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
.swatch:active { transform: translateY(4px); box-shadow: 0 0 0 var(--stroke); }

/* ── Controls row ── */
.controls { display: flex; gap: 12px; }
.controls .small {
  width: auto; flex: 1; font-size: 16px; padding: 13px;
}
.controls .check { flex: 2; }
.pbtn:disabled {
  filter: grayscale(0.5) brightness(0.95);
  opacity: 0.55; cursor: not-allowed;
  transform: none; box-shadow: var(--sh-lg);
}

.status-line {
  text-align: center; font-size: 14px; font-weight: 600;
  color: var(--muted); margin-bottom: 10px; min-height: 18px;
}

/* ── End-of-game reveal in the secret row ── */
.secret-row.revealed .peg { animation: flipUp 0.4s var(--bounce) both; }
@keyframes flipUp {
  0% { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}
