/* Splash intro + High Seas lobby background overlay */

html.page-splash-active,
html.page-splash-active body {
    height: 100%;
    overflow: hidden;
    margin: 0;
}

.page-lobby {
    min-height: 100vh;
    overflow: hidden;
}

/* ── Splash ── */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #040810;
    background-image: var(--splash-bg);
    background-size: 115%;
    background-position: center center;
    background-repeat: no-repeat;
    transition: opacity 0.9s ease, visibility 0.9s ease;
}

.splash-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(4, 12, 24, 0.35) 0%,
        rgba(4, 12, 24, 0.55) 50%,
        rgba(4, 12, 24, 0.75) 100%
    );
    pointer-events: none;
}

.splash-screen.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo {
    position: relative;
    z-index: 1;
    max-width: min(520px, 85vw);
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transform: translateX(-120vw);
    opacity: 0;
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.6));
}

.splash-stats-btn {
    position: absolute;
    z-index: 2;
    bottom: clamp(20px, 5vh, 48px);
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 22px;
    font-size: 0.92rem;
    font-family: inherit;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    animation: splashStatsFade 0.6s ease 1.2s forwards;
    transition: background 0.2s, border-color 0.2s;
}

.splash-stats-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: #ffffff;
    color: #ffffff;
}

@keyframes splashStatsFade {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.splash-screen.logo-in .splash-logo {
    animation: logoSlideIn 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes logoSlideIn {
    0% {
        transform: translateX(-120vw) scale(0.92);
        opacity: 0;
    }
    70% {
        transform: translateX(0) scale(1.02);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* ── Lobby with background art ── */
.lobby-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
    background: #061018;
}

.lobby-screen.show {
    opacity: 1;
    visibility: visible;
}

.lobby-screen.hidden {
    display: block !important;
}

.lobby-bg {
    position: fixed;
    inset: 0;
    background-size: 115%;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.lobby-bg-dim {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(4, 12, 24, 0.6) 0%,
        rgba(4, 12, 24, 0.8) 45%,
        rgba(4, 12, 24, 0.95) 100%
    );
}

.lobby-overlay {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    padding: clamp(12px, 3vh, 28px) clamp(16px, 4vw, 40px);
    box-sizing: border-box;
    overflow: hidden;
}

.lobby-overlay-header {
    text-align: center;
    flex-shrink: 0;
    animation: overlayFadeUp 0.8s ease 0.3s both;
}

.lobby-overlay-header h1 {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    margin: 0 0 6px;
    color: #ffd36b;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.lobby-overlay-header .tagline {
    margin: 0;
    color: #c8dce8;
    font-size: 0.95rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

.lobby-panels-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(16px, 3vw, 32px);
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    flex: 1;
    align-items: center;
    animation: overlayFadeUp 0.8s ease 0.55s both;
}

.lobby-panel-left {
    justify-self: start;
    width: 100%;
    max-width: 380px;
}

.lobby-panel-right {
    justify-self: end;
    width: 100%;
    max-width: 380px;
}

.lobby-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: clamp(8px, 2vh, 20px);
    animation: overlayFadeUp 0.8s ease 0.75s both;
}

.lobby-footer .analytics-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lobby-how-btn {
    width: auto !important;
    min-width: 180px;
    padding: 12px 28px !important;
    font-size: 1rem !important;
    margin: 0 !important;
}

@media (max-width: 720px) {
    .lobby-panels-row {
        grid-template-columns: 1fr;
        max-width: min(420px, 100%);
        align-content: center;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lobby-panel-left,
    .lobby-panel-right {
        justify-self: center;
        max-width: none;
    }

    .lobby-overlay-header h1 {
        font-size: clamp(1.5rem, 8vw, 2rem);
    }
}

.overlay-panel {
    background: rgba(8, 22, 38, 0.88);
    border: 1px solid rgba(255, 211, 107, 0.35);
    backdrop-filter: blur(8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    margin-bottom: 0;
    padding: 18px;
}

.overlay-panel h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

.overlay-panel button {
    margin-top: 10px;
}

.rank-badge {
    margin: 6px 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 211, 107, 0.12);
    border: 1px solid rgba(255, 211, 107, 0.35);
    color: #ffe8a0;
    font-size: 0.82rem;
    line-height: 1.35;
}

.overlay-btn-small {
    width: auto !important;
    display: inline-block;
    margin-top: 8px !important;
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
}

@keyframes overlayFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rules-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    padding: 16px;
    box-sizing: border-box;
}

.rules-overlay.hidden {
    display: none !important;
}

.rules-overlay .modal.tutorial-modal.tutorial-premium {
    max-width: min(920px, 96vw);
    max-height: 90vh;
}

.page-lobby .sea-bg {
    display: none;
}

.page-lobby .lobby-wrap {
    display: none;
}
