/*
╔═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║                                              DOODLE JUMP GAME - MAIN STYLESHEET                                   ║
╠═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣
║                                                                                                                   ║
║ PURPOSE: Complete styling for the Doodle Jump game including all UI screens, animations, and responsive design   ║
║                                                                                                                   ║
║ STRUCTURE:                                                                                                        ║
║   1. GLOBAL STYLES: Reset, root variables, canvas, and container                                                 ║
║   2. IN-GAME UI: Pause button, play again button                                                                 ║
║   3. START SCREEN: Title, character, play button, instructions                                                   ║
║   4. PAUSE SCREEN: Overlay, sleeping character, stats, resume button                                             ║
║   5. RESPONSIVE DESIGN: Mobile and desktop adaptations                                                           ║
║                                                                                                                   ║
║ SAFE AI MODIFICATIONS:                                                                                            ║
║   ✅ CHANGE colors, fonts, sizes, spacing throughout                                                              ║
║   ✅ ADD new CSS classes and animations                                                                           ║
║   ✅ MODIFY animation timings and effects                                                                         ║
║   ✅ UPDATE responsive breakpoints and mobile styles                                                              ║
║   ✅ CHANGE background gradients and visual themes                                                                ║
║   ✅ ADD new UI elements styling                                                                                  ║
║                                                                                                                   ║
║ CRITICAL - DO NOT MODIFY:                                                                                        ║
║   ❌ Element IDs and class names (used by JavaScript)                                                             ║
║   ❌ Display properties for show/hide functionality                                                               ║
║   ❌ Position properties for layout-critical elements                                                             ║
║   ❌ --game-font CSS custom property (managed by JavaScript)                                                      ║
║                                                                                                                   ║
║ DYNAMIC ELEMENTS:                                                                                                 ║
║   • Font family: Set via --game-font CSS custom property from gameConfig.js                                     ║
║                                                                                                                   ║
╚═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
*/

/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* GLOBAL STYLES - Base reset and root configuration */
/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

/* Global reset - SAFE TO MODIFY: Add more reset properties if needed */
* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}

/* NEW: Added a modern, playful color palette and fonts.
  These variables are used throughout the stylesheet for a consistent theme.
*/
:root {
    /* Fonts */
    --font-title: 'Lilita One', cursive;
    --font-body: 'Nunito', sans-serif;

    /* Colors */
    --primary: #2980b9; /* Bright Blue */
    --primary-dark: #2471a3;
    --secondary: #f39c12; /* Orange */
    --secondary-dark: #d68910;
    --accent: #27ae60; /* Green */
    --accent-dark: #229954;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --white: #ffffff;
    --overlay: rgba(44, 62, 80, 0.85); /* Dark blue overlay */

    /* Game Font - this is still updated by JS but we set a default */
    --game-font: var(--font-body);
}

body {
    font-family: var(--font-body);
    background-color: var(--dark-text);
}

/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* CANVAS AND MAIN CONTAINER */
/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

#body-canvas {
    width: 100%;
    height: 100%;
    display: block; /* Removes extra space below canvas */
}

#body-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* IN-GAME UI ELEMENTS */
/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

.pause-game-button {
    position: absolute;
    top: 15px;
    right: 15px; /* IMPROVED: Changed from 'left: 90.5%' for better responsiveness */
    height: 45px;
    width: 45px;
    display: none;
    cursor: pointer;
    background: var(--secondary);
    border: none;
    border-radius: 50%; /* NEW: Circular button */
    box-shadow: 0 4px 0 var(--secondary-dark), 0 6px 10px rgba(0,0,0,0.3);
    transition: all 0.15s ease-out;
    z-index: 100;
}

.pause-game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--secondary-dark), 0 8px 12px rgba(0,0,0,0.3);
}

.pause-game-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--secondary-dark), 0 4px 8px rgba(0,0,0,0.3);
}

.pause-icon-game {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 100%;
    width: 100%;
}

.pause-bar-game {
    width: 5px;
    height: 18px;
    background: var(--white);
    border-radius: 3px;
}


/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* PAUSE SCREEN */
/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

#pause-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    z-index: 1000;
    background-color: var(--overlay);
    backdrop-filter: blur(8px); /* NEW: Frosted glass effect */
}

.pause-screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pause-content {
    background-color: var(--light-bg);
    border-radius: 20px; /* NEW: Softer corners */
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 100%;
    border: 5px solid var(--white);
}

.pause-header {
    margin-bottom: 25px;
}

.pause-title {
    font-family: var(--font-title);
    font-size: clamp(32px, 8vw, 48px); /* IMPROVED: Fluid font size */
    color: var(--primary);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
    margin: 0;
}

.pause-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.resume-button {
    background: var(--accent);
    border: none;
    border-radius: 15px;
    padding: 15px 40px;
    cursor: pointer;
    transition: all 0.15s ease-out;
    box-shadow: 0 5px 0 var(--accent-dark), 0 8px 10px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 250px;
}

.resume-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 var(--accent-dark), 0 10px 12px rgba(0,0,0,0.25);
}

.resume-button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--accent-dark), 0 5px 8px rgba(0,0,0,0.2);
}

.resume-button span {
    font-family: var(--font-title);
    font-size: clamp(20px, 5vw, 24px);
    color: var(--white);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 1.5px;
}

.pause-stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: 10px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase; /* NEW */
}

.stat-value {
    font-family: var(--font-body);
    font-size: 22px;
    color: var(--dark-text);
    font-weight: 700;
    display: block;
}

/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* START SCREEN */
/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

#startpage {
    position: relative;
    width: 100%;
    height: 100%;
    display: none;
    background-color: var(--dark-text);
}

.start-screen {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.start-menu-container {
    background-color: var(--light-bg);
    border-radius: 20px; /* NEW: Softer corners */
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 420px;
    width: 100%;
    border: 5px solid var(--white);
}

.start-header {
    text-align: center;
    margin-bottom: 10px;
}

.game-title {
    font-family: var(--font-title);
    font-size: clamp(48px, 12vw, 64px);
    color: var(--primary);
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.1);
    margin: 0;
    line-height: 1.1;
}

.start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px; /* NEW: Gap for spacing */
}

.play-button {
    background: var(--accent);
    border: none;
    border-radius: 15px;
    padding: 15px 40px;
    cursor: pointer;
    transition: all 0.15s ease-out;
    box-shadow: 0 5px 0 var(--accent-dark), 0 8px 10px rgba(0,0,0,0.2);
    margin-top: 20px;
    width: 100%;
    max-width: 280px;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 var(--accent-dark), 0 10px 12px rgba(0,0,0,0.25);
}

.play-button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--accent-dark), 0 5px 8px rgba(0,0,0,0.2);
}

.play-button span {
    font-family: var(--font-title);
    font-size: clamp(20px, 5vw, 26px);
    color: var(--white);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 1.5px;
}

.high-score-container {
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--dark-text);
    font-weight: 700;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 15px;
    border-radius: 10px;
}

#startplay {
    position: relative;
}

/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* PLAY AGAIN BUTTON */
/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
.play-again-button {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translateX(-50%);
    width: 180px; /* Increased size */
    height: 55px;
    display: none;
    z-index: 1000;
    cursor: pointer;
    user-select: none;
}

.play-again-content {
    width: 100%;
    height: 100%;
    background: var(--secondary);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 5px 0 var(--secondary-dark), 0 8px 10px rgba(0,0,0,0.2);
    transition: all 0.15s ease-out;
    font-family: var(--font-title);
}

.play-again-button:hover .play-again-content {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 var(--secondary-dark), 0 10px 12px rgba(0,0,0,0.25);
}

.play-again-button:active .play-again-content {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--secondary-dark), 0 5px 8px rgba(0,0,0,0.2);
}

.play-triangle {
    width: 0;
    height: 0;
    border-left: 14px solid white;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    margin-left: 4px;
}

.play-again-text {
    color: white;
    font-size: 18px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* INSTRUCTIONS BOX */
/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

.instructions {
    position: absolute;
    bottom: 20px;
    font-family: var(--font-body);
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none; /* Controlled by media queries */
}

.instructions-title {
    font-weight: 700;
    font-family: var(--font-title);
    color: var(--secondary);
    font-size: 18px;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.instructions span {
    display: block;
    margin-top: 5px;
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
}

/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE DESIGN */
/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

/* Mobile styles (screens smaller than 500px) */
@media screen and (max-width:499px) {
    #mobileinstruction {
        display: block;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 40px);
        text-align: center;
    }

    .start-menu-container {
        padding: 30px 20px;
    }
    
    .pause-content {
        padding: 30px 20px;
    }
}

/* Desktop styles (screens 500px and larger) */
@media screen and (min-width:500px) {
    #pcinstruction {
        display: block;
        right: 20px;
    }

    #mobileinstruction {
        display: none;
    }

    #body-canvas,
    #body-container,
    #startpage,
    #pause-container {
        width: 500px;
        height: 100%;
        margin: 0 auto;
        position: relative; /* Ensure container context */
    }

    /* Override absolute positioning for desktop layout */
    #pause-container {
       position: absolute;
       top: 0;
       left: 50%;
       transform: translateX(-50%);
    }
}