/* --- Global Variables --- */
:root {
    --bg-dark: #090412;        /* Main background */
    --nav-bg: #11111b;         /* Navbar & Card background */
    --accent-html: #00ffcc;    /* Cyan for HTML5 */
    --accent-flash: #ff9800;   /* Orange for Flash */
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border: #222222;
}

/* --- Base Styles --- */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
}

/* --- Shared Navbar (Homepage & Players) --- */
#navbar, #nav {
    height: 60px;
    background-color: var(--nav-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-logo {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent-html);
    text-decoration: none;
    letter-spacing: 1px;
}

.back-btn {
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    transition: 0.2s;
}

.back-btn:hover {
    background: #ffffff1a;
    border-color: var(--text-primary);
}

/* --- Search Bar (Homepage) --- */
.search-container {
    flex-grow: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-input {
    width: 100%;
    background-color: #1a1a2e;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: 0.3s;
}

.search-input:focus {
    border-color: var(--accent-html);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
}

/* --- Games Grid --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Game Cards --- */
.game-card {
    background-color: var(--nav-bg);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: white;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-card.flash:hover { border-color: var(--accent-flash); box-shadow: 0 5px 15px rgba(255, 152, 0, 0.2); }
.game-card.html5:hover { border-color: var(--accent-html); box-shadow: 0 5px 15px rgba(0, 255, 204, 0.2); }

.img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-label {
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    text-transform: capitalize;
}

/* --- Badges --- */
.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 900;
    border-radius: 4px;
    color: #000;
    text-transform: uppercase;
}

.badge.flash { background-color: var(--accent-flash); }
.badge.html5 { background-color: var(--accent-html); }

/* --- Player Layouts --- */
#player-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

iframe, #ruffle-container {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}