/* Shared site header & footer (loaded on all pages) */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
}

.logo-games {
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 400;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    min-width: 0;
}

.header-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
}

.header-title.is-hidden {
    display: none;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.header-nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.header-nav a:hover,
.header-nav a.is-active {
    color: var(--accent);
}

.language-switcher {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 8px;
}

.language-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.language-select {
    height: 34px;
    max-width: 88px;
    padding: 0 28px 0 12px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.language-select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    font-size: 13px;
    color: var(--footer-text);
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-top: auto;
}

.footer-contact {
    margin: 0;
    line-height: 1.5;
    flex: 1 1 240px;
    min-width: 0;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.footer a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact a {
    font-weight: 500;
}

.footer a:hover,
.footer a.is-active {
    color: var(--accent);
}

.footer-sep {
    color: var(--border);
    margin: 0 2px;
}

.game-stage-layout {
    width: 100%;
}

.ad-slot {
    width: min(100% - 32px, 980px);
    min-height: 112px;
    margin: 24px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
}

.ad-slot[hidden] {
    display: none;
}

.ad-slot--native {
    min-height: 170px;
}

.ad-slot--banner {
    min-height: 96px;
}

.ad-slot--after-game {
    margin-top: 0;
    margin-bottom: 32px;
}

.ad-slot--before-faq {
    margin-top: 0;
    margin-bottom: 0;
}

.ad-slot--sidebar {
    display: none;
    width: 160px;
    min-width: 160px;
    min-height: 600px;
    margin: 0;
}

.ad-provider-container {
    width: 100%;
    max-width: 100%;
}

.ad-slot iframe,
.ad-slot img,
.ad-slot ins {
    max-width: 100%;
}

.ad-slot--failed {
    min-height: 0;
    border: 0;
    margin: 0 auto;
}

@media (min-width: 1440px) {
    .game-stage-layout {
        width: min(100% - 32px, 1320px);
        margin: 0 auto;
        display: grid;
        grid-template-columns: 160px minmax(0, 1100px);
        gap: 24px;
        align-items: start;
        justify-content: center;
    }

    .ad-slot--sidebar-left {
        grid-column: 1;
    }

    .game-stage-layout > .game-area {
        grid-column: 2;
    }

    .ad-slot--sidebar {
        display: flex;
    }
}

@media (max-width: 1279px) {
    .ad-slot--sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        padding: 12px 14px;
        min-height: 64px;
        gap: 10px 12px;
    }

    .header-left {
        gap: 8px;
        flex: 1 1 0;
        min-width: 0;
    }

    .logo {
        gap: 8px;
        font-size: 17px;
        white-space: nowrap;
        min-width: 0;
    }

    .logo span {
        min-width: 0;
    }

    .logo-icon {
        width: 34px;
        height: 34px;
    }

    .header-title {
        display: none;
    }

    .header-nav {
        display: none;
    }

    .language-switcher {
        margin-left: 0;
    }

    .language-select {
        max-width: 78px;
        height: 32px;
        padding-left: 10px;
        font-size: 12px;
    }

    .footer {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-nav {
        justify-content: flex-start;
    }

    .ad-slot {
        width: min(100% - 24px, 640px);
        min-height: 132px;
        margin: 18px auto;
    }

    .ad-slot--native {
        min-height: 156px;
    }

    .ad-slot--banner {
        display: none;
    }
}
