:root
{
    --c-red: #d62828;
    --c-yel: #f1c40f;
    --c-grn: #2ecc71;
    --c-cyn: #1abc9c;
    --bg:    #0a0a0a;
    --card:  #131313;
    --text:  #f0f0f0;
    --muted: #888;
    --line:  #2a2a2a;

    /* Onboarding intro window — tune width/height here */
    --intro-width:  50%;
    --intro-height: 70%;
}

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

html, body
{
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
}

body
{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1.5rem;
    text-align: center;
}

/* --- Top bar (language + currency controls) ------------------------ */

.top-bar
{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: rgba(10, 10, 10, 0.85);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(4px);
    z-index: 500;
}

.top-icon-btn
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
}

.top-icon-btn:hover
{
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.top-icon-btn svg
{
    width: 1.3rem;
    height: 1.3rem;
}

.lang-wrap
{
    position: relative;
}

.lang-menu[hidden]
{
    display: none;
}

.lang-menu
{
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    display: flex;
    flex-direction: column;
    min-width: 9rem;
    padding: 0.25rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.lang-option
{
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.lang-option:hover
{
    background: rgba(255, 255, 255, 0.06);
}

.lang-option.is-active
{
    color: #f7931a;
    font-weight: 700;
}

/* --- Hero ---------------------------------------------------------- */

.hero
{
    margin-bottom: 3.5rem;
}

#cc-logo{display:inline-flex;align-items:center;gap:40px;padding:28px 34px;font-family:'Space Grotesk',sans-serif;}
  #cc-stage{position:relative;width:150px;height:151px;transform:translateY(3px);display:flex;flex:none;overflow:hidden;background:#cfeaef;border-radius:16px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);}

/* keep the logo readable / centered on small screens */
#cc-logo { flex-wrap: wrap; justify-content: center; }

.tagline
{
    margin-top: 2rem;
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.welcome
{
    margin: 1.4rem auto 0;
    max-width: 640px;
    color: #bbb;
    font-size: 1rem;
    line-height: 1.55;
}

/* --- Games --------------------------------------------------------- */

.games
{
    width: 100%;
    max-width: 760px;
    display: grid;
    gap: 1rem;
}

/* Game cards sit side by side; narrow screens wrap to a single column. */
.game-row
{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.games-title
{
    text-align: left;
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.game-card
{
    display: block;
    text-decoration: none;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.game-card:hover,
.game-card:focus-visible
{
    transform: translateY(-3px);
    border-color: var(--c-yel);
    box-shadow: 0 0 28px rgba(241, 196, 15, 0.18);
    outline: none;
}

.game-card h2
{
    font-size: 1.4rem;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.game-card .arrow
{
    color: var(--c-yel);
    transition: transform 0.18s ease;
}

.game-card:hover .arrow
{
    transform: translateX(4px);
}

.game-card p
{
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

/* "Chuckie ₿" wordmark — same lettering as the game's title screen and
   in-game header: bold Space Grotesk, primary yellow, Bitcoin badge as the B. */
.chuckie-wordmark
{
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--c-yel);
}

.btc-badge
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: #f7931a;
    color: #fff;
    font-size: 1.1rem;
    flex: none;
}

/* Invaders logo — same mark as the game's header: the marching alien sprite
   next to the title, in the game's alien cyan. */
.invaders-wordmark
{
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #5fd4ff;
    text-shadow: 0 0 12px rgba(95, 212, 255, 0.4);
}

.invader-sprite
{
    width: 1.9rem;
    height: 1.4rem;
    fill: #5fd4ff;
    flex: none;
}

@keyframes invader-march-first
{
    0%, 49.9% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes invader-march-second
{
    0%, 49.9% { opacity: 0; }
    50%, 100% { opacity: 1; }
}

.invader-frame-first
{
    animation: invader-march-first 1.1s steps(1, end) infinite;
}

.invader-frame-second
{
    animation: invader-march-second 1.1s steps(1, end) infinite;
}

@media (prefers-reduced-motion: reduce)
{
    .invader-frame-first { animation: none; opacity: 1; }
    .invader-frame-second { animation: none; opacity: 0; }
}

.upcoming-card
{
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: 10px;
    padding: 2rem 1.75rem;
    color: var(--muted);
    font-size: 0.95rem;
}

/* --- Footer -------------------------------------------------------- */

footer
{
    margin-top: 4rem;
    color: #555;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.footer-help
{
    margin-bottom: 0.5rem;
}

.footer-help a
{
    color: var(--muted);
    text-transform: none;
    letter-spacing: normal;
}

.footer-help a:hover
{
    color: var(--text);
}

/* --- Onboarding intro crawl (Star Wars style) --------------------- */

.intro-overlay
{
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.intro-overlay[hidden]
{
    display: none;
}

.intro-window
{
    position: relative;
    width: var(--intro-width);
    max-width: 100%;
    height: var(--intro-height);
    max-height: 90vh;
    background: #000;
    border: 2px solid var(--c-yel);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(241, 196, 15, 0.18);
    overflow: hidden;
}

.intro-viewport
{
    position: absolute;
    inset: 0;
    perspective: 420px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 22%, #000 68%, transparent 100%);
    mask-image: linear-gradient(to top, transparent 0%, #000 22%, #000 68%, transparent 100%);
}

.intro-crawl
{
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 92%;
    max-width: 680px;
    transform: translateX(-50%) rotateX(30deg);
    transform-origin: 50% 100%;
    color: var(--c-yel);
    font-family: 'Space Grotesk', sans-serif;
    text-align: justify;
}

/*
    The crawl content is animated to scroll upwards and out of view.
    The animation speed can be adjusted as needed.
*/
.intro-content
{
    animation: intro-crawl 120s linear forwards;
}

.intro-logo
{
    display: flex;
    justify-content: center;
    margin-bottom: 2.2rem;
}

.intro-content p
{
    margin-bottom: 1.4rem;
    font-size: 1.55rem;
    line-height: 1.55;
    font-weight: 700;
}

@keyframes intro-crawl
{
    0%
    {
        transform: translateY(100%);
    }

    100%
    {
        transform: translateY(-185%);
    }
}

.intro-actions
{
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 1001;
    display: flex;
    gap: 0.6rem;
}

.intro-skip,
.intro-dismiss,
.intro-sound
{
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.intro-skip:hover,
.intro-dismiss:hover,
.intro-sound:hover
{
    color: var(--text);
    border-color: var(--c-yel);
}

.intro-sound
{
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.6rem;
}

.intro-sound svg
{
    display: block;
}

/* Sound off — keep the same icon, just dim and soften it. */
.intro-sound.is-muted
{
    opacity: 0.45;
    filter: grayscale(1) blur(0.4px);
}

.intro-sound-wrap
{
    position: relative;
    display: inline-flex;
}

/* Cartoon speech bubble nudging the user to enable sound. */
.intro-hint
{
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    white-space: nowrap;
    background: #fff;
    color: #111;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0.45rem 0.7rem;
    border: 2px solid #111;
    border-radius: 14px;
    box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.45);
    pointer-events: none;
    animation: intro-hint-bob 1.4s ease-in-out infinite;
}

/* Bubble tail — black outline triangle with a white triangle on top. */
.intro-hint::before,
.intro-hint::after
{
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    border: 8px solid transparent;
    border-bottom-color: #111;
    transform: translateX(-50%);
}

.intro-hint::after
{
    border-width: 6px;
    border-bottom-color: #fff;
    margin-bottom: -1px;
}

/* Hide the bubble once sound is on. */
.intro-sound:not(.is-muted) + .intro-hint
{
    display: none;
}

@keyframes intro-hint-bob
{
    0%, 100%
    {
        transform: translateX(-50%) translateY(0);
    }

    50%
    {
        transform: translateX(-50%) translateY(-3px);
    }
}

@media (prefers-reduced-motion: reduce)
{
    .intro-hint
    {
        animation: none;
    }
}

.intro-replay
{
    position: fixed;
    bottom: 1.4rem;
    right: 1.4rem;
    z-index: 900;
    width: 44px;
    height: 44px;
    background: var(--card);
    color: var(--c-yel);
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.intro-replay[hidden]
{
    display: none;
}

.intro-replay:hover
{
    transform: translateY(-2px);
    border-color: var(--c-yel);
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.25);
}

@media (max-width: 520px)
{
    .intro-content p
    {
        font-size: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce)
{
    .intro-content
    {
        animation-duration: 90s;
    }
}

/* --- Learn Bitcoin page -------------------------------------------- */

/* This page is a scrollable article, so override the centred body layout. */
.learn-body
{
    display: block;
    justify-content: flex-start;
    text-align: left;
    /* Extra top padding clears the fixed top bar. */
    padding: 4.5rem 1.5rem 3rem;
}

.learn
{
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.learn-hero
{
    text-align: center;
    margin-bottom: 3rem;
}

.learn-coin
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 3px solid #f7931a;
    border-radius: 50%;
    color: #f7931a;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

.learn-hero h1
{
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 7vw, 3rem);
    margin-bottom: 1rem;
}

.learn-lede
{
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.55;
    max-width: 40ch;
    margin: 0 auto;
}

.learn-section
{
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.25rem;
}

.learn-section h2
{
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--c-yel);
}

.learn-section p
{
    line-height: 1.65;
    margin-bottom: 1rem;
}

.learn-section p:last-child
{
    margin-bottom: 0;
}

.learn-steps,
.learn-tips
{
    padding-left: 1.4rem;
    line-height: 1.65;
}

.learn-steps li,
.learn-tips li
{
    margin-bottom: 0.9rem;
}

.learn-steps li:last-child,
.learn-tips li:last-child
{
    margin-bottom: 0;
}

.learn-note
{
    color: var(--muted);
    font-size: 0.95rem;
    border-left: 3px solid var(--c-grn);
    padding-left: 1rem;
    margin-top: 1.25rem;
}

.learn-section strong
{
    color: var(--text);
}

.learn-actions
{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
}

.learn-btn
{
    display: inline-block;
    text-decoration: none;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.8rem 1.4rem;
    font-weight: 700;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.learn-btn:hover,
.learn-btn:focus-visible
{
    transform: translateY(-2px);
    border-color: var(--c-yel);
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.18);
    outline: none;
}

.learn-btn-primary
{
    background: #f7931a;
    border-color: #f7931a;
    color: #0a0a0a;
}

.learn-btn-primary:hover,
.learn-btn-primary:focus-visible
{
    box-shadow: 0 0 24px rgba(247, 147, 26, 0.35);
}

/* --- Learn link on the landing page -------------------------------- */

.learn-link
{
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1.5rem;
    color: #f7931a;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    transition: opacity 0.18s ease;
}

.learn-link:hover,
.learn-link:focus-visible
{
    opacity: 0.8;
    outline: none;
}
