/* ============================================
   GLHF Games - Shared Core Styles
   ============================================ */

.game-page {
    padding-top: calc(var(--glhf-header-height) + 40px);
    padding-bottom: 4rem;
    min-height: 100vh;
}
.admin-bar .game-page {
    padding-top: calc(var(--glhf-header-height) + 40px);
}

/* --- Auth Required --- */
.game-auth-required {
    text-align: center;
    padding: 6rem 2rem;
}
.game-auth-icon {
    font-size: 4rem;
    opacity: 0.5;
    margin-bottom: 1.5rem;
}
.game-auth-required h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}
.game-auth-required p {
    color: var(--glhf-text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* --- Game Header Bar --- */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-xl);
    padding: 1.25rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.game-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--game-accent, var(--glhf-accent)), transparent);
}
.game-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.game-header-icon {
    font-size: 2rem;
    line-height: 1;
}
.game-header-title {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--glhf-text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}
.game-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* --- Balance Display --- */
.game-balance {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(var(--glhf-funcoin-rgb), 0.1);
    border: 1px solid rgba(var(--glhf-funcoin-rgb), 0.25);
    border-radius: var(--glhf-radius-full);
    padding: 0.5rem 1.25rem;
}
.game-balance-icon {
    font-size: 1.2rem;
}
.game-balance-value {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--glhf-funcoin);
}
.game-balance-label {
    font-size: 0.8rem;
    color: var(--glhf-text-muted);
    font-weight: 600;
}

/* --- User Info (in header) --- */
.game-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.game-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--glhf-border-bright);
}
.game-user-name {
    font-weight: 600;
    color: var(--glhf-text-primary);
    font-size: 0.9rem;
}

/* --- Game Container --- */
.game-container {
    max-width: 900px;
    margin: 0 auto;
}

/* --- Game Arena Card --- */
.game-arena {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-xl);
    padding: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.game-arena::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(var(--game-accent-rgb, var(--glhf-accent-rgb)), 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* --- Play Button --- */
.game-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    padding: 1.25rem 3.5rem;
    border: 2px solid var(--game-accent, var(--glhf-accent));
    border-radius: var(--glhf-radius-lg);
    background: rgba(var(--game-accent-rgb, var(--glhf-accent-rgb)), 0.1);
    color: var(--game-accent, var(--glhf-accent));
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}
.game-play-btn:hover:not(:disabled) {
    background: var(--game-accent, var(--glhf-accent));
    color: var(--glhf-bg-primary);
    box-shadow: 0 0 40px rgba(var(--game-accent-rgb, var(--glhf-accent-rgb)), 0.4);
    transform: translateY(-2px);
}
.game-play-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.game-play-btn:active:not(:disabled) {
    transform: scale(0.97);
}

/* --- Bet Info --- */
.game-bet-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--glhf-text-muted);
}
.game-bet-value {
    color: var(--glhf-funcoin);
    font-weight: 700;
    font-family: var(--glhf-font-heading);
}

/* --- Result Display --- */
.game-result {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: var(--glhf-radius-lg);
    text-align: center;
    animation: resultAppear 0.5s ease;
    position: relative;
    z-index: 1;
}
@keyframes resultAppear {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}
.game-result--win {
    background: rgba(0, 255, 100, 0.08);
    border: 1px solid rgba(0, 255, 100, 0.3);
}
.game-result--loss {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.game-result-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}
.game-result-title {
    font-family: var(--glhf-font-heading);
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.game-result--win .game-result-title {
    color: var(--glhf-success);
}
.game-result--loss .game-result-title {
    color: var(--glhf-danger);
}
.game-result-fc {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--glhf-funcoin);
}
.game-result-balance {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--glhf-text-muted);
}

/* --- Stats Panel --- */
.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}
.game-stat {
    background: var(--glhf-bg-tertiary);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-md);
    padding: 1rem;
    text-align: center;
}
.game-stat-value {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--glhf-text-primary);
    line-height: 1;
}
.game-stat-label {
    font-size: 0.75rem;
    color: var(--glhf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.35rem;
}
.game-stat--win .game-stat-value { color: var(--glhf-success); }
.game-stat--loss .game-stat-value { color: var(--glhf-danger); }
.game-stat--fc .game-stat-value { color: var(--glhf-funcoin); }

/* --- Cooldown --- */
.game-cooldown {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 152, 0, 0.08);
    border: 1px solid rgba(255, 152, 0, 0.25);
    border-radius: var(--glhf-radius-md);
    color: var(--glhf-warning);
    font-size: 0.9rem;
    text-align: center;
}

/* --- Back Link --- */
.game-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--glhf-text-muted);
    transition: color 0.2s ease;
}
.game-back-link:hover {
    color: var(--glhf-accent);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        padding: 1.25rem 1.5rem;
        gap: 1rem;
    }
    .game-header-right {
        width: 100%;
        justify-content: center;
    }
    .game-arena {
        padding: 2rem 1.25rem;
    }
    .game-play-btn {
        font-size: 1.1rem;
        padding: 1rem 2.5rem;
    }
    .game-header-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .game-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
