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

:root {
    --paper-color: #fefefe;
    --line-color: #e0e0e0;
    --text-color: #333;
    --accent-color: #4a90e2;
    --accent-hover: #357abd;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Kalam', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px;
    margin: auto;
}

/* Prize Header */
.prize-header {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.handwritten-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    transform: rotate(-1deg);
    margin: 0;
    letter-spacing: 2px;
}

@keyframes titleWiggle {
    0%, 100% { transform: rotate(-1deg); }
    50% { transform: rotate(1deg); }
}

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

/* Ticket Selection */
.ticket-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.ticket-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ticket-counter label {
    color: #fff;
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 400;
}

.counter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.counter-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #fff;
    color: var(--accent-color);
    font-size: 24px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow);
}

.counter-btn:hover:not(:disabled) {
    transform: scale(1.1);
    background: var(--accent-color);
    color: #fff;
}

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

#ticketCount {
    width: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: #fff;
    font-family: 'Kalam', cursive;
}

.ticket-limit {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.pay-button {
    position: relative;
    display: inline-block;
    padding: 18px 50px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: #fff;
    text-decoration: none;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(238, 90, 111, 0.4);
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.pay-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(238, 90, 111, 0.6);
}

.pay-button:active {
    transform: translateY(-1px);
}

.button-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lined Paper Section */
.paper-section {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    animation: fadeIn 1s ease-out 0.4s both;
}

.lined-paper {
    width: 100%;
    max-width: 800px;
    background: var(--paper-color);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    padding: 20px 40px 20px 60px;
    min-height: 300px;
    max-height: 100%;
    overflow: hidden;
}

.paper-header {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 19px,
        var(--line-color) 19px,
        var(--line-color) 20px
    );
    border-right: 2px solid #ddd;
}

.spiral-holes {
    position: absolute;
    left: 15px;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.spiral-holes span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.2);
}

.paper-content {
    position: relative;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 39px,
        var(--line-color) 39px,
        var(--line-color) 40px
    );
    min-height: 100%;
    padding-top: 10px;
}

.raffle-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    margin-bottom: 5px;
    animation: entryAppear 0.6s ease-out, entryDisappear 0.6s ease-in;
    position: relative;
}

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

@keyframes entryDisappear {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.entry-name {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    filter: blur(2px);
    opacity: 0.6;
}

.entry-name::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        var(--text-color) 2px,
        var(--text-color) 4px
    );
    opacity: 0.5;
    filter: blur(1px);
}

.entry-name::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -5px;
    right: -5px;
    height: 2px;
    background: var(--text-color);
    opacity: 0.4;
    transform: translateY(-50%);
}

.entry-number {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 700;
    color: var(--accent-color);
    background: rgba(74, 144, 226, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    min-width: 60px;
    text-align: center;
    animation: numberPulse 2s ease-in-out infinite;
}

@keyframes numberPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 5px rgba(74, 144, 226, 0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        gap: 20px;
        padding: 15px;
        max-height: 100vh;
    }

    .lined-paper {
        padding: 15px 30px 15px 50px;
    }

    .paper-header {
        width: 30px;
    }

    .spiral-holes {
        left: 10px;
        gap: 25px;
    }

    .spiral-holes span {
        width: 8px;
        height: 8px;
    }

    .counter-controls {
        padding: 8px 15px;
    }

    .counter-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    #ticketCount {
        width: 50px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .container {
        gap: 15px;
        padding: 10px;
    }

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

    .lined-paper {
        padding: 10px 20px 10px 40px;
    }

    .paper-content {
        background: repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 34px,
            var(--line-color) 34px,
            var(--line-color) 35px
        );
    }

    .raffle-entry {
        padding: 6px 10px;
    }
}
