/* ========================================
   SPIN HADIAH — Premium Elegant Design
   Fonts: Cinzel · Cormorant Garamond · Outfit
   ======================================== */

:root {
    --bg-dark: #08080c;
    --bg-card: #101018;
    --bg-card-soft: #14141e;
    --gold: #d4af37;
    --gold-light: #f0d77b;
    --gold-soft: #e8c96a;
    --gold-dark: #a8892a;
    --text-primary: #f4f0e6;
    --text-secondary: #b8b0a0;
    --text-muted: #6e6860;
    --border: rgba(212, 175, 55, 0.18);
    --border-soft: rgba(212, 175, 55, 0.08);
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    --radius: 18px;
    --font-display: 'Cinzel', 'Times New Roman', serif;
    --font-elegant: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Outfit', -apple-system, sans-serif;
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Background */
.bg-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 175, 55, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 90%, rgba(168, 137, 42, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 10% 80%, rgba(212, 175, 55, 0.04) 0%, transparent 45%),
        linear-gradient(180deg, #08080c 0%, #0c0c14 50%, #08080c 100%);
    z-index: -2;
}

.bg-grain {
    position: fixed;
    inset: 0;
    opacity: 0.035;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 24px 56px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ========== Header / Logo ========== */
.header {
    text-align: center;
    margin-bottom: 36px;
    width: 100%;
}

.logo-wrap {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.logo-img {
    max-height: 88px;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(212, 175, 55, 0.25));
}

.logo-emblem {
    width: 72px;
    height: 72px;
    animation: logoGlow 4s ease-in-out infinite;
}

.logo-emblem svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.35));
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.3)); }
    50% { filter: drop-shadow(0 0 22px rgba(212, 175, 55, 0.5)); }
}

.event-tagline {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.85;
    margin-bottom: 10px;
}

.event-name {
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 4.5vw, 2.4rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.25;
    background: linear-gradient(135deg, #f5e6b8 0%, var(--gold-light) 35%, var(--gold) 65%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 18px;
}

.header-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 28px;
}

.ornament-line {
    width: 48px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.6;
}

.ornament-diamond {
    width: 6px;
    height: 6px;
    background: var(--gold);
    transform: rotate(45deg);
    opacity: 0.8;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 36px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-label {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--gold-light);
    letter-spacing: 0.04em;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent, var(--border), transparent);
}

/* ========== Prize Section ========== */
.prize-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 22px 36px;
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.9), rgba(16, 16, 24, 0.95));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    position: relative;
}

.prize-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.4), transparent);
}

.prize-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.prize-name {
    font-family: var(--font-elegant);
    font-size: clamp(1.45rem, 3.5vw, 1.85rem);
    font-weight: 600;
    font-style: italic;
    color: var(--gold-light);
    letter-spacing: 0.02em;
}

/* ========== Spin Area ========== */
.spin-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
    flex: 1;
}

.spin-display {
    width: 100%;
    max-width: 480px;
    min-height: 168px;
    background: linear-gradient(160deg, var(--bg-card-soft), var(--bg-card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.spin-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

.spin-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.35), transparent);
}

.spin-placeholder {
    font-family: var(--font-elegant);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.spin-name {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 4vw, 2rem);
    font-weight: 600;
    text-align: center;
    padding: 24px 28px;
    letter-spacing: 0.03em;
    animation: pulseName 0.12s ease;
}

@keyframes pulseName {
    0% { opacity: 0.35; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}

/* Spin Button */
.btn-spin {
    position: relative;
    padding: 18px 56px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #0a0a0c;
    background: linear-gradient(135deg, #f5e6b8, var(--gold-light) 30%, var(--gold) 70%, var(--gold-dark));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow:
        0 8px 28px rgba(212, 175, 55, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-spin:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow:
        0 14px 40px rgba(212, 175, 55, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-spin:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-spin:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-spin.spinning {
    pointer-events: none;
    animation: btnPulse 1.2s ease infinite;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 8px 28px rgba(212, 175, 55, 0.35); }
    50% { box-shadow: 0 8px 48px rgba(212, 175, 55, 0.55); }
}

/* ========== Winner Modal ========== */
.winner-modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 8, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    padding: 24px;
}

.winner-modal.show {
    opacity: 1;
    visibility: visible;
}

.winner-card {
    background: linear-gradient(165deg, #16161f 0%, #101018 100%);
    border: 1px solid var(--gold);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.15),
        0 0 80px rgba(212, 175, 55, 0.2),
        0 32px 64px rgba(0, 0, 0, 0.5);
    transform: scale(0.92) translateY(12px);
    transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.winner-modal.show .winner-card {
    transform: scale(1) translateY(0);
}

.winner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}

.winner-badge {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 20px;
}

.winner-name {
    font-family: var(--font-elegant);
    font-size: clamp(1.9rem, 5vw, 2.7rem);
    font-weight: 600;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 28px;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.winner-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 18px;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-row.highlight {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.22);
}

.detail-label {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.detail-value {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.detail-row.highlight .detail-value {
    font-family: var(--font-elegant);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--gold-light);
}

.btn-close {
    padding: 12px 36px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-close:hover {
    border-color: var(--gold);
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.06);
}

/* Confetti */
.confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    top: -10px;
    opacity: 0;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(420px) rotate(720deg);
    }
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
    .container {
        padding: 32px 16px 48px;
    }

    .logo-emblem {
        width: 60px;
        height: 60px;
    }

    .logo-img {
        max-height: 72px;
    }

    .stats {
        gap: 24px;
    }

    .prize-section {
        padding: 18px 22px;
    }

    .btn-spin {
        padding: 16px 40px;
        font-size: 0.85rem;
        width: 100%;
        max-width: 300px;
        letter-spacing: 0.16em;
    }

    .winner-card {
        padding: 36px 22px;
    }

    .detail-row {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}
