* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* StarCraft-style grey-brown pointer; hotspot at tip (top-left) */
    --gw-cursor: url('cursors/sc_pointer.png') 1 1, crosshair;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f1a;
    color: #eee;
}
 a {
    font-family: 'Outfit';
    color: #eee;
}
.hidden {
    display: none !important;
}

/* Lobby / Homepage */
.lobby-page,
.home-page {
    min-height: 100vh;
    min-height: 100dvh;
    color: #eee;
}

.lobby-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0c12 url('../geowars_background.png') center center / auto 100vh no-repeat;
}

/* Homepage + public pages: sticky footer via flex column */
.home-page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #121212;
    background-image: var(--site-bg-index, url('../backgroundindex.png'));
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% auto;
}

/* Mobile: bg only on first viewport layer (scrolls away); page falls back to solid color */
.home-hero-bg {
    display: none;
}

@media (max-width: 640px) {
    .home-page {
        min-height: 100vh;
        height: auto;
        background-image: none;
        background-color: #101116;
    }

    .home-hero-bg {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 0;
        pointer-events: none;
        background-color: #101116;
        background-image: var(--site-bg-index, url('../backgroundindex.png'));
        background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;
    }

    /* Keep header sticky on mobile â€” do not override to position:relative */
    .home-page > .site-header {
        position: sticky;
        top: 0;
        z-index: 200;
    }

    .home-page > .home-main,
    .home-page > .site-footer,
    .home-page > .cookie-notice {
        position: relative;
        z-index: 1;
    }
}
.site-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(8, 10, 18, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.65rem 1.15rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem 1rem;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
    flex: 0 0 auto;
    z-index: 2;
    grid-column: 1;
}

.site-logo-img {
    display: block;
    height: 34px;
    width: auto;
    max-width: min(220px, 42vw);
    object-fit: contain;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    min-width: 0;
    grid-column: 2;
}

.site-nav a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.92rem;
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover {
    color: #ffe082;
    border-bottom-color: #ffe082;
}

.site-nav a[aria-current="page"] {
    color: #ffe082;
    border-bottom-color: rgba(255, 213, 79, 0.7);
}

.site-header-aside {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    grid-column: 3;
    justify-self: end;
}

.site-header-tools {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 0 0 auto;
}

.site-auth {
    display: flex;
    align-items: center;
    gap: 0.45rem 0.55rem;
    flex-wrap: nowrap;
    padding: 0.28rem 0.45rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
}

.site-auth-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.site-auth-register-hint {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.25;
    white-space: nowrap;
}

.site-auth-register-hint a {
    color: #ffd54f;
    text-decoration: none;
    font-weight: 600;
}

.site-auth-register-hint a:hover {
    color: #ffeb3b;
    text-decoration: underline;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.lang-switcher-flags {
    gap: 0.25rem;
}

.lang-flag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.4rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #e8eef5;
    cursor: pointer;
    line-height: 1;
    opacity: 0.78;
    transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.lang-flag-btn:hover,
.lang-flag-btn:focus-visible {
    opacity: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    outline: none;
}

.lang-flag-btn.is-active {
    opacity: 1;
    color: #ffe082;
    border-color: rgba(255, 213, 79, 0.55);
    background: rgba(255, 213, 79, 0.12);
}

.lang-flag-code {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    color: inherit;
}

.lang-flag {
    display: block;
    width: 18px;
    height: 12px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

/* Mobile header: flags only (save space next to menu toggle) */
@media (max-width: 860px) {
    .site-lang-switcher .lang-flag-btn {
        width: 2rem;
        padding: 0;
        gap: 0;
    }

    .site-lang-switcher .lang-flag-code {
        display: none;
    }

    .site-lang-switcher .lang-flag {
        width: 20px;
        height: 14px;
    }
}

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

.lang-switcher-select {
    appearance: none;
    background: rgba(0, 0, 0, 0.35);
    color: #e8eef5;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    padding: 0.35rem 1.6rem 0.35rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, #bbb 50%),
        linear-gradient(135deg, #bbb 50%, transparent 50%);
    background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.lang-switcher-select:hover,
.lang-switcher-select:focus {
    border-color: rgba(255, 213, 79, 0.55);
    outline: none;
}

.account-language-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-width: 280px;
}

.account-language-form .lang-switcher-select {
    width: 100%;
}

.site-auth-user {
    font-weight: 700;
    color: #ffd54f;
    text-decoration: none;
}

.site-auth-user:hover {
    color: #ffeb3b;
}

.site-auth-with-avatar {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.site-auth-name {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-auth-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 213, 79, 0.45);
    background: #1a1f2e;
}

a.btn-auth {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-auth-mini {
    font-size: 0.78rem;
    color: #aaa;
}

.btn-auth {
    border-radius: 8px;
    padding: 0.42rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.btn-auth-primary {
    background: linear-gradient(180deg, #42a5f5, #1565c0);
    color: #fff;
}

.btn-auth-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #eee;
}

.btn-auth-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
}

.site-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    flex: 0 0 auto;
}

.site-nav-toggle:hover,
.site-nav-toggle:focus-visible {
    border-color: rgba(255, 213, 79, 0.5);
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.site-nav-toggle-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 1.05rem;
}

.site-nav-toggle-bars span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 1px;
    background: #eee;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.site-nav-toggle[aria-expanded="true"] .site-nav-toggle-bars span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.site-nav-toggle[aria-expanded="true"] .site-nav-toggle-bars span:nth-child(2) {
    opacity: 0;
}

.site-nav-toggle[aria-expanded="true"] .site-nav-toggle-bars span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.site-nav-auth {
    color: #ffd54f !important;
    font-weight: 600;
}

.site-nav-logout {
    display: none;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffd54f;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0.7rem 0.15rem;
}

@media (min-width: 861px) {
    .site-nav-toggle {
        display: none;
    }

    /* Logged-in account/logout stay in header chip; guests keep login/register in nav */
    .site-nav-auth-account,
    .site-nav-logout {
        display: none;
    }

    .site-auth-register-hint {
        display: none;
    }
}

@media (max-width: 860px) {
    .site-header-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo tools"
            "nav nav";
        align-items: center;
        gap: 0.45rem 0.5rem;
        padding: 0.55rem 0.85rem;
    }

    .site-header-aside {
        display: contents;
    }

    .site-logo {
        grid-area: logo;
        grid-column: auto;
    }

    .site-logo-img {
        height: 30px;
        max-width: min(160px, 38vw);
    }

    .site-header-tools {
        grid-area: tools;
        justify-self: end;
        gap: 0.25rem;
    }

    .site-nav-toggle {
        display: inline-flex;
    }

    /* Sticky bar stays logo + flags + hamburger; auth lives in the menu */
    .site-auth {
        display: none;
    }

    .lang-flag-btn {
        width: 1.85rem;
        height: 1.85rem;
    }

    .site-nav {
        grid-area: nav;
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0.25rem 0 0.35rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        grid-column: auto;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav-logout {
        display: block;
    }

    .site-nav a,
    .site-nav .site-nav-logout {
        padding: 0.7rem 0.15rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        font-size: 0.95rem;
    }

    .site-nav a[aria-current="page"] {
        border-bottom-color: rgba(255, 213, 79, 0.35);
    }
}

.home-user-panel {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.home-user-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin: 0.5rem 0 0.75rem;
    font-size: 0.88rem;
}

.home-user-stats strong {
    color: #ffd54f;
}

.home-inline-link {
    color: #4fc3f7;
    font-size: 0.88rem;
}

.home-quick-list {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.88rem;
    color: #bbb;
}

.home-mini-panel {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.home-mini-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.home-mini-item {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.home-mini-link {
    color: #4fc3f7;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.home-mini-link:hover {
    text-decoration: underline;
}

.home-lobby-lock {
    display: inline-flex;
    color: #ffd54f;
    line-height: 0;
}

.home-lobby-lock-svg {
    width: 0.95rem;
    height: 0.95rem;
}

.home-mini-meta {
    color: #aaa;
    font-size: 0.85rem;
}

.home-user-last {
    margin: 0.25rem 0 0.75rem;
}

.home-last-result {
    display: flex;
    gap: 0.35rem;
    align-items: baseline;
    font-size: 0.88rem;
}

.hint-inline {
    font-size: 0.82rem;
    font-weight: 400;
    color: #888;
}

.leaderboard-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 2rem 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
}

.lb-rank {
    color: #888;
    font-weight: 700;
}

.lb-name {
    font-weight: 600;
}

.lb-badge {
    color: #ffd54f;
    margin-left: 0.25rem;
}

.lb-rating {
    color: #ffd54f;
    font-weight: 700;
}

.lb-wl {
    color: #aaa;
    font-size: 0.8rem;
}

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-modal-overlay.hidden {
    display: none;
}

.auth-modal-panel {
    position: relative;
    width: min(100%, 400px);
    background: #12151f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.auth-modal-panel.hidden {
    display: none;
}

.auth-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: #ccc;
}

.auth-form input {
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
}

.auth-form-error {
    color: #ef9a9a;
    font-size: 0.85rem;
    margin: 0;
}

.auth-form-error.hidden {
    display: none;
}

.account-main {
    max-width: 820px;
}

.account-card h1 {
    margin-bottom: 0.35rem;
}

.account-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.account-avatar-wrap {
    flex-shrink: 0;
}

.account-avatar-img,
.account-avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(79, 195, 247, 0.45);
    background: #1a2233;
}

.account-avatar-img {
    object-fit: cover;
    display: block;
}

.account-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffd54f;
}

.account-hero-text h1 {
    font-size: 1.55rem;
}

.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.account-section {
    margin-bottom: 1.5rem;
}

.account-narrow-section {
    max-width: 360px;
}

.account-danger-section {
    padding-top: 1rem;
    border-top: 1px solid rgba(229, 115, 115, 0.25);
}

.account-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    font-size: 0.9rem;
}

.account-dl dt {
    color: #888;
}

.account-games-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.account-games-table th,
.account-games-table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.result-win { color: #81c784; }
.result-loss { color: #e57373; }
.result-draw { color: #90caf9; }
.result-eliminated { color: #ffb74d; }

.account-flash {
    color: #81c784;
    margin-bottom: 1rem;
}

.auth-form-narrow {
    max-width: 100%;
    width: 100%;
}

.auth-consent {
    flex-direction: row !important;
    align-items: flex-start;
    gap: 0.55rem !important;
    font-size: 0.85rem;
}

.auth-consent input {
    margin-top: 0.2rem;
    width: auto;
}

.auth-page-card {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
}

.auth-page-card h1,
.auth-page-card .section-intro,
.auth-page-card .hint {
    max-width: 100%;
}

.auth-main {
    max-width: 420px;
    width: 100%;
}

.avatar-upload-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-width: 320px;
}

.avatar-upload-label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #ccc;
}

.avatar-upload-label input[type="file"] {
    font-size: 0.82rem;
    color: #bbb;
}

.stat-value-text {
    font-size: 1.05rem !important;
    line-height: 1.2;
}

.btn-danger {
    background: linear-gradient(180deg, #e57373, #c62828);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.65rem 1.1rem;
    font-weight: 700;
    cursor: pointer;
}

.cookie-notice {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 300;
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    gap: 0.85rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(18, 21, 31, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
    font-size: 0.85rem;
    color: #ccc;
}

.cookie-notice.hidden {
    display: none;
}

.cookie-notice p {
    margin: 0;
}

.cookie-notice a {
    color: #4fc3f7;
}

.privacy-card h2 {
    margin: 1.25rem 0 0.5rem;
    font-size: 1.15rem;
}

.privacy-card code {
    font-size: 0.85em;
    color: #90caf9;
}

.tutorial-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0 0 1.25rem;
}

@media (max-width: 720px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
    .leaderboard-item {
        grid-template-columns: 2rem 1fr;
    }
    .lb-rating, .lb-wl {
        grid-column: 2;
    }
    .cookie-notice {
        flex-direction: column;
        align-items: stretch;
    }
}

.home-main {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.home-page > .site-footer {
    flex-shrink: 0;
    margin-top: auto;
}

.home-section {
    margin-bottom: 2rem;
    scroll-margin-top: 4.5rem;
}

.home-top {
    padding-top: 0.25rem;
}

.home-hero-logo-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.55rem;
    margin: 0.15rem 0 1.15rem;
}

.home-hero-logo {
    display: block;
    width: min(520px, 92%);
    max-width: 520px;
    height: auto;
    filter: drop-shadow(0 6px 28px rgba(0, 0, 0, 0.45));
}

.home-hero-tagline {
    margin: 0;
    max-width: 42rem;
    padding: 2rem 1rem;
    font-family: 'Outfit', 'Sora', 'Segoe UI', sans-serif;
    font-size: clamp(0.95rem, 2.2vw, 1.75rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.35;
    text-align: center;
    color: #ffffff;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.7);
}

.home-play-auth-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
    gap: 0.85rem 1rem;
    align-items: stretch;
    margin-bottom: 0.85rem;
}

.home-play-ctas {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.home-play-ctas .home-tutorial-banner,
.home-play-ctas .home-env-banner {
    margin-bottom: 0.7rem;
}

.home-play-ctas .home-multi-banner {
    margin-bottom: 0.7rem;
}

.home-play-ctas .home-dusk-stats {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    flex: 0 0 auto;
}

.home-play-ctas .home-tutorial-status {
    margin: 0 0 0.55rem;
}

.home-auth-panel {
    scroll-margin-top: 4.75rem;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin: 0;
    padding: 1rem 1.15rem;
    background: rgba(10, 12, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

.home-auth-panel .subsection-title {
    margin: 0 0 0.65rem;
    font-size: 1.35rem;
    font-family: 'Outfit';
    color: #ffe082;
}

.home-login-form {
    gap: 0.55rem;
}

.home-login-form .btn-primary {
    margin-top: 0.15rem;
    width: 100%;
}

.home-auth-register {
    margin-top: 0.65rem;
}

.home-auth-panel .home-user-panel-strip {
    margin: 0;
    padding: 0;
    border: none;
}

.home-auth-panel .home-user-stats {
    flex-direction: column;
    gap: 0.35rem;
}

@media (max-width: 900px) {
    .home-play-auth-row {
        grid-template-columns: 1fr;
    }

    .home-hero-logo {
        width: min(420px, 88%);
    }
}

@media (max-width: 640px) {
    .home-hero-logo {
        width: min(300px, 84%);
    }

    .home-hero-logo-wrap {
        gap: 0.45rem;
        margin-bottom: 0.85rem;
    }

    .home-hero-tagline {
        font-size: clamp(0.88rem, 3.6vw, 1.02rem);
    }
}

.home-dusk-stats {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 120px;
    margin: 0 0 0.85rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 176, 96, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}

.home-dusk-stats-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-dusk-stats-art {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 120px;
}

.home-dusk-stats-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    height: 100%;
    padding: 0.55rem 1rem;
    box-sizing: border-box;
}

.home-dusk-stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem 0.75rem;
    align-items: center;
}

.home-dusk-stat {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.home-dusk-stat-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 8px;
    color: #ffc078;
    background: rgba(12, 18, 32, 0.45);
    border: 1px solid rgba(255, 192, 120, 0.22);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.home-dusk-stat-icon svg {
    width: 0.95rem;
    height: 0.95rem;
    display: block;
}

.home-dusk-stat-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.home-dusk-stat-value {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #f5f0e8;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.home-dusk-stat-label {
    font-family: 'Sora', 'Segoe UI', sans-serif;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(220, 228, 240, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 820px) {
    .home-dusk-stats {
        height: auto;
        min-height: 120px;
    }

    .home-dusk-stats-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem 0.65rem;
    }

    .home-dusk-stats-inner {
        padding: 0.65rem 0.85rem;
        gap: 0.45rem;
    }
}

@media (max-width: 480px) {
    .home-dusk-stat-label {
        white-space: normal;
        font-size: 0.58rem;
    }
}

.home-video-banner {
    position: relative;
    width: 100%;
    height: clamp(180px, 28vw, 320px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 0.7rem;
    background: #0a0c12;
}

.home-tutorial-banner {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 72px;
    margin-bottom: 1.15rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(165, 214, 167, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.home-tutorial-banner-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-tutorial-banner-art {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 72px;
}

.home-tutorial-banner-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.75rem 1.15rem;
}

.home-tutorial-banner-text {
    margin: 0;
    font-family: 'Sora', 'Segoe UI', sans-serif;
    font-size: clamp(0.98rem, 2.1vw, 1.2rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #e8f5e9;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.home-tutorial-banner-text span {
    font-weight: 700;
    color: #fff8e1;
}

.home-tutorial-banner-btn {
    flex: 0 0 auto;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1.2rem;
    cursor: pointer;
    color: #14352a;
    background: linear-gradient(135deg, #ffe082 0%, #ffca28 55%, #ffb300 100%);
    box-shadow: 0 4px 14px rgba(255, 193, 7, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.home-tutorial-banner-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(255, 193, 7, 0.45);
}

.home-tutorial-banner-btn:active {
    transform: translateY(0);
}

.home-tutorial-banner-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.home-env-banner {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 72px;
    margin-bottom: 0.85rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.home-env-banner-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-env-banner-art {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 72px;
}

.home-env-banner-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.75rem 1.15rem;
}

.home-env-banner-text {
    margin: 0;
    font-family: 'Sora', 'Segoe UI', sans-serif;
    font-size: clamp(0.98rem, 2.1vw, 1.2rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.home-env-banner-text span {
    font-weight: 700;
}

.home-env-banner-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1.2rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.home-env-banner-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.home-env-banner-btn:active {
    transform: translateY(0);
}

.home-solo-banner {
    border: 1px solid rgba(110, 176, 224, 0.45);
}

.home-solo-banner .home-env-banner-text {
    color: #0f3d5c;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.home-solo-banner .home-env-banner-text span {
    color: #0a5580;
}

.home-solo-banner-btn {
    color: #0d3d66;
    background: linear-gradient(135deg, #ffffff 0%, #e8f4fc 50%, #cfe8f8 100%);
    box-shadow: 0 4px 14px rgba(66, 140, 200, 0.32);
}

.home-solo-banner-btn:hover {
    box-shadow: 0 6px 18px rgba(66, 140, 200, 0.42);
}

.home-multi-banner {
    border: 1px solid rgba(255, 138, 80, 0.38);
}

.home-multi-banner .home-env-banner-text {
    color: #fff3e0;
}

.home-multi-banner .home-env-banner-text span {
    color: #fff8e1;
}

.home-multi-banner-btn {
    color: #4a1c0a;
    background: linear-gradient(135deg, #ffcc80 0%, #ffab40 45%, #ff7043 100%);
    box-shadow: 0 4px 14px rgba(255, 112, 67, 0.38);
}

.home-multi-banner-btn:hover {
    box-shadow: 0 6px 18px rgba(255, 112, 67, 0.5);
}

@media (max-width: 640px) {
    .home-tutorial-banner-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
        padding: 0.85rem 1rem;
    }

    .home-tutorial-banner-btn {
        width: 100%;
        text-align: center;
    }

    .home-env-banner-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
        padding: 0.85rem 1rem;
    }

    .home-env-banner-btn {
        width: 100%;
        text-align: center;
    }
}

.home-video-el {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.home-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.15);
}

.home-video-logo {
    display: block;
    width: min(520px, 78vw);
    height: auto;
    opacity: 0.72;
    filter: drop-shadow(0 4px 28px rgba(0, 0, 0, 0.45));
}

.races-showcase {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.races-showcase-top {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-bottom: 2rem;
}

.races-overview-img {
    display: block;
    width: 100%;
    max-width: 960px;
    height: auto;
    margin: 0 auto 1.25rem;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.races-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.race-card {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}

.race-card h4 {
    margin: 0 0 0.35rem;
    color: #4fc3f7;
    font-size: 1.05rem;
}

.race-tagline {
    margin: 0 0 0.65rem;
    color: #bbb;
    font-size: 0.92rem;
}

@media (max-width: 860px) {
    .races-columns {
        grid-template-columns: 1fr;
    }
}

.home-video-title {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 4.5rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.5;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.home-logged-strip {
    margin: 0.75rem 0 0.85rem;
    padding: 1rem 1.2rem;
}

.home-user-panel-strip {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.home-geowiki-cta {
    margin-top: 1.25rem;
}

.home-cta-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    align-items: stretch;
    margin-bottom: 0.85rem;
}

.home-gallery-card {
    width: 100%;
    margin: 0 0 0.85rem;
    padding: 0.95rem 1.1rem;
}

.home-chat-card {
    width: 100%;
    margin: 0 0 0.85rem;
    padding: 0.95rem 1.1rem;
}

.home-chat-log {
    max-height: 280px;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
    margin: 0.5rem 0 0.75rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    line-height: 1.4;
}

.home-chat-line {
    padding: 0.28rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    word-break: break-word;
}

.home-chat-line:last-child {
    border-bottom: none;
}

.home-chat-line.is-sticky {
    background: rgba(255, 213, 79, 0.08);
    border-left: 3px solid #ffd54f;
    padding-left: 0.55rem;
    margin: 0.15rem 0;
    border-radius: 0 4px 4px 0;
}

.home-chat-line.home-chat-empty {
    color: #8a93a3;
    border: none;
}

.home-chat-line strong {
    color: #ffe082;
    font-weight: 600;
    margin-right: 0.25rem;
}

.home-chat-actions {
    float: right;
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.home-chat-act {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.35);
    color: #cfd8dc;
    border-radius: 4px;
    font-size: 0.68rem;
    padding: 0.1rem 0.35rem;
    cursor: pointer;
    line-height: 1.2;
}

.home-chat-act:hover {
    border-color: #ef9a9a;
    color: #ffcdd2;
}

.home-chat-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.home-chat-form input[type="text"] {
    flex: 1 1 180px;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.35);
    color: #e8eaed;
}

.home-chat-sticky-label {
    font-size: 0.78rem;
    color: #9aa3b2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

body.mobile-web .home-chat-log {
    max-height: 220px;
}

.home-gallery-card h2 {
    font-size: 1.15rem;
    margin-bottom: 0.3rem;
}

.home-gallery-card .section-intro {
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}

.home-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.home-gallery-item {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    text-align: left;
    color: inherit;
    aspect-ratio: 16 / 10;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.home-gallery-item:hover,
.home-gallery-item:focus-visible {
    border-color: rgba(79, 195, 247, 0.55);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    outline: none;
}

.home-gallery-item img,
.home-gallery-video-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.home-gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #e8e8e8;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 55%);
    pointer-events: none;
}

.home-gallery-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3rem;
    height: 3rem;
    margin: -1.5rem 0 0 -1.5rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.75);
    pointer-events: none;
}

.home-gallery-play::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0.45rem 0 0.45rem 0.75rem;
    border-color: transparent transparent transparent #fff;
    transform: translate(-50%, -50%);
}

.home-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
}

.home-gallery-lightbox[hidden] {
    display: none !important;
}

.home-gallery-lightbox-inner {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}

.home-gallery-lightbox-img,
.home-gallery-lightbox-video {
    display: block;
    width: 100%;
    max-height: calc(100vh - 5.5rem);
    object-fit: contain;
    border-radius: 10px;
    background: #0a0c14;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.home-gallery-lightbox-img[hidden],
.home-gallery-lightbox-video[hidden] {
    display: none !important;
}

.home-gallery-lightbox-caption {
    margin: 0;
    color: #ccc;
    font-size: 0.9rem;
    text-align: center;
}

.home-gallery-lightbox-close {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    z-index: 1;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(10, 12, 20, 0.85);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.home-gallery-lightbox-close:hover,
.home-gallery-lightbox-close:focus-visible {
    border-color: rgba(79, 195, 247, 0.6);
    outline: none;
}

body.home-gallery-open {
    overflow: hidden;
}

@media (max-width: 820px) {
    .home-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .home-gallery-grid {
        grid-template-columns: 1fr;
    }
}

.home-cta-row-guest {
    grid-template-columns: 1fr 1fr;
}

.home-play-card,
.home-guest-card,
.home-stats-card {
    min-width: 0;
    padding: 0.95rem 1.1rem;
}

.home-play-card,
.home-guest-card {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.home-play-card .subtitle {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.home-play-card .home-lead {
    margin-bottom: 0;
    font-size: 0.86rem;
    line-height: 1.4;
}
.home-guest-card .subsection-title {
    margin-top: 0;
    margin-bottom: 0.45rem;
    font-size: 1.05rem;
}

.home-guest-card .hint {
    margin: 0.35rem 0;
    font-size: 0.82rem;
}

.home-guest-card .home-quick-list {
    margin: 0.4rem 0 0.25rem;
    font-size: 0.84rem;
}

.home-user-panel {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
}

.home-mini-panel {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
}

.home-lobbies-in-stats {
    margin-top: 0.55rem;
    margin-bottom: 0.35rem;
    padding-top: 0.55rem;
}

.home-user-stats {
    margin: 0.35rem 0 0.5rem;
}

.home-stats-full {
    width: 100%;
}

.home-stats-card h2 {
    font-size: 1.15rem;
    margin-bottom: 0.3rem;
}

.home-stats-card .section-intro {
    font-size: 0.82rem;
    margin-bottom: 0.65rem;
}

.stats-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.stats-grid-compact .stat-box {
    padding: 0.45rem 0.4rem;
}

.stats-grid-compact .stat-value {
    font-size: 1.15rem;
}

.stats-grid-compact .stat-label {
    font-size: 0.68rem;
}

.home-stats-card .subsection-title {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.home-stats-card .games-list-item {
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 0.3rem 0.65rem;
    padding: 0.3rem 0;
}

.home-stats-card .leaderboard-item {
    padding: 0.3rem 0;
}

@media (max-width: 820px) {
    .home-cta-row-guest {
        grid-template-columns: 1fr;
    }

    .stats-grid-compact {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    }
}

.home-card {
    background: rgb(10 12 20 / 70%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1rem 1.25rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.home-content-card {
    text-align: left;
}

.home-lead {
    color: #bbb;
    line-height: 1.55;
    margin-bottom: 1.75rem;
    font-size: 0.98rem;
}

.section-intro {
    color: #aaa;
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

.home-card h2 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: #e8e8e8;
}

.subsection-title {
    font-size: 1.15rem;
    margin: 1.75rem 0 0.85rem;
    color: #c9a227;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem 0.75rem;
    text-align: center;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: #4fc3f7;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.78rem;
    color: #999;
    margin-top: 0.35rem;
}

.games-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.games-list-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 0.75rem 1rem;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
}

.game-id {
    font-family: monospace;
    color: #888;
}

.game-status {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-playing { background: rgba(76, 175, 80, 0.25); color: #81c784; }
.status-waiting, .status-race_select { background: rgba(255, 193, 7, 0.2); color: #ffd54f; }

.game-players, .game-time {
    color: #999;
    font-size: 0.82rem;
}

.info-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}

.info-block h3 {
    font-size: 1rem;
    color: #4fc3f7;
    margin-bottom: 0.5rem;
}

.info-block p {
    color: #bbb;
    line-height: 1.55;
    font-size: 0.92rem;
}

.info-list {
    margin: 0;
    padding-left: 1.1rem;
    color: #bbb;
    font-size: 0.92rem;
    line-height: 1.6;
}

.unit-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

.unit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.unit-table th,
.unit-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.unit-table th {
    color: #aaa;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.25);
}

.unit-table td {
    color: #ccc;
}

.building-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.building-card {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.building-card h4 {
    font-size: 0.95rem;
    color: #ffe082;
    margin-bottom: 0.4rem;
}

.building-card p {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.45;
    margin: 0;
}

.tutorial-steps {
    margin: 0;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tutorial-steps li {
    color: #bbb;
    line-height: 1.55;
}

.tutorial-steps h3 {
    font-size: 1rem;
    color: #e0e0e0;
    margin-bottom: 0.35rem;
}

.controls-box {
    margin-top: 2rem;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(79, 195, 247, 0.2);
}

.controls-box h3 {
    font-size: 1rem;
    margin-bottom: 0.85rem;
    color: #4fc3f7;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem 1rem;
    font-size: 0.88rem;
    color: #aaa;
}

.controls-grid kbd {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 0.78rem;
    color: #ddd;
    margin-right: 0.35rem;
}

.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1.5rem;
    color: #666;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(8, 10, 18, 0.75);
}

.site-footer a {
    color: #4fc3f7;
}

@media (max-width: 640px) {
    .home-card {
        padding: 1.35rem 1.1rem;
    }

    .games-list-item {
        grid-template-columns: 1fr 1fr;
        gap: 0.35rem;
    }
}
.lobby-card {
    text-align: center;
    padding: 3rem;
    background: rgba(10, 12, 20, 0.82);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    max-width: 520px;
    width: 90%;
    backdrop-filter: blur(6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.lobby-link {
    color: #4fc3f7;
}

.lobby-card h1,
.home-play-card h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #4fc3f7, #ff7043);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #aaa;
    margin-bottom: 2rem;
}

.lobby-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lobby-actions .btn-primary,
.lobby-actions .btn-secondary {
    width: 100%;
}

.btn-primary,
.btn-secondary {
    padding: 0.85rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
}

.btn-primary {
    background: linear-gradient(165deg, #ffe566 0%, #ffd54f 38%, #f9a825 72%, #f57f17 100%);
    color: #1a1200;
    font-weight: 700;
    box-shadow:
        0 2px 0 rgba(183, 110, 0, 0.45),
        0 6px 18px rgba(255, 193, 7, 0.35),
        0 0 24px rgba(255, 213, 79, 0.28);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-secondary {
    background: #333;
    color: #fff;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: scale(1.03);
}

.btn-primary:hover {
    box-shadow:
        0 2px 0 rgba(183, 110, 0, 0.5),
        0 8px 22px rgba(255, 193, 7, 0.45),
        0 0 32px rgba(255, 224, 130, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: wait;
    box-shadow: none;
}

.invite-box {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.invite-box input {
    flex: 1;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #444;
    background: #1a1a2e;
    color: #fff;
    font-size: 0.9rem;
}

.hint {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.error {
    color: #ff5252;
    margin-top: 1rem;
}

.status {
    color: #81c784;
    margin-top: 1rem;
}

.debug-panel {
    text-align: left;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
}

.debug-panel h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #aaa;
}

.debug-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.debug-panel li {
    padding: 0.2rem 0;
}

.debug-ok { color: #81c784; }
.debug-fail { color: #ff8a80; }
.debug-wait { color: #aaa; }

.debug-hint {
    margin-top: 0.75rem;
    color: #666;
    font-size: 0.75rem;
}

.debug-panel code {
    background: #222;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

#btn-enter:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.invite-box input::placeholder {
    color: #666;
}

/* Game layout */
.game-page {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    background: #0c1a27;
}

#game-layout {
    position: relative;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
}

#game-viewport {
    position: absolute;
    inset: 0;
    background: #0c1a27;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: var(--gw-cursor);
}

.hud-stat-gas {
    color: #f48fb1;
}

.hud-stat-cap-full {
    animation: resource-cap-glow 1.1s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes resource-cap-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 82, 82, 0); }
    50% { box-shadow: 0 0 12px rgba(255, 82, 82, 0.85); }
}

.selection-unit-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 4px;
    width: 100%;
    max-width: 100%;
    max-height: calc(var(--gui-panel-height) * 0.42);
    overflow-x: hidden;
    overflow-y: auto;
    flex-shrink: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.selection-unit-cards::-webkit-scrollbar {
    width: 6px;
}

.selection-unit-cards::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 4px;
}

.selection-unit-cards.hidden {
    display: none !important;
}

.selection-unit-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    padding: 3px 2px 2px;
    min-width: 0;
    min-height: 0;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
}

.selection-unit-card:hover,
.selection-unit-card.active {
    border-color: #ffeb3b;
    background: rgba(255, 235, 59, 0.12);
}

.selection-unit-card canvas {
    display: block;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.selection-unit-card .card-label {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
    color: #eceff1;
}

.selection-unit-card .card-count {
    display: inline-block;
    margin: 0;
    min-width: 1.1em;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 0 5px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #ffe082;
    line-height: 1.35;
}

#hud-panel-stats {
    position: absolute;
    left: 50%;
    bottom: calc(var(--gui-panel-height) * var(--gui-center-rim) + 28px);
    transform: translateX(-50%);
    z-index: 22;
    display: flex;
    gap: 10px;
    pointer-events: none;
}

/* Ephemeral last-chat toast â€” sits just above the minerals/gas/population strip */
#chat-last-toast {
    position: absolute;
    left: 50%;
    bottom: calc(var(--gui-panel-height) * var(--gui-center-rim) + 28px + 44px);
    transform: translateX(-50%) translateY(6px);
    z-index: 23;
    max-width: min(72vw, 420px);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#chat-last-toast.hidden {
    display: none;
}

#chat-last-toast.visible {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.chat-last-toast-author {
    margin-right: 0.35em;
}

.chat-last-toast-author.slot-1 { color: #64b5f6; }
.chat-last-toast-author.slot-2 { color: #ef5350; }
.chat-last-toast-author.slot-3 { color: #81c784; }
.chat-last-toast-author.slot-4 { color: #ce93d8; }

.chat-last-toast-text {
    color: #fff;
    font-weight: 500;
}

.hud-stat-chat {
    pointer-events: auto;
    cursor: pointer;
    padding: 6px 10px;
    color: #e3f2fd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hud-stat-chat:hover {
    border-color: rgba(129, 212, 250, 0.75);
}

.hud-stat-chat.chat-glow {
    animation: chat-glow-pulse 2s ease-out 1;
}

.hud-stat-idle {
    pointer-events: auto;
    cursor: pointer;
    color: #b0bec5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.hud-stat-idle:hover {
    border-color: rgba(176, 190, 197, 0.55);
}

.hud-stat-idle.has-idle {
    color: #ffe0b2;
    background: rgba(48, 24, 6, 0.88);
    border-color: rgba(255, 152, 0, 0.9);
    box-shadow:
        0 0 10px rgba(255, 140, 0, 0.55),
        0 0 22px rgba(255, 152, 0, 0.28),
        1px 1px 3px #000000a3;
    animation: idle-worker-glow 1.6s ease-in-out infinite alternate;
}

.hud-stat-idle.has-idle:hover {
    border-color: rgba(255, 183, 77, 1);
}

@keyframes idle-worker-glow {
    from {
        box-shadow:
            0 0 8px rgba(255, 140, 0, 0.4),
            0 0 16px rgba(255, 152, 0, 0.18),
            1px 1px 3px #000000a3;
    }
    to {
        box-shadow:
            0 0 14px rgba(255, 152, 0, 0.75),
            0 0 28px rgba(255, 167, 38, 0.4),
            1px 1px 3px #000000a3;
    }
}

#hud-panel-stats.hidden {
    display: none;
}

.hud-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(8, 10, 18, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffd54f;
    box-shadow: 1px 1px 3px #000000a3;
}

#panel-minerals,
#panel-gas,
#panel-units,
#panel-idle-workers {
    font-family: 'Roboto Condensed', 'Segoe UI', sans-serif;
    font-weight: 300;
    font-size: 0.79rem;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.hud-stat-icon {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.9;
}

.entity-hover-tooltip {
    position: fixed;
    z-index: 230;
    min-width: 120px;
    max-width: min(280px, calc(100vw - 24px));
    padding: 0.4rem 0.55rem;
    background: rgba(8, 10, 18, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    color: #eee;
    pointer-events: none;
    line-height: 1.25;
}

.entity-hover-tooltip.hidden {
    display: none;
}

.entity-hover-tooltip-player {
    font-family: 'Roboto Condensed', 'Segoe UI', sans-serif;
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: #90caf9;
    margin-bottom: 0.15rem;
}

.entity-hover-tooltip-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff8e1;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0.2rem 0.75rem;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    gap: 1rem;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    font-size: 0.7rem;
    line-height: 1.25;
    min-height: 0;
}

#hud-zoom {
    margin-left: auto;
    color: #aaa;
}

.game-menu-corner-btn {
    position: absolute;
    top: calc(1.65rem + env(safe-area-inset-top, 0px));
    left: 8px;
    z-index: 12;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.55);
    color: #e3f2fd;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.game-menu-corner-btn:hover,
.game-menu-corner-btn:focus-visible {
    border-color: rgba(129, 212, 250, 0.75);
    background: rgba(0, 0, 0, 0.72);
}

.game-menu-corner-icon {
    font-size: 1rem;
    line-height: 1;
}

/* SpodnÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â½ panel ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã…â€œ guimodern.png (plÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡vajÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Âºci overlay, ~60 % ÃƒÆ’Ã¢â‚¬Â¦Ãƒâ€šÃ‚Â¡ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â­rky) */
:root {
    --gui-panel-width: clamp(520px, 60vw, 1040px);
    --gui-panel-height: calc(var(--gui-panel-width) * 372 / 1536);
    --gui-center-rim: 0.735;
    --minimap-left: calc(var(--gui-panel-width) * 0.022);
    --minimap-top: calc(var(--gui-panel-height) * 0.195);
    --minimap-width: calc(var(--gui-panel-width) * 0.156);
    --minimap-height: calc(var(--gui-panel-height) * 0.675);
}

.game-toast {
    position: absolute;
    left: 50%;
    bottom: 22%;
    transform: translateX(-50%) translateY(12px);
    z-index: 30;
    max-width: min(92vw, 520px);
    padding: 10px 18px;
    border-radius: 8px;
    background: rgba(12, 14, 24, 0.92);
    border: 1px solid rgba(255, 235, 59, 0.35);
    color: #f5f5f5;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.45s ease, transform 0.45s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.game-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.game-toast.error {
    border-color: rgba(244, 67, 54, 0.5);
    color: #ffcdd2;
}

.hero-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
    max-width: 120px;
}

.hero-skills-float {
    position: absolute;
    z-index: 25;
    pointer-events: auto;
    left: calc(50% + var(--gui-panel-width) / 2 + 10px);
    bottom: calc(var(--gui-panel-height) * 0.22);
}

.hero-skills-float.hidden {
    display: none;
}

.merchant-shop {
    position: absolute;
    left: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 158px);
    z-index: 26;
    width: min(320px, calc(100vw - 24px));
    max-height: 240px;
    display: flex;
    flex-direction: column;
    background: rgba(12, 16, 24, 0.94);
    border: 1px solid rgba(176, 190, 197, 0.35);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.merchant-shop.hidden {
    display: none;
}

.merchant-shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #cfd8dc;
    font-size: 0.85rem;
}

.merchant-shop-list {
    overflow-y: auto;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.merchant-shop-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    text-align: left;
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #eceff1;
    cursor: pointer;
    font: inherit;
}

.merchant-shop-item:hover:not(:disabled) {
    border-color: #ffd54f;
    background: rgba(255, 213, 79, 0.08);
}

.merchant-shop-item.is-disabled,
.merchant-shop-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.merchant-shop-name {
    font-size: 0.8rem;
    font-weight: 600;
}

.merchant-shop-name em {
    font-style: normal;
    opacity: 0.65;
    font-weight: 500;
    font-size: 0.72rem;
}

.merchant-shop-cost {
    font-size: 0.72rem;
    color: #90caf9;
}

body.mobile-game .merchant-shop {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 132px);
    max-height: 200px;
}

.hero-panel-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.hero-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.hero-cards.hero-cards-dual {
    grid-template-columns: 1fr 1fr;
}

.hero-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    height: 100%;
    padding: 6px 7px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
}

.hero-card:hover {
    border-color: rgba(255, 235, 59, 0.45);
    background: rgba(255, 235, 59, 0.06);
}

.hero-card.is-selected {
    border-color: #ffeb3b;
    box-shadow: inset 0 0 0 1px rgba(255, 235, 59, 0.35);
}

.hero-card-top {
    display: flex;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.hero-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.45);
}

.hero-card-meta {
    flex: 1;
    min-width: 0;
}

.hero-card-name {
    font-weight: 700;
    color: #ffe082;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-card-level {
    color: #9aa3b2;
    font-size: 0.62rem;
    margin-top: 1px;
}

.hero-card-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}

.hero-bar {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hero-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.58rem;
    color: #9aa3b2;
    line-height: 1.2;
}

.hero-bar-track {
    height: 7px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.12s linear;
}

.hero-bar-fill.is-hp {
    background: linear-gradient(90deg, #c62828, #ef5350);
}

.hero-bar-fill.is-xp {
    background: linear-gradient(90deg, #1565c0, #42a5f5);
}

.hero-cards-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #6f7887;
    font-size: 0.72rem;
}

.hero-skill-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
}

.hero-skill-btn:hover:not(:disabled) {
    border-color: #ffeb3b;
    background: rgba(255, 235, 59, 0.12);
}

.hero-skill-btn.active {
    border-color: #ffeb3b;
    box-shadow: 0 0 0 2px rgba(255, 235, 59, 0.25);
}

.hero-skill-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hero-skill-btn .skill-cd {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffeb3b;
}

#bottom-panel {
    position: absolute;
    left: 50%;
    bottom: 0px;
    transform: translateX(-50%);
    width: var(--gui-panel-width);
    height: var(--gui-panel-height);
    background: url('../guimodern.png') center / 100% 100% no-repeat;
    filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.65));
    z-index: 20;
    pointer-events: none;
}

#bottom-panel .minimap-wrap {
    position: absolute;
    left: var(--minimap-left);
    top: var(--minimap-top);
    width: var(--minimap-width);
    height: var(--minimap-height);
    pointer-events: auto;
    z-index: 2;
}

.gui-shell {
    display: grid;
    grid-template-columns: 16% 1fr 13% 18%;
    height: 100%;
    padding: 11% 3.2% 7% 3.2%;
    gap: 1%;
    box-sizing: border-box;
    pointer-events: auto;
    align-items: start;
}

.gui-zone {
    min-height: 0;
    display: flex;
    align-items: stretch;
}

.gui-zone-minimap {
    padding: 0;
    overflow: visible;
    pointer-events: none;
}

@keyframes chat-glow-pulse {
    0% { box-shadow: 0 0 0 rgba(255, 235, 59, 0); border-color: rgba(255, 255, 255, 0.15); }
    15% { box-shadow: 0 0 14px rgba(255, 235, 59, 0.95); border-color: rgba(255, 235, 59, 0.95); }
    100% { box-shadow: 0 0 0 rgba(255, 235, 59, 0); border-color: rgba(255, 255, 255, 0.15); }
}

.chat-popup {
    position: absolute;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    z-index: 30;
    pointer-events: auto;
}

/* Always-visible in-game chat ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â pinned top-left under thin HUD (flat, shade-only blocks) */
#chat-popup {
    left: 8px;
    top: 26px;
    width: min(300px, calc(100vw - 24px));
    height: 240px;
    border: none;
    box-shadow: none;
    overflow: hidden;
    background: rgb(0 0 0 / 24%);
    color: #fff;
}

#chat-popup .chat-close-btn {
    display: none;
}

#chat-popup .chat-popup-header {
    color: #fff;
    border-bottom: none;
    background: rgb(18 18 18 / 58%);
}

#chat-popup .chat-messages {
    background: rgba(0, 0, 0, 0.42);
}

#chat-popup .chat-msg,
#chat-popup .chat-msg-text,
#chat-popup .chat-msg-empty {
    color: #fff;
}

#chat-popup .chat-form {
    border-top: none;
    background: rgb(14 14 14 / 68%);
}

#chat-popup .chat-input {
    color: #fff;
    border: none;
    background: rgba(0, 0, 0, 0.45);
}

.live-stats-popup {
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--gui-panel-height) * var(--gui-center-rim) + 72px);
    top: auto;
    height: auto;
    max-height: min(420px, 70vh);
    width: min(380px, calc(100vw - 24px));
    background: rgba(12, 16, 24, 0.94);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.game-menu-popup {
    left: 8px;
    top: calc(1.65rem + 36px + env(safe-area-inset-top, 0px));
    width: min(280px, calc(100vw - 24px));
    height: auto;
    max-height: min(420px, 70vh);
    background: rgba(12, 16, 24, 0.94);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.game-menu-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 14px;
}

.game-menu-item {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: #e8eef5;
    cursor: pointer;
    font: inherit;
}

.game-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.game-menu-item.game-menu-danger {
    color: #ff8a80;
    border-color: rgba(255, 138, 128, 0.35);
}

.game-menu-resign-confirm {
    padding: 8px 0 0;
    color: #cfd8dc;
    font-size: 0.92rem;
}

.game-menu-resign-confirm p {
    margin: 0 0 10px;
}

.game-menu-resign-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.build-slot.repair-slot .slot-abbr,
.build-slot.repair-slot .repair-slot-icon {
    font-size: 1.15rem;
    line-height: 1;
    text-align: center;
}

.build-slot.repair-slot.active {
    outline: 2px solid #81d4fa;
}

.live-stats-body {
    padding: 10px 12px 14px;
    overflow-y: auto;
    color: #cfd8dc;
    font-size: 0.82rem;
}

.live-stats-hint {
    margin: 0 0 10px;
    color: #90a4ae;
    font-size: 0.75rem;
}

.live-stats-row {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.live-stats-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.live-stats-name {
    font-weight: 600;
    color: #eceff1;
    margin-bottom: 6px;
}

.live-stats-bar-row {
    display: grid;
    grid-template-columns: 72px 1fr 36px;
    gap: 6px;
    align-items: center;
    margin: 3px 0;
}

.live-stats-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.live-stats-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #81c784);
    border-radius: 4px;
}

.live-stats-bar-fill.is-army { background: linear-gradient(90deg, #ef5350, #ff8a65); }
.live-stats-bar-fill.is-pop { background: linear-gradient(90deg, #ba68c8, #ce93d8); }

.match-loading-overlay {
    background: #06080f url('../geowars_background.png') center center / cover no-repeat;
    opacity: 0;
    transition: opacity 0.55s ease;
}

.match-loading-overlay.match-loading-visible {
    opacity: 1;
}

.match-loading-overlay.match-loading-fade-out {
    opacity: 0;
    pointer-events: none;
}

.match-loading-stage {
    transition: transform 0.55s ease, opacity 0.55s ease;
}

.match-loading-overlay:not(.match-loading-visible) .match-loading-stage {
    transform: translateY(12px);
    opacity: 0.35;
}

.match-loading-versus {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 14px;
    margin: 18px 0 10px;
    flex-wrap: wrap;
}

.match-loading-team {
    flex: 1 1 140px;
    max-width: 200px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
}

.match-loading-team-title {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #90caf9;
    margin-bottom: 8px;
}

.match-loading-player {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.88rem;
}

.match-loading-player:last-child {
    margin-bottom: 0;
}

.match-loading-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.match-loading-race {
    display: inline-block;
    font-size: 0.72rem;
    color: #ffd54f;
    margin-left: 4px;
}

.match-loading-vs {
    align-self: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: #ff7043;
    letter-spacing: 0.06em;
    text-shadow: 0 0 18px rgba(255, 112, 67, 0.45);
}

.match-loading-progress-wrap {
    margin: 14px 0 8px;
}

.match-loading-progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.match-loading-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #42a5f5, #66bb6a);
    transition: width 0.25s ease;
}

.match-loading-progress-label {
    margin-top: 8px;
    font-size: 0.82rem;
    color: #b0bec5;
}

.match-loading-shade {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.match-loading-card {
    position: relative;
    z-index: 1;
    max-width: 480px;
    width: min(92vw, 480px);
}

.match-loading-summary {
    margin: 12px 0;
    text-align: left;
    color: #e0e0e0;
    font-size: 0.92rem;
    line-height: 1.45;
}

.match-loading-tip {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid #ffd54f;
    color: #ffe082;
    font-size: 0.85rem;
    text-align: left;
}

.match-loading-countdown {
    margin-top: 14px;
    color: #90caf9;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.chat-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    color: #e0e0e0;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.chat-close-btn:hover {
    color: #fff;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    font-size: 0.78rem;
    line-height: 1.35;
}

.chat-msg {
    margin-bottom: 6px;
    word-break: break-word;
}

.chat-msg-author {
    font-weight: 600;
    margin-right: 4px;
}

.chat-msg-author.slot-1 { color: #64b5f6; }
.chat-msg-author.slot-2 { color: #ef5350; }
.chat-msg-author.slot-3 { color: #81c784; }
.chat-msg-author.slot-4 { color: #ce93d8; }

.chat-form {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.35);
    color: #eee;
    font-size: 0.78rem;
}

.chat-send-btn {
    padding: 6px 10px;
    border: 1px solid rgba(129, 212, 250, 0.5);
    border-radius: 4px;
    background: rgba(33, 150, 243, 0.25);
    color: #e3f2fd;
    font-size: 0.75rem;
    cursor: pointer;
}

.chat-send-btn:hover {
    background: rgba(33, 150, 243, 0.4);
}

.minimap-wrap {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    overflow: hidden;
    cursor: var(--gw-cursor);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.minimap-wrap.under-attack {
    border-color: rgba(244, 67, 54, 0.95);
    box-shadow: 0 0 14px rgba(244, 67, 54, 0.55);
    animation: minimap-alert-pulse 0.9s ease-in-out infinite;
}

@keyframes minimap-alert-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(244, 67, 54, 0.35); }
    50% { box-shadow: 0 0 18px rgba(244, 67, 54, 0.75); }
}

#minimap-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.minimap-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #666;
    font-size: 0.72rem;
    text-align: center;
    line-height: 1.3;
}

.minimap-label {
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.minimap-soon {
    font-size: 0.65rem;
    color: #555;
}

.gui-zone-hero {
    padding: 6px 4px;
    width: 65%;
}

.hero-panel-inner {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: stretch;
    background: rgb(0 0 0 / 84%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    height: 140px;
    margin-top: -35px;
    margin-left: -12px;
    padding: 6px 8px;
    flex-direction: column;
}

#hero-portrait {
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    max-height: 24px;
    max-width: 24px;
}

.hero-panel-inner #hero-cards {
    flex: 1;
}

.hero-stats {
    flex: 1;
    min-width: 0;
    font-size: 0.65rem;
    line-height: 1.35;
}

.hero-name {
    font-weight: 700;
    color: #ffe082;
    font-size: 0.78rem;
    margin-bottom: 2px;
}

.hero-line {
    color: #bbb;
}

.gui-zone-center {
    padding: 4px 8px;
    overflow: hidden;
    margin-left: 35%;
    margin-top: -32px;
    width: 60%;
    max-height: calc(var(--gui-panel-height) * 0.62);
}

.selection-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 6px 10px;
    min-height: 0;
    overflow: hidden;
}

.selection-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    width: 100%;
    flex-shrink: 0;
}

.selection-header-row .selection-title {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.selection-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #c9a227;
    margin: 0 0 4px;
    line-height: 1.25;
}

.demolish-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(244, 67, 54, 0.45);
    border-radius: 4px;
    background: rgba(80, 20, 20, 0.75);
    color: #ef9a9a;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0;
}

.demolish-btn:hover {
    background: rgba(180, 40, 40, 0.9);
    color: #fff;
}

.demolish-btn.hidden {
    display: none;
}

.skill-hotkey {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 0.55rem;
    color: #bbb;
    opacity: 0.9;
}

.selection-body {
    font-size: 0.74rem;
    color: #ccc;
    line-height: 1.4;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.selection-body.hidden {
    display: none !important;
}

.selection-body p {
    margin: 0.2rem 0;
    font-size: 0.78rem;
    color: #ccc;
}

.unit-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 4px;
}

.unit-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid #777;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    font-size: 0.76rem;
    font-weight: 700;
    color: #e8e8e8;
    cursor: help;
    line-height: 1;
}

.unit-stat-chip:hover {
    border-color: #aaa;
    background: rgba(20, 24, 32, 0.75);
}

.unit-stat-icon {
    font-size: 0.82rem;
    opacity: 0.9;
}

#panel-activity.hidden {
    display: none;
}

.gui-zone-build {
    padding: 4px 10px 8px 4px;
    align-items: flex-start;
    justify-content: flex-end;
    margin-top: -77px;
    margin-left: -24px;
    width: 220px;
    height: 204px;
}


.build-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    height: 100%;
    max-height: 100%;
    aspect-ratio: 1;
}

.backpack-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    align-content: stretch;
    align-self: stretch;
    gap: 3px;
    width: 100%;
    height: 100%;
    max-height: 100%;
    aspect-ratio: 1;
    overflow: visible;
}

.backpack-slot {
    position: relative;
    aspect-ratio: auto;
    width: 100%;
    min-height: 24px;
    height: 100%;
    border: 1px solid rgba(80, 80, 100, 0.8);
    background: rgba(0, 0, 0, 0.55);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    padding: 2px;
    color: #ddd;
    cursor: pointer;
    overflow: hidden;
}

.backpack-slot.has-thumb {
    padding: 0;
}

.backpack-slot .backpack-thumb {
    position: absolute;
    inset: 1px;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    object-fit: cover;
    border-radius: 2px;
    pointer-events: none;
}

.backpack-slot.has-thumb .backpack-abbr {
    display: none;
}

.backpack-slot:not(.empty):hover {
    background: rgba(120, 40, 40, 0.45);
    border-color: #ef5350;
}

.backpack-slot.empty {
    opacity: 0.2;
}

.backpack-slot.locked {
    opacity: 0.55;
    cursor: help;
    border-style: dashed;
    border-color: rgba(120, 120, 140, 0.55);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(180, 180, 200, 0.7);
}

.backpack-slot.locked:hover {
    background: rgba(40, 40, 60, 0.55);
    border-color: rgba(201, 162, 39, 0.55);
}

.backpack-lock-icon {
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0.85;
    pointer-events: none;
}

/* Legacy inline tooltip kept hidden; floating #item-hover-tooltip is used instead. */
.backpack-slot .item-tooltip {
    display: none !important;
}

.item-hover-tooltip {
    position: fixed;
    z-index: 220;
    min-width: 260px;
    max-width: min(440px, calc(100vw - 24px));
    padding: 0.55rem 0.7rem 0.6rem;
    background: rgba(10, 12, 22, 0.96);
    border: 2px solid #bdbdbd;
    border-radius: 8px;
    box-shadow: none;
    color: #eee;
    /* Must not steal hover from backpack slots (taller aura blurbs). */
    pointer-events: none !important;
    --item-tier-color: #bdbdbd;
}

.item-hover-tooltip * {
    pointer-events: none !important;
}

.item-hover-tooltip.hidden {
    display: none;
}

.item-hover-tooltip-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--item-tier-color, #ffe082);
    margin-bottom: 0.35rem;
}

.item-hover-tooltip-tier {
    font-weight: 600;
    opacity: 0.8;
    margin-left: 0.35rem;
    font-size: 0.72rem;
    color: inherit;
}

.item-hover-tooltip-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem 0.45rem;
    margin-bottom: 0.4rem;
}

.item-hover-tooltip-stat {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.72rem;
    font-weight: 500;
    color: #e3f2fd;
    white-space: nowrap;
}

.item-hover-tooltip-hint {
    font-size: 0.68rem;
    color: #9e9e9e;
    font-style: italic;
}

.item-hover-tooltip-blurb {
    font-size: 0.74rem;
    line-height: 1.35;
    color: #cfd8dc;
    margin-bottom: 0.4rem;
}

.item-hover-tooltip-lock {
    margin-top: 0.15rem;
    padding: 0.28rem 0.45rem;
    border-radius: 4px;
    background: rgba(255, 152, 0, 0.22);
    border: 1px solid rgba(255, 183, 77, 0.7);
    color: #ffe082;
    font-size: 0.7rem;
    font-weight: 600;
}

.item-hover-tooltip.is-panel,
.item-hover-tooltip.is-build {
    border-color: #b0bec5;
    --item-tier-color: #cfd8dc;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

.build-slot .build-tooltip {
    display: none !important;
}

/* T1 common ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â no glow */
.item-hover-tooltip.tier-1 {
    box-shadow: none;
}

/* T2 uncommon ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â soft glow */
.item-hover-tooltip.tier-2 {
    box-shadow: 0 0 10px rgba(102, 187, 106, 0.35);
}

/* T3 rare ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â medium glow */
.item-hover-tooltip.tier-3 {
    box-shadow: 0 0 16px rgba(79, 195, 247, 0.5), 0 0 4px rgba(79, 195, 247, 0.35);
}

/* T4 epic ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â strong glow */
.item-hover-tooltip.tier-4 {
    box-shadow: 0 0 22px rgba(206, 147, 216, 0.65), 0 0 8px rgba(206, 147, 216, 0.45);
}

/* T5 legendary ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â pronounced glow */
.item-hover-tooltip.tier-5 {
    box-shadow:
        0 0 10px rgba(255, 213, 79, 0.85),
        0 0 28px rgba(255, 213, 79, 0.7),
        0 0 48px rgba(255, 193, 7, 0.4);
}

.build-slot {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 28px;
    padding: 0;
    border: 1px solid rgba(80, 80, 100, 0.8);
    background: rgba(0, 0, 0, 0.55);
    color: #ddd;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.build-slot:hover:not(.disabled):not(.empty) {
    border-color: #c9a227;
    background: rgba(201, 162, 39, 0.18);
}

.build-slot.active {
    border-color: #4fc3f7;
    box-shadow: 0 0 6px rgba(79, 195, 247, 0.45);
}

.build-slot.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.build-slot.empty {
    opacity: 0.15;
    cursor: default;
    pointer-events: none;
}

.build-slot.queued {
    cursor: default;
    pointer-events: none;
    overflow: hidden;
}

.build-slot .slot-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background: #4fc3f7;
    max-width: 100%;
}

.sel-queue {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sel-queue-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 6px;
    align-items: center;
    font-size: 0.68rem;
}

.sel-queue-label {
    color: #bbb;
    grid-column: 1;
}

.sel-queue-item .activity-bar {
    grid-column: 1 / -1;
}

.sel-queue-item .activity-eta {
    grid-column: 2;
    color: #888;
    font-size: 0.65rem;
}

.sel-hint {
    color: #888;
    font-size: 0.7rem;
    margin-top: 4px;
}

.sel-owner {
    color: #90caf9;
    font-size: 0.72rem;
    margin-bottom: 6px;
}

.sel-buffs {
    margin: 6px 0 2px;
    font-size: 0.72rem;
    color: #c8c8c8;
    line-height: 1.45;
}

.sel-buffs-label {
    color: #999;
    margin-right: 2px;
}

.sel-buff-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px 4px 2px 0;
    padding: 2px 6px 2px 5px;
    border: 1px solid #666;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    color: #ddd;
    white-space: nowrap;
}

.sel-buff-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--buff-color, #ffeb3b);
    flex-shrink: 0;
}

.sel-buff-time {
    color: #aaa;
    font-variant-numeric: tabular-nums;
}

.build-slot canvas {
    display: block;
    width: 80%;
    height: 80%;
}

.build-slot .slot-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    display: block;
    border-radius: 2px;
}

.build-slot.has-thumb .slot-abbr {
    display: none;
}

.build-slot.disabled.has-thumb {
    opacity: 1;
}

.build-slot.disabled.has-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
    border-radius: 2px;
    z-index: 1;
}

.build-slot .slot-abbr {
    position: relative;
    z-index: 1;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.build-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    z-index: 50;
    background: rgba(10, 12, 20, 0.98);
    border: 1px solid rgba(201, 162, 39, 0.85);
    padding: 6px 9px;
    border-radius: 5px;
    font-size: 0.72rem;
    white-space: normal;
    pointer-events: none;
    color: #f5f5f5;
    line-height: 1.35;
    max-width: 210px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75);
}

.build-tooltip .tooltip-lock {
    display: block;
    margin-top: 5px;
    padding: 4px 6px;
    background: rgba(255, 193, 7, 0.22);
    border: 1px solid rgba(255, 213, 79, 0.65);
    border-radius: 3px;
    color: #ffe082;
    font-weight: 600;
    font-style: normal;
}

.build-slot.disabled .build-tooltip .tooltip-lock {
    color: #fff59d;
    background: rgba(255, 152, 0, 0.28);
    border-color: rgba(255, 183, 77, 0.75);
}

.build-slot:hover .build-tooltip {
    display: block;
}

.train-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.train-btn {
    padding: 4px 8px;
    font-size: 0.72rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid #555;
    color: #eee;
    border-radius: 4px;
    cursor: pointer;
}

.train-btn:hover:not(.disabled) {
    border-color: #4fc3f7;
}

.train-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.selection-upgrade {
    margin-top: 6px;
}

.upgrade-btn {
    width: 100%;
    padding: 5px 8px;
    font-size: 0.72rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid #555;
    color: #eee;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
}

.upgrade-btn:hover:not(.disabled) {
    border-color: #c9a227;
}

.upgrade-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.selection-activity {
    margin-top: 6px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.upgrade-owned {
    font-size: 0.78rem;
    color: #81c784;
    margin: 0.35rem 0 0;
    line-height: 1.35;
}

.upgrade-item.hidden {
    display: none;
}

.activity-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-content: flex-start;
}

.activity-empty {
    font-size: 0.75rem;
    color: #888;
    margin: 0;
    line-height: 1.35;
}

.activity-empty.hidden {
    display: none;
}

.activity-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
    max-width: 100%;
    padding: 5px 8px 6px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    color: #eee;
    font-family: 'Roboto Condensed', 'Segoe UI', sans-serif;
    font-size: 0.72rem;
    font-weight: 400;
    cursor: pointer;
    text-align: left;
}

.activity-item:hover {
    border-color: rgba(79, 195, 247, 0.55);
    background: rgba(79, 195, 247, 0.1);
}

.activity-label {
    grid-column: 1;
    grid-row: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f0f0f0;
}

.activity-eta {
    grid-column: 2;
    grid-row: 1;
    color: #ffd54f;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.activity-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 4px;
    background: #1a1a1a;
    border-radius: 2px;
    overflow: hidden;
}

.activity-fill {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #29b6f6);
    transition: width 0.25s ease;
}

.activity-fill.queued {
    background: rgba(255, 255, 255, 0.2);
    width: 8% !important;
}

#build-hint {
    position: absolute;
    bottom: calc(var(--gui-panel-height) + 22px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #4fc3f7;
    z-index: 15;
    font-size: 0.85rem;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.overlay-card {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    max-width: 480px;
}

.overlay-card h2 {
    margin-bottom: 1rem;
}

.race-picker {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.race-btn {
    background: #252540;
    border: 2px solid #444;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    color: #eee;
    transition: border-color 0.2s, transform 0.15s;
    min-width: 110px;
}

.race-btn:hover:not(:disabled) {
    border-color: #4fc3f7;
    transform: translateY(-2px);
}

.race-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.race-btn span {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

#waiting-text {
    color: #aaa;
}

/* Post-game victory panel */
.victory-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(380px, calc(100vw - 24px));
    z-index: 40;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.victory-panel.hidden {
    display: none;
}

.victory-panel-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: rgba(10, 12, 22, 0.94);
    border: 1px solid rgba(79, 195, 247, 0.35);
    border-radius: 12px;
    padding: 1.1rem 1.15rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.victory-panel-inner h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    color: #ffd54f;
    line-height: 1.2;
}

.victory-subtitle {
    margin: 0 0 0.85rem;
    color: #c5cae9;
    font-size: 0.88rem;
    line-height: 1.35;
}

.victory-stats-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
}

.victory-stats {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.victory-stats th,
.victory-stats td {
    padding: 0.42rem 0.45rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.victory-stats th {
    position: sticky;
    top: 0;
    background: rgba(20, 24, 38, 0.98);
    color: #90a4ae;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.victory-stats td small {
    color: #ffd54f;
    font-size: 0.68rem;
}

.victory-row-you td {
    background: rgba(79, 195, 247, 0.1);
    color: #e3f2fd;
}

.victory-meta {
    margin: 0 0 0.55rem;
    color: #78909c;
    font-size: 0.76rem;
}

.victory-hint {
    margin: 0 0 0.85rem;
    color: #8a8fa8;
    font-size: 0.74rem;
    line-height: 1.35;
}

.victory-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.victory-btn {
    display: block;
    text-align: center;
    padding: 0.62rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #e0e0e0;
    text-decoration: none;
    font-family: 'Roboto Condensed', 'Segoe UI', Tahoma, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.victory-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.victory-btn-primary {
    background: linear-gradient(180deg, #29b6f6 0%, #0288d1 100%);
    border-color: #4fc3f7;
    color: #fff;
}

.victory-btn-primary:hover {
    background: linear-gradient(180deg, #4fc3f7 0%, #039be5 100%);
    border-color: #81d4fa;
}

/* Full-viewport end banner over the map (not the side stats panel) */
.end-banner {
    position: absolute;
    inset: 0;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.85s ease;
}

.end-banner.hidden {
    display: none;
}

.end-banner.is-visible {
    opacity: 1;
}

.end-banner.is-fading-out {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.end-banner-veil {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

.end-banner-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.35em;
    padding: 0 1.5rem;
    font-family: 'Roboto Condensed', 'Segoe UI', sans-serif;
    font-size: clamp(2.6rem, 7vw, 4.8rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.65);
    line-height: 1.05;
}

.end-banner-you {
    color: #ffffff;
}

.end-banner-outcome.is-lost {
    color: #ef5350;
}

.end-banner-outcome.is-won {
    color: #66bb6a;
}

@media (max-width: 720px) {
    .victory-panel {
        top: auto;
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-height: 45vh;
    }
}

/* ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬ÂÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â Tutorial ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬ÂÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â */
.tutorial-overlay {
    z-index: 120;
}

.tutorial-card {
    max-width: 520px;
    text-align: left;
}

.tutorial-card h2 {
    text-align: center;
}

.tutorial-body {
    color: #ccc;
    font-size: 0.92rem;
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.tutorial-body p {
    margin: 0 0 0.75rem;
}

.tutorial-card .btn-primary {
    display: block;
    width: 100%;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    background: linear-gradient(180deg, #29b6f6 0%, #0288d1 100%);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.tutorial-spotlight {
    position: fixed;
    border-radius: 50%;
    border: 2px solid rgba(255, 235, 59, 0.95);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.38), 0 0 16px rgba(255, 235, 59, 0.5);
    pointer-events: none;
    z-index: 110;
}

.tutorial-marker {
    position: fixed;
    border-radius: 50%;
    border: 2px dashed rgba(129, 199, 132, 0.95);
    background: rgba(76, 175, 80, 0.12);
    box-shadow: 0 0 14px rgba(129, 199, 132, 0.45);
    pointer-events: none;
    z-index: 109;
    animation: tutorial-pulse 1.2s ease-in-out infinite;
}

@keyframes tutorial-pulse {
    0%, 100% { transform: scale(1); opacity: 0.95; }
    50% { transform: scale(1.08); opacity: 0.7; }
}

/* Guide arrow: solid bar (NOT height:0 + border â€” broken under global border-box).
   z-index above tutorial tip (130) so it is never covered. */
.tutorial-nav-line {
    position: fixed;
    box-sizing: content-box;
    height: 10px;
    width: 260px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 5px;
    transform-origin: 0 50%;
    pointer-events: none;
    z-index: 200;
    background: #ffe082;
    box-shadow:
        0 0 0 3px rgba(20, 20, 30, 0.85),
        0 0 18px rgba(255, 214, 0, 1),
        0 0 6px rgba(255, 255, 255, 0.95);
    animation: tutorial-nav-pulse 0.9s ease-in-out infinite;
}

.tutorial-nav-line::after {
    content: '';
    position: absolute;
    right: -22px;
    top: 50%;
    width: 0;
    height: 0;
    margin-top: -14px;
    border-style: solid;
    border-width: 14px 0 14px 26px;
    border-color: transparent transparent transparent #ffe082;
    filter: drop-shadow(0 0 8px rgba(255, 214, 0, 1));
}

@keyframes tutorial-nav-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.78; }
}

.tutorial-tip {
    position: fixed;
    z-index: 130;
    width: min(300px, calc(100vw - 24px));
    max-height: min(42vh, 320px);
    display: flex;
    flex-direction: column;
    background: rgba(14, 16, 28, 0.94);
    border: 1px solid rgba(79, 195, 247, 0.65);
    border-radius: 10px;
    padding: 0.65rem 0.75rem 0.7rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
    color: #e8eaf0;
}

.tutorial-tip-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff59d;
    margin-bottom: 0.35rem;
    flex: 0 0 auto;
}

.tutorial-tip-body {
    font-size: 0.78rem;
    line-height: 1.4;
    color: #cfd8dc;
    margin-bottom: 0.55rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.tutorial-tip-body p {
    margin: 0 0 0.35rem;
}

.tutorial-tip-btn {
    display: block;
    width: 100%;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.55rem;
    background: #0288d1;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}

.tutorial-tip-btn:hover {
    background: #039be5;
}

.tutorial-objective {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 108;
    background: rgba(12, 14, 28, 0.94);
    border: 1px solid #4fc3f7;
    color: #e3f2fd;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    max-width: min(560px, 92vw);
    text-align: center;
    pointer-events: none;
}

.tutorial-ui-focus {
    position: relative;
    z-index: 120 !important;
    outline: 2px solid rgba(255, 235, 59, 0.95) !important;
    outline-offset: 4px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42), 0 0 18px rgba(255, 235, 59, 0.55) !important;
    border-radius: 8px;
    animation: tutorial-ui-pulse 1.4s ease-in-out infinite;
}

@keyframes tutorial-ui-pulse {
    0%, 100% { outline-color: rgba(255, 235, 59, 0.95); }
    50% { outline-color: rgba(129, 199, 132, 0.95); }
}

.home-tutorial-status {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: #ef9a9a;
}

.lobby-actions {
    flex-wrap: wrap;
}

/* ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬ÂÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â Mobile game shell (desktop rules untouched) ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬ÂÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â */
.mobile-toolbar {
    display: none;
}

body.mobile-game {
    overscroll-behavior: none;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    --mobile-nav-pad: env(safe-area-inset-bottom, 0px);
}

body.mobile-game #game-canvas {
    touch-action: none;
}

/* Top action bar removed on mobile â€” keep hidden (no empty gap) */
body.mobile-game .mobile-toolbar,
body.mobile-game .mobile-toolbar.hidden {
    display: none !important;
}

body.mobile-game .mobile-tool-btn {
    flex: 0 0 auto;
    min-height: 40px;
    min-width: 52px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(10, 14, 22, 0.88);
    color: #e8eef7;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

body.mobile-game .mobile-tool-btn.is-active {
    border-color: rgba(255, 193, 7, 0.75);
    background: rgba(255, 193, 7, 0.18);
    color: #ffe082;
}

body.mobile-game .mobile-tool-icon {
    min-width: 40px;
    font-size: 1.15rem;
    line-height: 1;
}

body.mobile-game .mobile-tool-cancel {
    margin-left: auto;
    border-color: rgba(239, 83, 80, 0.55);
    color: #ffcdd2;
}

body.mobile-game .game-menu-corner-btn {
    top: calc(env(safe-area-inset-top, 0px) + 26px);
    left: 8px;
    width: 32px;
    height: 28px;
}

body.mobile-game .game-menu-popup {
    top: calc(env(safe-area-inset-top, 0px) + 26px + 34px);
}

/* Realtime strip at the very top; resources/population stacked below it */
body.mobile-game #hud {
    top: env(safe-area-inset-top, 0px);
    padding: 0.18rem 0.55rem;
    font-size: 0.65rem;
    gap: 0.75rem;
}

/* ID selector must override desktop #hud-panel-stats (else bottom stretches full height) */
body.mobile-game #hud-panel-stats {
    top: calc(env(safe-area-inset-top, 0px) + 26px);
    left: 8px;
    right: 8px;
    bottom: auto;
    height: auto;
    width: auto;
    max-width: calc(100vw - 16px);
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
    justify-content: flex-start;
    gap: 5px;
    pointer-events: none;
}

body.mobile-game #hud-panel-stats .hud-stat {
    flex: 0 0 auto;
    align-self: center;
    height: auto;
    min-height: 0;
    max-height: none;
    font-size: 0.72rem;
    padding: 4px 7px;
    line-height: 1.15;
    border-radius: 8px;
}

body.mobile-game #hud-panel-stats .hud-stat-icon {
    font-size: 0.85rem;
}

body.mobile-game #chat-last-toast {
    top: calc(env(safe-area-inset-top, 0px) + 68px);
    right: 8px;
    left: auto;
    bottom: auto;
    transform: translateY(-4px);
    max-width: min(70vw, 320px);
    text-align: right;
}

body.mobile-game #chat-last-toast.visible {
    transform: translateY(0);
}

body.mobile-game #bottom-panel {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    height: auto;
    max-height: min(38vh, 300px);
    background:
        linear-gradient(180deg, rgba(8, 12, 20, 0.2) 0%, rgba(8, 12, 20, 0.94) 18%),
        linear-gradient(160deg, #101826 0%, #0b1018 55%, #121a14 100%);
    border-top: 1px solid rgba(255, 213, 79, 0.22);
    filter: none;
    border-radius: 16px 16px 0 0;
    padding-bottom: var(--mobile-nav-pad);
    overflow: hidden;
    box-sizing: border-box;
}

body.mobile-game #bottom-panel .minimap-wrap {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 88px !important;
    height: 66px !important;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.mobile-game .gui-shell {
    display: grid;
    grid-template-columns: 96px 1fr;
    grid-template-rows: auto minmax(48px, 1fr) auto;
    grid-template-areas:
        "mini hero"
        "center center"
        "build build";
    height: auto;
    max-height: min(38vh, 300px);
    padding: 6px 8px 4px;
    gap: 5px;
    align-items: start;
    box-sizing: border-box;
}

body.mobile-game .gui-zone-minimap {
    grid-area: mini;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    padding: 0;
}

body.mobile-game .gui-zone-hero {
    grid-area: hero;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    padding: 4px 4px 0;
    overflow: visible;
}

body.mobile-game .gui-zone-hero .hero-panel-inner {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 4px 6px;
    font-size: 0.72rem;
    align-items: stretch;
    gap: 4px;
}

body.mobile-game .gui-zone-hero .hero-card-icon {
    width: 28px !important;
    height: 28px !important;
}

body.mobile-game .gui-zone-hero .hero-card {
    padding: 4px 5px;
    gap: 3px;
}

body.mobile-game .gui-zone-hero .hero-stats {
    padding-top: 1px;
    line-height: 1.3;
}

body.mobile-game .gui-zone-hero #hero-portrait {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0;
}

body.mobile-game .gui-zone-center {
    grid-area: center;
    margin: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    width: auto !important;
    height: auto !important;
    max-height: 120px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 6px 8px 4px;
}

body.mobile-game .gui-zone-center .selection-info {
    margin: 0;
    padding: 2px;
    background: transparent;
    border: none;
    overflow: hidden;
}

body.mobile-game .selection-unit-cards {
    gap: 3px;
    max-height: 96px;
}

body.mobile-game .gui-zone-center .selection-title {
    margin-top: 2px;
    padding-top: 2px;
}

body.mobile-game .gui-zone-build,
body.mobile-game #gui-zone-build {
    grid-area: build;
    margin: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    width: auto !important;
    height: auto !important;
    max-height: 56px;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* display:flex !important niÃƒâ€¦Ã‚Â¾Ãƒâ€¦Ã‚Â¡ie by inak prebil .hidden */
body.mobile-game #gui-zone-build.hidden,
body.mobile-game #build-buttons.hidden,
body.mobile-game #hero-backpack.hidden {
    display: none !important;
}

body.mobile-game .gui-zone-build .build-grid,
body.mobile-game .gui-zone-build .backpack-grid,
body.mobile-game #build-buttons,
body.mobile-game #hero-backpack {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    gap: 5px !important;
    width: max-content !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    align-self: auto !important;
    overflow: visible !important;
}

body.mobile-game .build-slot,
body.mobile-game .train-grid .build-item,
body.mobile-game .backpack-slot {
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    aspect-ratio: auto !important;
    box-sizing: border-box;
}

body.mobile-game .backpack-slot .backpack-lock-icon {
    font-size: 0.85rem;
}

body.mobile-game .hero-skills-float {
    left: auto;
    right: 8px;
    bottom: calc(var(--mobile-bottom-panel-h, 160px) + 8px);
    max-width: none;
    flex-direction: row;
}

body.mobile-game .hero-skill-btn {
    width: 44px;
    height: 44px;
}

body.mobile-game #build-hint {
    bottom: calc(var(--mobile-bottom-panel-h, 160px) + 10px);
    left: 50%;
    top: auto;
    width: min(94vw, 420px);
    font-size: 0.8rem;
}

body.mobile-game .game-toast {
    bottom: calc(var(--mobile-bottom-panel-h, 160px) + 16px);
}

.mobile-deselect-btn {
    display: none;
}

.mobile-selection-actions {
    display: none;
}

body.mobile-game .mobile-selection-actions {
    display: flex;
    position: fixed;
    left: 50%;
    bottom: calc(var(--mobile-bottom-panel-h, 160px) + 12px);
    transform: translateX(-50%);
    z-index: 28;
    gap: 8px;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

body.mobile-game .mobile-selection-actions.hidden {
    display: none;
}

body.mobile-game .mobile-deselect-btn,
body.mobile-game .mobile-rally-btn {
    display: flex;
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    z-index: 28;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    background: rgba(20, 24, 36, 0.92);
    color: #eceff1;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto;
}

body.mobile-game .mobile-rally-btn {
    font-size: 1.05rem;
}

body.mobile-game .mobile-rally-btn.hidden {
    display: none;
}

body.mobile-game .mobile-rally-btn.is-active {
    border-color: rgba(100, 181, 246, 0.85);
    background: rgba(33, 70, 110, 0.95);
    box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.35);
}

body.mobile-game .mobile-deselect-btn.hidden {
    display: none;
}

body.mobile-game .mobile-deselect-btn:active,
body.mobile-game .mobile-rally-btn:active {
    background: rgba(55, 71, 79, 0.95);
}

/* Chat stays pinned top-left (flat); live-stats remains a centered popup */
body.mobile-game #chat-popup {
    position: fixed;
    left: 8px;
    right: auto;
    top: calc(env(safe-area-inset-top, 0px) + 68px);
    bottom: auto;
    transform: none;
    width: min(280px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    height: min(36vh, 260px);
    max-height: min(36vh, 260px);
    z-index: 27;
    box-sizing: border-box;
    border: none;
    box-shadow: none;
}

body.mobile-game .live-stats-popup {
    position: fixed;
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(92vw, 420px);
    max-width: calc(100vw - 16px);
    height: auto;
    max-height: min(72vh, 520px);
    z-index: 80;
    box-sizing: border-box;
}

body.mobile-game .live-stats-body,
body.mobile-game .chat-messages {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.mobile-game .victory-hint { display: none; }
body.mobile-game .victory-hint-mobile { display: block !important; }

body.mobile-game .selection-title {
    font-size: 0.7rem;
}

body.mobile-game .selection-body {
    font-size: 0.72rem;
    line-height: 1.25;
}

body.mobile-game .formation-bar {
    left: 8px;
    top: calc(env(safe-area-inset-top, 0px) + 68px);
    bottom: auto;
    right: auto;
    transform: none;
    max-width: none;
}

/* Landscape: one compact strip at the bottom — maximize canvas height */
@media (orientation: landscape) {
    body.mobile-game #bottom-panel,
    body.mobile-game .gui-shell {
        max-height: min(34vh, 120px);
    }

    body.mobile-game .gui-shell {
        display: grid;
        grid-template-columns: 76px minmax(0, 1.35fr) minmax(96px, 20vw) minmax(0, 1fr);
        grid-template-rows: 1fr;
        grid-template-areas: "mini center hero build";
        align-items: center;
        padding: 4px 6px;
        gap: 5px;
    }

    body.mobile-game #bottom-panel .minimap-wrap {
        width: 72px !important;
        height: 54px !important;
    }

    body.mobile-game .gui-zone-center {
        max-height: 112px;
        overflow: hidden;
        padding: 4px 6px 2px;
    }

    body.mobile-game .selection-unit-cards {
        max-height: 52px;
    }

    body.mobile-game .gui-zone-hero .hero-panel-inner {
        padding: 4px 6px;
        font-size: 0.64rem;
        gap: 4px;
    }

    body.mobile-game .gui-zone-hero .hero-card-icon {
        width: 28px !important;
        height: 28px !important;
    }

    body.mobile-game .gui-zone-build,
    body.mobile-game #gui-zone-build {
        max-height: 48px;
    }

    body.mobile-game .build-slot,
    body.mobile-game .train-grid .build-item,
    body.mobile-game .backpack-slot {
        flex: 0 0 36px !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }

    body.mobile-game #hud-panel-stats {
        top: calc(env(safe-area-inset-top, 0px) + 22px);
    }

    body.mobile-game #chat-last-toast,
    body.mobile-game #chat-popup,
    body.mobile-game .formation-bar {
        top: calc(env(safe-area-inset-top, 0px) + 58px);
    }

    body.mobile-game .hero-skills-float {
        right: 6px;
        bottom: calc(var(--mobile-bottom-panel-h, 120px) + 6px);
    }

    body.mobile-game .hero-skill-btn {
        width: 40px;
        height: 40px;
    }
}

/* JS fallback when orientation media query is unreliable */
body.mobile-game.mobile-landscape #bottom-panel,
body.mobile-game.mobile-landscape .gui-shell {
    max-height: min(34vh, 120px);
}

body.mobile-game.mobile-landscape .gui-shell {
    display: grid;
    grid-template-columns: 76px minmax(0, 1.35fr) minmax(96px, 20vw) minmax(0, 1fr);
    grid-template-rows: 1fr;
    grid-template-areas: "mini center hero build";
    align-items: center;
    padding: 4px 6px;
    gap: 5px;
}

body.mobile-game.mobile-landscape #bottom-panel .minimap-wrap {
    width: 72px !important;
    height: 54px !important;
}

body.mobile-game.mobile-landscape .gui-zone-center {
    max-height: 112px;
    overflow: hidden;
    padding: 4px 6px 2px;
}

body.mobile-game.mobile-landscape .selection-unit-cards {
    max-height: 52px;
}

body.mobile-game.mobile-landscape .gui-zone-hero .hero-panel-inner {
    padding: 4px 6px;
    font-size: 0.64rem;
    gap: 4px;
}

body.mobile-game.mobile-landscape .gui-zone-hero .hero-card-icon {
    width: 28px !important;
    height: 28px !important;
}

body.mobile-game.mobile-landscape .gui-zone-build,
body.mobile-game.mobile-landscape #gui-zone-build {
    max-height: 48px;
}

body.mobile-game.mobile-landscape .build-slot,
body.mobile-game.mobile-landscape .train-grid .build-item,
body.mobile-game.mobile-landscape .backpack-slot {
    flex: 0 0 36px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
}

body.mobile-game.mobile-landscape #hud-panel-stats {
    top: calc(env(safe-area-inset-top, 0px) + 22px);
}

body.mobile-game.mobile-landscape #chat-last-toast,
body.mobile-game.mobile-landscape #chat-popup,
body.mobile-game.mobile-landscape .formation-bar {
    top: calc(env(safe-area-inset-top, 0px) + 58px);
}

body.mobile-game.mobile-landscape .hero-skills-float {
    right: 6px;
    bottom: calc(var(--mobile-bottom-panel-h, 120px) + 6px);
}

body.mobile-game.mobile-landscape .hero-skill-btn {
    width: 40px;
    height: 40px;
}

/* ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬ÂÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â FormÃƒÆ’Ã‚Â¡cie (desktop + mobile): vertical left panel ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬ÂÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â */
.formation-bar {
    position: absolute;
    z-index: 26;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 7px 6px;
    background: rgba(8, 12, 20, 0.88);
    border: 1px solid rgba(255, 213, 79, 0.28);
    border-radius: 10px;
    pointer-events: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.formation-bar.hidden {
    display: none !important;
}

.formation-bar-label {
    font-size: 0.62rem;
    color: #b0bec5;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 2px;
    text-align: center;
    white-space: nowrap;
    writing-mode: horizontal-tb;
}

.formation-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.4);
    color: #eceff1;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.formation-btn:hover {
    border-color: rgba(255, 213, 79, 0.55);
}

.formation-btn.is-active {
    border-color: rgba(255, 213, 79, 0.9);
    background: rgba(255, 213, 79, 0.18);
    color: #ffe082;
}

.formation-btn.formation-here {
    width: 34px;
    min-width: 34px;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬ÂÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â Mobile item inspect popup ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬ÂÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â */
.item-action-popup {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    background: rgba(0, 0, 0, 0.55);
    pointer-events: auto;
}

.item-action-popup.hidden {
    display: none !important;
}

.item-action-card {
    width: min(92vw, 360px);
    max-height: min(70vh, 440px);
    overflow: auto;
    background: rgba(12, 16, 24, 0.96);
    border: 2px solid var(--item-tier-color, rgba(255, 213, 79, 0.35));
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
    padding: 14px 14px 12px;
    --item-tier-color: rgba(255, 213, 79, 0.35);
}

.item-action-card.tier-1 {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.item-action-card.tier-2 {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 10px rgba(102, 187, 106, 0.35);
}

.item-action-card.tier-3 {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 16px rgba(79, 195, 247, 0.5), 0 0 4px rgba(79, 195, 247, 0.35);
}

.item-action-card.tier-4 {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 22px rgba(206, 147, 216, 0.65), 0 0 8px rgba(206, 147, 216, 0.45);
}

.item-action-card.tier-5 {
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.55),
        0 0 10px rgba(255, 213, 79, 0.85),
        0 0 28px rgba(255, 213, 79, 0.7),
        0 0 48px rgba(255, 193, 7, 0.4);
}

.item-action-body {
    color: #e0e0e0;
    font-size: 0.88rem;
    line-height: 1.35;
    margin-bottom: 12px;
}

.item-action-body .item-hover-tooltip-title {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--item-tier-color, #ffe082);
}

.item-action-actions {
    display: flex;
    gap: 8px;
}

.item-action-btn {
    flex: 1;
    min-height: 42px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #eee;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
}

.item-action-btn.item-action-primary {
    border-color: rgba(255, 213, 79, 0.55);
    background: rgba(255, 213, 79, 0.18);
    color: #ffe082;
}

/* â€”â€” Geowiki â€”â€” */
.geowiki-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0 0 1.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.geowiki-jump a {
    color: #ffe082;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.geowiki-jump a:hover {
    text-decoration: underline;
}

.geowiki-section {
    margin-top: 2rem;
    scroll-margin-top: 5rem;
}

.geowiki-section h2 {
    margin-bottom: 0.4rem;
}

.geowiki-unit-grid,
.geowiki-building-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.geowiki-entry {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.85rem 0.95rem 1rem;
}

.geowiki-entry h3 {
    font-size: 1.05rem;
    margin: 0.35rem 0 0.25rem;
}

.geowiki-blurb {
    font-size: 0.82rem;
    line-height: 1.4;
    color: rgba(238, 238, 238, 0.78);
    margin-bottom: 0.55rem;
    min-height: 2.4em;
}

.geowiki-preview-row {
    display: flex;
    gap: 0.35rem;
    justify-content: space-between;
}

.geowiki-unit-canvas,
.geowiki-building-canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    background: rgba(8, 12, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.geowiki-unit-canvas {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
}

.geowiki-building-canvas {
    height: 110px;
    margin-bottom: 0.25rem;
}

.geowiki-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 0.65rem;
    font-size: 0.78rem;
}

.geowiki-stats div {
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.08);
    padding: 0.12rem 0;
}

.geowiki-stats dt {
    color: rgba(238, 238, 238, 0.55);
    font-weight: 500;
}

.geowiki-stats dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
}

.geowiki-tier-title {
    margin: 1.35rem 0 0.5rem;
    font-size: 1.05rem;
    color: #ffe082;
}

.geowiki-item-id {
    display: block;
    font-size: 0.72rem;
    opacity: 0.55;
    font-weight: 400;
}

.geowiki-item-table td:nth-child(2),
.geowiki-item-table td:nth-child(3),
.geowiki-item-table td:nth-child(4) {
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .geowiki-unit-grid,
    .geowiki-building-grid {
        grid-template-columns: 1fr;
    }
}



/* ——— Google auth button ——— */
.auth-or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.85rem 0 0.65rem;
    color: rgba(232, 245, 233, 0.55);
    font-size: 0.82rem;
}
.auth-or::before,
.auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}
.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #fff;
    color: #202124;
    font-weight: 650;
    text-decoration: none;
    line-height: 1.2;
}
.btn-google:hover {
    background: #f5f5f5;
}
.btn-google-icon {
    display: inline-flex;
}
.btn-google-hint {
    margin: 0.45rem 0 0;
    text-align: center;
    font-size: 0.78rem;
}

/* ——— Mobile WebView /m/ home ——— */
body.mobile-web.home-page {
    min-height: 100dvh;
}
body.mobile-web.home-page .home-hero-bg {
    display: block !important;
    opacity: 1;
}

/* Guest /m/: dedicated mapp-login screen (css/mobile_app.css). Keep classic mobile guest fallback unused. */
body.mobile-web.home-page:not(.home-logged-in) .site-header,
body.mobile-web.home-page:not(.home-logged-in) .home-play-ctas,
body.mobile-web.home-page:not(.home-logged-in) .home-video-banner,
body.mobile-web.home-page:not(.home-logged-in) .home-cta-row,
body.mobile-web.home-page:not(.home-logged-in) #galeria,
body.mobile-web.home-page:not(.home-logged-in) #statistiky,
body.mobile-web.home-page:not(.home-logged-in) #o-hre,
body.mobile-web.home-page:not(.home-logged-in) .home-hero-tagline {
    display: none !important;
}

/* Logged-in: hamburger, no hero logo; CTA titles visible like desktop */
body.mobile-web.home-page.home-logged-in .home-hero-logo-wrap {
    display: none !important;
}
body.mobile-web.home-page.home-logged-in .site-header .site-logo {
    opacity: 0.92;
}
body.mobile-web.home-page.home-logged-in .home-main {
    padding-top: 0.35rem;
}
body.mobile-web.home-page.home-logged-in .home-section.home-top {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
body.mobile-web.home-page.home-logged-in .home-play-auth-row {
    display: contents;
}
body.mobile-web.home-page.home-logged-in .home-auth-panel {
    order: 1;
    width: 100%;
    margin: 0;
}
body.mobile-web.home-page.home-logged-in .home-play-ctas {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    margin: 0;
}
body.mobile-web.home-page.home-logged-in #statistiky {
    order: 3;
    width: 100%;
}
body.mobile-web.home-page.home-logged-in .home-tables-block {
    order: 4;
    width: 100%;
}
body.mobile-web.home-page.home-logged-in .home-video-banner {
    order: 5;
}
body.mobile-web.home-page.home-logged-in .home-cta-row {
    order: 6;
}
body.mobile-web.home-page.home-logged-in #galeria {
    order: 7;
}
body.mobile-web.home-page.home-logged-in .home-gallery-lightbox {
    order: 8;
}
body.mobile-web.home-page.home-logged-in .home-tutorial-banner,
body.mobile-web.home-page.home-logged-in .home-env-banner {
    min-height: 0;
    border-radius: 14px;
    overflow: hidden;
}
body.mobile-web.home-page.home-logged-in .home-tutorial-banner-inner,
body.mobile-web.home-page.home-logged-in .home-env-banner-inner {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    min-height: 0;
}
body.mobile-web.home-page.home-logged-in .home-tutorial-banner-text,
body.mobile-web.home-page.home-logged-in .home-env-banner-text {
    display: block !important;
    text-align: center;
    font-size: clamp(0.92rem, 3.6vw, 1.05rem);
}
body.mobile-web.home-page.home-logged-in .home-tutorial-banner-btn,
body.mobile-web.home-page.home-logged-in .home-env-banner-btn {
    margin: 0 auto;
    min-width: 70%;
    text-align: center;
}
body.mobile-web.home-page.home-logged-in .home-tutorial-banner-bg .home-tutorial-banner-art,
body.mobile-web.home-page.home-logged-in .home-env-banner-bg .home-env-banner-art {
    animation: mobileCtaPan 14s ease-in-out infinite alternate;
    transform-origin: center;
}
@keyframes mobileCtaPan {
    from { transform: scale(1.08) translateX(-2%); }
    to { transform: scale(1.14) translateX(2%); }
}

/* Android / Capacitor: keep header below status bar icons */
html.capacitor-native body.mobile-app .site-header,
body.mobile-app.capacitor-native .site-header {
    padding-top: max(env(safe-area-inset-top, 0px), 28px);
}
html.capacitor-native body.mobile-app .sc-topbar,
body.mobile-app.capacitor-native .sc-topbar,
body.mobile-app.sc-lobby-page .sc-topbar {
    padding-top: calc(0.65rem + max(env(safe-area-inset-top, 0px), 28px));
}
body.mobile-web.home-page.home-logged-in .site-header {
    padding-top: max(env(safe-area-inset-top, 0px), 0px);
}
html.capacitor-native body.mobile-web.home-page.home-logged-in .site-header {
    padding-top: max(env(safe-area-inset-top, 0px), 28px);
}

/* MOBA mode HUD — hide build grid / idle workers, keep backpack visible */
body.moba-mode #build-buttons,
body.moba-mode #idle-workers-btn,
body.moba-mode #build-hint {
    display: none !important;
}
body.moba-mode .gui-zone-build:not(.hidden) {
    display: flex !important;
}
body.moba-mode .gui-zone-build.hidden {
    display: none !important;
}
