/* Color Code Breaker (w036) */
.ccb { display: grid; gap: 1rem; }
.ccb > * { min-width: 0; }
.ccb-modes { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; padding: .25rem; border: 1px solid var(--border); border-radius: .8rem; background: #0c1220; }
.ccb-modes button { border: 0; background: transparent; }
.ccb-modes button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.ccb-how { border: 1px solid var(--border); border-radius: .85rem; background: #0c1220; }
.ccb-how summary { display: flex; align-items: center; min-height: 48px; padding: .5rem 1rem; cursor: pointer; font-weight: 700; }
.ccb-how-body { display: grid; gap: .6rem; padding: 0 1rem 1rem; }
.ccb-how-body p { margin: 0; }
.ccb-example { display: grid; gap: .4rem; padding: .6rem .75rem; border-radius: .7rem; background: var(--card); }
.ccb-example p { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ccb-example-label { min-width: 7.5rem; color: var(--muted); font-weight: 700; }
.ccb-example .ccb-peg { width: 32px; height: 32px; font-size: 1rem; }

.ccb-title { margin: 0; font-size: 1.15rem; }
.ccb-board { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.ccb-row { display: grid; grid-template-columns: 1.4rem auto minmax(0, 1fr); align-items: center; gap: .6rem; padding: .3rem .5rem; border: 1px solid transparent; border-radius: .75rem; }
.ccb-row.current { border-color: var(--accent); background: #13231f; }
.ccb-row-no { color: var(--muted); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.ccb-slots, .ccb-pegs { display: inline-flex; gap: .4rem; }
.ccb-peg { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #10151f; font-size: 1.15rem; font-weight: 800; line-height: 1; }
.ccb-peg.empty { border: 2px dashed #4b5a77; }
button.ccb-slot { width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 50%; border: 2px dashed #6b7a97; background: transparent; font-size: 1.2rem; }
button.ccb-slot.ccb-peg { border: 2px solid #0c1220; }
.ccb-marks { justify-self: end; color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ccb-marks.pending { color: var(--muted); font-weight: 600; font-size: .9rem; white-space: normal; text-align: end; }
/* .ccb prefix: the colors must win over the shared button background (filled slots are buttons). */
.ccb .c0 { background: #ff7b72; }
.ccb .c1 { background: #ffd43b; }
.ccb .c2 { background: #69db7c; }
.ccb .c3 { background: #5cb8ff; }
.ccb .c4 { background: #c4a7ff; }
.ccb .c5 { background: #f1f3f5; }
.ccb .ccb-possible:empty, .ccb .kit-status:empty { display: none; }

.ccb-input { display: grid; gap: .75rem; }
.ccb-palette { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .3rem; }
.ccb-color { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-width: 0; min-height: 52px; padding: .3rem .2rem; border: 2px solid #0c1220; color: #10151f; }
.ccb-color span { font-size: 1.35rem; line-height: 1; }
.ccb-color small { font-size: .85rem; font-weight: 800; line-height: 1.15; overflow-wrap: normal; text-align: center; }
.ccb-color:hover:not(:disabled), .ccb-color:focus-visible { border-color: var(--text); }
.ccb-actions { display: grid; grid-template-columns: 1fr 2fr; }
.ccb-actions .primary { min-height: 52px; font-size: 1.1rem; }
.ccb-title { line-height: 1.3; }
.ccb-title:focus { outline: none; }
.ccb-title:focus-visible { outline: 3px solid #ffd36e; outline-offset: 2px; }

.ccb-result { display: grid; gap: .75rem; padding: 1rem; border: 2px solid var(--accent); border-radius: 1rem; background: #13231f; text-align: center; }
.ccb-result[data-won="false"] { border-color: var(--danger); background: #2a1a1d; }
.ccb-result h2 { margin: 0; font-size: clamp(1.3rem, 5vw, 1.8rem); }
.ccb-answer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem; margin: 0; font-weight: 700; }
.ccb-result-actions { justify-content: center; }
.ccb-result-actions button { min-height: 52px; }

.ccb-stats { display: grid; gap: .6rem; padding: 1rem; border: 1px solid var(--border); border-radius: .85rem; }
.ccb-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 0; text-align: center; }
.ccb-stat-grid dt { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.ccb-stat-grid dd { margin: 0; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ccb-dist-title { margin: .25rem 0 0; font-size: 1rem; color: var(--muted); }
.ccb-dist { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.ccb-dist li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); align-items: center; gap: .5rem; font-variant-numeric: tabular-nums; }
.ccb-bar { display: block; min-width: 1.8rem; padding: .1rem .45rem; border-radius: .35rem; background: #2b3954; text-align: end; font-weight: 700; }
.ccb-bar.today { background: var(--accent); color: var(--accent-ink); }
.ccb-footer-actions { justify-content: flex-end; }

/* Phones: one row of symbols (each color has its own symbol; the name stays in the accessible label). */
@media (max-width: 639px) {
  .ccb-color small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ccb-color span { font-size: 1.5rem; }
}
@media (min-width: 640px) {
  .ccb-peg { width: 44px; height: 44px; }
  button.ccb-slot { width: 50px; height: 50px; }
}
@media (max-width: 380px) {
  .ccb-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ccb-row { gap: .4rem; padding-inline: .3rem; }
  .ccb-slots { gap: .3rem; }
  .ccb-peg { width: 36px; height: 36px; }
  button.ccb-slot { width: 44px; height: 44px; min-height: 44px; }
}
