/* Number Pyramid: sandstone bricks under a low desert sun */
.ny-col { gap: 6px; padding: 6px 8px 8px; }
.ny-wrap {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ny-wrap::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: min(78%, 420px); aspect-ratio: 1;
  transform: translate(-50%, -58%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 140, 40, 0.34) 0 38%, rgba(196, 83, 45, 0.16) 39% 62%, rgba(196, 83, 45, 0) 70%);
  pointer-events: none;
}
.ny-pyr {
  --bw: 60px; --bh: 40px; --R: 4;
  position: relative;
  direction: ltr;
  -webkit-user-select: none; user-select: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
}
.ny-pyr::after {
  content: "";
  position: absolute;
  left: -6%; right: -6%; bottom: -6px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(232, 176, 74, 0), #A8743C 18%, #A8743C 82%, rgba(232, 176, 74, 0));
}
.ny-brick {
  position: absolute;
  left: calc(((var(--R) - 1 - var(--r)) / 2 + var(--c)) * var(--bw) + 2px);
  top: calc(var(--r) * var(--bh) + 2px);
  width: calc(var(--bw) - 4px);
  height: calc(var(--bh) - 4px);
  margin: 0; padding: 0;
  border: 1.5px solid #7A4A22;
  border-radius: 5px;
  background: linear-gradient(180deg, #F1D29C 0%, #E2B573 55%, #C9924F 100%);
  box-shadow: inset 0 2px 0 rgba(255, 246, 222, 0.6), inset 0 -3px 0 rgba(122, 74, 34, 0.35);
  color: #1F5F73;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, box-shadow 0.15s;
}
.ny-brick::before {
  content: "";
  position: absolute;
  inset: 22% 8% auto 8%;
  height: 1px;
  background: rgba(122, 74, 34, 0.16);
  pointer-events: none;
}
.ny-num { position: relative; display: block; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ny-brick.is-long .ny-num { font-size: 0.82em; }
.ny-brick.is-given {
  background: linear-gradient(180deg, #D9AE6E 0%, #C4914F 60%, #A8743C 100%);
  color: #3A1E0B;
  cursor: default;
}
.ny-brick.is-given .ny-num { text-shadow: 0 1px 0 rgba(255, 238, 200, 0.55), 0 -1px 0 rgba(58, 30, 11, 0.4); }
.ny-brick.is-sel {
  z-index: 2;
  transform: translateY(-2px);
  background: linear-gradient(180deg, #FFF3D6 0%, #F4D79F 60%, #E2B573 100%);
  box-shadow: 0 0 0 3px #FBEFD9, 0 0 0 6px #3F8FA6, 0 6px 14px rgba(0, 0, 0, 0.4);
}
.ny-brick:focus-visible { outline: 3px solid #FBEFD9; outline-offset: 1px; z-index: 3; }
.ny-brick.is-bad { color: #9E1F12; box-shadow: inset 0 0 0 3px #D8432A, inset 0 0 14px 3px rgba(216, 67, 42, 0.55); }
.ny-brick.is-sel.is-bad { box-shadow: 0 0 0 3px #FBEFD9, 0 0 0 6px #D8432A, inset 0 0 14px 3px rgba(216, 67, 42, 0.55); }
.ny-brick.is-pop .ny-num { animation: ny-pop 0.2s cubic-bezier(.3, 1.6, .5, 1); }
.ny-brick.is-nudge { animation: ny-nudge 0.25s; }
.ny-brick.is-won { animation: ny-glow 0.6s ease-out both; animation-delay: var(--d, 0s); }
.ny-brick.is-cap.is-won {
  color: #5A3300;
  background: linear-gradient(180deg, #FFF0A8 0%, #FFD45C 45%, #E8A33A 100%);
  border-color: #A86A12;
  box-shadow: 0 0 0 2px rgba(255, 212, 92, 0.6), 0 0 26px 8px rgba(255, 196, 64, 0.65);
  animation: ny-crown 0.9s cubic-bezier(.3, 1.5, .5, 1) both;
  animation-delay: var(--d, 0s);
  overflow: hidden;
}
.ny-brick.is-cap.is-won::after {
  content: "";
  position: absolute;
  top: -20%; bottom: -20%; width: 30%; left: -40%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0));
  transform: skewX(-20deg);
  animation: ny-shine 1.1s ease-in-out both;
  animation-delay: calc(var(--d, 0s) + 0.45s);
}
@keyframes ny-pop { from { transform: scale(0.5); } to { transform: scale(1); } }
@keyframes ny-nudge { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes ny-glow { 0% { filter: brightness(1); } 45% { filter: brightness(1.25); transform: translateY(-2px); } 100% { filter: brightness(1.06); } }
@keyframes ny-crown { 0% { transform: scale(1); } 50% { transform: scale(1.18) translateY(-4px); } 100% { transform: scale(1.06); } }
@keyframes ny-shine { from { left: -40%; } to { left: 120%; } }

#sub { min-height: 24px; font-size: 0.95rem; }
#sub.is-bad { color: #FFB199; }
#sizes .fa-seg button { min-height: 38px; min-width: 72px; }

.ny-pad {
  direction: ltr;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 420px;
  transition: opacity 0.2s;
}
.ny-pad.is-off { opacity: 0.45; }
.ny-key {
  min-height: 46px;
  margin: 0; padding: 0;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #5A3822, #43291A);
  box-shadow: inset 0 0 0 1px rgba(242, 160, 61, 0.35), 0 3px 0 #1C1009;
  color: #FBEFD9;
  font: inherit;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ny-key:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px rgba(242, 160, 61, 0.5), 0 1px 0 #1C1009; background: #6B4428; }
.ny-key:focus-visible { outline: 3px solid #F2A03D; outline-offset: 1px; }
.ny-del { grid-column: span 2; color: #F8C987; }
.ny-del svg { width: 26px; height: 26px; vertical-align: middle; }

@media (max-height: 600px) {
  .ny-col { gap: 4px; padding-top: 4px; }
  #sizes .fa-seg button { min-height: 34px; }
  #sub { min-height: 20px; font-size: 0.88rem; }
  .ny-key { min-height: 40px; font-size: 1.15rem; }
  .ny-pad { gap: 5px; }
}
@media (max-width: 359px) { #solved-chip { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .ny-brick, .ny-brick.is-won, .ny-brick.is-cap.is-won, .ny-brick.is-nudge, .ny-brick.is-pop .ny-num { animation: none; transition: none; }
  .ny-brick.is-cap.is-won::after { display: none; }
}
.ny-del svg { display: block; margin: 0 auto; }
body[data-game="numpyramid"] .fa-title { font-size: clamp(0.85rem, 4.4vw, 1.5rem); white-space: nowrap; }
