/* GameHub Styles */

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Grid Layout */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

/* Game Card Container */
.game-card-container {
    position: relative;
    display: flex;
    flex-direction: column;
    /* Ensure z-index context */
    isolation: isolate; 
}

/* Game Card */
.game-card {
    display: block;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    z-index: 10; /* Above selector */
    position: relative;
    height: 100%; /* Full height */
}

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

.game-card h2 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.game-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Difficulty Selector (Slide-out) */
.difficulty-selector {
    background-color: var(--bg-dark); /* Darker background for contrast */
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 20px 15px 15px 15px; /* Top padding accounts for overlap */
    border-radius: 0 0 12px 12px;
    margin-top: -15px; /* Overlap with card */
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 5; /* Below card */
    
    /* Animation */
    opacity: 0;
    transform: translateY(-20px); /* Start slightly up */
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

/* Show selector on hover OR when active (for mobile tap) */
.game-card-container:hover .difficulty-selector,
.game-card-container.is-active .difficulty-selector {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.game-card-container:hover .game-card,
.game-card-container.is-active .game-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Dropdown */
.difficulty-selector label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.difficulty-dropdown {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    appearance: none; /* Remove default arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23c0a0d0%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right .7em top 50%;
    background-size: .65em auto;
}

.difficulty-dropdown:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .game-grid {
        grid-template-columns: 1fr;
    }
    
    /* On mobile, always show selector or make it easier? */
    /* Let's keep hover logic but ensure tap works (pointer-events) */
}