/* ==========================================================================
   WORDSMITH page skin (/games/wordsmith/)
   Mirrors the app: bright sky blue, white rounded cards with a deeper-blue
   edge, chunky word tiles. The hero builds words from their pieces on its
   own (js/wordsmith-bg.js) and letter tiles drift up behind the page.
   Readability: text sitting straight on the blue is large and bold (white
   on this blue is ~3.2:1, fine for large text only); everything else is
   dark ink on white cards.
   ========================================================================== */

.ws-page {
    --ws-sky: #1599E3;
    --ws-deep: #0C6FB8;
    --ws-tile: #1F5FD6;
    --ws-ink: #17233F;
    --ws-ink-soft: #3A4766;
    background: var(--ws-sky);
}

.ws-page main { position: relative; z-index: 1; }

/* Heavy rounded headings, like the app (Nunito is loaded up to 900) */
.ws-page h1, .ws-page h2, .ws-page h3,
.ws-page .gp-page-subtitle,
.ws-page .gp-page-tagline,
.ws-page .gp-chapter-name,
.ws-page .gp-chapter-example { font-family: 'Nunito', var(--font-body); }
.ws-page h2 { font-weight: 900; }
.ws-page h3, .ws-page .gp-chapter-name { font-weight: 800; }
.ws-page .gp-page-subtitle { font-weight: 900; }
.ws-page .gp-page-tagline { font-weight: 800; }
.ws-page .gp-chapter-example { font-weight: 900; }

/* White bar, like the app's cards */
.ws-page .navbar:not(.navbar-dark),
.ws-page .navbar:not(.navbar-dark).scrolled { background: rgba(255, 255, 255, 0.95); }
@media (max-width: 968px) {
    .ws-page .nav-menu { background: #fff; }
}

/* Letter tiles drifting up behind the page */
.ws-backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.ws-backdrop canvas { display: block; width: 100%; height: 100%; }

/* --- Sections sit on the blue --- */
.ws-page .gp-page-hero,
.ws-page .gp-features-section,
.ws-page .gp-howto-section,
.ws-page .gp-chapters-section,
.ws-page .gp-screenshots-section,
.ws-page .gp-guides-section,
.ws-page .gp-cta-section { background: transparent; }
.ws-page .gp-page-hero::before,
.ws-page .gp-hero-bg { display: none; }

.ws-page .gp-section-heading h2 { color: #fff; text-shadow: 0 3px 0 rgba(12, 70, 140, 0.35); }
.ws-page .gp-section-heading p { color: #fff; font-size: 1.2rem; font-weight: 800; }

/* --- Hero --- */
.ws-page .gp-page-tag { border-color: transparent; color: var(--ws-deep); }
.ws-page .gp-page-title {
    font-family: 'Nunito', var(--font-body);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 5px 0 rgba(12, 70, 140, 0.4);
}
.ws-page .gp-page-subtitle { color: #fff; font-family: 'Nunito', var(--font-body); font-weight: 900; font-size: 1.5rem; }
.ws-page .gp-page-tagline { color: #fff; font-weight: 700; font-size: 1.25rem; }
.ws-page .gp-pill-badge { border-color: transparent; color: var(--ws-ink); }
.ws-page .gp-pill-badge i { color: var(--ws-tile); }
/* The word chips carry light inline tints made for a white page */
.ws-page .gp-wedge-chip { background: #fff !important; }
.ws-page .gp-hero-facts span { color: #fff; font-size: 1.2rem; font-weight: 800; }
.ws-page .gp-hero-facts i { color: #FFE27A; }
.ws-page .gp-app-icon { box-shadow: 0 16px 36px -12px rgba(12, 50, 110, 0.55); }

/* --- White cards with the app's deeper-blue edge --- */
.ws-page .gp-feature-card,
.ws-page .gp-chapter-card,
.ws-page .gp-step-card {
    background: #fff;
    border: 0;
    box-shadow: 0 6px 0 var(--ws-deep);
}
.ws-page .gp-feature-card h3,
.ws-page .gp-step-card h3,
.ws-page .gp-chapter-name { color: var(--ws-ink); }
.ws-page .gp-feature-card p,
.ws-page .gp-step-card p { color: var(--ws-ink-soft); }
.ws-page .gp-chapter-num { color: #5B6785; }

.ws-page .gp-step-number {
    background: #EE8E2E;
    border: 3px solid #fff;
    box-shadow: 0 4px 0 #B8620B;
}

.ws-page .gp-screenshot-label { border: 0; color: var(--ws-ink); box-shadow: 0 4px 0 var(--ws-deep); }
.ws-page .gp-screenshot-frame img,
.ws-page .gp-hero-phone { filter: drop-shadow(0 22px 30px rgba(10, 50, 110, 0.4)); }

.ws-page .gp-cta-content { background: #fff; border: 0; box-shadow: 0 10px 0 var(--ws-deep); }
.ws-page .gp-cta-content h2 { color: var(--ws-ink); }
.ws-page .gp-cta-privacy-link { color: var(--ws-tile); }

/* Guides are real links; they keep their own hover */
.ws-page .learn-card { border: 0; border-top: 6px solid #F0912F; box-shadow: 0 6px 0 var(--ws-deep); }

/* Information, not buttons: no hover lift on cards or phones */
.ws-page .gp-feature-card:hover,
.ws-page .gp-chapter-card:hover,
.ws-page .gp-screenshot-frame:hover,
.ws-page .gp-hero-phone:hover { transform: none; box-shadow: 0 6px 0 var(--ws-deep); }
.ws-page .gp-screenshot-frame:hover,
.ws-page .gp-hero-phone:hover { box-shadow: none; }
.ws-page .gp-screenshot-frame-lg,
.ws-page .gp-screenshot-frame-lg:hover { transform: translateY(-14px); }
@media (max-width: 640px) {
    .ws-page .gp-screenshot-frame-lg,
    .ws-page .gp-screenshot-frame-lg:hover { transform: none; }
}

/* --- Hero demo: a word builds itself from its pieces --- */
.ws-page .gp-hero-visual { display: block; }

.ws-demo {
    max-width: 460px;
    margin: 0 auto;
    padding: 1.6rem 1.4rem 1.5rem;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 8px 0 var(--ws-deep), 0 30px 60px -30px rgba(10, 50, 110, 0.5);
    text-align: center;
}

.ws-demo-label {
    display: block;
    margin-bottom: 1.1rem;
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ws-deep);
}

.ws-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    transition: gap 0.35s ease;
}

.ws-slot {
    position: relative;
    display: flex;
    min-width: 64px;
    height: 64px;
    border-radius: 16px;
    border: 3px dashed #C9D3E3;
    transition: border-color 0.3s ease, min-width 0.35s ease;
}

.ws-tile {
    position: relative;
    margin: -3px;
    min-width: calc(100% + 6px);
    height: calc(100% + 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.9rem;
    border-radius: 16px;
    background: var(--c, #EE8E2E);
    color: #fff;
    font-family: 'Nunito', var(--font-body);
    font-weight: 900;
    font-size: 1.8rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(26px) scale(0.85);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(.3, 1.5, .5, 1), border-radius 0.35s ease;
}

.ws-slot.is-filled { border-color: transparent; }
.ws-slot.is-filled .ws-tile { opacity: 1; transform: none; }

/* Pieces snap together into one word */
.ws-row.is-joined { gap: 0; }
.ws-row.is-joined .ws-tile { border-radius: 0; }
.ws-row.is-joined .ws-slot:first-child .ws-tile { border-radius: 16px 0 0 16px; }
.ws-row.is-joined .ws-slot:last-child .ws-tile { border-radius: 0 16px 16px 0; }

.ws-word {
    margin: 1rem 0 0.2rem;
    min-height: 2.6rem;
    font-family: 'Nunito', var(--font-body);
    font-weight: 900;
    font-size: 2.1rem;
    line-height: 1.2;
    color: var(--ws-ink);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(.3, 1.6, .5, 1);
}
.ws-word.is-shown { opacity: 1; transform: none; }

.ws-demo-cap { margin: 0; min-height: 1.5em; font-weight: 700; color: #5B6785; }

@media (max-width: 968px) {
    .ws-page .gp-hero-visual { margin-top: 2rem; }
}

@media (max-width: 540px) {
    .ws-slot { min-width: 52px; height: 56px; }
    .ws-tile { font-size: 1.45rem; padding: 0 0.65rem; }
    .ws-word { font-size: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ws-row, .ws-slot, .ws-tile, .ws-word { transition: none; }
}
