.games-shell {
    --app-bg-image: url('../imgs/istockphoto-498309616-612x612.jpg');
    --app-bg-overlay:
        radial-gradient(1200px 500px at 50% 115%, rgba(48, 78, 64, 0.45), rgba(21, 35, 80, 0) 60%),
        linear-gradient(180deg, rgba(9, 18, 38, 0.55), rgba(33, 51, 95, 0.45));
}

/* Make Game Hub window much bigger to fit Mario and retro text crisply */
.games-shell.app-shell {
    width: min(1560px, 98.5vw);
    height: min(950px, 96.5vh);
    max-width: 99vw;
    display: flex;
    flex-direction: column;
}

.games-shell .section-main {
    flex: 1;
    padding: 10px 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

/* =========================================
   GAME HUB NAVIGATION & TOOLBAR
   ========================================= */
.game-hub-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(18, 22, 45, 0.72);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.hub-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hub-pill-tag {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.18);
    border: 1px solid rgba(255, 209, 102, 0.4);
    border-radius: 999px;
    padding: 3px 8px;
}

.hub-main-title {
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 8px rgba(255, 105, 180, 0.4);
    margin: 0;
}

.hub-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hub-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 6px 14px;
    color: #d1d7f0;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    user-select: none;
}

.hub-tab:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    transform: translateY(-1px);
}

.hub-tab.active {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.38), rgba(99, 102, 241, 0.48));
    border-color: rgba(255, 214, 238, 0.8);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(236, 72, 153, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tab-badge-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.tab-text-group {
    display: flex;
    flex-direction: column;
}

.tab-name {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.tab-desc {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.hub-featured-sparkle {
    font-size: 0.64rem;
    font-weight: 800;
    background: linear-gradient(90deg, #ec4899, #f59e0b);
    color: #fff;
    padding: 2px 6px;
    border-radius: 999px;
    margin-left: 4px;
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}

.hub-tools {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hub-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    padding: 6px 11px;
    color: #e2e8f8;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.hub-tool-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    color: #fff;
    transform: translateY(-1px);
}

/* =========================================
   GAME CARD CONTAINER (ENLARGED)
   ========================================= */
.game-card {
    padding: 0;
    overflow: hidden;
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    height: 100%;
    background: #0a0e1c;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.game-card:fullscreen {
    border-radius: 0;
    border: none;
    width: 100vw;
    height: 100vh;
}

.hub-game-view {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hub-game-view.hidden {
    display: none !important;
}

/* =========================================
   VIEW 1: STAR GAME
   ========================================= */
#game-container {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 480px;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;
    pointer-events: none;
}

#score-board {
    background: rgba(11, 19, 43, 0.85);
    border: 1px solid rgba(212, 209, 255, 0.45);
    color: #f8e9ff;
    padding: 8px 14px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.94rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.game-star-bar {
    width: 160px;
    height: 13px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(180, 190, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#love-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #ffd166, #ffc44c, #f7e375);
    transition: width 0.25s ease;
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.6);
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 24px;
    z-index: 8;
    background: radial-gradient(circle at center, rgba(16, 26, 61, 0.88), rgba(6, 10, 25, 0.95));
    backdrop-filter: blur(4px);
}

.screen.hidden {
    display: none;
}

.screen h2 {
    color: #ffe8fa;
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(255, 105, 180, 0.5);
}

.screen p {
    color: #e5edff;
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.proposal-content {
    width: min(560px, 92%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-inline: auto;
}

.btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 26px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
    transform: scale(1.04);
}

#start-btn,
.yes-btn {
    background: linear-gradient(120deg, #ffd166, #ffc44c);
    color: #3f2e10;
    box-shadow: 0 6px 18px rgba(255, 209, 102, 0.4);
}

.no-btn {
    background: linear-gradient(120deg, #f176ac, #9d65e9);
    color: #fff;
    box-shadow: 0 6px 18px rgba(241, 118, 172, 0.4);
}

.buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.no-gif {
    width: min(280px, 80%);
    max-height: 240px;
    object-fit: cover;
    border-radius: 14px;
    border: 3px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

/* =========================================
   VIEW 2: MARIO PROJECT (CANDICE QUEST)
   ========================================= */
#mario-game-view {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    background: #000;
    overflow: hidden;
}

#mario-frame {
    width: 100%;
    height: 100%;
    flex: 1;
    border: none;
    display: block;
    outline: none;
    background: #5c94fc;
}

/* =========================================
   BOTTOM CONTROLS BAR
   ========================================= */
.hub-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 16px;
    background: rgba(9, 13, 27, 0.94);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.78rem;
    color: #cfd8f5;
    flex-wrap: wrap;
}

.controls-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
}

.ctrl-icon {
    font-size: 0.95rem;
}

.audio-tip {
    font-size: 0.72rem;
    color: #9eb1df;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .hub-main-title {
        display: none;
    }
    .game-hub-bar {
        padding: 6px 10px;
    }
    .tab-desc {
        display: none;
    }
    .hub-tab {
        padding: 6px 10px;
    }
    .hub-controls-bar {
        font-size: 0.72rem;
        padding: 6px 10px;
    }
}
