.completion-celebration {
    position: fixed; inset: 0; width: min(420px, calc(100% - 32px)); max-width: calc(100% - 32px);
    max-height: calc(100dvh - 32px); box-sizing: border-box; overflow: auto;
    margin: auto; padding: 72px 24px 24px; border: 1px solid #c6b68b; border-radius: 24px;
    background: #fff9eb; color: #303d2c; text-align: center; font-family: inherit;
}
.completion-celebration::backdrop {background: rgb(22 32 22 / 55%);}
.completion-celebration h2 {position: relative; margin: 0 0 20px; font-size: clamp(24px, 6vw, 32px); line-height: 1.2; color: #365c39;}
.completion-celebration p {position: relative; margin: 20px 0; line-height: 1.5; font-size: 16px;}
.completion-celebration-stats {position: relative; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 0;}
.completion-celebration-stats div {padding: 16px 8px; background: #fff3cf; border-radius: 16px;}
.completion-celebration-stats dt {font-size: 14px; font-weight: 600;}
.completion-celebration-stats dd {margin: 6px 0 0; font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums;}
.completion-celebration button {position: relative; width: 100%; min-height: 48px; border: 0; border-radius: 12px; padding: 12px; background: #365c39; color: #fff9eb; font: inherit; font-weight: 700; cursor: pointer;}
.completion-celebration button:focus-visible {outline: 3px solid #795515 !important; outline-offset: 3px;}
.completion-celebration.has-learnt-words {padding-top: 28px;}
.completion-celebration.has-learnt-words[open] {display: flex; flex-direction: column; height: min(640px, calc(100dvh - 32px)); overflow: hidden;}
.completion-celebration.has-learnt-words > h2,
.completion-celebration.has-learnt-words > dl,
.completion-celebration.has-learnt-words > button {flex-shrink: 0;}
.completion-celebration.has-learnt-words > p {display: none;}
.has-learnt-words .completion-celebration-stats div {padding: 10px 8px;}
.has-learnt-words .completion-celebration-stats dd {font-size: 24px; margin-top: 4px;}
.completion-learnt {position: relative; text-align: left; margin: 20px 0;}
.has-learnt-words .completion-learnt {display: flex; flex-direction: column; flex: 1; min-height: 0;}
.completion-learnt h3 {font-size: 20px; margin: 0 0 12px;}
.completion-learnt-list {list-style: none; padding: 0 4px 0 0; margin: 0; max-height: min(32dvh, 280px); overflow: auto;}
.has-learnt-words .completion-learnt-list {flex: 1; min-height: 0; max-height: none;}
.completion-learnt-list li {display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid #c6b68b;}
.completion-learnt-details {display: grid; gap: 3px; overflow-wrap: anywhere;}
.completion-learnt-details strong {font-size: 23px;}
.completion-learnt-details span {font-size: 15px;}
.completion-learnt-details small {font-size: 13px; color: #365c39;}
.completion-learnt-list button {width: auto; min-width: 68px; padding: 10px 12px;}
.completion-celebration button:disabled {opacity: .6; cursor: default;}
.completion-fireworks {position: absolute; inset: 12px 0 auto; height: 160px; overflow: hidden; pointer-events: none;}
.completion-firework {position: absolute; top: 44px; left: 20%;}
.completion-firework:nth-child(2) {left: 77%; top: 34px;}
.completion-firework:nth-child(3) {left: 38%; top: 60px;}
.completion-firework:nth-child(4) {left: 65%; top: 65px;}
.completion-firework i {position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--color); opacity: 0; animation: completion-burst 1.5s ease-out calc(var(--burst) * 180ms) 2;}
@keyframes completion-burst {0% {opacity: 0; transform: rotate(var(--angle)) translateX(0) scale(.5);} 15% {opacity: 1;} 100% {opacity: 0; transform: rotate(var(--angle)) translateX(66px) scale(.3);}}
@media (prefers-reduced-motion: reduce) {.completion-firework i {animation: none;} .completion-celebration {padding-top: 24px;}}
