:root {
    --primary-gold: #D4AF37;
    --light-gold: #F3E5AB;
    --dark-brown: #2C1B18;
    --bg-gradient-start: #4A3B32;
    --bg-gradient-end: #1A0F0D;
    --text-color: #333;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: radial-gradient(circle at center, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--white);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 600px;
    height: 100%;
    background: url('assets/bg_pattern.png'), linear-gradient(to bottom, #5D4037, #281815);
    /* Fallback if pattern missing */
    background-blend-mode: overlay;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Header */
header {
    text-align: center;
    padding-top: 40px;
    padding-bottom: 20px;
    width: 100%;
}

.brand-logo {
    font-size: 1.2rem;
    color: var(--primary-gold);
    margin-bottom: 10px;
    font-weight: bold;
}

.main-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 3rem;
    color: var(--light-gold);
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

.sub-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.1rem;
    color: #ccc;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.box-container {
    position: relative;
    cursor: pointer;
    margin-bottom: 30px;
    text-align: center;
}

.gift-box {
    width: 280px;
    height: auto;
    transition: transform 0.2s;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
}

.instruction {
    margin-top: 15px;
    color: var(--light-gold);
    font-size: 1rem;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Animations */
@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

.shaking {
    animation: shake 0.5s;
    animation-iteration-count: infinite;
}

/* Info Panel */
.info-panel {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px 40px;
    text-align: center;
    color: var(--dark-brown);
    width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary-gold);
}

.price-tag {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 5px;
}

.price-tag .price {
    color: #B71C1C;
    font-size: 1.8rem;
}

.price-tag .vat {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
}

.counter-badge {
    background: var(--dark-brown);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    font-size: 1.1rem;
}

#remainingCount {
    color: var(--primary-gold);
    font-weight: bold;
    font-size: 1.3rem;
}

/* Footer */
footer {
    width: 100%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    font-size: 0.9rem;
    color: #ddd;
}

.prize-info h3 {
    color: var(--primary-gold);
    margin-bottom: 5px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    width: 85%;
    max-width: 400px;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    color: var(--dark-brown);
    box-shadow: 0 0 30px var(--primary-gold);
    border: 3px solid var(--primary-gold);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.confetti {
    font-size: 3rem;
    margin-bottom: 10px;
}

.modal-content h2 {
    color: var(--dark-brown);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.result-details {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.result-details>div {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.result-details>div:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.badge {
    display: inline-block;
    background: #ccc;
    color: #333;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.badge.special {
    background: var(--primary-gold);
    color: white;
}

.prize-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #B71C1C;
}

.confirm-btn {
    background: var(--dark-brown);
    color: var(--primary-gold);
    border: none;
    padding: 12px 40px;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s;
}

.confirm-btn:hover {
    background: #4A3B32;
}