* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Urbanist', sans-serif;
}

body {
    background-color: #1a1025;
    color: #e0e0e0;
    line-height: 1.6;
    font-family: 'Urbanist', sans-serif;
}

header {
    background-color: #2a1a3a;
    color: #e0e0e0;
    padding: 0.8rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #b388ff;
    font-weight: 700;
}

.filters-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1rem auto;
    max-width: 800px;
    padding: 0 1rem;
}

.search-container {
    flex: 1;
    max-width: 400px;
}

.category-container {
    flex: 0 0 auto;
}

#searchInput {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #2a1a3a;
    color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#categoryFilter {
    width: 200px;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    background-color: #2a1a3a;
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b388ff'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 1.5em;
    transition: all 0.3s ease;
}

#categoryFilter:hover {
    background-color: #3a2a4a;
}

#categoryFilter:focus {
    outline: none;
    box-shadow: 0 0 0 2px #b388ff;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
}

.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: #2a1a3a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #3a2a4a;
    position: relative;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-color: #b388ff;
}

.game-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.game-info {
    padding: 1rem;
}

.game-info h3 {
    margin-bottom: 0.5rem;
    color: #b388ff;
}

.game-info p {
    color: #aaa;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: #1e1e1e;
    color: #e0e0e0;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* Game Viewer Styles */
.game-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 1000;
}

.game-viewer.active {
    opacity: 1;
    visibility: visible;
}

.game-viewer iframe {
    width: 90%;
    height: 90%;
    border: none;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.game-viewer.active iframe {
    opacity: 1;
    transform: scale(1);
}

.game-viewer.closing iframe {
    opacity: 0;
    transform: scale(0.8);
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.game-viewer.active .close-button {
    opacity: 1;
    transform: scale(1);
}

.game-viewer.closing .close-button {
    opacity: 0;
    transform: scale(0.8);
}

@media (max-width: 768px) {
    .games-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .game-viewer iframe {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

.game-category {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background-color: #3a2a4a;
    color: #b388ff;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Loading Indicator Styles */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1001;
}

.game-viewer.active .loading-indicator {
    opacity: 1;
}

.game-viewer.active iframe.loaded ~ .loading-indicator {
    opacity: 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #b388ff;
    animation: spin 1s linear infinite;
}

.loading-indicator p {
    color: #e0e0e0;
    font-size: 1.2rem;
    margin: 0;
}

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

.game-counter {
    font-size: 0.9em;
    background-color: #b388ff;
    color: #1a1025;
    padding: 0.2em 0.6em;
    border-radius: 12px;
    margin: 0.2em auto;
    display: inline-block;
    font-weight: 600;
    text-align: center;
}

.random-button {
    background-color: #b388ff;
    color: #1a1025;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'Urbanist', sans-serif;
}

.random-button:hover {
    background-color: #9c64ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.random-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Hamburger Menu Styles */
.hamburger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.hamburger-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: block;
}

.hamburger-button span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #b388ff;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.hamburger-button:hover span {
    background-color: #9c64ff;
}

.tools-text {
    color: #b388ff;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.3s ease;
    text-align: center;
}

.flyout-panel.active ~ .hamburger-menu .tools-text {
    opacity: 0;
}

/* Flyout Panel Styles */
.flyout-panel {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background-color: #2a1a3a;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.flyout-panel.active {
    transform: translateX(300px);
}

.flyout-panel.active ~ .hamburger-menu {
    opacity: 0;
    pointer-events: none;
}

.flyout-content {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.flyout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a2a4a;
}

.flyout-header h2 {
    color: #b388ff;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-flyout {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.links-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.link-card {
    background-color: #3a2a4a;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.link-card:hover {
    transform: translateX(5px);
    background-color: #4a3a5a;
}

.link-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.link-card h3 {
    color: #b388ff;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.link-card p {
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Recently Played Styles */
.recently-played-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.recently-played-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.recent-icon {
    font-size: 1.2rem;
}

.recent-text {
    color: #b388ff;
    font-size: 0.9rem;
    font-weight: 600;
}

.recently-played-panel {
    position: fixed;
    top: -300px;
    left: 0;
    width: 100%;
    height: 300px;
    background-color: #2a1a3a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.recently-played-panel.active {
    transform: translateY(300px);
}

.recently-played-content {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.recently-played-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a2a4a;
}

.recently-played-header h2 {
    color: #b388ff;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-recent {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.recent-games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px;
}

.recent-game-card {
    background-color: #3a2a4a;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-game-card:hover {
    transform: translateY(-2px);
    background-color: #4a3a5a;
}

.recent-game-card img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.recent-game-info {
    flex: 1;
}

.recent-game-info h3 {
    color: #b388ff;
    font-size: 1rem;
    margin-bottom: 5px;
}

.recent-game-info p {
    color: #e0e0e0;
    font-size: 0.8rem;
    opacity: 0.8;
} 
