/* ==========================================================================
   Spin & Win Stylesheet - Premium Australian Theme
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark-primary: #050d22;
    --bg-dark-secondary: #0c1836;
    --blue-accent: #00F2FE;
    --gold-primary: #D4AF37;
    --gold-light: #FFEFA6;
    --gold-dark: #8A6605;
    --gold-gradient: linear-gradient(135deg, #FFEFA6 0%, #D4AF37 50%, #8A6605 100%);
    --white: #ffffff;
    --text-muted: #a0aec0;
    --danger: #ff4d4d;
    --danger-gradient: linear-gradient(135deg, #ff9999 0%, #ff4d4d 50%, #990000 100%);
    
    /* Layout Variables */
    --font-primary: 'Outfit', sans-serif;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --border-radius-circle: 50%;
    
    /* Shadows */
    --gold-glow: 0 0 20px rgba(212, 175, 55, 0.4);
    --blue-glow: 0 0 20px rgba(0, 242, 254, 0.3);
    --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Reset and Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: var(--font-primary);
    background-color: var(--bg-dark-primary);
    color: var(--white);
    overflow-x: hidden;
    scroll-behavior: smooth;
    line-height: 1.5;
}

/* Body Backdrop overlay for depth */
body {
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(12, 24, 54, 0.8) 0%, rgba(5, 13, 34, 1) 90%),
        radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.04) 0%, transparent 70%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Confetti overlay */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    display: none;
}

/* ==========================================================================
   Header & Live Ticker
   ========================================================================== */

.winners-ticker-wrap {
    width: 100%;
    background: rgba(12, 24, 54, 0.85);
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    display: flex;
    align-items: center;
    padding: 10px 15px;
    z-index: 100;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    height: 42px;
}

.ticker-header {
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    padding-right: 12px;
    margin-right: 12px;
}

.winners-ticker {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.ticker-track {
    display: flex;
    white-space: nowrap;
    animation: ticker-slide 22s linear infinite;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.ticker-track span {
    padding-right: 30px;
    font-weight: 400;
}

.ticker-track span strong {
    color: var(--gold-light);
    font-weight: 600;
}

@keyframes ticker-slide {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* Header Controls (Left-Aligned Timer + Floating Sound Button) */
.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px; /* Symmetrical top-bottom spacing */
    position: relative;
    padding: 0 4px;
}

.countdown-container {
    background: rgba(12, 24, 54, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 0 14px;
    height: 36px; /* Compact height matching sound toggle */
    border-radius: 50px; /* Pill shape */
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4); /* Removed cyan glow */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    width: fit-content;
}

.timer-icon {
    color: var(--blue-accent);
}

#timer-display {
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.sound-toggle {
    background: rgba(12, 24, 54, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--white);
    width: 36px;
    height: 36px; /* Matching countdown height */
    border-radius: var(--border-radius-circle); /* Perfect circle shape */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
}

.sound-toggle:hover, .sound-toggle:focus {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold-primary);
    box-shadow: var(--gold-glow);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.main-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 20px 40px 20px;
}

.hero-section {
    text-align: center;
    margin-top: 10px; /* Tightened top space */
    margin-bottom: 20px; /* Tightened bottom space above wheel */
}

.badge {
    display: inline-block;
    background: linear-gradient(90deg, rgba(212,175,55,0.2) 0%, rgba(212,175,55,0.05) 100%);
    border: 1px solid var(--gold-primary);
    color: var(--gold-light);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px; /* Tightened space below badge */
}

.headline {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 8px; /* Tightened space above subheadline */
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subheadline {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 90%;
    margin: 0 auto;
}

/* ==========================================================================
   Spin Wheel Section
   ========================================================================== */

.wheel-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.wheel-outer-container {
    position: relative;
    width: 90vw;
    height: 90vw;
    max-width: 380px;
    max-height: 380px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

/* Glowing back-glow representing premium feel */
.wheel-glow {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    border-radius: var(--border-radius-circle);
    background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
    filter: blur(15px);
    z-index: 1;
    animation: rotate-slow 15s linear infinite;
}

/* Top Indicator Arrow */
.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 32px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.wheel-canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-circle);
    border: 6px solid var(--gold-primary);
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.1),
        0 8px 30px rgba(0, 0, 0, 0.8),
        inset 0 0 15px rgba(0, 0, 0, 0.6),
        var(--gold-glow);
    z-index: 2;
    overflow: hidden;
    background: var(--bg-dark-secondary);
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    display: block;
    transform: rotate(0deg);
    transition: transform cubic-bezier(0.15, 0.85, 0.25, 1);
}

/* SPIN Button Center Hub Overlay */
.wheel-spin-btn-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 78px;
    height: 78px;
    border-radius: var(--border-radius-circle);
    background: radial-gradient(circle, #FFEFA6 0%, #D4AF37 50%, #8A6605 100%);
    border: 4px double #ffffff;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(212, 175, 55, 0.8);
    color: #050d22;
    font-size: 1.05rem; /* Slightly larger text */
    font-weight: 900;
    line-height: 1.0; /* Fits two lines of text perfectly */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 5;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    animation: center-hub-pulse 2s infinite;
}

.wheel-spin-btn-center:hover, .wheel-spin-btn-center:focus {
    transform: translate(-50%, -50%) scale(1.05);
    background: radial-gradient(circle, #ffffff 0%, #FFEFA6 40%, #D4AF37 100%);
    border-color: #FFEFA6;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.7),
        0 0 25px rgba(212, 175, 55, 1);
    animation-play-state: paused;
}

.wheel-spin-btn-center:active {
    transform: translate(-50%, -50%) scale(0.92);
}

/* Center Hub Pulse Glow Animation */
@keyframes center-hub-pulse {
    0% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(212, 175, 55, 0.6); }
    70% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 0 12px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* Wobble Pointer Animation */
.wheel-pointer.wobble {
    animation: pointer-wag 0.15s ease-out;
}

@keyframes pointer-wag {
    0% { transform: translateX(-50%) rotate(0deg); }
    30% { transform: translateX(-50%) rotate(-12deg); }
    70% { transform: translateX(-50%) rotate(8deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

/* Secondary CTA / Main Action Button Below Wheel */
.action-btn-container {
    width: 100%;
    text-align: center;
    margin-top: 10px;
    z-index: 3;
}

.trust-badge {
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.trust-badge i {
    color: var(--blue-accent);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gold-gradient);
    color: var(--bg-dark-primary);
    box-shadow: 
        0 6px 20px rgba(212, 175, 55, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 30%;
    height: 200%;
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(30deg);
    transition: none;
    animation: btn-shine 3.5s ease-in-out infinite;
}

.btn-primary:hover, .btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(212, 175, 55, 0.6),
        0 4px 6px rgba(0, 0, 0, 0.2);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 
        0 3px 10px rgba(212, 175, 55, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 15px;
    font-family: var(--font-primary);
}

.btn-link:hover {
    color: var(--white);
}

/* Shine effect */
@keyframes btn-shine {
    0% { left: -60%; }
    15% { left: 130%; }
    100% { left: 130%; }
}

/* Animations */
.pulse-animation {
    animation: element-pulse 2s infinite;
}

@keyframes element-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); box-shadow: 0 8px 28px rgba(212, 175, 55, 0.7); }
    100% { transform: scale(1); }
}

.gold-pulse {
    animation: gold-glow-pulse 2.5s infinite alternate;
}

@keyframes gold-glow-pulse {
    0% { color: var(--gold-primary); text-shadow: 0 0 2px rgba(212, 175, 55, 0.3); }
    100% { color: var(--gold-light); text-shadow: 0 0 10px rgba(212, 175, 55, 0.8); }
}

@keyframes rotate-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin-slow {
    animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Modals & Popups
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-dark-secondary);
    border: 2px solid var(--gold-primary);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 30px;
    box-shadow: 
        0 15px 45px rgba(0, 0, 0, 0.9),
        var(--gold-glow);
    position: relative;
    transform: scale(0.85);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-modal-btn:hover {
    color: var(--white);
}

.modal-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold-primary);
    color: var(--gold-light);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 50px;
    margin-bottom: 18px;
}

.modal-badge.bg-danger {
    background: rgba(255, 77, 77, 0.15);
    border-color: var(--danger);
    color: #ff9999;
}

.gold-gradient-text {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.danger-gradient-text {
    background: var(--danger-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.win-message {
    color: #e2e8f0;
    font-size: 1.05rem;
    margin-bottom: 24px;
}

/* Reward Credits Value Box */
.reward-box {
    position: relative;
    background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    border: 2px dashed rgba(212, 175, 55, 0.5);
    border-radius: var(--border-radius-md);
    padding: 24px 10px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.reward-glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: var(--border-radius-circle);
    background: var(--gold-primary);
    opacity: 0.12;
    filter: blur(25px);
}

.reward-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    letter-spacing: -1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.reward-unit {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold-light);
    font-weight: 600;
    margin-top: 2px;
}

.urgency-note {
    font-size: 0.8rem;
    color: #fda4af;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
    font-weight: 600;
}

.urgency-note i {
    font-size: 0.85rem;
}

/* Lead Modal Layout */
.lead-subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.lead-subtext strong {
    color: var(--gold-light);
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label i {
    color: var(--gold-primary);
}

.form-control {
    background: rgba(5, 13, 34, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-sm);
    padding: 12px 14px;
    font-family: var(--font-primary);
    color: var(--white);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.form-control:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
    background: rgba(12, 24, 54, 0.9);
}

.form-control.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.25);
}

.error-msg {
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 600;
    display: none;
    margin-top: 2px;
}

.error-msg.visible {
    display: block;
}

/* Custom Checkbox */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 5px;
}

.form-check-input {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    cursor: pointer;
    accent-color: var(--gold-primary);
}

.form-check-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
    cursor: pointer;
}

.form-check-label a {
    color: var(--gold-light);
    text-decoration: underline;
}

.security-assurance {
    margin-top: 18px;
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.security-assurance i {
    color: var(--blue-accent);
}

/* Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hidden {
    display: none !important;
}

/* Exit intent popup elements */
.exit-intent-card {
    border-color: var(--danger);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 77, 77, 0.3);
}

.exit-message {
    font-size: 0.95rem;
    color: #e2e8f0;
    margin-bottom: 20px;
}

.exit-wheel-visual {
    margin: 15px 0 25px 0;
}

.exit-spin-icon {
    font-size: 3.5rem;
    color: var(--danger);
    opacity: 0.8;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer-wrap {
    flex-shrink: 0;
    width: 100%;
    background: rgba(5, 13, 34, 0.9);
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-terms {
    max-width: 700px;
    margin: 0 auto 18px auto;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.5;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

.footer-links .divider {
    color: #334155;
    font-size: 0.75rem;
}

.footer-copyright {
    font-size: 0.7rem;
    color: #475569;
}

/* ==========================================================================
   Utility Classes & Layout Tuning
   ========================================================================== */

.text-center { text-align: center; }
.font-bold { font-weight: 800; }

/* Scale up animation helper for modal popups */
.scale-up-animation {
    animation: scaleUp 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleUp {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Small Devices (Mobile First default is small, below 360px) */
@media (max-width: 350px) {
    .headline {
        font-size: 1.55rem;
    }
    .subheadline {
        font-size: 0.85rem;
    }
    .countdown-container {
        font-size: 0.72rem;
        padding: 0 10px;
        height: 38px;
    }
    .wheel-spin-btn-center {
        width: 66px;
        height: 66px;
        font-size: 0.85rem;
    }
    .reward-value {
        font-size: 2.8rem;
    }
    .btn-lg {
        padding: 14px 28px;
        font-size: 1rem;
    }
}

/* Tablet and larger portrait (min-width: 600px) */
@media (min-width: 600px) {
    .main-wrapper {
        padding-top: 30px;
        padding-bottom: 60px;
    }
    .headline {
        font-size: 2.3rem;
    }
    .subheadline {
        font-size: 1.1rem;
    }
    .wheel-outer-container {
        margin: 15px auto;
    }
    .footer-wrap {
        padding: 40px 30px;
    }
}
