.pg-page {
    --pg-blue: #3776ab;
    --pg-gold: #ffe234;
    --pg-purple: #6d28d9;
    color: #17131f;
    background: #fff;
}

.pg-page code,
.pg-page pre,
.pg-page textarea { font-family: "IBM Plex Mono", monospace; }
.pg-page textarea { white-space: pre; overflow-x: auto; }
.pg-page h1,
.pg-page h2,
.pg-page h3 { font-family: "Outfit", sans-serif; }
.pg-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pg-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #e8e2f1;
    background:
        radial-gradient(circle at 13% 10%, rgba(255, 226, 52, .22), transparent 28%),
        radial-gradient(circle at 88% 38%, rgba(55, 118, 171, .16), transparent 34%),
        #fbfaff;
}
.pg-grid {
    position: absolute;
    inset: 0;
    opacity: .42;
    background-image:
        linear-gradient(rgba(109, 40, 217, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(109, 40, 217, .07) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, #000, transparent 92%);
}
.pg-hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
    align-items: center;
    gap: clamp(42px, 7vw, 92px);
    min-height: 650px;
    padding-top: 88px;
    padding-bottom: 88px;
}
.pg-kicker,
.pg-eyebrow {
    margin: 0 0 14px;
    color: var(--pg-purple);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.pg-kicker span { color: #e0a800; }
.pg-hero h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(2.4rem, 4.6vw, 3.9rem);
    font-weight: 900;
    line-height: .98;
    letter-spacing: -.055em;
}
.pg-hero-lead {
    max-width: 690px;
    margin: 25px 0 0;
    color: #554d61;
    font-size: clamp(1.05rem, 1.7vw, 1.25rem);
    line-height: 1.68;
}
.pg-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.pg-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin: 27px 0 0;
    padding: 0;
    color: #625b6c;
    font-size: 13px;
    font-weight: 700;
    list-style: none;
}
.pg-proof li::before { content: "✓"; margin-right: 7px; color: #16a34a; }

.pg-window {
    position: relative;
    overflow: hidden;
    border: 1px solid #241a35;
    border-radius: 22px;
    box-shadow: 20px 25px 0 rgba(109, 40, 217, .09), 0 32px 70px rgba(29, 18, 48, .2);
    transform: rotate(1.5deg);
    background: #111827;
}
.pg-window::after {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 68px;
    height: 68px;
    content: "";
    background: var(--pg-gold);
    clip-path: polygon(55% 0, 100% 0, 63% 46%, 86% 46%, 25% 100%, 42% 59%, 16% 59%);
    opacity: .95;
}
.pg-window-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 44px;
    padding: 0 15px;
    color: #bcb6c8;
    background: #181126;
}
.pg-window-bar span { width: 10px; height: 10px; border-radius: 50%; background: #f05f57; }
.pg-window-bar span:nth-child(2) { background: #f3bd4f; }
.pg-window-bar span:nth-child(3) { background: #50c45b; }
.pg-window-bar em { margin-left: 8px; font: 500 12px "IBM Plex Mono"; font-style: normal; }
.pg-window-screen {
    position: relative;
    min-height: 350px;
    overflow: hidden;
    background: linear-gradient(#66c5db 0 72%, #d9d792 72% 100%);
}
.pg-window-screen strong {
    position: absolute;
    top: 22px;
    left: 50%;
    color: #fff;
    font: 900 40px "Outfit";
    text-shadow: 2px 2px #35566f;
}
.pg-cloud { position: absolute; width: 75px; height: 22px; border-radius: 30px; background: rgba(255,255,255,.65); }
.pg-cloud::before, .pg-cloud::after { position: absolute; bottom: 0; content: ""; border-radius: 50%; background: inherit; }
.pg-cloud::before { left: 12px; width: 32px; height: 32px; }
.pg-cloud::after { right: 10px; width: 25px; height: 25px; }
.pg-cloud--one { top: 82px; left: 24px; }
.pg-cloud--two { top: 142px; right: 40px; transform: scale(.7); }
.pg-pipe { position: absolute; right: 48px; width: 64px; background: linear-gradient(90deg, #3f9f32, #78d24f 45%, #318527); border: 3px solid #246c27; }
.pg-pipe::after { position: absolute; left: -9px; width: 76px; height: 24px; content: ""; border: 3px solid #246c27; background: #62c444; }
.pg-pipe--top { top: 0; height: 118px; border-top: 0; }
.pg-pipe--top::after { bottom: -5px; }
.pg-pipe--bottom { bottom: 0; height: 92px; border-bottom: 0; }
.pg-pipe--bottom::after { top: -5px; }
.pg-bird {
    position: absolute;
    top: 48%;
    left: 38%;
    display: grid;
    width: 54px;
    height: 42px;
    place-items: center;
    border: 3px solid #b87700;
    border-radius: 55% 45% 52% 48%;
    color: #6d28d9;
    font-size: 19px;
    background: var(--pg-gold);
    box-shadow: inset -9px -7px rgba(241, 165, 0, .35);
    animation: pg-fly 1.1s ease-in-out infinite alternate;
}
@keyframes pg-fly { to { transform: translateY(-18px) rotate(-8deg); } }

.pg-section { padding: 92px 0; border-bottom: 1px solid #ebe6f1; }
.pg-section--tint { background: #f8f6fc; }
.pg-section--dark { color: #fff; background: #161020; }
.pg-section-head { max-width: 760px; margin: 0 auto 42px; text-align: center; }
.pg-section h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.45rem);
    line-height: 1.06;
    letter-spacing: -.045em;
}
.pg-section-head > p:last-child,
.pg-prose > p {
    color: #655d70;
    font-size: 1.04rem;
    line-height: 1.8;
}
.pg-section--dark .pg-section-head > p:last-child { color: #bdb5c8; }
.pg-prose { max-width: 920px; margin: 0 auto; }
.pg-prose h2 { max-width: 790px; margin-bottom: 26px; }
.pg-prose code, .pg-section-head code {
    padding: 2px 6px;
    border-radius: 5px;
    color: #5b21b6;
    font-size: .88em;
    background: #eee8f8;
}

.pg-playground {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(270px, .65fr);
    gap: 20px;
    align-items: stretch;
}
.pg-editor {
    overflow: hidden;
    border: 1px solid #2a2037;
    border-radius: 16px;
    box-shadow: 0 22px 60px rgba(32, 20, 49, .14);
    background: #111019;
}
.pg-editor-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 18px;
    border-bottom: 1px solid #31283e;
    color: #fff;
    font: 600 13px "IBM Plex Mono";
    background: #1c1724;
}
.pg-editor-bar small { color: #9e93ad; font-size: 11px; }
#pygameStarterCode {
    display: block;
    width: 100%;
    min-height: 500px;
    resize: vertical;
    padding: 22px;
    border: 0;
    outline: 0;
    color: #e7e3ed;
    font-size: 13.5px;
    line-height: 1.65;
    tab-size: 4;
    background: #111019;
}
#pygameStarterCode:focus { box-shadow: inset 0 0 0 2px var(--pg-purple); }
.pg-editor-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 70px;
    padding: 12px 16px;
    border-top: 1px solid #31283e;
    background: #1c1724;
}
.pg-editor-actions .st-btn { border: 0; cursor: pointer; }
.pg-editor-actions .st-btn[disabled] { cursor: wait; opacity: .7; }
.pg-reset { border: 0; color: #bcb3c8; background: transparent; cursor: pointer; text-decoration: underline; }
#pygameLaunchStatus { margin-left: auto; color: #c5bcd2; font-size: 12px; }
.pg-steps {
    padding: 30px;
    border: 1px solid #e0d9ea;
    border-radius: 16px;
    background: #faf9fc;
}
.pg-steps h3 { margin: 0 0 24px; font-size: 1.45rem; }
.pg-steps ol { display: grid; gap: 30px; margin: 0; padding: 0; counter-reset: steps; list-style: none; }
.pg-steps li { position: relative; padding-left: 48px; counter-increment: steps; }
.pg-steps li::before {
    position: absolute;
    top: -4px;
    left: 0;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    content: counter(steps);
    color: #fff;
    font-weight: 800;
    background: var(--pg-purple);
}
.pg-steps strong, .pg-steps span { display: block; }
.pg-steps span { margin-top: 6px; color: #706778; font-size: 14px; line-height: 1.55; }

.pg-definitions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 42px;
}
.pg-definitions article { padding: 26px; border: 1px solid #ded7e8; border-radius: 14px; background: #fff; }
.pg-definitions span { color: var(--pg-purple); font: 800 12px "IBM Plex Mono"; }
.pg-definitions h3 { margin: 16px 0 7px; font-size: 1.35rem; }
.pg-definitions p { margin: 0; color: #6b6373; font-size: 14px; line-height: 1.65; }
.pg-split, .pg-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(45px, 8vw, 105px); align-items: center; }
.pg-two-col { align-items: start; }
.pg-two-col .pg-prose { margin: 0; }
.pg-two-col .pg-prose + .pg-prose { padding-left: clamp(0px, 3vw, 45px); border-left: 1px solid #e0dae8; }
.pg-terminal { overflow: hidden; border-radius: 16px; box-shadow: 0 20px 55px rgba(34, 22, 50, .17); background: #15111b; }
.pg-terminal > div { display: flex; gap: 7px; align-items: center; height: 42px; padding: 0 14px; color: #aaa0b7; background: #211a2a; }
.pg-terminal i { width: 9px; height: 9px; border-radius: 50%; background: #ec5f56; }
.pg-terminal i:nth-child(2) { background: #f3bd4f; }
.pg-terminal i:nth-child(3) { background: #50c45b; }
.pg-terminal span { margin-left: auto; font: 11px "IBM Plex Mono"; }
.pg-terminal pre { margin: 0; padding: 28px; color: #d8d1e1; font-size: 13px; line-height: 1.85; }
.pg-flow { display: grid; grid-template-columns: 1fr auto 1.4fr auto 1.2fr; gap: 15px; align-items: center; margin: 40px 0; }
.pg-flow span { padding: 20px; border: 1px solid #dcd4e7; border-radius: 12px; text-align: center; background: #faf9fc; }
.pg-flow i { color: var(--pg-purple); font-style: normal; font-weight: 900; }

.pg-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pg-game {
    overflow: hidden;
    padding: 0;
    border: 1px solid #40364b;
    border-radius: 16px;
    color: inherit;
    text-align: left;
    background: #211929;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease;
}
.pg-game:hover { transform: translateY(-5px); border-color: var(--pg-gold); }
.pg-game:focus-visible { outline: 3px solid var(--pg-gold); outline-offset: 3px; }
.pg-game:disabled { cursor: wait; opacity: .7; }
.pg-game-art { position: relative; display: grid; height: 180px; place-items: center; overflow: hidden; }
.pg-game-art b { position: relative; z-index: 2; font: 800 34px "Outfit"; letter-spacing: 3px; }
.pg-game-art i { position: absolute; inset: auto 0 0; height: 38px; background: rgba(0,0,0,.18); }
.pg-game--flappy .pg-game-art { color: #ffd43b; background: #55b9cd; }
.pg-game--snake .pg-game-art { color: #4ade80; background: #234f39; }
.pg-game--pong .pg-game-art { color: #fff; background: #0b1630; }
.pg-game > span:last-child { display: flex; flex-direction: column; padding: 20px; }
.pg-game strong { font: 800 1.35rem "Outfit"; }
.pg-game small { margin-top: 4px; color: #aaa0b5; }
.pg-game em { margin-top: 18px; color: var(--pg-gold); font-size: 13px; font-style: normal; font-weight: 800; }

.pg-faq { max-width: 900px; }
.pg-faq details { border-top: 1px solid #dcd5e5; }
.pg-faq details:last-child { border-bottom: 1px solid #dcd5e5; }
.pg-faq summary { position: relative; padding: 22px 48px 22px 0; font: 700 1.08rem "Outfit"; cursor: pointer; list-style: none; }
.pg-faq summary::-webkit-details-marker { display: none; }
.pg-faq summary::after { position: absolute; top: 20px; right: 4px; content: "+"; color: var(--pg-purple); font-size: 24px; }
.pg-faq details[open] summary::after { content: "−"; }
.pg-faq details p { margin: 0; padding: 0 50px 24px 0; color: #655d70; line-height: 1.75; }
.pg-cta { padding: 72px 0; color: #fff; background: #171020; }
.pg-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.pg-cta h2 { margin: 0; font: 900 clamp(2rem, 4vw, 3.5rem)/1 "Outfit"; letter-spacing: -.04em; }
.pg-cta p:last-child { margin-bottom: 0; color: #bdb5c7; }
.pg-cta .pg-eyebrow { color: var(--pg-gold); }

@media (max-width: 900px) {
    .pg-hero-inner, .pg-playground, .pg-split, .pg-two-col { grid-template-columns: 1fr; }
    .pg-hero-inner { min-height: 0; padding-top: 70px; }
    .pg-window { max-width: 620px; width: 100%; margin: 0 auto; }
    .pg-definitions, .pg-games { grid-template-columns: 1fr; }
    .pg-game { display: grid; grid-template-columns: 170px 1fr; }
    .pg-game-art { height: 100%; min-height: 160px; }
    .pg-two-col .pg-prose + .pg-prose { padding: 45px 0 0; border-top: 1px solid #e0dae8; border-left: 0; }
    .pg-flow { grid-template-columns: 1fr; }
    .pg-flow i { transform: rotate(90deg); text-align: center; }
}
@media (max-width: 600px) {
    .pg-hero-inner { padding-top: 52px; padding-bottom: 60px; }
    .pg-hero h1 { font-size: 2.7rem; }
    .pg-window-screen { min-height: 270px; }
    .pg-section { padding: 68px 0; }
    .pg-editor-actions { align-items: stretch; flex-direction: column; }
    #pygameLaunchStatus { margin-left: 0; }
    .pg-game { grid-template-columns: 1fr; }
    .pg-game-art { min-height: 145px; }
    .pg-cta-inner { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    .pg-bird { animation: none; }
    .pg-game { transition: none; }
}
