﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.game-title {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Score Display */
.score-display {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.score-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.score-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.score-value {
    display: block;
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

/* Canvas Container */
.canvas-container {
    position: relative;
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
}

#game-canvas {
    display: block;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
    border-radius: 15px;
    max-width: 100%;
    height: auto;
}

/* Overlay Screens */
.overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    width: 80%;
    max-width: 300px;
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    color: #19547b;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.overlay p {
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.new-record {
    color: #ffd43b !important;
    font-weight: 700;
    font-size: 1.3rem !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.game-btn {
    background: #ffd43b;
    color: #19547b;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(255, 212, 59, 0.4);
}

.game-btn:hover {
    background: #ffcd00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 212, 59, 0.5);
}

.game-btn:active {
    transform: translateY(0);
}

/* Instructions */
.instructions {
    color: white;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 500px) {
    .game-title {
        font-size: 2rem;
    }

    #game-canvas {
        width: 100%;
        height: auto;
    }

    .score-item {
        padding: 0.8rem 1.5rem;
    }

    .score-value {
        font-size: 1.5rem;
    }

    .overlay {
        padding: 2rem 1.5rem;
        width: 90%;
    }

    .overlay h2 {
        font-size: 1.6rem;
    }

    .overlay p {
        font-size: 1rem;
    }

    .game-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}

/* ========================================
   RESPONSIVE ADDITIONS
   ======================================== */

/* ========================================
   Universal Responsive Game Styles
   Add this to all game style.css files
   ======================================== */

/* Canvas Auto-Resize */
.canvas-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    /* Maintains square aspect ratio */
}

#game-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    border-radius: 15px;
    touch-action: none;
    /* Prevents scrolling while playing */
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .canvas-container {
        max-width: 100%;
        padding: 0 !important;
    }

    .game-title {
        font-size: 1.8rem !important;
        text-align: center;
    }

    .score-display {
        flex-wrap: wrap;
        gap: 0.5rem !important;
        justify-content: center;
    }

    .score-item {
        padding: 0.7rem 1.5rem !important;
        font-size: 0.9rem;
    }

    .score-value {
        font-size: 1.5rem !important;
    }

    /* Make social buttons stack vertically on mobile */
    .social-section {
        margin-top: 1rem;
    }

    .social-buttons {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .social-btn {
        width: 100% !important;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px !important;
    }

    .game-container {
        padding: 1rem 0.5rem !important;
        gap: 1rem;
    }

    .game-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.8rem !important;
    }

    .score-display {
        gap: 0.4rem !important;
        margin-bottom: 1rem !important;
        flex-direction: column;
        align-items: stretch;
    }

    .score-item {
        padding: 0.6rem 1rem !important;
        flex: 1;
        min-width: auto;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .score-label {
        font-size: 0.75rem !important;
    }

    .score-value {
        font-size: 1.3rem !important;
    }

    .canvas-container {
        padding: 0 !important;
        border-radius: 12px !important;
        margin: 0 auto;
    }

    .instructions {
        font-size: 0.85rem !important;
        padding: 0.5rem !important;
        text-align: center;
    }

    .overlay {
        padding: 1.5rem !important;
    }

    .overlay h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    .overlay p {
        font-size: 0.9rem !important;
        margin: 0.5rem 0 !important;
    }

    .game-btn {
        padding: 0.8rem 2rem !important;
        font-size: 1rem !important;
        width: 100%;
        max-width: 200px;
    }

    /* Mobile hint for touch controls */
    .canvas-container::after {
        content: "ðŸ’¡ Swipe to move";
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.5);
        margin-top: 0.5rem;
        font-style: italic;
    }
}

/* Touch Controls Enhancement */
@media (hover: none) and (pointer: coarse) {

    /* Touch device detected */
    .game-btn {
        min-height: 44px;
        min-width: 120px;
    }

    button,
    .social-btn {
        min-height: 44px;
        padding: 0.7rem 1.2rem;
    }
}

/* Landscape Mode for Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 5px;
    }

    .game-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto 1fr auto;
        gap: 0.5rem;
        max-width: 100%;
    }

    .game-title {
        grid-column: 1 / -1;
        font-size: 1.3rem !important;
        margin-bottom: 0.5rem !important;
    }

    .score-display {
        grid-column: 1 / -1;
        margin-bottom: 0.5rem !important;
    }

    .canvas-container {
        grid-column: 1;
        grid-row: 3;
        max-width: 400px;
        justify-self: center;
    }

    .instructions {
        grid-column: 1 / -1;
        grid-row: 4;
        margin-top: 0.5rem;
    }

    .social-section {
        grid-column: 2;
        grid-row: 3;
        align-self: start;
    }
}