/* Cipher Grid — game-local styles. Extends the shared claed3d-games token set
   (styles.css); never edits it. Difficulty-pill idiom shared with Deep Signal;
   adds the number-pad row and the generation shimmer. */

/* difficulty pills row (Deep Signal idiom) */
.diff-pills {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 0.7rem;
}
.diff-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  flex: 1;
  min-height: 2.5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(239, 241, 250, 0.18);
  border-radius: 0.7rem;
  background: rgba(8, 8, 13, 0.5);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}
.diff-pill:hover {
  border-color: rgba(168, 140, 255, 0.6);
  transform: translateY(-1px);
}
.diff-pill[aria-pressed="true"] {
  border-color: rgba(105, 221, 255, 0.7);
  background: linear-gradient(rgba(30, 24, 54, 0.72), rgba(12, 12, 19, 0.72));
  color: var(--ink);
  box-shadow: 0 0 0.9rem rgba(105, 221, 255, 0.18);
}
.diff-meta {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

/* the cipher board frame: tight inner padding + faint violet↔cyan grid tint */
.cg-frame {
  padding: 0.35rem;
  background:
    linear-gradient(rgba(10, 10, 17, 0.72), rgba(7, 7, 11, 0.9)),
    radial-gradient(circle at 50% 12%, rgba(121, 87, 255, 0.1), transparent 60%);
}
.cg-frame #board {
  width: 100%;
  height: auto;
  cursor: pointer;
  touch-action: manipulation;
}

/* generation shimmer overlay — a calm sweep while the seeded build runs */
.cg-generating {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 7, 11, 0.72);
  backdrop-filter: blur(2px);
  overflow: hidden;
}
.cg-generating::before {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(115deg, transparent 42%, rgba(105, 221, 255, 0.14) 50%, transparent 58%);
  animation: cg-sweep 1.1s linear infinite;
}
.cg-gen-text {
  position: relative;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 0.8rem rgba(105, 221, 255, 0.5);
}
@keyframes cg-sweep {
  from { transform: translateX(-40%); }
  to   { transform: translateX(40%); }
}
@media (prefers-reduced-motion: reduce) {
  .cg-generating::before { animation: none; }
}

/* win overlay accent */
.game-over.is-win h2 { color: var(--cyan); text-shadow: 0 0 1.4rem rgba(105, 221, 255, 0.5); }
.game-over .final { color: var(--cyan); font-family: var(--mono); letter-spacing: 0.06em; }

/* ---------- number pad ---------- */
.cg-pad {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  margin: 0.7rem 0 0;
}
.cg-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  border: 1px solid rgba(239, 241, 250, 0.16);
  border-radius: 0.6rem;
  background: rgba(10, 10, 17, 0.6);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease, color 140ms ease;
}
.cg-key:hover {
  border-color: rgba(105, 221, 255, 0.55);
  background: rgba(24, 22, 44, 0.66);
  transform: translateY(-1px);
}
.cg-key:active { transform: translateY(0) scale(0.96); }
.cg-key--act { font-size: 1.05rem; color: var(--muted); }
.cg-key--act[aria-pressed="true"] {
  border-color: rgba(105, 221, 255, 0.75);
  background: linear-gradient(rgba(30, 24, 54, 0.8), rgba(12, 12, 19, 0.8));
  color: var(--cyan);
  box-shadow: 0 0 0.7rem rgba(105, 221, 255, 0.22);
}
/* count-complete: digits already placed 9 times dim out */
.cg-key.is-done { opacity: 0.32; pointer-events: none; }

@media (max-width: 400px) {
  .cg-key { min-height: 2.6rem; font-size: 1.05rem; }
}
