/* ===================================
   PLAY PAGE
   =================================== */

.play-page {
    /* Stacks everything vertically */
    display: flex;
    flex-direction: column;

    /* Centers everything horizontally */
    align-items: center;

    /* Adds vertical spacing between elements */
    gap: var(--spacing-large);
}

/* Main container with purple border containing everything */
.play-container {
    background-color: var(--background-white);
    border: 2px solid var(--border-purple);
    border-radius: 25px;

    /* Space inside the container */
    padding: var(--spacing-large);

    /* Limits how wide the container can be */
    max-width: 800px;
    width: 100%;
}

/* Top row: Mobile stacks, Desktop side-by-side */
.top-row {
    /* Stacks everything vertically */
    display: flex;
    flex-direction: column;

    gap: var(--spacing-large);
    margin-bottom: var(--spacing-large);

    /* Makes children stretch to full width */
    align-items: stretch;
}

/* Desktop: Health bar and Pet display side-by-side */
@media (min-width: 769px) {
    .top-row {
        flex-direction: row;
        align-items: flex-start;
    }
    
    /* Health bar on the left - narrower */
    .top-row .health-bar {
        /* Sets fixed width of 240px */
        flex: 0 0 240px;

        margin: 0;
    }
    
    /* Pet display on the right - wider */
    .top-row .pet-display {
        /* Controls width */
        flex: 1;

        min-height: 280px;
        margin-bottom: 0;
    }
}

/* Mobile: Full width elements */
@media (max-width: 768px) {
    .top-row .health-bar {
        width: 100%;
        margin: 0;
    }
    
    .top-row .pet-display {
        width: 100%;
        min-height: 250px;
        margin-bottom: 0;
    }
}

.play-area {
    width: 100%;
    background-color: var(--background-white);
    border: 2px solid var(--border-purple);
    border-radius: 15px;
    padding: var(--spacing-large);
}

/* Pet display area */
.pet-display {
    background-color: var(--background-white);
    border: 2px solid var(--border-purple);
    border-radius: 15px;
    padding: var(--spacing-large);
    min-height: 300px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: var(--spacing-medium);
}

/* Weather-based backgrounds */
.pet-display.sunny {
    background: linear-gradient(to bottom, #FFE5B4, #FFEFC1);
}

.pet-display.rainy {
    background: linear-gradient(to bottom, #B0E0E6, #D4E8F0);
}

.pet-display.cloudy {
    background: linear-gradient(to bottom, #D3D3D3, #E8E8E8);
}

/* Weather effects container */
.weather-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Star background container */
.star-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Individual star */
.star {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.1;
    }
    50% {
        opacity: 1;
    }
}

/* Weather icon in top left corner -->
.weather-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 48px;
    z-index: 10;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    animation: weatherFloat 3s ease-in-out infinite;
}

@keyframes weatherFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border: 2px solid #000;
    border-radius: 15px;
    padding: 8px 12px;
    max-width: 160px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid white;
}

.speech-bubble p {
    margin: 0;
    font-size: 0.8rem;
    color: #000000;
    line-height: 1.3;
}

.activity-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-medium);
    margin-top: 0;
}

.activity-btn {
    padding: 1.2rem;
    background-color: var(--light-purple);
    border: 2px solid var(--border-purple);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.activity-btn:hover {
    background-color: var(--primary-purple);
    color: white;
    transform: scale(1.05);
}

/* ===================================
   RESPONSIVE DESIGN - MOBILE
   =================================== */

@media (max-width: 768px) {
    .pet-display {
        min-height: 300px;
    }
    
    /* Speech bubble adjustments */
    .speech-bubble {
        position: absolute;
        top: 10px;
        right: 10px;
        left: auto;
        transform: none;
        max-width: 140px;
    }
    
    .speech-bubble::after {
        display: none;
    }
    
    /* Larger buttons for mobile - 2 column layout */
    .activity-buttons {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.8rem;
    }
    
    .activity-btn {
        padding: 1.2rem 0.8rem;
        font-size: 0.95rem;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 60px;
    }
}

/* Medium screens adjustment (tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
    .activity-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}
