/* ============================================
   Heart Run Game Styles
   ============================================ */

.heart-run-game {
    width: 100%;
    /* max-width: 850px;  <-- remove this */
    margin: 0 auto;
}

.heart-run-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.heart-run-header h2 {
    font-size: 2rem;
    background: linear-gradient(135deg, rgba(26, 188, 156, 0.95), rgba(22, 160, 133, 0.95));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.heart-run-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-dark);
    opacity: 0.8;
    margin: 0;
}

/* Game Canvas Container */
/* Game Canvas Container */
.game-canvas-container {
    position: relative;
    width: 100%;
    /* max-width: 800px;  <-- remove this */
    margin: 0 auto var(--spacing-md);
    background: linear-gradient(135deg, #FFFFFF, #FFF0F5);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(255, 105, 180, 0.2);
    border: 2px solid rgba(255, 105, 180, 0.3);
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Game Screens */
.game-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    z-index: 10;
}

#gameOverScreen {
    background: rgba(255, 255, 255, 0.98);
}

.start-content,
.gameover-content {
    text-align: center;
    padding: var(--spacing-lg);
    animation: fadeInScale 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.start-content h3,
.gameover-content h3 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
}

.start-content p,
.gameover-content p {
    font-size: 1.1rem;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-md);
}

.sweet-message {
    font-size: 1.2rem !important;
    font-weight: 500;
    margin-bottom: var(--spacing-lg) !important;
}

/* Game Button */
.game-button {
    display: inline-block;
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, rgba(26, 188, 156, 0.95), rgba(22, 160, 133, 0.95));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: var(--spacing-xs);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
}

.game-button:active {
    transform: translateY(0);
}

.game-button.special {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    }
    50% { 
        box-shadow: 0 4px 25px rgba(255, 215, 0, 0.6);
    }
}

.game-button.special:hover {
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.5);
}

/* Controls Hint */
.controls-hint {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(255, 105, 180, 0.1);
    border-radius: 8px;
}

.controls-hint p {
    font-size: 0.95rem;
    margin: 0;
}

/* Score Display */
.score-display {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

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

.score-item span {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-dark);
    opacity: 0.7;
    margin-bottom: 4px;
}

.score-item strong {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}

/* HUD */
.game-hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 5;
    pointer-events: none;
}

.score,
.high-score {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.score span,
.high-score span {
    font-weight: 700;
}

/* Hint */
.heart-run-hint {
    text-align: center;
    margin-top: var(--spacing-sm);
}

.heart-run-hint small {
    color: var(--color-text-dark);
    opacity: 0.6;
    font-size: 0.875rem;
}

/* Success Message Override */
.heart-run-game .game-success-message {
    background: linear-gradient(135deg, #FFE4E1, #FFF0F5);
    border: 2px;
    padding: var(--spacing-xl);
    border-radius: 16px;
    text-align: center;
    animation: successPop 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    50% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.heart-run-game .game-success-message h3 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #FF69B4, #FF1493);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-md);
}

.heart-run-game .game-success-message p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-text-dark);
}

/* Confetti Override for Heart Theme */
.heart-run-game .confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

.heart-run-game .confetti:nth-child(even) {
    width: 8px;
    height: 8px;
    background: #FFD700;
    animation-duration: 2.5s;
}

.heart-run-game .confetti:nth-child(3n) {
    animation-duration: 3.5s;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .heart-run-header h2 {
        font-size: 1.6rem;
    }
    
    .heart-run-subtitle {
        font-size: 1rem;
    }
    
    .start-content h3,
    .gameover-content h3 {
        font-size: 1.5rem;
    }
    
    .game-button {
        padding: 10px 24px;
        font-size: 1rem;
    }
    
    .score-item strong {
        font-size: 1.5rem;
    }
    
    .game-hud {
        top: 10px;
        left: 10px;
        right: 10px;
    }
    
    .score,
    .high-score {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .heart-run-header h2 {
        font-size: 1.4rem;
    }
    
    .heart-run-subtitle {
        font-size: 0.95rem;
    }
    
    .game-button {
        display: block;
        width: calc(100% - 40px);
        margin: var(--spacing-xs) auto;
    }
    
    .score-display {
        gap: var(--spacing-md);
    }
}

/* Touch feedback */
@media (hover: none) {
    .game-button:active {
        transform: scale(0.98);
    }
}
