/* Game Hub Portal Stylesheet */

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

body {
    background-color: #0b0b12;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header & Navigation */
header {
    background: rgba(18, 18, 28, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    font-size: 14px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    -webkit-text-fill-color: #a855f7;
    margin-left: 5px;
    font-weight: 600;
}

.search-box {
    position: relative;
    width: 320px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    padding-left: 45px;
    background: #141422;
    border: 2px solid #232338;
    border-radius: 50px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

.search-box .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.5;
}

/* Category Filter Tabs */
.categories-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 25px 40px;
    background: #0d0d18;
}

.category-pill {
    padding: 10px 24px;
    background: #151526;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-pill:hover {
    background: #1d1d36;
    color: white;
    transform: translateY(-1px);
}

.category-pill.active {
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    color: white;
    border: none;
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.35);
}

/* Main Grid Layout */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px 60px 40px;
}

.grid-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.grid-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: #a855f7;
    border-radius: 3px;
}

/* Game Catalog Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}

/* Game Cards */
.game-card {
    background: #121220;
    border: 2px solid #1a1a2e;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: #a855f7;
    box-shadow: 0 15px 30px rgba(168, 85, 247, 0.15);
}

.game-thumb {
    position: relative;
    width: 100%;
    padding-top: 60%; /* Aspect Ratio 5:3 */
    background: #1a1a2e;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-thumb canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-card:hover .game-thumb canvas {
    transform: scale(1.08);
}

.game-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: rgba(12, 12, 20, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.game-info {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.game-title {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.4;
    height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ffde17;
}

/* Coming Soon card */
.game-card.coming-soon {
    opacity: 0.65;
    cursor: default;
    border-style: dashed;
}

.game-card.coming-soon:hover {
    transform: none;
    border-color: #1a1a2e;
    box-shadow: none;
}

.coming-soon-placeholder {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 800;
    gap: 8px;
    background: #141424;
}

.plus-icon {
    font-size: 32px;
}

/* Theater Mode Overlay */
#theater-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 8, 14, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    transition: opacity 0.3s ease;
}

.theater-container {
    width: 100%;
    height: 100%;
    display: flex;
    padding: 30px;
    gap: 30px;
}

.theater-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.theater-header h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.theater-controls {
    display: flex;
    gap: 12px;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.control-btn.close-btn:hover {
    background: #ff3c3c;
    border-color: #ff3c3c;
    box-shadow: 0 0 15px rgba(255, 60, 60, 0.4);
}

/* Game Frame wrapper */
.game-frame-wrapper {
    position: relative;
    flex-grow: 1;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid #232338;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.game-frame-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Loading overlay inside theater */
.theater-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0e0e1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    gap: 15px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(168, 85, 247, 0.2);
    border-top: 5px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.theater-loader p {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.6;
    letter-spacing: 2px;
}

/* Sidebar in Theater Mode (for other games recommendation - Poki style) */
.theater-sidebar {
    width: 320px;
    background: rgba(20, 20, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow-y: auto;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    opacity: 0.85;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-card {
    display: flex;
    gap: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
}

.sidebar-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    border-color: #a855f7;
}

.sidebar-thumb-mini {
    width: 80px;
    height: 50px;
    border-radius: 8px;
    background: #1a1a2e;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sidebar-thumb-mini canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    min-width: 0;
}

.sidebar-name {
    font-size: 13px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-cat {
    font-size: 11px;
    color: #a855f7;
    font-weight: 600;
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Footer of the Portal */
footer {
    text-align: center;
    padding: 40px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    background: #09090f;
}
