/* Page-specific layout for /wrapped-free. Colors, fonts, and card chrome all
 * come from theme.css -- nothing here redefines a design token. */

.privacy-banner {
    background: var(--ink);
    color: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 13.5px;
    line-height: 1.6;
}
.privacy-banner strong { color: var(--gold); }
.privacy-banner details { margin-top: 8px; }
.privacy-banner summary { cursor: pointer; color: var(--on-dark-muted); font-size: 12.5px; }
.privacy-banner .verify-text { margin: 8px 0 0; color: var(--on-dark-muted); font-size: 12.5px; }

#wrapped-error {
    display: none;
    background: #fdeaea;
    color: #b3302f;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
}

#wrapped-results { display: none; }

#wrapped-card-preview {
    display: none;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 4px 18px 6px 16px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
    margin: 0 auto 16px;
}

.wrapped-card-actions { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }

/* The off-screen share-card subtree that gets rasterized. Positioned off
 * canvas (not display:none) so it's genuinely laid out with real computed
 * styles/fonts when dom-to-image-more reads it. */
.wrapped-card-offscreen {
    position: fixed;
    top: -9999px;
    left: -9999px;
    pointer-events: none;
}

.wrapped-card {
    background: radial-gradient(ellipse at 50% 0%, var(--ocean-1) 0%, var(--ocean-2) 70%);
    overflow: hidden;
}

.wrapped-card-inner {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 64px 48px;
    height: 100%;
    box-sizing: border-box;
}

.wrapped-card-h1 {
    font-family: 'Fredoka', ui-rounded, sans-serif;
    font-size: 64px;
    font-weight: 700;
    color: var(--on-dark);
    margin: 0;
    line-height: 1.1;
}

.wrapped-card-subtitle {
    font-size: 24px;
    margin: 0 0 8px;
}

.wrapped-card-grid .stat-value { font-size: 34px; }
.wrapped-card-grid .stat-label { font-size: 15px; }

.wrapped-card-quote {
    font-style: italic;
    font-size: 19px;
    color: var(--ink-soft);
    margin: 0;
}

.wrapped-card-timeline-icons {
    font-size: 32px;
    letter-spacing: 6px;
    text-align: center;
    margin: 0 0 6px;
}
.wrapped-card-timeline-caption {
    text-align: center;
    font-size: 14px;
    color: var(--ink-faint);
    margin: 0;
}

.wrapped-card-footer {
    margin-top: auto;
    text-align: center;
    font-size: 17px;
    color: var(--gold);
    font-weight: 600;
}

/* ===== On-page results: hero number, timeline, words/phrases, emoji grid =====
 * Everything below reuses theme.css's existing tokens/fonts -- no new colors. */

.wrapped-hero { margin: 4px 0 28px; }
.wrapped-hero-value {
    font-family: 'Fredoka', ui-rounded, sans-serif;
    font-weight: 700;
    font-size: clamp(52px, 11vw, 84px);
    line-height: 1;
    color: var(--gold);
    margin: 4px 0 2px;
    font-variant-numeric: tabular-nums;
}
.wrapped-hero-label { color: var(--on-dark-muted); margin: 0; font-size: 16px; }

/* Inline (non-fixed) adaptation of the fixed-position milestone timeline
 * used on the paid map view (static/archipelago/map.css's .timeline-panel,
 * not loaded on this page). Same tl-icon/tl-label/tl-date/tl-detail/tl-quote
 * visual language, scoped under .wf- so there's no chance of collision if
 * both stylesheets are ever loaded on the same page in the future. */
.wf-timeline { list-style: none; margin: 4px 0 0; padding: 0; position: relative; }

.wf-timeline::before {
    content: "";
    position: absolute;
    left: 19px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--parchment-edge);
}

.wf-timeline-item { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.wf-timeline-item:last-child { padding-bottom: 0; }

.wf-timeline-item .tl-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blush);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 3px var(--parchment);
}
.wf-timeline-body { flex: 1; min-width: 0; }
.wf-timeline-item .tl-label {
    font-family: 'Fredoka', ui-rounded, sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
    margin: 2px 0 0;
}
.wf-timeline-item .tl-date {
    display: block;
    font-size: 10.5px;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
    margin: 1px 0 0;
}
.wf-timeline-item .tl-detail {
    font-size: 12.5px;
    color: var(--ink-faint);
    margin: 4px 0 0;
    line-height: 1.4;
}
.wf-timeline-item .tl-quote {
    margin: 6px 0 0;
    font-size: 12px;
    font-style: italic;
    color: var(--ink);
    background: var(--blush);
    border-radius: 8px;
    padding: 6px 10px;
}

/* Words & Phrases: one card, primary list + a visually subordinate
 * secondary list (border, not a second card) rather than three
 * equal-weight list cards side by side. */
.words-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
@media (max-width: 600px) {
    .words-grid { grid-template-columns: 1fr; gap: 20px; }
}
.words-col-secondary {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-left: 20px;
    border-left: 1px solid var(--blush);
}
@media (max-width: 600px) {
    .words-col-secondary {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--blush);
        padding-top: 18px;
    }
}
.rank-list-compact li { padding: 6px 0; font-size: 13px; }

/* Top Emojis: real emoji characters in a graphical tile grid instead of a
 * plain text rank-list -- no icon font/images, just larger glyphs. */
.emoji-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 4px; }
@media (max-width: 480px) {
    .emoji-grid { grid-template-columns: repeat(4, 1fr); }
}
.emoji-tile {
    background: var(--blush);
    border-radius: 14px;
    padding: 14px 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.emoji-glyph { font-size: 34px; line-height: 1; }
.emoji-count {
    font-family: 'Fredoka', ui-rounded, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--deep-rose);
}
/* The single most-used emoji gets a "hero" tile, same move as the page's
 * own hero number. */
.emoji-tile:first-child { grid-column: span 2; background: var(--rose); }
.emoji-tile:first-child .emoji-glyph { font-size: 52px; }
.emoji-tile:first-child .emoji-count { color: var(--ink); }

/* One-shot scroll reveal. Scoped entirely inside the no-preference branch
 * so a prefers-reduced-motion user (or any JS failure) always sees the
 * finished page, never a section stuck invisible. */
@media (prefers-reduced-motion: no-preference) {
    .reveal-section {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    }
    .reveal-section.is-visible { opacity: 1; transform: translateY(0); }

    .wf-timeline-item, .emoji-tile {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.4s ease-out, transform 0.4s ease-out;
        transition-delay: calc(var(--i, 0) * 60ms);
    }
    .is-visible .wf-timeline-item, .is-visible .emoji-tile {
        opacity: 1;
        transform: translateY(0);
    }
}
