.perfect-grid{max-width:45rem;margin-inline:auto}.perfect-grid__card{padding:clamp(1rem,4vw,2.5rem);overflow:hidden}.perfect-grid__header{justify-content:space-between;align-items:flex-start;gap:1rem;display:flex}.perfect-grid__header h1,.perfect-grid__result h2{letter-spacing:-.045em;margin:.35rem 0 0;font-size:clamp(2.25rem,8vw,3.4rem);font-weight:850;line-height:1}.perfect-grid__subtitle{max-width:34rem;color:var(--game-muted);margin:.75rem 0 0;line-height:1.55}.perfect-grid__new{flex:none;min-height:3rem;padding-inline:1rem}.perfect-grid__sizes{border:1px solid var(--game-border);background:var(--game-surface-soft);border-radius:999px;grid-template-columns:repeat(3,1fr);gap:.25rem;width:fit-content;margin:1.5rem auto 0;padding:.25rem;display:grid}.perfect-grid__sizes button{min-width:4.35rem;min-height:2.65rem;color:var(--game-muted);border-radius:999px;font-size:.9rem;font-weight:750;transition:background .15s,color .15s,box-shadow .15s}.perfect-grid__sizes button[aria-pressed=true]{background:var(--game-surface);color:var(--game-text);box-shadow:0 .15rem .6rem #0f172a1f}.perfect-grid__sizes button:focus-visible,.perfect-grid__tile:focus-visible{outline-offset:2px;outline:3px solid #0161ef4d}.perfect-grid__target{color:var(--game-muted);justify-content:center;align-items:baseline;gap:.55rem;margin-top:1.35rem;font-weight:700;display:flex}.perfect-grid__target strong{color:var(--game-text);font-size:1.8rem;font-weight:900;line-height:1}.perfect-grid__scoreboard{grid-template-columns:repeat(2,1fr);gap:.65rem;width:min(100%,17rem);margin:1rem auto 0;display:grid}.perfect-grid__scoreboard div{border:1px solid var(--game-border);background:var(--game-surface-soft);text-align:center;border-radius:.9rem;padding:.55rem .75rem}.perfect-grid__scoreboard dt{color:var(--game-muted);text-transform:uppercase;font-size:.7rem;font-weight:700}.perfect-grid__scoreboard dd{font-variant-numeric:tabular-nums;margin:.1rem 0 0;font-size:1.25rem;font-weight:850;line-height:1}.perfect-grid__matrix{--sum-width:3.35rem;grid-template-columns:minmax(0,1fr) var(--sum-width);grid-template-rows:2.35rem auto;gap:.45rem;width:min(100%,31rem);margin:1rem auto 0;display:grid}.perfect-grid__column-sums{grid-column:1;grid-template-columns:repeat(var(--grid-size),minmax(0,1fr));gap:clamp(.25rem,1.4vw,.55rem);display:grid}.perfect-grid__board{grid-area:2/1;grid-template-columns:repeat(var(--grid-size),minmax(0,1fr));touch-action:manipulation;-webkit-user-select:none;user-select:none;gap:clamp(.25rem,1.4vw,.55rem);display:grid}.perfect-grid__row-sums{grid-area:2/2;grid-template-rows:repeat(var(--grid-size),minmax(0,1fr));gap:clamp(.25rem,1.4vw,.55rem);display:grid}.perfect-grid__sum{min-width:0;color:var(--game-muted);font-variant-numeric:tabular-nums;border:1px solid #0000;border-radius:.65rem;justify-content:center;align-items:center;font-size:clamp(.72rem,2.8vw,.9rem);font-weight:750;line-height:1;transition:background .16s,color .16s,transform .16s;display:flex}.perfect-grid__sum[data-correct]{color:#166534;background:#dcfce7;transform:scale(1.025)}.perfect-grid__sum-check{margin-right:.2rem;font-size:.75em}.perfect-grid__tile{aspect-ratio:1;border:1px solid var(--game-border);background:var(--game-surface-soft);min-width:0;color:var(--game-text);font-size:clamp(1.05rem,calc(8vw - var(--grid-size)*.25rem),2.1rem);font-variant-numeric:tabular-nums;border-radius:clamp(.55rem,2vw,.9rem);place-items:center;font-weight:850;line-height:1;transition:border-color .14s,background .14s,box-shadow .14s,transform .14s;display:grid;box-shadow:0 .22rem #94a3b87a}.perfect-grid__tile:hover:not(:disabled){border-color:#60a5fa;transform:translateY(-1px)}.perfect-grid__tile[aria-pressed=true]{border-color:var(--game-accent);color:#1e40af;background:#dbeafe;transform:translateY(-2px);box-shadow:0 .22rem #2563eb73,0 0 0 3px #3b82f633}.perfect-grid__tile[data-swapped]{animation:.18s ease-out perfect-grid-swap}.perfect-grid__board[data-complete] .perfect-grid__tile{border-color:#4ade80;box-shadow:0 .22rem #22c55e73}.perfect-grid__diagonals{justify-content:center;gap:.55rem;margin-top:.6rem;display:flex}.perfect-grid__diagonals .perfect-grid__sum{border-color:var(--game-border);min-width:5.25rem;min-height:2rem}.perfect-grid__hint{min-height:1.5rem;color:var(--game-muted);text-align:center;margin:.85rem 0 0;font-size:.82rem}.perfect-grid__result{text-align:center;background:#f0fdf4;border:1px solid #86efac;border-radius:1.25rem;margin-top:1.5rem;padding:clamp(1rem,4vw,1.5rem)}.perfect-grid__result>p:not(.game-eyebrow,.perfect-grid__share-status){color:#475569;margin:.65rem 0 0}.perfect-grid__result dl{grid-template-columns:repeat(3,1fr);gap:.6rem;margin:1.15rem 0 0;display:grid}.perfect-grid__result dl div{background:#ffffffbf;border-radius:.8rem;padding:.65rem .35rem}.perfect-grid__result dt{color:#475569;text-transform:uppercase;font-size:.7rem;font-weight:700}.perfect-grid__result dd{margin:.15rem 0 0;font-size:1.15rem;font-weight:850}.perfect-grid__result-actions{justify-content:center;gap:.65rem;margin-top:1.1rem;display:flex}.perfect-grid__share-status{color:#475569;min-height:1.25rem;margin:.5rem 0 0;font-size:.78rem}.dark .perfect-grid__sizes button[aria-pressed=true]{box-shadow:0 .15rem .6rem #00000059}.dark .perfect-grid__tile[aria-pressed=true]{color:#dbeafe;background:#1e40af73}.dark .perfect-grid__sum[data-correct],.dark .perfect-grid__result{color:#bbf7d0;background:#14532d73}.dark .perfect-grid__result,.dark .perfect-grid__board[data-complete] .perfect-grid__tile{border-color:#22c55e}.dark .perfect-grid__result>p:not(.game-eyebrow,.perfect-grid__share-status),.dark .perfect-grid__result dt,.dark .perfect-grid__share-status{color:#cbd5e1}.dark .perfect-grid__result dl div{background:#0f172a8c}@keyframes perfect-grid-swap{50%{transform:scale(.92)}}@media (max-width:34rem){.perfect-grid__header{display:block}.perfect-grid__new{margin-top:1rem}.perfect-grid__matrix{--sum-width:2.7rem}.perfect-grid__sizes{width:100%}.perfect-grid__sizes button{min-width:0}}@media (prefers-reduced-motion:reduce){.perfect-grid__sizes button,.perfect-grid__sum,.perfect-grid__tile{transition:none;animation:none}}