/* Start menu styles (canonical) */
.start-menu-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    /* make wrapper transparent so the main page background shows through */
    background: transparent;
    backdrop-filter: none;
    color: var(--text-primary);
    transition: opacity 0.4s ease, visibility 0.4s ease, max-height 0.4s ease;
    max-height: 100vh;
    overflow: hidden;
    z-index: 3;
    /* removed heavy inset shadow to keep background uniform */
    box-shadow: none;
}

/* Background canvas sits behind the menu content */
.start-menu-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
    pointer-events: none;
}

/* Subtle grid overlay (separate element so we can tune opacity and size) */
.start-menu-bg-grid {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    /* subtle grid only — remove colored blobs to avoid bright spots */
    background-image: linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 64px 64px, 64px 64px;
    background-position: 0 0, 0 0;
    mix-blend-mode: normal;
    opacity: 0.28;
}

@keyframes bgFloat {
    0% { background-position: 8% 75%, 88% 18%, 0 0, 0 0; }
    50% { background-position: 12% 70%, 84% 22%, 0 0, 0 0; }
    100% { background-position: 8% 75%, 88% 18%, 0 0, 0 0; }
}

/* Ensure HUD corners inside the start menu render above the bg elements */
.start-menu-wrapper .hud-corner {
    z-index: 50;
}

/* Hide mobile connect button on desktop by default */
#connectWalletBtn {
    display: none !important;
}

.start-menu-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.start-menu-wrapper.hidden .start-card__username,
.start-menu-wrapper.hidden .wallet-display {
    display: none !important;
}

.start-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 6vw, 56px);
    min-height: 0;
}

/* Three-column layout container */
.start-menu-main {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 1400px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.start-menu-main::-webkit-scrollbar {
    display: none;
}

/* Each column */
.start-menu-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-width: 0;
    z-index: 10;
}

.start-menu-column--left {
    flex: 0 1 380px;
    justify-content: center;
}

.start-menu-column--center {
    flex: 0 1 380px;
    justify-content: center;
}

.start-menu-column--right {
    flex: 0 1 380px;
    justify-content: center;
}



/* Responsive adjustments for screens under 1150px - stack sections vertically */
@media (max-width: 1150px) {
    .start-menu-main {
        display: flex;
        flex-direction: column;
        gap: 20px;
        justify-content: flex-start;
        align-items: center;
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 180px);
        overflow-y: auto;
        overflow-x: hidden;
        padding: 0 16px;
    }

    .start-menu-column {
        display: flex;
        flex-direction: column;
        gap: 12px;
        flex: 0 1 auto;
        min-width: 0;
        width: 100%;
        max-width: 380px;
    }

    .start-menu-column--left {
        flex: 0 1 auto;
        width: 100%;
        max-width: 380px;
        justify-content: center;
    }

    .start-menu-column--center {
        flex: 0 1 auto;
        width: 100%;
        max-width: 380px;
        justify-content: center;
    }

    .start-menu-column--right {
        flex: 0 1 auto;
        width: 100%;
        max-width: 380px;
        justify-content: center;
    }
}

/* Responsive adjustments for start menu */
@media (max-width: 900px) {
    .start-menu-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .start-menu-wallet {
        position: static;
        width: 100%;
        margin: 0 clamp(20px, 6vw, 40px);
    }

    .start-menu {
        padding: clamp(16px, 5vw, 40px);
    }
}

@media (max-width: 600px) {
    .start-card {
        padding: 24px 20px;
        border-radius: 18px;
    }

    .payment-container {
        padding: 16px;
    }

    .start-menu-topbar {
        padding: 20px;
    }
}

/* Start menu leaderboard styles moved to `start-leaderboard.css` */

/* Responsive HUD layout for screens under 700px width */
@media (max-width: 700px) {
    .start-menu {
        padding-top: 50px;
    }

    .hud-corner--top-left {
        top: 10px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: auto;
        min-width: 310px;
    }

    .hud-corner--top-right {
        top: 60px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        min-width: 310px;
    }

    .hud-corner--top-right .top-right-group {
        display: flex;
        gap: 8px;
        justify-content: center;
    }

    .hud-corner--bottom-left {
        bottom: 10px;
        left: 10px;
        right: auto;
        transform: none;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .hud-corner--bottom-right {
        bottom: 10px;
        right: 10px;
        left: auto;
        transform: none;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* Mobile: When wallet is not connected, show brand and connect button on one roll */
    .start-menu-wrapper.wallet-disconnected .hud-corner--top-left {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 12px;
        position: absolute;
        top: 10px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        flex-direction: row;
        width: auto;
    }

    .start-menu-wrapper.wallet-disconnected #connectWalletBtn {
        display: inline-flex !important;
        position: static !important;
        transform: none !important;
        margin: 0 !important;
        z-index: 51;
    }

    .start-menu-wrapper.wallet-disconnected .hud-corner--top-right {
        display: none !important;
    }

    .start-menu-wrapper.wallet-disconnected .username-display {
        display: none !important;
    }

    .start-menu-wrapper.wallet-disconnected #walletDisplay {
        display: none !important;
    }
}


@media (min-width: 1420px) {

        .start-menu {
        transform: scale(1.075);
        transform-origin: center;
    }

    .hud-corner--top-left {
        transform: scale(1.075);
        transform-origin: top left;
    }

    .hud-corner--top-right {
        transform: scale(1.075);
        transform-origin: top right;
    }

    .hud-corner--bottom-left {
        transform: scale(1.075);
        transform-origin: bottom left;
    }

    .hud-corner--bottom-right {
        transform: scale(1.075);
        transform-origin: bottom right;

    }

    .social-buttons {
        transform: scale(1.075);
        transform-origin: center;
    }
}

@media (min-width: 1500px) {

        .start-menu {
        transform: scale(1.125);
        transform-origin: center;
    }

    .hud-corner--top-left {
        transform: scale(1.125);
        transform-origin: top left;
    }

    .hud-corner--top-right {
        transform: scale(1.125);
        transform-origin: top right;
    }

    .hud-corner--bottom-left {
        transform: scale(1.125);
        transform-origin: bottom left;
    }

    .hud-corner--bottom-right {
        transform: scale(1.125);
        transform-origin: bottom right;
    }

    .social-buttons {
        transform: scale(1.125);
        transform-origin: center;
    }
}

@media (min-width: 1600px) {

        .start-menu {
        transform: scale(1.15);
        transform-origin: center;
    }

    .hud-corner--top-left {
        transform: scale(1.15);
        transform-origin: top left;
    }

    .hud-corner--top-right {
        transform: scale(1.15);
        transform-origin: top right;
    }

    .hud-corner--bottom-left {
        transform: scale(1.15);
        transform-origin: bottom left;
    }

    .hud-corner--bottom-right {
        transform: scale(1.15);
        transform-origin: bottom right;
    }

    .social-buttons {
        transform: scale(1.15);
        transform-origin: center;
    }
}

/* Scale HUD elements for large screens (1400px+) - 125% zoom effect */
@media (min-width: 1700px) {

        .start-menu {
        transform: scale(1.20);
        transform-origin: center;
    }

    .hud-corner--top-left {
        transform: scale(1.20);
        transform-origin: top left;
    }

    .hud-corner--top-right {
        transform: scale(1.20);
        transform-origin: top right;
    }

    .hud-corner--bottom-left {
        transform: scale(1.20);
        transform-origin: bottom left;
    }

    .hud-corner--bottom-right {
        transform: scale(1.20);
        transform-origin: bottom right;
    }

    .social-buttons {
        transform: scale(1.20);
        transform-origin: center;
    }
}

/* Scale HUD elements for extra large screens (1840px+) - 150% zoom effect */
@media (min-width: 1840px) {

        .start-menu {
        transform: scale(1.25);
        transform-origin: center;
    }

    .hud-corner--top-left {
        transform: scale(1.25);
        transform-origin: top left;
    }

    .hud-corner--top-right {
        transform: scale(1.25);
        transform-origin: top right;
    }

    .hud-corner--bottom-left {
        transform: scale(1.25);
        transform-origin: bottom left;
    }

    .hud-corner--bottom-right {
        transform: scale(1.25);
        transform-origin: bottom right;
    }

    .social-buttons {
        transform: scale(1.25);
        transform-origin: center;
    }
}
