/*
 * The results popup and "Next daily" link shown when a daily game is finished (see next-daily.js).
 * Everything is namespaced under .site-next-daily and .site-daily-results so it can't collide with app styles.
 */
.site-next-daily {
    display: flex;
    justify-content: center;
    width: 100%;
}

.site-next-daily[hidden] {
    display: none;
}

.site-next-daily-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 8px 14px 8px 8px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, .1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    color: #1f2937;
    font: 400 .85rem/1.2 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: left;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}

.site-next-daily-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

.site-next-daily-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.site-next-daily-link img {
    flex: none;
    border-radius: 6px;
    image-rendering: pixelated;
}

.site-next-daily-emoji {
    flex: none;
    width: 28px;
    font-size: 22px;
    line-height: 28px;
    text-align: center;
}

.site-next-daily-text {
    display: flex;
    flex-direction: column;
}

.site-next-daily-kicker {
    font-size: .72rem;
    opacity: .65;
}

.site-next-daily-title {
    font-weight: 700;
    font-size: .95rem;
}

.site-next-daily-arrow {
    margin-left: 4px;
    font-weight: 700;
}

.site-next-daily-all {
    margin: 0;
    font: 400 .85rem/1.3 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    opacity: .75;
    text-align: center;
}

/* Dark mode: shared/theme.js sets data-theme="dark" (chosen, or Auto on a dark device) */
:root[data-theme="dark"] .site-next-daily-link {
    background: #24262e;
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
    color: #e7e9ee;
}

/* Results popup (a <dialog> built by next-daily.js) */
.site-daily-results {
    box-sizing: border-box;
    width: min(380px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 22px 20px 20px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
    color: #1f2937;
    font: 400 .9rem/1.35 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
}

.site-daily-results[open] {
    animation: site-daily-results-in .22s ease-out;
}

@keyframes site-daily-results-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
}

.site-daily-results::backdrop {
    background: rgba(0, 0, 0, .45);
}

.site-daily-results-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
    opacity: .6;
}

.site-daily-results-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, .06);
}

.site-daily-results-kicker {
    margin: 0 0 4px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .6;
}

.site-daily-results-title {
    margin: 0 28px 6px;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.site-daily-results-note {
    margin: 0 0 12px;
    opacity: .8;
}

.site-daily-results-share-text {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .05);
    font: inherit;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.site-daily-results-share {
    width: 100%;
    padding: 11px 16px;
    border: 0;
    border-radius: 10px;
    background: #1f2937;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.site-daily-results-share:hover {
    background: #374151;
}

.site-daily-results-heading {
    margin: 20px 0 8px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .6;
}

.site-daily-results-more {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-daily-results-more .site-next-daily-link {
    display: flex;
}

.site-daily-results-more .site-next-daily-text {
    flex: 1;
    min-width: 0;
}

.site-daily-results-close:focus-visible,
.site-daily-results-share:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.site-daily-results [hidden] {
    display: none;
}

:root[data-theme="dark"] .site-daily-results {
    border-color: rgba(255, 255, 255, .12);
    background: #1b1d23;
    color: #e7e9ee;
}

:root[data-theme="dark"] .site-daily-results-close:hover,
:root[data-theme="dark"] .site-daily-results-share-text {
    background: rgba(255, 255, 255, .08);
}

:root[data-theme="dark"] .site-daily-results-share {
    background: #e7e9ee;
    color: #1b1d23;
}

:root[data-theme="dark"] .site-daily-results-share:hover {
    background: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
    .site-daily-results[open] {
        animation: none;
    }
}
