/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f23;
    color: #e0e0e0;
    min-height: 100vh;
}

/* ===== ARCADE HUB ===== */
.arcade-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 50px;
}

header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

header p {
    color: #888;
    font-size: 1.1rem;
}

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

.game-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 16px;
    padding: 30px 24px;
    text-decoration: none;
    color: #e0e0e0;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.game-icon {
    font-size: 3.5rem;
}

.game-card h2 {
    font-size: 1.4rem;
    color: #fff;
}

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

.play-btn {
    margin-top: 8px;
    padding: 10px 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    transition: opacity 0.2s;
}

.game-card:hover .play-btn {
    opacity: 0.9;
}

/* ===== GAME PAGES ===== */
.game-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    min-height: 100vh;
}

.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    color: #e0e0e0;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    z-index: 100;
}

.back-btn:hover {
    border-color: #667eea;
}

/* Auto-hide: hidden by default, shown for 4s after tapping a blank area */
.back-btn {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.back-btn.back-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px);
}

.game-title {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #fff;
}

.game-score {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 20px;
}

/* ===== BUTTONS ===== */
.game-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 16px;
}

.game-btn:hover {
    opacity: 0.9;
}

.game-btn:active {
    transform: scale(0.97);
}
