:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --primary: #00ff88;
    --secondary: #ff0055;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    width: 100%;
    background: linear-gradient(90deg, #111, #222);
    padding: 20px 0;
    text-align: center;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
}

nav {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.filter-btn {
    background-color: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary);
    color: #000;
}

main {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.game-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #333;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 255, 136, 0.2);
    border-color: var(--primary);
}

.game-card .thumb {
    height: 160px;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.game-card .info {
    padding: 20px;
}

.game-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
}

.game-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 20px 0;
    height: 40px;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.play-btn {
    text-decoration: none;
    background-color: var(--primary);
    color: #000;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.3s;
}

.play-btn:hover {
    background-color: #00cc6a;
}

.fav-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s, transform 0.2s;
}

.fav-btn:hover {
    transform: scale(1.1);
}

.fav-btn.favorited {
    color: var(--secondary);
}

/* Specific for Game Pages */
.game-page-container {
    margin-top: 30px;
    text-align: center;
    width: 100%;
}
.back-btn {
    text-decoration: none;
    color: var(--primary);
    font-size: 1.2rem;
    display: inline-block;
    margin-bottom: 20px;
    transition: color 0.3s;
}
.back-btn:hover {
    color: #fff;
}

#gameCanvas {
    background-color: #000;
    border: 3px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    display: block;
    margin: 0 auto;
}

.score-board {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.instructions {
    margin-top: 20px;
    color: var(--text-muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
}

/* Controls specifically for Smash / general buttons */
.smash-controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}
.smash-controls button {
    background-color: var(--card-bg);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 20px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}
.smash-controls button:hover, .smash-controls button.active {
    background-color: var(--primary);
    color: #000;
}
