/* main.css - Core Design System & Variables */
:root {
    /* Color Palette - Disney Storybook */
    --bg-page: #FAF7F2;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-warm: #F5F0E8;
    
    /* Disney Accent Colors */
    --accent-gold: #D4A843;
    --accent-royal-blue: #2E5A9B;
    --accent-crimson: #C0392B;
    --accent-teal: #1A8C7A;
    /* Success green. Fifteen places in cart.js and xbox_cloud.js already
       asked for this by name ("✓ Download started", "✓ Your save file is
       ready") with no fallback, so until now those lines simply inherited
       the surrounding text colour and the tick read as ordinary text. */
    --accent-green: #1F8F5F;
    --accent-plum: #7B3F7D;
    
    /* Typography Colors */
    --text-primary: #2C2520;
    --text-secondary: #5C544A;
    --text-muted: #9A9188;
    --text-light: #B8AFA4;
    
    /* Layout */
    --max-width: 95vw;
    --header-height: 72px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(44, 37, 32, 0.06);
    --shadow-md: 0 4px 16px rgba(44, 37, 32, 0.08);
    --shadow-lg: 0 12px 40px rgba(44, 37, 32, 0.1);
    --shadow-glow: 0 0 20px rgba(212, 168, 67, 0.12);
    
    /* Borders.
       Careful: --border-subtle is a whole shorthand ("1px solid ..."), so it
       belongs in `border: var(--border-subtle)`. Writing
       `border: 1px solid var(--border-subtle)` expands to nonsense and the
       browser throws the entire declaration away — which is exactly why the
       cart's input fields used to have no visible outline at all.
       When you only need the colour, use --border-color. */
    --border-subtle: 1px solid rgba(44, 37, 32, 0.08);
    --border-color: rgba(44, 37, 32, 0.08);

    /* Form fields need to read as fields, so they are drawn a good deal
       stronger than the hairline that separates two panels. */
    --field-border: #CFC6B8;
    --field-border-hover: #A99C88;
    --field-bg: #FCFAF6;
    --border-warm: 1px solid rgba(212, 168, 67, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

a {
    color: var(--accent-royal-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #FFFFFF;
}

/* Base Layout Structure */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-top: 0;
    padding: 2rem min(4%, 3rem);
    max-width: var(--max-width);
    width: 100%;
    margin-inline: auto;
}

.main-content.home-view {
    padding-top: 1.5rem;
}

.main-content.generic-view {
    padding-top: 2rem;
}

/* Surface Utilities */
.glass-panel {
    background: var(--bg-surface);
    border: var(--border-subtle);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
}

/* Header Styles */
.app-header {
    position: relative;
    z-index: 100;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem min(4%, 3rem) 0.5rem min(4%, 3rem);
    background: transparent;
    border-bottom: none;
    box-shadow: none;
}

.header-nav-container,
.header-bottom {
    display: flex;
    justify-content: center;
    width: 100%;
    z-index: 110;
}

.main-nav {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-self: center;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 30px;
    padding: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), var(--shadow-sm);
    position: relative;
}

.nav-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 0;
    background: var(--accent-royal-blue);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(46, 90, 155, 0.35);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
}

.nav-link {
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.45rem 1.25rem;
    border-radius: 20px;
    transition: color 0.3s ease, background-color 0.2s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 2;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: #FFFFFF;
}

.nav-link.active::after {
    display: none;
}

/* Footer — what this site is, on every page.
 *
 * Three things were wrong with the first attempt. It inherited the page's
 * serif body font (Libre Baskerville), while every other block of text on the
 * site is DM Sans, so it read as something pasted on. It was set at
 * 0.78–0.9rem, which is the size people skip. And the legal text sat in a
 * narrow centred column under three loose text blocks, which looked unsettled
 * rather than deliberate.
 *
 * Now it borrows the shape the rest of the site already uses: three cards on
 * the page background, each with a tinted icon, exactly like the panels
 * elsewhere. Under them a full-width band carries the legal notice, set in
 * three labelled notes so it fills the width without any line running 180
 * characters across a wide screen.
 */
.app-footer {
    margin-top: 4rem;
    border-top: var(--border-subtle);
    background: var(--bg-warm);
    color: var(--text-secondary);
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
}

/* ── the three cards ─────────────────────────────────────────────────── */
.footer-top {
    max-width: 1240px;
    margin: 0 auto;
    padding: 4rem 2rem 3.25rem;
}
.footer-lead {
    margin: 0 0 2.5rem;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -0.012em;
    color: var(--text-primary);
}
.footer-lead span {
    /* The second half is the warmer half; letting it break onto its own line
       on a narrow screen keeps the sentence from splitting mid-thought. */
    display: inline-block;
    font-weight: 500;
    color: var(--text-secondary);
}
.footer-cards {
    display: grid;
    /* auto-fit rather than a fixed three: the cards then drop to two and to
       one when the width really runs out, instead of at a number picked in
       advance. A fixed breakpoint had them stacking into one very wide card
       at 900px while the band below still showed two columns. */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.footer-card {
    position: relative;
    background: var(--bg-card);
    border: var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem 1.75rem 1.9rem;
    overflow: hidden;
}
/* A hairline of colour along the top edge, so the three read as a set
   without three loud boxes. */
.footer-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--footer-accent);
}
.footer-card.is-yes   { --footer-accent: var(--accent-teal); }
.footer-card.is-no    { --footer-accent: var(--accent-crimson); }
.footer-card.is-free  { --footer-accent: var(--accent-green); }

.footer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
    border-radius: 50%;
    color: var(--footer-accent);
    /* Neutral tint first: a browser without color-mix() still gets a proper
       disc behind the icon rather than nothing. */
    background: rgba(44, 37, 32, 0.06);
    background: color-mix(in srgb, var(--footer-accent) 12%, transparent);
}
.footer-icon svg { width: 21px; height: 21px; }

.footer-card h3 {
    margin: 0 0 .55rem;
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}
.footer-card p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--text-secondary);
}
.footer-card strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* ── the legal band, edge to edge ────────────────────────────────────── */
.footer-legal {
    border-top: var(--border-subtle);
    background: rgba(44, 37, 32, 0.035);
}
.footer-legal-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2.5rem 2rem 2.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem 3rem;
}
.footer-note h4 {
    margin: 0 0 .5rem;
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    /* Dark, not muted grey: these labels are what gives the band its
       structure, and at this size the muted grey measured 2.6:1 against the
       band — below the 4.5:1 small text needs. The hierarchy runs the other
       way now: dark label, lighter body. */
    color: var(--text-primary);
}
.footer-note p {
    margin: 0;
    /* --text-secondary, not --text-muted: measured against this band the muted
       grey comes to 2.7:1, well under the 4.5:1 ordinary text needs. A notice
       nobody can read protects nobody. This is 6.5:1. */
    color: var(--text-secondary);
    font-size: 0.93rem;
    font-weight: 400;
    line-height: 1.7;
}

@media (max-width: 1000px) {
    .footer-legal-inner { gap: 1.75rem 2.5rem; }
}
@media (max-width: 640px) {
    .footer-top { padding: 3rem 1.25rem 2.25rem; }
    .footer-lead { font-size: 1.18rem; margin-bottom: 1.75rem; }
    .footer-cards { gap: 1.25rem; }
    .footer-card { padding: 1.4rem 1.4rem 1.5rem; }
    .footer-legal-inner { padding: 2rem 1.25rem 2.25rem; gap: 1.5rem; }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(44, 37, 32, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(44, 37, 32, 0.25);
}

/* Responsive Design / Mobile Adjustments */
@media screen and (max-width: 768px) {
    .main-content {
        padding: 1rem;
        /* 95vw left a needless sliver of margin on a phone; the padding above
           already provides the breathing room. */
        max-width: 100%;
    }
    .main-content.home-view {
        padding-top: 1rem;
    }
    .main-content.generic-view {
        /* Was 5rem — 80px of empty space above every sub-page, which read as
           "the page is not centred" on a short screen. */
        padding-top: 1.5rem;
    }
    .app-header {
        padding: 0.75rem 0 0 0;
    }
    .header-bottom {
        position: static;
        margin-top: 1rem;
    }

    /* ── The navigation ───────────────────────────────────────────────────
       Six items need 547px; a phone offers 375. The pill used to be centred
       inside a too-narrow container, so it was clipped by 86px on BOTH sides:
       "Home" was unreachable on the left, the cart cut off on the right, and
       the 91px of overflow made every page look shifted.
       It now scrolls sideways instead — the standard mobile pattern. The auto
       margins keep it centred on the wider phones where it does fit. */
    .header-nav-container {
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0.35rem 1rem;
        scroll-padding-inline: 1rem;
    }
    .header-nav-container::-webkit-scrollbar {
        display: none;
    }
    .main-nav {
        flex: 0 0 auto;
        margin-inline: auto;
    }
    .nav-link {
        padding: 0.45rem 0.8rem;
        font-size: 0.78rem;
        white-space: nowrap;
        scroll-snap-align: center;
    }
}
