/* Completion feedback shares the existing paper and evening themes. */
.game-result {
 position:fixed;
 inset:0;
 width:min(480px,calc(100vw - 32px));
 height:fit-content;
 max-height:calc(100dvh - 32px);
 margin:auto;
 padding:0;
 overflow:auto;
 border:1px solid var(--line);
 border-radius:20px;
 background-color:var(--bg);
 background-image:var(--texture);
 background-size:760px 760px;
 color:var(--ink);
 box-shadow:0 18px 70px #102e3538,0 2px 8px #102e351a;
}
.game-result:not([open]) { display:none; }
.game-result[open] { animation:result-appear .22s ease-out; }
.game-result::backdrop {
 background:rgba(12,29,35,.42);
 backdrop-filter:blur(4px);
 -webkit-backdrop-filter:blur(4px);
}
.game-result-inner { position:relative;padding:2.7rem 2rem 1.6rem;text-align:center; }
.game-result-close {
 position:absolute;
 top:.5rem;
 right:.5rem;
 min-width:44px;
 min-height:44px;
 padding:.4rem .65rem;
 border-color:transparent;
 background:transparent;
 box-shadow:none;
 color:var(--ink-soft);
 font-size:.78rem;
}
.game-result-close:hover { background:var(--button-hover);box-shadow:none; }
.game-result-kicker {
 margin:0 0 .8rem;
 color:var(--accent);
 font-size:.72rem;
 font-weight:600;
 letter-spacing:.16em;
 text-transform:uppercase;
}
.game-result-title {
 margin:0;
 font-family:var(--display-font);
 font-size:2.25rem;
 font-weight:500;
 line-height:1.18;
 letter-spacing:-.045em;
}
:root[data-theme=dark] .game-result-title { font-weight:600; }
.game-result-puzzle { margin:.6rem 0 0;color:var(--ink-soft);font-size:1rem; }
.game-result-stats {
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 margin:1.5rem 0 1.15rem;
 padding:1.1rem 0;
 border-block:1px solid var(--line);
}
.game-result-stats>div+div { border-left:1px solid var(--line); }
.game-result-stats span { display:block;color:var(--ink-soft);font-size:.8rem; }
.game-result-stats strong {
 display:block;
 margin-top:.2rem;
 font-size:2.1rem;
 font-weight:500;
 line-height:1.25;
 letter-spacing:-.035em;
 font-variant-numeric:tabular-nums;
}
.game-result-note { max-width:34ch;margin:0 auto;color:var(--ink-soft);font-size:.9rem;line-height:1.65; }
.game-result-actions { display:grid;grid-template-columns:1.2fr 1fr;gap:.65rem;margin-top:1.5rem; }
.game-result-actions a,.game-result-actions button {
 display:flex;
 align-items:center;
 justify-content:center;
 min-height:46px;
 padding:.65rem .85rem;
 border:1px solid var(--line);
 border-radius:9px;
 font-size:.92rem;
 line-height:1.4;
 text-decoration:none;
}
.game-result-actions a.primary { border-color:var(--accent);background:var(--accent);color:var(--accent-ink); }
.game-result-actions a.primary:hover { filter:brightness(1.06); }
.game-result-continue {
 min-height:44px;
 margin-top:.6rem;
 padding:.45rem .7rem;
 border-color:transparent;
 background:transparent;
 box-shadow:none;
 color:var(--ink-soft);
 font-size:.82rem;
 text-decoration:underline;
 text-underline-offset:4px;
}
.game-result-continue:hover { border-color:transparent;background:transparent;box-shadow:none;color:var(--accent); }
.game-complete-banner {
 display:flex;
 align-items:center;
 justify-content:space-between;
 gap:1rem;
 padding:.75rem 1.25rem;
 border-bottom:1px solid var(--line);
 background:var(--tray);
 color:var(--ink);
}
.game-complete-banner[hidden] { display:none!important; }
.game-complete-banner strong { display:block;font-size:.94rem;font-weight:600; }
.game-complete-banner span { color:var(--ink-soft);font-size:.82rem;font-variant-numeric:tabular-nums; }
.game-complete-banner button { flex:none;min-height:44px;font-size:.84rem; }
.game.just-completed { animation:board-completed .65s ease-out; }
@keyframes result-appear {
 from { opacity:0;transform:translateY(10px) scale(.985); }
 to { opacity:1;transform:translateY(0) scale(1); }
}
@keyframes board-completed {
 0% { box-shadow:0 0 0 0 var(--accent); }
 100% { box-shadow:0 0 0 7px transparent; }
}
@media(width<=540px) {
 .game-result { border-radius:17px; }
 .game-result-inner { padding:2.7rem 1.3rem 1.3rem; }
 .game-result-title { font-size:2rem; }
 .game-result-stats { margin-top:1.25rem; }
 .game-result-actions { grid-template-columns:1fr;margin-top:1.25rem; }
 .game-result-actions a,.game-result-actions button { min-height:46px; }
 .game-complete-banner { gap:.6rem;padding:.65rem .85rem; }
 .game-complete-banner strong { font-size:.85rem; }
 .game-complete-banner span { font-size:.76rem; }
 .game-complete-banner button { padding:.45rem .65rem;font-size:.78rem; }
}
@media(prefers-reduced-motion:reduce) {
 .game-result[open],.game.just-completed { animation:none!important; }
}
@media print { .game-result,.game-complete-banner { display:none!important; } }
