/* ========================================
   LANE RACER - CSS STYLES
   ======================================== */

:root {
    /* Colors from Dream Puff */
    --primary-color: #D4A574;
    --secondary-color: #8B6F47;
    --accent-color: #F5E6D3;
    --bg-color: #FEFDFB;
    --text-dark: #2C2416;
    --text-light: #F5E6D3;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background:
        linear-gradient(135deg, rgba(245, 230, 211, 0.35) 0%, rgba(254, 253, 251, 0.80) 100%),
        url('../puff_lg5pq0lg5pq0lg5p.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Game Page Wrapper
   ======================================== */
.game-page-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: 80px; /* Account for fixed navbar */
}

/* ========================================
   Game Container
   ======================================== */
.game-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(139, 111, 71, 0.15);
    padding: 30px;
    max-width: 95vw;
    width: fit-content;
}

/* ========================================
   Header
   ======================================== */
.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.game-subtitle {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
}

#game-container-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#gameCanvas {
    display: block;
    background-color: #3D3225;
    border: 4px solid #D4A574;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Accessibility description */
#game-description {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    color: #8B6F47;
    font-size: 12px;
    text-align: center;
    max-width: 400px;
    line-height: 1.4;
}

/* Sound toggle button */
#sound-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(44, 36, 22, 0.8);
    border: 2px solid #D4A574;
    color: #F5E6D3;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
    transition: background 0.2s;
}

#sound-toggle:hover {
    background: rgba(44, 36, 22, 0.95);
}

/* Player Name Section */
.player-section {
    margin-top: 20px;
    text-align: center;
}

.player-greeting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

#greeting-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.name-editor {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.name-editor.hidden {
    display: none;
}

#player-name-input {
    padding: 10px 15px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: white;
    color: var(--text-dark);
    font-family: var(--font-body);
    font-size: 1rem;
    min-width: 200px;
    transition: all 0.3s ease;
}

#player-name-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 111, 71, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--secondary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--accent-color);
    border-color: var(--secondary-color);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* ========================================
   Game Back Link
   ======================================== */
.game-back-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--accent-color);
}

.game-back-link .back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.game-back-link .back-link:hover {
    color: var(--secondary-color);
}

/* Hide on very small screens */
@media (max-height: 500px) {
    #game-description {
        display: none;
    }

    .player-section {
        margin-top: 10px;
    }

    #greeting-text {
        font-size: 1rem;
    }
}
