* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Courier Prime', 'Courier New', monospace;
    background-color: #1a1a2e;
    color: #eee;
    overflow-x: hidden;
    transition: background-color 1.5s ease;
}

html {
    height: -webkit-fill-available;
}

body.love-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
}

.container {
    text-align: center;
    padding: 20px 15px;
    max-width: 100%;
    width: 100%;
    padding-bottom: 100px;
}

/* ==================== */
/* ERROR PAGE           */
/* ==================== */
.error-code {
    font-size: clamp(60px, 20vw, 120px);
    font-weight: bold;
    color: #e94560;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
    line-height: 1;
    transition: all 1s ease;
    cursor: default;
}

.error-code.transform {
    animation: heartbeat 0.6s ease-in-out;
}

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

.error-message {
    font-size: clamp(18px, 5vw, 24px);
    margin: 15px 0;
    color: #a0a0a0;
    transition: all 1s ease;
}

.error-details {
    font-size: clamp(12px, 3.5vw, 14px);
    color: #666;
    margin-bottom: 25px;
    line-height: 1.8;
    transition: all 1s ease;
    padding: 0 10px;
}

/* ==================== */
/* BUTTONS              */
/* ==================== */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 13px;
    font-family: inherit;
    background-color: #e94560;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 6px;
    touch-action: manipulation;
}

.btn:hover, .btn:active {
    background-color: #ff6b6b;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #4ecca3;
}

.btn-secondary:hover, .btn-secondary:active {
    background-color: #6fe8bb;
    box-shadow: 0 8px 25px rgba(78, 204, 163, 0.4);
}

.btn-small {
    padding: 12px 22px;
    font-size: 12px;
}

/* ==================== */
/* SECTIONS             */
/* ==================== */
.section {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.section.visible {
    display: block;
    opacity: 1;
}

.section-title {
    color: #ff6b6b;
    margin-bottom: 8px;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(28px, 8vw, 36px);
}

.section-subtitle {
    color: #888;
    margin-bottom: 20px;
    font-size: clamp(12px, 3.5vw, 14px);
    padding: 0 10px;
}

/* ==================== */
/* LOVE CONTENT         */
/* ==================== */
.love-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(40px, 12vw, 60px);
    color: #ff6b6b;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.6);
}

.love-message {
    font-size: clamp(16px, 4vw, 18px);
    line-height: 1.8;
    color: #eee;
    margin-bottom: 20px;
    padding: 0 15px;
}

.love-message .name {
    color: #ff6b6b;
    font-weight: bold;
    font-size: clamp(20px, 5vw, 24px);
}

/* Love Counter */
.love-counter {
    background: rgba(255, 107, 107, 0.1);
    border: 2px solid #ff6b6b;
    border-radius: 20px;
    padding: 18px 15px;
    margin: 20px 15px;
}

.love-counter-title {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.love-counter-days {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(32px, 10vw, 48px);
    color: #ff6b6b;
}

.love-counter-details {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Big heart */
.big-heart {
    font-size: clamp(50px, 15vw, 70px);
    animation: pulse 1.5s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.2s;
    display: inline-block;
}

.big-heart:active {
    transform: scale(1.3);
}

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

.signature {
    margin-top: 15px;
    font-style: italic;
    color: #888;
    font-size: 14px;
}

/* Navigation buttons */
.nav-buttons {
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 10px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.nav-buttons .btn {
    margin: 0;
    width: 100%;
}

/* ==================== */
/* HEARTS ANIMATION     */
/* ==================== */
.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.heart {
    position: absolute;
    font-size: 20px;
    animation: float-up 4s ease-in forwards;
    opacity: 0;
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* ==================== */
/* GLITCH & LOADING     */
/* ==================== */
.glitch {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-5px, 5px); }
    40% { transform: translate(-5px, -5px); }
    60% { transform: translate(5px, 5px); }
    80% { transform: translate(5px, -5px); }
}

.loading {
    display: none;
    margin-top: 20px;
}

.loading.visible {
    display: block;
}

.loading span {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #e94560;
    border-radius: 50%;
    margin: 0 5px;
    animation: bounce 0.6s infinite alternate;
}

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

@keyframes bounce {
    to { transform: translateY(-10px); opacity: 0.5; }
}

.hidden {
    display: none !important;
}

/* ==================== */
/* MUSIC CONTROL        */
/* ==================== */
.music-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 100;
    background: rgba(26, 26, 46, 0.95);
    padding: 10px 15px;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.music-control.visible {
    display: flex;
}

.music-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e94560;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    touch-action: manipulation;
}

.music-toggle:active {
    transform: scale(0.95);
    background: #ff6b6b;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #ff6b6b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: #ff6b6b;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.5);
}

/* ==================== */
/* CATCH HEARTS GAME    */
/* ==================== */
.game-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 60vh;
    max-height: 400px;
    margin: 15px auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid #e94560;
    touch-action: none;
}

.game-score {
    position: absolute;
    top: 12px;
    left: 15px;
    font-size: 16px;
    color: #ff6b6b;
    z-index: 10;
}

.game-timer {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 16px;
    color: #4ecca3;
    z-index: 10;
}

.game-catcher {
    position: absolute;
    bottom: 10px;
    width: 70px;
    height: 70px;
    font-size: 50px;
    line-height: 70px;
    text-align: center;
    transition: left 0.05s ease-out;
    user-select: none;
}

.falling-heart {
    position: absolute;
    font-size: 30px;
    animation: fall linear forwards;
    cursor: pointer;
}

@keyframes fall {
    to { transform: translateY(60vh); }
}

.game-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #fff;
    text-align: center;
    z-index: 20;
    width: 90%;
}

.game-message h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 28px;
    color: #ff6b6b;
    margin-bottom: 12px;
}

.catch-effect {
    position: absolute;
    font-size: 16px;
    animation: catchPop 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes catchPop {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2) translateY(-30px); opacity: 0; }
}

/* ==================== */
/* SCRATCH CARDS        */
/* ==================== */
.scratch-cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 15px 0;
    padding: 0 5px;
}

.scratch-card {
    width: 100%;
    aspect-ratio: 3/4;
    max-height: 200px;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.scratch-card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 15px 10px 45px 10px;
    text-align: center;
    background: linear-gradient(135deg, #ff6b6b 0%, #e94560 100%);
    box-sizing: border-box;
}

.scratch-card-content .icon {
    font-size: clamp(30px, 8vw, 40px);
    margin-bottom: 5px;
    margin-top: 5px;
}

.scratch-card-content .title {
    font-size: clamp(11px, 3vw, 13px);
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.scratch-card-content .description {
    font-size: clamp(9px, 2.3vw, 10px);
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
    line-height: 1.25;
    padding: 0 2px;
}

.scratch-card canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
}

.scratch-card.revealed canvas {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.scratch-card-actions {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 25;
}

.scratch-card.revealed .scratch-card-actions {
    opacity: 1;
}

.btn-save {
    background: rgba(255, 255, 255, 0.95);
    color: #e94560;
    padding: 6px 12px;
    font-size: 9px;
    border-radius: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-save:hover, .btn-save:active {
    background: white;
    transform: translateY(-1px);
}

/* ==================== */
/* COMPLIMENT SHAKE     */
/* ==================== */
.shake-section {
    background: rgba(78, 204, 163, 0.1);
    border: 2px solid #4ecca3;
    border-radius: 20px;
    padding: 25px 15px;
    margin: 15px;
}

.shake-icon {
    font-size: 50px;
    animation: shake-hint 2s ease-in-out infinite;
}

@keyframes shake-hint {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.compliment-display {
    font-size: clamp(16px, 4.5vw, 20px);
    color: #4ecca3;
    margin: 20px 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    padding: 0 10px;
    transition: opacity 0.2s ease;
}

.shake-hint {
    font-size: 12px;
    color: #666;
    margin-top: 15px;
}

/* ==================== */
/* LOVE ANIMATION       */
/* ==================== */
.love-anim-container {
    position: relative;
    width: 100%;
    height: 70vh;
    max-height: 500px;
    background: linear-gradient(to bottom, #0f0c29 0%, #302b63 50%, #24243e 100%);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
}

#loveAnimCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.love-anim-character {
    position: absolute;
    bottom: 10px;
    font-size: 40px;
    animation: characterBounce 0.5s ease-in-out infinite alternate;
}

.love-anim-character.left {
    left: 15px;
}

.love-anim-character.right {
    right: 15px;
    transform: scaleX(-1);
}

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

.love-anim-character.right {
    animation: characterBounceRight 0.5s ease-in-out infinite alternate;
}

@keyframes characterBounceRight {
    0% { transform: scaleX(-1) translateY(0); }
    100% { transform: scaleX(-1) translateY(-5px); }
}

#replayAnimBtn {
    margin-bottom: 10px;
}

/* ==================== */
/* TOAST                */
/* ==================== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #4ecca3;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 13px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    white-space: nowrap;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Back button */
.back-btn {
    margin-top: 20px;
}

/* ==================== */
/* RESPONSIVE           */
/* ==================== */
@media (min-width: 500px) {
    .scratch-cards-container {
        grid-template-columns: repeat(3, 1fr);
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .nav-buttons {
        grid-template-columns: repeat(3, 1fr);
        max-width: 500px;
    }
}

@media (max-height: 700px) {
    .game-container {
        height: 50vh;
    }
    
    .love-counter {
        padding: 12px;
    }
    
    .love-counter-days {
        font-size: 28px;
    }
}
