:root {
    --p1-color: #b026ff; /* Neon Purple */
    --p2-color: #00e5ff; /* Neon Blue */
    --danger: #ff0055;   /* Bright Red */
    --accent: #ff5e00;   /* Bright Orange */
}

body {
    background-color: #050505;
    background-image: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    color: white;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Fixes tiny cards by allowing proper spacing */
    min-height: 100vh;
    border: 8px solid var(--p1-color);
    transition: border 0.5s ease;
    box-sizing: border-box;
    padding-top: 10px;
}

body.p2-turn { border-color: var(--p2-color); }

/* Rules Modal / Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.modal {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    width: 85%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

/* Updated Typography: White Outline + Neon Glow */
.logo-text {
    font-family: 'Bangers', cursive;
    font-size: 4.5rem;
    color: transparent; /* Makes the inside transparent to show background or use solid color below */
    color: var(--p1-color);
    -webkit-text-stroke: 2px #ffffff; /* This adds the sharp outline */
    text-shadow: 0 0 15px var(--p1-color), 0 0 30px var(--p1-color);
    margin: 0 0 20px 0;
    letter-spacing: 5px;
    transform: rotate(-3deg);
}

.rules-container h2 { font-size: 1.2rem; letter-spacing: 2px; margin-bottom: 20px; color: #fff; }
.rules-container ul { list-style: none; padding: 0; text-align: left; }
.rules-container li { margin-bottom: 15px; font-size: 0.9rem; display: flex; align-items: center; }

.rules-container span.num {
    background: var(--accent);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    font-weight: bold;
}

/* Game Elements */
.turn-indicator {
    font-family: 'Bangers', cursive;
    font-size: 2.2rem;
    letter-spacing: 2px;
    transition: all 0.4s ease;
    -webkit-text-stroke: 1px #ffffff;
    margin-bottom: 10px;
}

body.p1-turn .turn-indicator { color: var(--p1-color); text-shadow: 0 0 15px var(--p1-color); }
body.p2-turn .turn-indicator { color: var(--p2-color); text-shadow: 0 0 15px var(--p2-color); }

/* Fixed the "Tiny" Grid */
#game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px; /* Slightly tighter gap for mobile */
    width: 95vw;
    max-width: 450px;
    margin-bottom: 20px;
}

.card {
    width: 100%;
    aspect-ratio: 2.5 / 3.5;
    background-image: url("card back.webp");
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* We removed the huge hover scale for mobile so it doesn't get stuck */
.card:active { transform: scale(0.95); } 

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    border-radius: 6px;
}

.card.flipped {
    background-image: none;
    background-color: white;
    border-color: var(--accent);
}

.card.flipped img { display: block; }

/* Buttons */
.start-btn, .control-btn {
    background: var(--p1-color);
    color: white;
    border: 2px solid white;
    padding: 15px 30px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--p1-color);
}

.start-btn:active, .control-btn:active { transform: scale(0.95); }
.fade-out { opacity: 0; pointer-events: none; }
