/* GameMinty shared game chrome */
html, body {
    font-size: 10px;
}
@media (min-width: 768px) {
    html, body { font-size: 11px; }
}
@media (min-width: 992px) {
    html, body { font-size: 12px; }
}

:root {
    --gamehub-header-h: 4.8rem;
    --gh-cyan: #00f0ff;
    --gh-magenta: #ff00ff;
    --gh-gold: #ffcc00;
}

.gamehub-header {
    --header-pad-x: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    height: var(--gamehub-header-h);
    padding: 0 var(--header-pad-x);
    background: linear-gradient(180deg, rgba(8, 8, 22, 0.96) 0%, rgba(5, 5, 15, 0.88) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0, 240, 255, 0.18);
    box-shadow: 0 0.4rem 2rem rgba(0, 0, 0, 0.35), 0 1px 0 rgba(0, 240, 255, 0.08) inset;
    font-family: system-ui, -apple-system, sans-serif;
}

.gamehub-header::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.45), rgba(255, 0, 255, 0.25), transparent);
    pointer-events: none;
}

.gamehub-header-bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    height: 100%;
    max-width: 120rem;
    margin: 0 auto;
    min-width: 0;
}

.gamehub-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 240, 255, 0.28);
    background: rgba(0, 240, 255, 0.06);
    color: var(--gh-cyan);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.gamehub-back:hover {
    background: rgba(0, 240, 255, 0.14);
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
    color: var(--gh-cyan);
}

.gamehub-back-icon {
    flex-shrink: 0;
}

.gamehub-title-wrap {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 0 0.4rem;
}

.gamehub-title {
    display: block;
    font-size: clamp(1rem, 2.8vw, 1.25rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 0 18px rgba(0, 240, 255, 0.12);
}

.gamehub-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    min-width: 0;
}

.gamehub-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.gamehub-chip-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
}

.gamehub-chip-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--gh-gold);
    font-variant-numeric: tabular-nums;
}

.gamehub-chip--login {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gh-cyan);
    border-color: rgba(0, 240, 255, 0.25);
    background: rgba(0, 240, 255, 0.08);
    transition: background 0.15s, border-color 0.15s;
}

.gamehub-chip--login:hover {
    background: rgba(0, 240, 255, 0.16);
    border-color: rgba(0, 240, 255, 0.45);
    color: var(--gh-cyan);
}

.gamehub-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.gamehub-avatar {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 240, 255, 0.35);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.12);
}

.gamehub-avatar--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 255, 0.15));
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.gamehub-username {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gamehub-player-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gamehub-player-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.gamehub-guest-badge {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
}

.gamehub-content {
    padding-top: var(--gamehub-header-h);
    min-height: 100vh;
}

/* Fit games below fixed header — no page scrollbar */
body:has(#gamehub-header) {
    height: 100dvh;
    overflow: hidden;
}

body:has(#gamehub-header) .gamehub-content {
    height: 100dvh;
    min-height: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body:has(#gamehub-header).market-sim-page .gamehub-content {
    align-items: stretch;
}

body:has(#gamehub-header) .gamehub-content > #game,
body:has(#gamehub-header) .gamehub-content > #game-container,
body:has(#gamehub-header) .gamehub-content > #root,
body:has(#gamehub-header) .gamehub-content > #wrap,
body:has(#gamehub-header) .gamehub-content > #gc,
body:has(#gamehub-header) .gamehub-content > .container,
body:has(#gamehub-header) .gamehub-content > .container-fluid,
body:has(#gamehub-header) .gamehub-content > section {
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

body:has(#gamehub-header) .gamehub-content #game-container,
body:has(#gamehub-header) .gamehub-content #root,
body:has(#gamehub-header) .gamehub-content #wrap,
body:has(#gamehub-header) .gamehub-content #gc {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
}

@media (max-width: 991px) {
    body:has(#gamehub-header) .gamehub-content #game-container {
        border: none;
    }
}

@media (min-width: 992px) {
    body:has(#gamehub-header) .gamehub-content #game-container {
        border: 0px;
        border-bottom-width: 0px;
    }
}

body:has(#gamehub-header) .gamehub-content .min-vh-100,
body:has(#gamehub-header) .gamehub-content .vh-100,
body:has(#gamehub-header) .gamehub-content .h-screen,
body:has(#gamehub-header) .gamehub-content .min-h-screen {
    min-height: 0 !important;
    height: 100% !important;
}

body.gamehub-waiting .gamehub-content {
    pointer-events: none;
    filter: blur(2px);
}

/* Splash */
.gamehub-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.6rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
}

.gamehub-splash.hidden {
    display: none;
}

.gamehub-splash-card {
    width: 100%;
    max-width: 44rem;
    max-height: calc(100dvh - 3.2rem);
    overflow-y: auto;
    background: linear-gradient(145deg, #12122a, #0a0a18);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 1.2rem;
    padding: 2rem;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.15);
    text-align: center;
}

.gamehub-splash-kicker {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #00f0ff;
    margin-bottom: 0.4rem;
}

.gamehub-splash-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 1.2rem;
    color: #fff;
}

.gamehub-splash-rules {
    text-align: left;
    margin: 0 0 1.2rem;
    padding-left: 1.6rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.15rem;
    line-height: 1.6;
}

.gamehub-splash-hint {
    font-size: 1.05rem;
    color: #ffcc00;
    margin-bottom: 1rem;
}

.gamehub-splash-arrow-types {
    margin: 0 0 1.2rem;
    text-align: left;
}

.gamehub-splash-arrow-types-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 0.6rem;
}

.gamehub-splash-arrow-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.gamehub-splash-arrow-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.35);
    border-radius: 0.5rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.88);
}

.gamehub-splash-arrow-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    flex-shrink: 0;
}

@media (max-width: 479px) {
    .gamehub-splash-arrow-grid {
        grid-template-columns: 1fr;
    }
}

.gamehub-splash-note {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.2rem;
}

.gamehub-splash-note a {
    color: #00f0ff;
}

.gamehub-splash-btn {
    display: inline-block;
    width: 100%;
    max-width: 28rem;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #050505;
    background: linear-gradient(135deg, #00f0ff, #00ff88);
    border: none;
    border-radius: 999px;
    cursor: pointer;
}

.gamehub-splash-btn:hover {
    filter: brightness(1.08);
}

/* Hide legacy username prompts once GameMinty is active */
body.gamehub-ready #splash:not(#gamehub-splash),
body.gamehub-ready #name-modal-overlay,
body.gamehub-ready .setup-card label[for="player-name"],
body.gamehub-ready #player-name {
    display: none !important;
}

@media (min-width: 768px) {
    :root { --gamehub-header-h: 4.6rem; }
}

@media (max-width: 639px) {
    .gamehub-back-text { display: none; }
    .gamehub-back { padding: 0.45rem; }
    .gamehub-player-sub { display: none; }
    .gamehub-chip--login { display: none; }
    .gamehub-username { max-width: 5.5rem; }
}

@media (max-width: 399px) {
    .gamehub-chip--score .gamehub-chip-label { display: none; }
    .gamehub-avatar { width: 2.2rem; height: 2.2rem; }
}
