@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Playfair+Display:wght@700&display=swap');

:root {
    --primary: #ff4d6d;
    --primary-dark: #c9184a;
    --secondary: #ffb3c1;
    --accent: #ffccd5;
    --bg-dark: #1a1a1a;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: url('assets/bg.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    background: linear-gradient(to right, #ff4d6d, #ffb3c1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-weight: 300;
    letter-spacing: 2px;
    opacity: 0.8;
}

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

.game-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,77,109,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: 0.4s;
}

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

.game-card:hover::before {
    opacity: 1;
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.game-card p {
    font-weight: 300;
    opacity: 0.7;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.play-btn {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.play-btn:hover {
    box-shadow: 0 0 20px var(--primary);
    transform: scale(1.05);
}

/* Room Overlay */
#room-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal {
    background: #2a2a2a;
    padding: 3rem;
    border-radius: 32px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--primary);
    text-align: center;
}

.input-group {
    margin: 2rem 0;
}

input {
    width: 100%;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Game Canvas styles */
#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    z-index: 2000;
}

canvas {
    display: block;
    margin: 0 auto;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2001;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
}

#mobile-controls {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 400px;
    display: none; /* Shown by JS when game starts */
    justify-content: space-around;
    pointer-events: none;
    z-index: 2002;
}

.m-btn {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 2px solid var(--primary);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    user-select: none;
    touch-action: manipulation;
}

.m-btn:active {
    background: var(--primary);
    transform: scale(0.9);
}
