@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&display=swap');

:root {
    --primary: #FF8C00;
    --primary-light: #FFB347;
    --primary-bg: #F0F4F8;
    --secondary: #003B5C;
    --accent: #018ABD;
    --text: #1A1A1A;
    --text-light: #5A6A72;
    --white: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.85);
    --shadow: 0 10px 30px rgba(0, 59, 92, 0.08);
    --shadow-hover: 0 15px 40px rgba(255, 107, 0, 0.2);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--primary-bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    padding: 20px 0;
    background: var(--glass);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid rgba(255, 77, 141, 0.1);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo img {
    height: 40px;
}

/* Search and Filters */
.search-container {
    margin: 30px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 12px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    color: white;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translateY(-2px);
}

/* Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* Game Card */
.game-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    border: 3px solid transparent;
}

.game-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.game-thumb-wrapper {
    position: relative;
    padding-top: 100%;
    /* Square icons */
    overflow: hidden;
    background: #eee;
}

.game-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.game-info {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.game-title {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 0;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.card-fav-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #ccc;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-fav-btn:hover {
    transform: scale(1.2);
    color: #FF4D8D;
}

.card-fav-btn.active {
    color: #FF4D8D;
}

.card-fav-btn.active svg {
    fill: #FF4D8D;
}

/* Game Detail Page */
.game-player-section {
    padding: 40px 0;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--white);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-hover);
}

.game-frame-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 10px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.game-frame {
    width: 100%;
    height: calc(100vh - 250px);
    min-height: 500px;
    border: none;
    border-radius: calc(var(--radius-lg) - 10px);
    display: block;
    flex: 1;
}

/* Fullscreen Specifics */
#fullscreen-container:fullscreen {
    padding: 0;
    border-radius: 0;
    width: 100vw;
    height: 100vh;
}

#fullscreen-container:fullscreen .game-frame {
    flex: 1;
    height: calc(100% - 60px);
    /* ESSENCIAL */
    border-radius: 0;
}

/* Modal Player Container */
.fs-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background: #000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    /* Prevent scrolls */
}

.fs-modal-container:fullscreen {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Specificity to override any other height rules */
#fullscreen-container .game-frame {
    flex: 1 !important;
    /* Let flexbox decide */
    width: 100%;
    border: none;
    background: #000;
}

/* Docked Fullscreen Bar (Top) */
.exit-fs-bar {
    width: 100%;
    flex-shrink: 0;
    /* Do not shrink the bar */
    background: var(--secondary);
    padding: 12px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001;
    position: sticky;
    opacity: 0;
    transform: translateY(0);
    transition: all 0.5s ease;
}

#fullscreen-container:fullscreen .exit-fs-bar {
    opacity: 1;
}

.fs-bar-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.exit-fs-bar .site-logo {
    height: 35px;
    width: auto;
}

.exit-fs-bar .game-icon {
    height: 45px;
    width: 45px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.exit-fs-bar .game-name {
    font-weight: 800;
    font-size: 20px;
    color: white;
}

.fs-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.fs-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.fs-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.fs-action-btn.fav.active {
    background: #FF4D8D;
    color: white;
}

.exit-action {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--primary);
    color: white;
    padding: 12px 30px;
    border-radius: 40px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exit-action:hover {
    background: #FFF;
    color: var(--primary);
    transform: translateY(-2px);
}

.game-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: flex-end;
}

.control-btn {
    padding: 12px 24px;
    border: none;
    background: var(--secondary);
    color: var(--white);
    border-radius: var(--radius-md);
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.control-btn.fs {
    background: var(--accent);
    color: var(--text);
}

.control-btn.fav {
    background: #FFD23F;
    color: var(--text);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0 !important;
    }

    .hero-section h1 {
        font-size: 36px !important;
    }

    .hero-section p {
        font-size: 18px !important;
    }

    .search-input {
        min-width: 100%;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

    .game-frame {
        height: 60vh;
    }

    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .game-controls {
        width: 100%;
        justify-content: space-between;
    }

    .control-btn {
        flex: 1;
        padding: 12px 10px;
        font-size: 14px;
    }

    .game-details-content {
        padding: 20px !important;
    }

    /* Bottom Bar Mobile */
    .exit-fs-bar {
        min-width: calc(100% - 40px);
        bottom: 20px;
        gap: 10px;
        padding: 6px;
    }

    .exit-fs-bar .game-name {
        font-size: 14px;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .exit-fs-bar .site-logo {
        height: 20px;
    }

    .exit-fs-bar .game-icon {
        height: 30px;
        width: 30px;
    }

    .exit-action {
        padding: 8px 15px;
        font-size: 13px;
    }

    .fs-action-btn {
        width: 36px;
        height: 36px;
    }
}

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

    .logo {
        font-size: 18px;
    }

    .logo img {
        height: 30px;
    }
}