.pyramid { --n: 3; display: grid; grid-template-columns: repeat(calc(var(--n) * 2), 1fr); gap: 6px 4px; width: min(100%, 380px); margin: 16px auto 0; }
.py-cell { display: grid; place-items: center; min-width: 0; min-height: 62px; padding: 2px; border: 3px solid var(--ink); border-radius: 15px; background: var(--surface); color: var(--ink); font-size: 1.55rem; font-weight: 950; cursor: pointer; }
.pyramid.n5 .py-cell { font-size: 1.3rem; min-height: 58px; }
.py-cell.given { background: var(--path); cursor: default; }
.py-cell.empty { border-style: dashed; }
.py-cell:not(.given):not(.empty) { color: var(--accent-dark); }
.py-cell.sel { outline: 5px solid #2b85d3; outline-offset: 2px; background: color-mix(in srgb, #2b85d3 16%, var(--surface)); z-index: 2; }
.py-cell.wrong { background: #ffd2cb; border-color: var(--bad); color: var(--bad); }
.py-cell.wrong::after { content: "!"; position: absolute; }
body.theme-high .py-cell.wrong { background: #3a0f0c; color: #ff8a80; }
body.theme-high .py-cell:not(.given):not(.empty) { color: #fff; }
.keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: min(100%, 380px); margin: 16px auto 0; }
.keypad button { min-height: 62px; padding: 4px; border: 3px solid var(--ink); border-radius: 16px; background: var(--surface); color: var(--ink); font-size: 1.6rem; font-weight: 950; box-shadow: 0 5px 0 color-mix(in srgb, var(--ink) 26%, transparent); cursor: pointer; }
.keypad button:active { transform: translateY(3px); }
.keypad .wide { grid-column: span 5; min-height: 54px; font-size: 1.05rem; }
.keypad .back { grid-column: span 2; font-size: 1.2rem; }
@media (max-width:370px) { .py-cell { min-height: 54px; font-size: 1.3rem; } .pyramid.n5 .py-cell { font-size: 1.1rem; min-height: 50px; } }
