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

body {
    font-family: "Arial", sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    width: 100vw;
    position: relative;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10px;
    overflow-y: auto;
}

/* Snowflakes Animation */
.snowflakes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    position: absolute;
    color: white;
    font-size: 2em;
    animation: fall linear infinite;
    opacity: 0.8;
}

.snowflake:nth-child(1) {
    left: 10%;
    animation-duration: 10s;
    animation-delay: 0s;
}
.snowflake:nth-child(2) {
    left: 20%;
    animation-duration: 12s;
    animation-delay: 1s;
}
.snowflake:nth-child(3) {
    left: 30%;
    animation-duration: 14s;
    animation-delay: 2s;
}
.snowflake:nth-child(4) {
    left: 40%;
    animation-duration: 11s;
    animation-delay: 0.5s;
}
.snowflake:nth-child(5) {
    left: 50%;
    animation-duration: 13s;
    animation-delay: 1.5s;
}
.snowflake:nth-child(6) {
    left: 60%;
    animation-duration: 15s;
    animation-delay: 2.5s;
}
.snowflake:nth-child(7) {
    left: 70%;
    animation-duration: 10s;
    animation-delay: 0.8s;
}
.snowflake:nth-child(8) {
    left: 80%;
    animation-duration: 12s;
    animation-delay: 1.8s;
}
.snowflake:nth-child(9) {
    left: 90%;
    animation-duration: 14s;
    animation-delay: 0.3s;
}
.snowflake:nth-child(10) {
    left: 95%;
    animation-duration: 13s;
    animation-delay: 1.2s;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.content-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 100%;
}

.title {
    font-size: clamp(1.3rem, 4vw, 3.5rem);
    color: white;
    text-shadow:
        3px 3px 6px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 255, 255, 0.5);
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
    line-height: 1.2;
    margin: 0;
    padding: 0 10px;
}

.animate-fade-in {
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scratch-card-container {
    perspective: 1000px;
}

.scratch-card {
    position: relative;
    width: 90vw;
    max-width: 600px;
    height: 550px;
    min-height: 550px;
    border-radius: 20px;
    overflow: visible;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(255, 255, 255, 0.2);
    transform-style: preserve-3d;
    transition: transform 0.3s;
}

.scratch-card:hover {
    transform: scale(1.02);
}

.scratch-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    cursor: grab;
    user-select: none;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.scratch-surface:active {
    cursor: grabbing;
}

@keyframes shimmer {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.scratch-pattern {
    display: none;
}

.scratch-text {
    position: relative;
    z-index: 4;
    color: #333;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: bold;
    text-shadow:
        2px 2px 4px rgba(255, 255, 255, 0.8),
        0 0 10px rgba(255, 255, 255, 0.5);
    animation: pulse 2s ease-in-out infinite;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}

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

.scratch-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    opacity: 1;
    visibility: visible;
    border-radius: 20px;
    overflow: hidden;
}

.gift-content {
    text-align: center;
    padding: 15px 10px;
    animation: reveal 0.5s ease-out;
    position: relative;
    z-index: 10;
    opacity: 1;
    visibility: visible;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: visible;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gift-title {
    font-size: clamp(1.2rem, 3.5vw, 2.5rem);
    color: white;
    margin-top: 5px;
    margin-bottom: 8px;
    text-shadow:
        3px 3px 6px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(255, 255, 255, 0.5),
        0 0 10px rgba(255, 255, 255, 0.3);
    animation: bounce 1s ease infinite;
    font-weight: bold;
    z-index: 100;
    position: relative;
    opacity: 1;
    visibility: visible;
    line-height: 1.2;
}

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

.gift-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.5rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    line-height: 1.3;
}

.iphone-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.iphone-image {
    max-width: 140px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

.iphone-title {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
    line-height: 1.2;
}

.sparkles {
    margin-top: 5px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.sparkle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    animation: sparkle 1.5s ease-in-out infinite;
}

.sparkle:nth-child(1) {
    animation-delay: 0s;
}
.sparkle:nth-child(2) {
    animation-delay: 0.5s;
}
.sparkle:nth-child(3) {
    animation-delay: 1s;
}

@keyframes sparkle {
    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

.instruction {
    color: white;
    font-size: clamp(0.85rem, 2vw, 1.5rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
    margin: 0;
    padding: 0 10px;
    line-height: 1.3;
}

.animate-bounce {
    animation: bounceInstruction 2s ease-in-out infinite;
}

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

@keyframes confettiFall {
    to {
        transform: translateY(100vh) translateX(var(--horizontal)) rotate(360deg);
        opacity: 0;
    }
}

#scratchCanvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: auto;
    z-index: 3;
    border-radius: 20px;
    cursor: grab;
    touch-action: none;
    background: transparent;
}

#scratchCanvas:active {
    cursor: grabbing;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }

    .content-wrapper {
        gap: 15px;
        width: 100%;
        max-width: 100%;
        align-items: center;
        justify-content: center;
    }

    .scratch-card {
        width: 90vw;
        max-width: 500px;
        height: 450px;
        min-height: 450px;
        max-height: 450px;
        margin: 0 auto;
    }

    .title {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        margin-bottom: 8px;
        padding: 0 15px;
    }

    .instruction {
        font-size: clamp(0.8rem, 2.5vw, 1rem);
        margin-top: 8px;
        padding: 0 15px;
    }

    .gift-content {
        padding: 20px 15px;
        justify-content: center;
    }

    .gift-title {
        font-size: clamp(1.1rem, 4vw, 1.6rem);
        margin-top: 5px;
        margin-bottom: 8px;
    }

    .gift-subtitle {
        font-size: clamp(0.9rem, 2.5vw, 1.2rem);
        margin-bottom: 12px;
    }

    .iphone-image {
        max-width: 130px;
    }

    .iphone-title {
        font-size: clamp(1.1rem, 3.5vw, 1.6rem);
    }

    .sparkles {
        gap: 12px;
        margin-top: 8px;
    }

    .sparkle {
        font-size: clamp(1.1rem, 3vw, 1.6rem);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px 10px;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }

    .content-wrapper {
        gap: 12px;
        width: 100%;
        max-width: 100%;
        align-items: center;
        justify-content: center;
    }

    .scratch-card {
        width: 92vw;
        max-width: 400px;
        height: 400px;
        min-height: 400px;
        max-height: 400px;
        border-radius: 18px;
        margin: 0 auto;
    }

    .scratch-content {
        border-radius: 18px;
    }

    .title {
        font-size: clamp(1.1rem, 5vw, 1.6rem);
        padding: 0 10px;
        margin-bottom: 6px;
    }

    .instruction {
        font-size: clamp(0.75rem, 2.5vw, 0.95rem);
        padding: 0 10px;
        margin-top: 6px;
    }

    .gift-content {
        padding: 18px 12px;
        justify-content: center;
    }

    .gift-title {
        font-size: clamp(1rem, 4vw, 1.4rem);
        margin-top: 4px;
        margin-bottom: 6px;
    }

    .gift-subtitle {
        font-size: clamp(0.85rem, 2.5vw, 1.1rem);
        margin-bottom: 10px;
    }

    .iphone-image {
        max-width: 110px;
    }

    .iphone-title {
        font-size: clamp(1rem, 3.5vw, 1.4rem);
    }

    .sparkles {
        gap: 10px;
        margin-top: 6px;
    }

    .sparkle {
        font-size: clamp(1rem, 3vw, 1.4rem);
    }
}

@media (max-height: 700px) {
    .container {
        justify-content: center;
        align-items: center;
        padding: 10px;
    }

    .scratch-card {
        height: calc(100vh - 180px);
        min-height: 350px;
        max-height: calc(100vh - 180px);
    }

    .content-wrapper {
        gap: 10px;
        justify-content: center;
    }

    .title {
        font-size: clamp(1rem, 4vw, 1.5rem);
        margin-bottom: 5px;
    }

    .instruction {
        font-size: clamp(0.7rem, 2vw, 0.9rem);
        margin-top: 5px;
    }
}

