body {
    font-family: "Nunito", "Inter", sans-serif;
}

body.gameplay-lock,
body.gameplay-lock * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important; /* iOS: disable copy/lookup callout */
    -webkit-tap-highlight-color: transparent; /* remove grey tap flash */
}

    /* Allow form fields to still behave normally if they ever show during lock */
    body.gameplay-lock input,
    body.gameplay-lock textarea,
    body.gameplay-lock [contenteditable="true"] {
        -webkit-user-select: text !important;
        user-select: text !important;
    }

    /* Reduce gesture handling on the game surface */
    body.gameplay-lock #gameOutput,
    body.gameplay-lock #gameFrame {
        touch-action: none; /* helps on modern browsers; iOS support varies */
    }

/* ---------------- GENERAL CSS ---------------- */

.gameIdeaInput {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.game-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--game-placeholder-bg);
}

.game-card-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border: 1px solid var(--game-placeholder-border);
    border-radius: 9999px;
    background: var(--game-placeholder-circle);
    color: var(--game-placeholder-text);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.dark .game-card-initials {
    color: rgba(255, 255, 255, 0.308);
}

.dark .gameIdeaInput {
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.top-1\/2 {
    top: 45% !important; /*OVERRIDDING TAILWIND VERIONS*/
}

/* ---------------- LOADING ---------------- */
#loadingScreen {
    opacity: 1;
    margin: 0;
    padding: 0;
    height: 100vh;
    background: #c0265f url("../assets/app_images/bg_doodles.svg") center / 420px repeat;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

    #loadingScreen.is-fading {
        opacity: 0;
        animation: none;
    }

.loading-brand-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    width: min(980px, 92vw);
    margin: 0 auto;
    text-align: left;
}

.loading-brand-logo,
.loading-brand-copy {
    opacity: 0;
    will-change: transform, opacity;
}

.loading-brand-logo {
    flex: 0 0 auto;
    transform: translateY(-36px);
}

.loading-brand-copy {
    flex: 0 1 auto;
    transform: translateY(36px);
}

.loading-brand-logo.is-ready {
    animation: loadingLogoReveal 0.95s cubic-bezier(.22,1,.36,1) forwards;
}

.loading-brand-copy.is-ready {
    animation: loadingCopyReveal 0.95s cubic-bezier(.22,1,.36,1) 0.12s forwards;
}

.loading-img {
    display: block;
    width: clamp(160px, 22vw, 300px);
    height: auto;
    filter: drop-shadow(0 22px 28px rgba(90, 10, 46, 0.45));
    animation: mascotBob 2.6s ease-in-out infinite;
}

.loading-brand-title {
    margin: 0;
    display: grid;
    gap: 0.05em;
    font-family: var(--font-display);
    font-weight: 400;
    color: #fff;
    text-transform: uppercase;
    font-size: clamp(2rem, 4.8vw, 4.25rem);
    line-height: 1.02;
    letter-spacing: 0.01em;
    text-shadow: 0 6px 0 rgba(120, 10, 56, 0.35);
}

.loading-brand-copy .text-sun {
    color: #ffd21f;
}

.loading-bar {
    margin-top: 1.4rem;
    width: min(320px, 70vw);
    height: 14px;
    border-radius: 9999px;
    background: rgba(90, 10, 46, 0.35);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

    .loading-bar span {
        display: block;
        height: 100%;
        width: 100%;
        border-radius: inherit;
        background: linear-gradient(180deg, #ffd04a, #ff8a00);
        box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45);
        transform-origin: left center;
        transform: scaleX(0);
    }

.loading-brand-copy.is-ready .loading-bar span {
    animation: loadingFill 3s cubic-bezier(.4, 0, .2, 1) forwards;
}

@keyframes loadingFill {
    to {
        transform: scaleX(1);
    }
}

@keyframes mascotBob {
    0%, 100% {
        transform: translateY(0) rotate(-1.5deg);
    }

    50% {
        transform: translateY(-12px) rotate(1.5deg);
    }
}

@keyframes loadingLogoReveal {
    from {
        opacity: 0;
        transform: translateY(-36px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loadingCopyReveal {
    from {
        opacity: 0;
        transform: translateY(36px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .loading-brand-wrap {
        flex-direction: column;
        text-align: center;
        gap: 18px;
    }

    .loading-brand-logo,
    .loading-brand-copy {
        flex: none;
    }

    .loading-brand-copy {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .loading-img {
        width: clamp(140px, 42vw, 220px);
    }

    .loading-brand-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-brand-logo,
    .loading-brand-copy,
    .loading-brand-logo.is-ready,
    .loading-brand-copy.is-ready {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ---------------- SIDEBAR ---------------- */
#sidebar {
    /* Clean modern sidebar */
    background: #020617e0 !important;
}

/* Modern close button for mobile */
#sidebarCloseBtn {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    padding: 0;
    z-index: 50;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: currentColor;
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

#sidebarCloseBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.dark #sidebarCloseBtn {
    background: rgba(255, 255, 255, 0.08);
}

.dark #sidebarCloseBtn:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 767px) {
    #sidebarCloseBtn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Sidebar buttons container - Mobile first */
#sidebarBaseButtons {
    width: 90vw;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Desktop: stack buttons vertically in narrow column */
@media (min-width: 768px) {
    #sidebarBaseButtons {
        width: auto;
        max-width: 60px;
        gap: 12px;
    }
}

/* Modern sidebar button style */
.sidebar-btn {
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.08);
    color: currentColor;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.dark .sidebar-btn {
    background: rgba(255, 255, 255, 0.05);
}

/* Desktop: icon-only style */
@media (min-width: 768px) {
    .sidebar-btn {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
        align-items: center;
        font-size: 18px;
        background: transparent;
        border: none;
    }

    .sidebar-btn span {
        display: none !important;
    }
}

/* Mobile: full width with icon + text */
@media (max-width: 767px) {
    .sidebar-btn {
        width: 100%;
        padding: 16px 18px;
        gap: 16px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .dark .sidebar-btn {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .sidebar-btn span {
        display: inline !important;
    }
}

.sidebar-btn i {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s ease;
}

.sidebar-btn span {
    display: none;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Base button hover state */
.sidebar-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
}

.dark .sidebar-btn:hover {
    background: rgba(99, 102, 241, 0.15);
}

.sidebar-btn:active {
    transform: translateY(0);
}

/* Logout button special styling */
#btnLogout {
    color: rgb(239, 68, 68);
}

#btnLogout:hover {
    background: rgba(239, 68, 68, 0.08);
}

.dark #btnLogout:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Theme toggle special styling */
#themeToggle {
    color: rgb(99, 102, 241);
}

#themeToggle:hover {
    background: rgba(99, 102, 241, 0.12);
}

.dark #themeToggle:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* Game actions block at top of sidebar */
.sidebar-game-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    /* animation defaults (hidden) */
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    margin-bottom: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 260ms ease, transform 260ms ease, max-height 320ms ease, margin-bottom 320ms ease;
}

    /* Visible state */
    .sidebar-game-actions.is-visible {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px; /* enough for 2 buttons */
        margin-bottom: 6px;
        pointer-events: auto;
    }

/* Speech bubble to right of sidebar */
.suggest-bubble {
    position: fixed; /* sidebar is fixed on mobile; fixed keeps it stable */
    z-index: 60;
    left: 76px; /* approx: sidebar width + padding */
    top: 120px; /* will be set by JS for perfect alignment */
}

.suggest-bubble-inner {
    border-radius: 16px;
    padding: 14px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgb(203 213 225);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.dark .suggest-bubble-inner {
    background: rgba(15,23,42,0.92);
    border-color: rgb(51 65 85);
}

/* Little “tail” */
.suggest-bubble-inner::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 22px;
    width: 16px;
    height: 16px;
    transform: rotate(45deg);
    background: inherit;
    border-left: 1px solid rgba(203,213,225,1);
    border-bottom: 1px solid rgba(203,213,225,1);
}

.dark .suggest-bubble-inner::before {
    border-left-color: rgb(51 65 85);
    border-bottom-color: rgb(51 65 85);
}

/* Bubble animation */
.suggest-bubble.is-open .suggest-bubble-inner {
    animation: bubbleIn 220ms ease-out forwards;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateX(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}


/* ---------------- LANDING CARDS ---------------- */
.landing-card-modern {
    width: 320px;
    min-height: 300px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 0 0 rgba(99, 102, 241, 0);
}

    .landing-card-modern:hover {
        transform: translateY(-10px);
        box-shadow: 0 22px 40px rgba(15, 23, 42, 0.14), 0 0 24px rgba(99, 102, 241, 0.18);
        border-color: rgb(99 102 241);
    }

.landing-card-icon {
    width: 52px;
    height: 52px;
}

.landing-card-cta {
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.22);
}

    .landing-card-cta:hover {
        transform: translateY(-1px);
    }

.dark .landing-card-modern {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 0 rgba(99, 102, 241, 0);
}

    .dark .landing-card-modern:hover {
        box-shadow: 0 24px 42px rgba(0, 0, 0, 0.36), 0 0 24px rgba(99, 102, 241, 0.22);
    }

/* ---------------- LOADING ANIMATIONS ---------------- */
@keyframes slideFadeLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideFadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideFadeRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-fade-left,
.slide-fade-up,
.slide-fade-right {
    opacity: 0;
    animation-fill-mode: forwards;
}

.slide-fade-left {
    animation: slideFadeLeft 0.9s ease-out forwards;
}

.slide-fade-up {
    animation: slideFadeUp 0.9s ease-out forwards;
}

.slide-fade-right {
    animation: slideFadeRight 0.9s ease-out forwards;
}

@keyframes idleFloat {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.action-btn {
    padding: 1.5rem;
    border-radius: 1rem;
    font-family: "Manrope", sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgb(203 213 225);
    transition: transform 0.2s, border-color 0.2s;
}

.dark .action-btn {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
}

.action-btn:hover {
    transform: scale(1.05);
    border-color: rgb(99 102 241);
}

.action-btn.is-tab-active,
.action-btn.is-selected {
    border-color: rgb(99 102 241) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    transform: none;
}

.action-btn-danger {
    padding: 1.5rem;
    border-radius: 1rem;
    font-family: "Manrope", sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 0.75rem;
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgb(220, 38, 38);
    color: white;
    transition: transform 0.2s, background-color 0.2s;
}

.dark .action-btn-danger {
    background: rgba(220, 38, 38, 0.9);
    border-color: rgb(185, 28, 28);
}

.action-btn-danger:hover {
    transform: scale(1.05);
    background: rgba(220, 38, 38, 1);
}

/* Wizard Slides */
.wizard-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-top: 24px;
    padding-bottom: 40px;
}

/* Re-imagine Slides */
.reimagine-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.reimagine-tab {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgb(203 213 225);
    background: rgba(255,255,255,0.9);
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.dark .reimagine-tab {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
}

.reimagine-tab.is-active {
    border-color: rgb(99 102 241);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Reimagine site info card */
.reimagine-site-card {
    background: rgb(241 245 249);
    border: 1px solid rgb(226 232 240);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 8px;
    max-width: 420px;
    width: 100%;
}
.dark .reimagine-site-card {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
}
.reimagine-card-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.reimagine-card-favicon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    background: white;
    border: 1px solid rgb(226 232 240);
    flex-shrink: 0;
}
.reimagine-card-info {
    flex: 1;
    min-width: 0;
}
.reimagine-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: rgb(15 23 42);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .reimagine-card-title {
    color: rgb(241 245 249);
}
.reimagine-card-desc {
    font-size: 0.75rem;
    color: rgb(100 116 139);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.reimagine-card-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.reimagine-card-swatch-label {
    font-size: 0.7rem;
    color: rgb(100 116 139);
    font-weight: 500;
    margin-right: 2px;
}
.reimagine-card-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

/* Game type cards */
.game-type-card {
    height: 140px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #0f172a, #334155);
    color: white;
    /*font-family: "Press Start 2P";
    font-size: 0.6rem;*/
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    transition: transform 0.2s;
}

.game-type-card {
    position: relative;
    overflow: hidden;
}

    /* Selected outline (you already added this) */
    .game-type-card.is-selected {
        outline: 3px solid rgba(99, 102, 241, 0.9);
        transform: scale(1.03);
    }

    /* Check icon */
    .game-type-card::after {
        content: "\f058"; /* Font Awesome check-circle */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        border-radius: 999px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(99, 102, 241, 0.95);
        color: white;
        font-size: 14px;
        opacity: 0;
        transform: scale(0.5);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    /* Show icon when selected */
    .game-type-card.is-selected::after {
        opacity: 1;
        transform: scale(1);
    }

    .game-type-card:hover {
        transform: scale(1.05);
    }

    .step4-option-card,
    .step4-section-card {
        min-height: 50px;
        height: auto;
        align-items: flex-end;
        justify-content: flex-start;
        text-align: left;
        border: 1px solid rgba(255,255,255,0.12);
    }

        .step4-option-card span,
        .step4-section-card span {
            position: relative;
            z-index: 1;
            line-height: 1.5;
        }

    .step4-option-card {
        background: linear-gradient(135deg, #0f172a, #334155);
    }

    .step4-section-card {
        background: linear-gradient(135deg, #0f172a, #334155);
    }

    #advancedStep4Settings summary::-webkit-details-marker {
        display: none;
    }

    #advancedStep4Settings[open] {
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
    }

/* Asset slots */
.asset-slot {
    height: 140px;
    border: 2px dashed rgb(148 163 184);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-repeat: no-repeat;
}

    .asset-slot.add-more {
        border-style: solid;
    }

.asset-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.asset-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgb(203 213 225);
    background: rgba(255,255,255,0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.dark .asset-icon-btn {
    border-color: rgb(51 65 85);
    background: rgba(15,23,42,0.75);
}

.asset-icon-btn:hover {
    transform: scale(1.05);
    border-color: rgb(99 102 241);
}

.asset-label {
    position: absolute;
    left: 12px;
    bottom: 12px;
    right: 12px;
    z-index: 1;
    padding: 8px 10px;
    border-radius: 14px;
    font-family: "Press Start 2P";
    font-size: 0.6rem;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgb(203 213 225);
}

.dark .asset-label {
    background: rgba(15,23,42,0.75);
    border-color: rgb(51 65 85);
}

/* when removed */
.asset-slot.is-removed {
    opacity: 0.45;
    filter: grayscale(0.5);
}

    .asset-slot.is-removed::after {
        content: "Removed";
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: "Press Start 2P";
        font-size: 0.65rem;
        background: rgba(0,0,0,0.35);
        color: white;
    }


/* Modal animation states */
#assetModal {
    opacity: 0;
    transition: opacity 220ms ease;
}

    #assetModal.is-open {
        opacity: 1;
    }

/* Panel slides up/down (you can switch to left/right below) */
.asset-modal-panel {
    transform: translateY(20px);
    opacity: 0;
    transition: transform 260ms ease, opacity 260ms ease;
}

#assetModal.is-open .asset-modal-panel {
    transform: translateY(0);
    opacity: 1;
}

/* Optional: reduce motion */
@media (prefers-reduced-motion: reduce) {
    #assetModal, .asset-modal-panel {
        transition: none !important;
    }
}

/* Selected game type */
.game-type-card.is-selected {
    outline: 3px solid rgba(99, 102, 241, 0.9); /* indigo-ish */
    transform: scale(1.03);
}

.review-card {
    border: 1px solid rgb(203 213 225);
    border-radius: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.75);
}

.dark .review-card {
    border-color: rgb(51 65 85);
    background: rgba(15,23,42,0.6);
}

.review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.review-title {
    font-family: "Press Start 2P";
    font-size: 0.75rem;
}

.review-edit {
    font-size: 0.75rem;
    color: rgb(99 102 241);
}

.review-meta {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.review-row {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 1rem;
    align-items: start;
}

.review-logo {
    width: 160px;
    height: 160px;
    border-radius: 1rem;
    object-fit: cover;
    border: 1px solid rgb(203 213 225);
}

.dark .review-logo {
    border-color: rgb(51 65 85);
}

.review-logo.empty {
    width: 160px;
    height: 160px;
    border-radius: 1rem;
    border: 2px dashed rgb(148 163 184);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .review-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.review-asset {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.review-thumb {
    width: 100%;
    height: 90px;
    border-radius: 0.9rem;
    object-fit: cover;
    border: 1px solid rgb(203 213 225);
}

.dark .review-thumb {
    border-color: rgb(51 65 85);
}

.review-thumb.empty {
    border: 2px dashed rgb(148 163 184);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    opacity: 0.8;
}

.review-label {
    font-size: 0.65rem;
    opacity: 0.85;
}

/* ============== INLINE EDITING STYLES ============== */

.review-content {
    display: block;
}

.review-content.hidden {
    display: none;
}

.review-edit-form {
    display: none;
}

.review-edit-form.visible {
    display: block;
}

.review-edit-form.visible {
    animation: slideDown 220ms ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.edit-form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.edit-form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-form-group input,
.edit-form-group textarea {
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    padding: 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid rgb(203 213 225);
    background: white;
    color: rgb(15 23 42);
    transition: border-color 220ms ease, box-shadow 220ms ease;
}

.dark .edit-form-group input,
.dark .edit-form-group textarea {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
    color: rgb(226 232 240);
}

.edit-form-group input:focus,
.edit-form-group textarea:focus {
    outline: none;
    border-color: rgb(99 102 241);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dark .edit-form-group input:focus,
.dark .edit-form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.edit-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.edit-form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgb(203 213 225);
}

.dark .edit-form-actions {
    border-top-color: rgb(51 65 85);
}

.edit-form-btn {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 220ms ease;
}

.edit-form-btn-save {
    background: rgb(99 102 241);
    color: white;
}

.edit-form-btn-save:hover {
    background: rgb(79 70 229);
}

.edit-form-btn-cancel {
    background: transparent;
    color: rgb(99 102 241);
    border: 1px solid rgb(99 102 241);
}

.edit-form-btn-cancel:hover {
    background: rgb(99 102 241 / 0.1);
}

.dark .edit-form-btn-cancel:hover {
    background: rgb(99 102 241 / 0.2);
}

/* Two-column layout for contact details */
.edit-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .edit-form-row {
        grid-template-columns: 1fr;
    }
}

/* Panel transitions */
.panel {
    transition: opacity 220ms ease, transform 220ms ease;
}

.panel-hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.panel-shown {
    opacity: 1;
    transform: translateY(0);
}

/* Prevent animations from running before preload */
.preload-paused {
    animation-play-state: paused;
}

/* ---------------- OVERLAY LOADER FADE ---------------- */
#overlayLoader {
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

    #overlayLoader.is-open {
        opacity: 1;
        pointer-events: auto;
    }

.build-reasoning-list {
    min-height: 4.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.45rem;
}

.build-reasoning-list.is-leaving {
    animation: buildReasoningFadeOut 180ms ease forwards;
}

.build-reasoning-list.is-entering {
    animation: buildReasoningFadeIn 420ms ease both;
}

.build-reasoning-item {
    opacity: 0.9;
}

@keyframes buildReasoningFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@keyframes buildReasoningFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .build-reasoning-list.is-leaving,
    .build-reasoning-list.is-entering {
        animation: none;
    }
}

/* Loading images default sizing */
.loading-img {
    width: 150px;
}

.loading-img--center {
    width: 240px;
}

/* Mobile: slightly smaller for better fit */
@media (max-width: 640px) {
    .loading-img {
        width: 110px;
    }

    .loading-img--center {
        width: 180px;
    }
}

/* Mobile sidebar becomes a full-width bottom sheet style panel */
@media (max-width: 768px) {

    #sidebar {
        width: 100vw;
        padding: 16px;
        justify-content: center;
        align-items: center;
        /* Solid background with dark mode support */
        background: rgba(255,255,255,0.98);
    }

    .dark #sidebar {
        background: rgba(2,6,23,0.98); /* slate-950-ish */
    }

    /* Same for game actions (when visible) */
    #sidebarGameActions {
        width: 100%;
    }

        #sidebarGameActions.is-visible {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
            max-height: none; /* override the “collapsed” logic */
            margin-bottom: 12px;
            overflow: visible;
        }

    /* Make buttons full-width in their grid cells */
    .sidebar-btn {
        width: 100%;
        height: 56px;
    }
}

@media (max-width: 768px) {
    .sidebar-btn span {
        display: none;
    }
}

/* Allow main content to scroll on mobile */
@media (max-width: 768px) {
    main {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    #landing {
        /* become a single column stack */
        grid-template-columns: 1fr !important;
        /* use full available height and allow scroll */
        height: 100%;
        overflow-y: auto;
        padding: 16px !important;
        gap: 14px !important;
        /* prevent horizontal clipping */
        justify-items: stretch;
    }

        #landing .landing-card {
            width: 100% !important;
        }

    .landing-card-modern {
        width: 100%;
        min-height: 260px;
    }

    #landingCardGrid {
        width: 100%;
    }
}

@media (max-width: 768px) {
    #sidebar {
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

        /* the wrapper that holds both action groups */
        #sidebar > .flex {
            height: 100%;
            width: 100%;
            justify-content: space-between; /* spreads groups */
        }
}

/* Hide scrollbar but keep scrolling */
.auth-scroll::-webkit-scrollbar {
    width: 0px;
    height: 0px;
}

.auth-scroll {
    -ms-overflow-style: none; /* IE / Edge */
    scrollbar-width: none; /* Firefox */
}

/* Dark mode scrollbar styling */
.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark ::-webkit-scrollbar-track {
    background: transparent;
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
}

/* Firefox dark mode scrollbar */
.dark {
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

/* --- Modal animation system --- */
.modal-root {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* hidden state */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 0ms linear 220ms;
}

    .modal-root.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 220ms ease, visibility 0ms linear 0ms;
    }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    opacity: 0;
    transition: opacity 220ms ease;
}

.modal-root.is-open .modal-backdrop {
    opacity: 1;
}

.modal-panel {
    position: relative;
    z-index: 1;
    /* hidden state: slightly down + faded */
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: transform 260ms ease, opacity 220ms ease;
    will-change: transform, opacity;
}

.modal-root.is-open .modal-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .modal-root,
    .modal-backdrop,
    .modal-panel {
        transition: none !important;
        transform: none !important;
    }
}

#advancedStep4Settings summary::-webkit-details-marker {
    display: none;
}

#advancedStep4Settings summary {
    user-select: none;
}

#advancedStep4Settings .advanced-step4-content-wrap {
    overflow: hidden;
    height: 0;
    opacity: 0;
    transition: height 280ms ease, opacity 220ms ease;
}

#advancedStep4Settings[open] .advanced-step4-content-wrap {
    opacity: 1;
}

#advancedStep4Settings .advanced-step4-content {
    transform: translateY(-8px);
    transition: transform 280ms ease;
}

#advancedStep4Settings[open] .advanced-step4-content {
    transform: translateY(0);
}

#advancedStep4Settings {
    transition: box-shadow 220ms ease, border-color 220ms ease;
}

    #advancedStep4Settings[open] {
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
    }

@media (prefers-reduced-motion: reduce) {
    #advancedStep4Settings .advanced-step4-content-wrap,
    #advancedStep4Settings .advanced-step4-content,
    #advancedStep4Settings {
        transition: none !important;
    }
}

/* Sliding panel animations */
#websiteRefactorSection.expanded,
#websiteVersionsSection.expanded {
    max-height: 1000px;
}

#websiteRefactorSection,
#websiteVersionsSection {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

:root {
    --loading-robot-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'%3E%3Cdefs%3E%3ClinearGradient id='g1' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23e2e8f0'/%3E%3Cstop offset='100%25' stop-color='%23cbd5e1'/%3E%3C/linearGradient%3E%3ClinearGradient id='g2' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%2360a5fa'/%3E%3Cstop offset='100%25' stop-color='%2322d3ee'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='110' cy='26' r='8' fill='%2322d3ee'/%3E%3Crect x='106' y='34' width='8' height='16' rx='4' fill='%2394a3b8'/%3E%3Crect x='42' y='48' width='136' height='112' rx='42' fill='url(%23g1)'/%3E%3Crect x='64' y='74' width='92' height='48' rx='24' fill='%230f172a'/%3E%3Ccircle cx='88' cy='98' r='10' fill='url(%23g2)'/%3E%3Ccircle cx='132' cy='98' r='10' fill='url(%23g2)'/%3E%3Cpath d='M92 118 Q110 132 128 118' fill='none' stroke='%2322d3ee' stroke-width='6' stroke-linecap='round'/%3E%3Ccircle cx='38' cy='98' r='16' fill='%2394a3b8'/%3E%3Ccircle cx='182' cy='98' r='16' fill='%2394a3b8'/%3E%3Ccircle cx='38' cy='98' r='8' fill='%230f172a'/%3E%3Ccircle cx='182' cy='98' r='8' fill='%230f172a'/%3E%3Crect x='88' y='160' width='44' height='22' rx='11' fill='%2394a3b8'/%3E%3Crect x='74' y='182' width='72' height='18' rx='9' fill='%230f172a' opacity='0.92'/%3E%3C/svg%3E");
}

/* Data Schemas Styling */
#dataSchemasList {
    display: flex;
    flex-direction: column;
}

.data-schema-card {
    transition: all 0.2s ease;
}

.data-schema-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .data-schema-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Data Viewer Modal */
#dataViewerModal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dataViewerModal .modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

#dataViewerModal table {
    width: 100%;
    border-collapse: collapse;
}

#dataViewerModal th {
    background-color: #f3f4f6;
    color: #374151;
    font-weight: 600;
    border-bottom: 2px solid #d1d5db;
}

#dataViewerModal .dark th {
    background-color: #1f2937;
    color: #e5e7eb;
    border-bottom-color: #4b5563;
}

#dataViewerModal td {
    border-bottom: 1px solid #e5e7eb;
    word-break: break-word;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#dataViewerModal .dark td {
    border-bottom-color: #4b5563;
}

#dataViewerModal tr:last-child td {
    border-bottom: none;
}

/* Data Editor Modal */
#dataEditorModal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dataEditorModal .modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

/* Responsive Grid for Website Details */
@media (max-width: 1024px) {
    #websiteInfoPanel .grid {
        grid-template-columns: 1fr;
    }
}

/* Chat Option Buttons */
.chat-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chat-option-btn {
    position: relative;
    padding: 8px 14px;
    border: 1px solid rgb(99, 102, 241);
    background: rgba(99, 102, 241, 0.1);
    color: rgb(99, 102, 241);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.chat-option-btn.is-recommended {
    border-color: rgb(15, 118, 110);
    background: rgba(20, 184, 166, 0.12);
    color: rgb(15, 118, 110);
}

.chat-option-btn.is-recommended::after {
    content: "Recommended";
    display: block;
    margin-top: 2px;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0;
    opacity: 0.8;
}

.dark .chat-option-btn.is-recommended {
    background: rgba(20, 184, 166, 0.18);
    color: rgb(94, 234, 212);
}

.dark .chat-option-btn {
    background: rgba(99, 102, 241, 0.15);
}

.chat-option-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgb(79, 82, 219);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.dark .chat-option-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.chat-option-btn:active {
    transform: translateY(0);
    background: rgba(99, 102, 241, 0.3);
}

/* Chat Wizard - Gemini-like Interface */
#chatMessagesContainer,
#reimagineChatMessages {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 16px;
}

#chatMessagesContainer:not(:empty),
#reimagineChatMessages:not(:empty) {
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
}

/* Chat message bubbles */
#chatMessagesContainer > div,
#reimagineChatMessages > div {
    display: flex;
}

/* Wizard greeting message */
#chatMessagesContainer .wizard-greeting,
#reimagineChatMessages .wizard-greeting {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
}

#chatMessagesContainer .wizard-greeting .greeting-hello,
#reimagineChatMessages .wizard-greeting .greeting-hello {
    font-size: 1.5rem;
    font-weight: 800;
    color: rgba(46, 13, 13, 0.8);
}

.dark #chatMessagesContainer .wizard-greeting .greeting-hello,
.dark #reimagineChatMessages .wizard-greeting .greeting-hello {
    color: rgb(255, 255, 255);
}

#chatMessagesContainer .wizard-greeting .greeting-question,
#reimagineChatMessages .wizard-greeting .greeting-question {
    font-size: 2.5rem;
    font-weight: 100;
    max-width: 600px;
    color: #0f172a;
    line-height: 1.2;
}

.dark #chatMessagesContainer .wizard-greeting .greeting-question,
.dark #reimagineChatMessages .wizard-greeting .greeting-question {
    color: #f1f5f9;
}

/* Chat input area styling */
#chatWizardInput,
#reimagineChatInput {
    font-size: 1rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: inherit !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-family: inherit !important;
    resize: none !important;
}

.dark #chatWizardInput,
.dark #reimagineChatInput {
    background: rgba(30, 41, 59, 0.6) !important;
}

#chatWizardInput:focus,
#reimagineChatInput:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
    transition: box-shadow 0.2s ease;
}

#chatWizardInput::placeholder,
#reimagineChatInput::placeholder {
    color: rgba(100, 116, 139, 0.7);
}

/* Chat wizard animation */
#chatMessagesContainer,
#reimagineChatMessages {
    opacity: 0;
    transform: translateY(30px);
}

#chatMessagesContainer.chat-animate-in,
#reimagineChatMessages.chat-animate-in {
    animation: slideFadeUp 0.8s ease-out forwards;
}

#chatWizardInput,
#reimagineChatInput {
    opacity: 0;
    transform: translateY(30px);
}

#chatWizardInput.chat-animate-in,
#reimagineChatInput.chat-animate-in {
    animation: slideFadeUp 0.8s ease-out 0.2s forwards;
}

/* Typing indicator animation */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(100, 116, 139, 0.6);
    animation: typingBounce 1.4s infinite;
}

.dark .chat-typing-dot {
    background-color: rgba(148, 163, 184, 0.6);
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* =====================================================
   KID-FRIENDLY THEME  (berry background, candy-orange buttons)
   Keep this block last so it overrides the base styles above.
===================================================== */
:root {
    --font-display: "Lilita One", "Nunito", sans-serif;
    --berry: #c0265f;
    --berry-dark: #a81f55;
    --berry-deep: #7a1040;
    --pink-text: #ffd3e4;
    --sun: #ffd21f;
    --game-placeholder-bg: rgba(122, 16, 64, 0.35);
    --game-placeholder-border: rgba(255, 255, 255, 0.35);
    --game-placeholder-circle: rgba(255, 255, 255, 0.14);
    --game-placeholder-text: rgba(255, 255, 255, 0.7);
}

body.kid-theme {
    background-color: var(--berry);
    background-image: url("../assets/app_images/bg_doodles.svg");
    background-size: 440px;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

.kid-theme h1,
.kid-theme h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-synthesis: none;
    letter-spacing: 0.02em;
}

.kid-theme .wizard-step,
.kid-theme .reimagine-step {
    background: transparent !important;
}

/* ---------- Top nav ---------- */
.top-nav {
    position: relative;
    z-index: 45;
    flex: none;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px clamp(14px, 3vw, 40px);
    background: linear-gradient(180deg, #b21f5a, #b8225d);
    box-shadow: 0 8px 18px rgba(80, 0, 40, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -2px 0 rgba(255, 255, 255, 0.06);
}

.brand {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.brand-mascot {
    width: 46px;
    height: auto;
    filter: drop-shadow(0 4px 4px rgba(80, 0, 40, 0.4));
    transition: transform 0.25s ease;
}

.brand:hover .brand-mascot {
    transform: rotate(-8deg) scale(1.08);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 0.9;
    font-family: var(--font-display);
}

.brand-small {
    font-size: 0.85rem;
    color: var(--sun);
    letter-spacing: 0.04em;
}

.brand-big {
    font-size: 1.7rem;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 3px 0 var(--berry-deep);
}

.nav-pills {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 22px;
    border: none;
    border-radius: 9999px;
    background: rgba(70, 0, 35, 0.22);
    box-shadow: inset 0 2px 4px rgba(60, 0, 30, 0.3);
    color: #ff9fc0;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

    .nav-pill:hover {
        color: #fff;
        background: rgba(70, 0, 35, 0.38);
        transform: translateY(-2px);
    }

    .nav-pill.is-active {
        background: linear-gradient(180deg, #ff6b9a, #ee3f7c);
        box-shadow: 0 3px 0 #a3194f, 0 8px 14px rgba(80, 0, 40, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.35);
        color: #fff;
    }

.nav-icons {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 9999px;
    background: transparent;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

    .nav-icon-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: #fff;
        transform: scale(1.08);
    }

    .nav-icon-btn.hidden {
        display: none;
    }

    #btnLogout.nav-icon-btn,
    #btnLogout.nav-icon-btn:hover {
        color: #fff;
    }

    .nav-icon-btn span {
        display: none !important;
    }

    .nav-icon-btn img {
        width: 100%;
        height: 100%;
        border-radius: 9999px;
        object-fit: cover;
    }

.nav-icon-btn--desktop {
    display: none;
}

@media (min-width: 640px) {
    .nav-icon-btn--desktop {
        display: flex;
    }
}

@media (max-width: 639px) {
    .top-nav {
        grid-template-columns: auto 1fr auto;
        padding: 10px 12px;
        gap: 8px;
    }

    .brand-text {
        display: none;
    }

    .nav-pills {
        justify-content: center;
        gap: 6px;
    }

    .nav-pill {
        padding: 8px 12px;
        font-size: 0.68rem;
        letter-spacing: 0.06em;
    }

    .nav-icons {
        gap: 6px;
    }

    .nav-icon-btn {
        width: 36px;
        height: 36px;
    }
}

/* Keep the nav slim while a game is running so the game gets the space */
body.gameplay-lock .top-nav {
    padding-top: 6px;
    padding-bottom: 6px;
}

body.gameplay-lock .brand-text {
    display: none;
}

body.gameplay-lock .brand-mascot {
    width: 32px;
}

/* ---------- Speech bubbles (drop down from the nav) ---------- */
#bubbleLayer .suggest-bubble {
    left: auto !important;
    right: clamp(12px, 3vw, 40px);
    top: 76px !important;
}

.suggest-bubble-inner {
    border-radius: 20px;
    background: var(--berry-dark);
    border: 2px solid #ff9fc0;
    color: #fff;
    box-shadow: 0 14px 30px rgba(60, 0, 30, 0.4);
}

.suggest-bubble-inner::before,
.dark .suggest-bubble-inner::before {
    left: auto;
    right: 22px;
    top: -9px;
    border: none;
    border-left: 2px solid #ff9fc0;
    border-top: 2px solid #ff9fc0;
}

.dark .suggest-bubble-inner {
    background: var(--berry-dark);
    border-color: #ff9fc0;
}

.suggest-bubble.is-open .suggest-bubble-inner {
    animation: bubbleDrop 220ms ease-out forwards;
}

@keyframes bubbleDrop {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bubble-label {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffe08a;
}

/* ---------- Landing hero ---------- */
.landing-inner {
    max-width: 1180px;
    min-height: 100%;
    margin: 0 auto;
    padding: clamp(8px, 2vh, 24px) clamp(16px, 4vw, 48px) 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(16px, 3.5vh, 40px);
}

.hero {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: 8px;
}

.hero-title {
    margin: 0;
    display: flex;
    flex-direction: column;
    font-size: clamp(2.8rem, min(7.5vw, 14vh), 7.5rem);
    line-height: 0.95;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 6px 0 rgba(122, 16, 64, 0.4), 0 16px 28px rgba(80, 0, 40, 0.25);
}

    .hero-title span:last-child {
        color: var(--sun);
    }

.hero-sub {
    margin-top: 1.1rem;
    max-width: 30rem;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    font-weight: 600;
    line-height: 1.5;
    color: var(--pink-text);
}

    .hero-sub strong {
        color: #fff;
        font-weight: 900;
    }

.hero-art {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .hero-art::before {
        content: "";
        position: absolute;
        width: 78%;
        aspect-ratio: 1;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 130, 175, 0.65), rgba(255, 130, 175, 0) 70%);
    }

.hero-mascot {
    position: relative;
    width: auto;
    max-width: 100%;
    height: clamp(220px, 44vh, 440px);
    filter: drop-shadow(0 24px 24px rgba(80, 0, 40, 0.4));
    animation: mascotBob 3.2s ease-in-out infinite;
}

/* ---------- Feature cards ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 24px;
    background: linear-gradient(180deg, #d03a74, #c93070);
    box-shadow: 0 12px 24px rgba(80, 0, 40, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.16);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .feature-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 20px 32px rgba(80, 0, 40, 0.38), inset 0 2px 0 rgba(255, 255, 255, 0.2);
    }

.feature-icon {
    flex: none;
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    color: #fff;
    font-size: 2rem;
    transform: rotate(-6deg);
    transition: transform 0.25s ease;
    box-shadow: 0 10px 18px rgba(80, 0, 40, 0.35), inset 0 3px 0 rgba(255, 255, 255, 0.45), inset 0 -6px 0 rgba(0, 0, 0, 0.14);
}

    .feature-icon i {
        filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.2));
    }

.feature-card:hover .feature-icon {
    transform: rotate(4deg) scale(1.06);
}

.feature-icon--pink {
    background: linear-gradient(145deg, #ff8ed0, #a653e8);
}

.feature-icon--blue {
    background: linear-gradient(145deg, #7fe0ff, #3a7cf0);
}

.feature-icon--yellow {
    background: linear-gradient(145deg, #ffe36a, #ff9a1f);
}

.feature-body {
    min-width: 0;
}

.feature-title {
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
}

.feature-text {
    margin: 0.35rem 0 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--pink-text);
}

.candy-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 18px;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(180deg, #ffc247, #ff8a00);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(150, 60, 0, 0.5);
    cursor: pointer;
    box-shadow: 0 4px 0 #c75a00, 0 10px 18px rgba(80, 0, 40, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

    .candy-btn i {
        width: 26px;
        height: 26px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: rgba(199, 90, 0, 0.45);
        font-size: 0.7rem;
        text-shadow: none;
    }

    .candy-btn:hover {
        transform: translateY(-2px);
        filter: brightness(1.06);
    }

    .candy-btn:active {
        transform: translateY(3px);
        box-shadow: 0 1px 0 #c75a00, 0 4px 8px rgba(80, 0, 40, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.5);
    }

@media (max-width: 900px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .landing-inner {
        justify-content: flex-start;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        align-items: center;
        font-size: clamp(2.8rem, 15vw, 4.5rem);
    }

    .hero-sub {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-mascot {
        height: clamp(180px, 32vh, 280px);
    }

    .feature-card {
        padding: 14px;
    }

    .feature-icon {
        width: 68px;
        height: 68px;
        font-size: 1.6rem;
    }
}

/* ---------- Splash screen sizing (overrides the generic .loading-img rules) ---------- */
#loadingScreen .loading-img {
    width: clamp(180px, 26vw, 340px);
}

@media (max-width: 768px) {
    #loadingScreen .loading-img {
        width: clamp(140px, 42vw, 220px);
    }
}

/* ---------- Shared controls ---------- */
.action-btn,
.dark .action-btn,
.reimagine-tab,
.dark .reimagine-tab {
    font-family: inherit;
    font-weight: 800;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

    .action-btn:hover,
    .reimagine-tab:hover {
        background: rgba(255, 255, 255, 0.26);
        border-color: var(--sun);
    }

.action-btn.is-tab-active,
.action-btn.is-selected,
.reimagine-tab.is-active {
    border-color: var(--sun) !important;
    background: rgba(255, 210, 31, 0.22);
    box-shadow: 0 0 0 3px rgba(255, 210, 31, 0.3);
}

.asset-slot {
    border-color: rgba(255, 255, 255, 0.55);
    background-color: rgba(255, 255, 255, 0.08);
}

.asset-icon-btn,
.dark .asset-icon-btn {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(122, 16, 64, 0.6);
    color: #fff;
}

.asset-icon-btn:hover {
    border-color: var(--sun);
}

.reimagine-site-card,
.dark .reimagine-site-card {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}

.reimagine-card-title,
.dark .reimagine-card-title {
    color: #fff;
}

.reimagine-card-desc,
.reimagine-card-swatch-label {
    color: var(--pink-text);
}

.game-type-card,
.step4-option-card,
.step4-section-card {
    background: linear-gradient(135deg, #a93df0, #ff5c93);
}

.game-type-card.is-selected {
    outline-color: var(--sun);
}

.game-type-card::after {
    background: #ff8a00;
}

.chat-option-btn,
.dark .chat-option-btn {
    border-color: var(--sun);
    background: rgba(255, 210, 31, 0.15);
    color: #ffe27a;
}

    .chat-option-btn:hover,
    .dark .chat-option-btn:hover {
        background: rgba(255, 210, 31, 0.3);
        border-color: var(--sun);
        box-shadow: 0 4px 12px rgba(80, 0, 40, 0.3);
    }

#chatWizardInput,
#reimagineChatInput,
.dark #chatWizardInput,
.dark #reimagineChatInput {
    background: rgba(122, 16, 64, 0.4) !important;
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.35) !important;
}

    #chatWizardInput:focus,
    #reimagineChatInput:focus {
        border-color: var(--sun) !important;
        box-shadow: 0 0 0 3px rgba(255, 210, 31, 0.25) !important;
    }

    #chatWizardInput::placeholder,
    #reimagineChatInput::placeholder {
        color: rgba(255, 211, 228, 0.7);
    }

.chat-typing-dot,
.dark .chat-typing-dot {
    background-color: rgba(255, 255, 255, 0.7);
}

.edit-form-group input,
.edit-form-group textarea,
.dark .edit-form-group input,
.dark .edit-form-group textarea {
    background: var(--berry-dark);
    border-color: #e8689a;
    color: #fff;
}

    .edit-form-group input:focus,
    .edit-form-group textarea:focus,
    .dark .edit-form-group input:focus,
    .dark .edit-form-group textarea:focus {
        border-color: var(--sun);
        box-shadow: 0 0 0 3px rgba(255, 210, 31, 0.25);
    }

.edit-form-actions,
.dark .edit-form-actions {
    border-top-color: #e8689a;
}

.edit-form-btn-save {
    background: linear-gradient(180deg, #ffc247, #ff8a00);
}

    .edit-form-btn-save:hover {
        background: linear-gradient(180deg, #ffb52e, #f27300);
    }

.edit-form-btn-cancel {
    color: var(--sun);
    border-color: var(--sun);
}

    .edit-form-btn-cancel:hover,
    .dark .edit-form-btn-cancel:hover {
        background: rgba(255, 210, 31, 0.18);
    }

.review-logo,
.review-thumb,
.dark .review-logo,
.dark .review-thumb {
    border-color: #e8689a;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
}

    ::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.55);
    }

.dark {
    scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

@media (prefers-reduced-motion: reduce) {
    .loading-img,
    .hero-mascot {
        animation: none !important;
    }
}