/* Root Variables & Theme */
:root {
    --primary-pink: #ff6b9d;
    --secondary-pink: #ff8fb1;
    --light-pink: #ffd4e5;
    --deep-rose: #e84a7f;
    --purple-accent: #a855f7;
    --gold-accent: #ffd700;
    --dark-bg: #1a0a14;
    --card-bg: rgba(255, 107, 157, 0.1);
    --text-light: #fff;
    --text-muted: rgba(255, 255, 255, 0.7);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1a0a14 0%, #2d1f3d 50%, #1a0a14 100%);
    min-height: 100vh;
    color: var(--text-light);
    overflow-x: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Floating Hearts Background */
.hearts-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.hearts-bg::before {
    content: '💕 💖 💗 💓 💝 ❤️ 💘 💞';
    position: absolute;
    font-size: 24px;
    animation: floatHearts 20s linear infinite;
    opacity: 0.15;
    white-space: nowrap;
}

@keyframes floatHearts {
    0% {
        transform: translateY(100vh) rotate(0deg);
        left: -100px;
    }

    100% {
        transform: translateY(-100vh) rotate(360deg);
        left: 100%;
    }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

header h1 {
    font-family: 'Pacifico', cursive;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-pink), var(--purple-accent), var(--gold-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 107, 157, 0.5);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.2);
    }
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.highlight {
    color: var(--primary-pink);
    font-weight: 600;
    font-family: 'Pacifico', cursive;
}

/* Game Container */
.game-container {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 107, 157, 0.3);
    box-shadow:
        0 8px 32px rgba(255, 107, 157, 0.2),
        inset 0 0 60px rgba(255, 107, 157, 0.05);
    position: relative;
    z-index: 1;
}

/* Score Board */
.score-board {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.score,
.high-score {
    text-align: center;
}

.score .label,
.high-score .label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.score .value,
.high-score .value {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-pink), var(--gold-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Canvas */
#gameCanvas {
    display: block;
    margin: 0 auto;
    border-radius: 16px;
    background: linear-gradient(145deg, #0d0510, #150a1a);
    box-shadow:
        inset 0 0 30px rgba(255, 107, 157, 0.1),
        0 4px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 107, 157, 0.3);
}

/* Controls Info */
.controls-info {
    text-align: center;
    margin-top: 20px;
}

.controls-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.controls-info strong {
    color: var(--primary-pink);
}

/* Start Button */
.start-btn {
    background: linear-gradient(135deg, var(--primary-pink), var(--deep-rose));
    border: none;
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
    font-family: 'Poppins', sans-serif;
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.6);
}

.start-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 5, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    animation: fadeIn 0.5s ease;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(145deg, rgba(40, 20, 50, 0.95), rgba(30, 15, 40, 0.98));
    border-radius: 30px;
    padding: 30px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    border: 2px solid rgba(255, 107, 157, 0.4);
    box-shadow:
        0 20px 60px rgba(255, 107, 157, 0.3),
        inset 0 0 80px rgba(255, 107, 157, 0.05);
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    margin: auto;
    max-height: none;
    overflow: visible;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hearts Animation */
.hearts-animation {
    font-size: 2rem;
    margin-bottom: 20px;
}

.hearts-animation span {
    display: inline-block;
    animation: heartBeat 1.5s ease-in-out infinite;
}

.hearts-animation span:nth-child(1) {
    animation-delay: 0s;
}

.hearts-animation span:nth-child(2) {
    animation-delay: 0.1s;
}

.hearts-animation span:nth-child(3) {
    animation-delay: 0.2s;
}

.hearts-animation span:nth-child(4) {
    animation-delay: 0.3s;
}

.hearts-animation span:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

.modal-title {
    font-family: 'Pacifico', cursive;
    font-size: 2.5rem;
    color: var(--primary-pink);
    margin-bottom: 10px;
}

.final-score {
    font-size: 1.2rem;
    color: var(--gold-accent);
    margin-bottom: 25px;
}

/* Valentine Message */
.valentine-message {
    background: rgba(255, 107, 157, 0.1);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 107, 157, 0.2);
}

.valentine-message h3 {
    font-family: 'Pacifico', cursive;
    font-size: 1.8rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.name-highlight {
    color: var(--primary-pink);
    font-weight: 600;
}

.love-text {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.6;
}

.asawa {
    color: var(--gold-accent);
    font-weight: 600;
    font-style: italic;
}

.my-love {
    color: var(--secondary-pink);
    font-weight: 600;
    font-style: italic;
}

/* Proposal Section */
.proposal {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed rgba(255, 107, 157, 0.3);
}

.question {
    font-family: 'Pacifico', cursive;
    font-size: 1.8rem;
    color: var(--primary-pink);
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.answer-btn {
    padding: 14px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.yes-btn {
    background: linear-gradient(135deg, var(--primary-pink), var(--deep-rose));
    color: white;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.5);
}

.yes-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.7);
}

.no-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.no-btn:hover {
    transform: scale(0.9);
    opacity: 0.7;
}

/* Play Again Button */
.play-again-btn {
    margin-top: 20px;
    background: transparent;
    border: 2px solid var(--primary-pink);
    color: var(--primary-pink);
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.play-again-btn:hover {
    background: var(--primary-pink);
    color: white;
    transform: scale(1.05);
}

/* Celebration Modal */
.celebration-content {
    background: linear-gradient(145deg, rgba(50, 20, 60, 0.98), rgba(40, 15, 50, 0.98));
}

.celebration-title {
    font-family: 'Pacifico', cursive;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--gold-accent), var(--primary-pink), var(--purple-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: celebrateTitle 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes celebrateTitle {

    0%,
    100% {
        transform: scale(1) rotate(-2deg);
    }

    50% {
        transform: scale(1.1) rotate(2deg);
    }
}

.celebration-hearts {
    font-size: 2.5rem;
    margin-bottom: 25px;
}

.celebration-hearts span {
    display: inline-block;
    animation: floatCelebrate 2s ease-in-out infinite;
}

.celebration-hearts span:nth-child(odd) {
    animation-direction: alternate-reverse;
}

@keyframes floatCelebrate {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(10deg);
    }
}

.celebration-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.6;
}

.close-celebration-btn {
    margin-top: 25px;
    background: linear-gradient(135deg, var(--gold-accent), #ff9500);
    border: none;
    color: #1a0a14;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
}

.close-celebration-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.7);
}

/* Confetti Effect */
.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    justify-content: center;
    margin-top: 20px;
    touch-action: manipulation;
}

.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.dpad-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dpad-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(255, 107, 157, 0.3), rgba(255, 107, 157, 0.1));
    color: var(--primary-pink);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow:
        0 4px 15px rgba(255, 107, 157, 0.2),
        inset 0 0 20px rgba(255, 107, 157, 0.1);
    border: 1px solid rgba(255, 107, 157, 0.3);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.dpad-btn:active {
    transform: scale(0.9);
    background: linear-gradient(145deg, rgba(255, 107, 157, 0.5), rgba(255, 107, 157, 0.3));
    box-shadow:
        0 2px 10px rgba(255, 107, 157, 0.4),
        inset 0 0 30px rgba(255, 107, 157, 0.2);
}

.dpad-center {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 107, 157, 0.05);
    border-radius: 15px;
    border: 1px dashed rgba(255, 107, 157, 0.2);
}

/* Show/hide hints based on device */
.desktop-hint {
    display: block;
}

.mobile-hint {
    display: none;
}

/* Touch feedback for mobile */
@media (hover: none) and (pointer: coarse) {
    .mobile-controls {
        display: flex;
    }

    .desktop-hint {
        display: none;
    }

    .mobile-hint {
        display: block;
    }

    .dpad-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .dpad-center {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
}

/* Responsive */
@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        padding: 20px 15px;
        border-radius: 20px;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .hearts-animation {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .final-score {
        font-size: 1rem;
        margin-bottom: 15px;
    }

    .valentine-message {
        padding: 15px;
        margin-bottom: 15px;
    }

    .valentine-message h3 {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    .love-text {
        font-size: 0.9rem;
        margin-bottom: 12px;
        line-height: 1.5;
    }

    .question {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .proposal {
        margin-top: 15px;
        padding-top: 15px;
    }

    .buttons {
        flex-direction: column;
        gap: 10px;
    }

    .answer-btn {
        width: 100%;
        padding: 12px 25px;
        font-size: 1rem;
    }

    .play-again-btn {
        margin-top: 15px;
        padding: 10px 25px;
        font-size: 0.9rem;
    }

    .celebration-title {
        font-size: 2rem;
    }

    .celebration-hearts {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .celebration-text {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .close-celebration-btn {
        margin-top: 15px;
        padding: 12px 30px;
        font-size: 1rem;
    }
}