/* 
   Roleta Brazino777 Stylesheet
   Reconstrução Premium baseada nos novos assets de imagem (Borda, Roleta, Botão e Seta)
   100vh viewport, sem rolagem, responsivo
*/

:root {
    --bg-dark-green: #041a0f;
    --bg-green-gradient: radial-gradient(circle at center, #0a3d24 0%, #03140b 100%);
    --accent-gold: #ffd700;
    --accent-orange: #ff6f00;
    --gold-gradient: linear-gradient(135deg, #ffe066 0%, #f5b041 50%, #d35400 100%);
    --white: #ffffff;
    --text-muted: #a3c4b2;
    --card-bg-glass: rgba(10, 30, 20, 0.7);
    --border-glass: rgba(255, 215, 0, 0.2);
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset and Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark-green);
    background-image: url('assets/background.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: var(--white);
    -webkit-user-select: none;
    user-select: none;
}

/* Background Canvas Particles */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* 100vh App Layout Wrapper */
.app-layout {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    z-index: 1;
    position: relative;
}

/* Centered Logo */
.app-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    height: 42px;
}

.logo-img {
    height: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

/* Hero Section */
.hero-section {
    text-align: center;
    width: 100%;
    max-width: 500px;
    margin: 5px 0;
}

.hero-title {
    font-size: 2.35rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 0.92;
    margin-bottom: 10px;
    color: #ffffff;
}

@media (min-width: 480px) {
    .hero-title {
        font-size: 2.9rem;
    }
}

.hero-subtitle {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin-top: 8px;
    margin-bottom: 12px;
}

.spins-counter-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1b4d32 0%, #0d281a 100%);
    border: 2px solid var(--accent-gold);
    color: var(--white);
    padding: 6px 18px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    letter-spacing: 0.5px;
}

.spins-counter-badge span {
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ROULETTE WHEEL SECTION */
.wheel-section {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    max-height: 55vh;
    margin: 10px 0 25px 0;
}

.wheel-outer-glow {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    border-radius: 50%;
    overflow: visible; /* Let pointer overlap */
    /* Circular glow shadow only, no square shadows or hard blocks */
    box-shadow: 0 0 40px rgba(12, 184, 96, 0.35);
    transition: var(--transition-smooth);
}

@media (min-width: 360px) {
    .wheel-outer-glow {
        width: 330px;
        height: 330px;
    }
}

@media (min-width: 480px) {
    .wheel-outer-glow {
        width: 440px;
        height: 440px;
    }
}

@media (min-height: 800px) and (min-width: 480px) {
    .wheel-outer-glow {
        width: 480px;
        height: 480px;
    }
}

/* Gold Frame Background Image */
.wheel-frame-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    pointer-events: none;
    border-radius: 50%; /* ensure frame shape is perfectly circular */
}

/* Pointer Arrow at Top Center */
.wheel-pointer-container {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 46px;
    z-index: 10;
    pointer-events: none;
}

@media (min-width: 480px) {
    .wheel-pointer-container {
        top: -20px;
        width: 65px;
    }
}

.wheel-pointer-img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

/* Rotating Wheel Wrapper */
.wheel-spin-wrapper {
    position: absolute;
    width: 81.5%;
    height: 81.5%;
    top: 9.25%;
    left: 9.25%;
    border-radius: 50%;
    overflow: hidden;
    z-index: 2;
    transform: rotate(0deg);
    transition: transform 5s cubic-bezier(0.1, 0.8, 0.1, 1);
    transform-origin: center center;
    /* Circular masking fix for iOS/Safari overflow:hidden bugs */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

/* Original Purple background of segments is preserved (no red filters) */
.wheel-divider-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Preserve metallic shine and original purple colors */
    filter: contrast(1.05) brightness(1.02);
}

/* Segment text labels - perfectly centered and radial */
.segment-label {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%; /* wider box prevents text wrapping too early */
    height: 12%;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Precise radial placement centered between inner hub and outer rim */
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-260%);
    transform-origin: center center;
    font-family: 'Outfit', sans-serif;
    color: var(--white);
    text-transform: uppercase;
    line-height: 1.1;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s ease;
}

.segment-label .val {
    font-size: clamp(1rem, 3.2vw, 1.4rem);
    font-weight: 900;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
    margin-bottom: 2px;
}

.segment-label .prize-300 {
    font-size: clamp(1.2rem, 3.8vw, 1.8rem);
    color: #ffd700;
}

.segment-label .lbl {
    font-size: clamp(0.5rem, 1.5vw, 0.58rem);
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.segment-label .label-300 {
    color: #ffd700;
}

.segment-label .deu-ruim {
    font-size: clamp(0.52rem, 1.6vw, 0.62rem);
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    letter-spacing: 0.2px;
    margin-bottom: 1px;
}

.segment-label .gire-novo {
    font-size: clamp(0.48rem, 1.4vw, 0.52rem);
    font-weight: 800;
    color: #ffe082;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* Scaling up on desktop */
@media (min-width: 480px) {
    .segment-label .val {
        font-size: 1.8rem;
    }
    .segment-label .prize-300 {
        font-size: 2.2rem;
    }
    .segment-label .lbl {
        font-size: 0.72rem;
    }
    .segment-label .deu-ruim {
        font-size: 0.8rem;
    }
    .segment-label .gire-novo {
        font-size: 0.68rem;
    }
}

/* Highlight the winning segment at 0 degrees */
.segment-label.winner-highlight {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-260%) scale(1.22);
    z-index: 10;
    animation: prizeBlink 0.6s infinite alternate;
}

@keyframes prizeBlink {
    0% { filter: drop-shadow(0 0 5px #ffd700); }
    100% { filter: drop-shadow(0 0 25px #ffd700) brightness(1.35); }
}

/* Center Spin Button Overlay */
.spin-button-trigger {
    position: absolute;
    width: 23%;
    height: 23%;
    top: 38.5%;
    left: 38.5%;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 5;
    transition: var(--transition-smooth);
    outline: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spin-btn-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: btnPulse 2s infinite ease-in-out;
    transition: var(--transition-smooth);
}

.spin-button-trigger:hover .spin-btn-img {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px rgba(255, 111, 0, 0.9));
}

.spin-button-trigger:active .spin-btn-img {
    transform: scale(0.94);
}

.spin-button-trigger:disabled {
    cursor: not-allowed;
}

.spin-button-trigger:disabled .spin-btn-img {
    filter: grayscale(1) brightness(0.6);
    animation: none;
}

@keyframes btnPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(255, 111, 0, 0.4)); }
    50% { transform: scale(1.04); filter: drop-shadow(0 0 15px rgba(255, 111, 0, 0.75)); }
}

/* Flashing Light Dots (12 bulbs aligned with frame bulbs) */
.wheel-border-lights {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.light-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 0 8px #fff;
    transform-origin: center;
    left: calc(50% - 2.5px);
    top: calc(50% - 2.5px);
    transform: rotate(var(--angle)) translateY(-135px);
}

@media (min-width: 360px) {
    .light-dot {
        transform: rotate(var(--angle)) translateY(-150px);
    }
}

@media (min-width: 480px) {
    .light-dot {
        width: 7px;
        height: 7px;
        left: calc(50% - 3.5px);
        top: calc(50% - 3.5px);
        transform: rotate(var(--angle)) translateY(-201px);
    }
}

@media (min-height: 800px) and (min-width: 480px) {
    .light-dot {
        transform: rotate(var(--angle)) translateY(-220px);
    }
}

/* Alternating bulb flashing animations */
.light-dot.even {
    animation: flashEven 0.8s infinite steps(1);
    background-color: #ffd700;
    box-shadow: 0 0 8px #ffd700, 0 0 15px #ff9800;
}

.light-dot.odd {
    animation: flashOdd 0.8s infinite steps(1);
    background-color: #ffffff;
    box-shadow: 0 0 8px #ffffff;
}

@keyframes flashEven {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; filter: brightness(1.3); }
}

@keyframes flashOdd {
    0%, 100% { opacity: 1; filter: brightness(1.3); }
    50% { opacity: 0.3; }
}

/* Dynamic Live Winner Ticker Overlay */
.live-ticker-overlay {
    background: rgba(3, 20, 11, 0.9);
    border: 1px solid var(--border-glass);
    border-radius: 40px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    max-width: 320px;
    width: 90%;
    z-index: 10;
}

.pulse-green-dot {
    width: 8px;
    height: 8px;
    background-color: #4caf50;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #4caf50;
    animation: pulseDot 1.5s infinite;
    flex-shrink: 0;
}

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

.ticker-wrapper {
    overflow: hidden;
    width: 100%;
    height: 24px;
    position: relative;
}

.ticker-track {
    display: flex;
    flex-direction: column;
    position: absolute;
    width: 100%;
    transition: transform 0.5s ease-in-out;
}

.ticker-item {
    font-size: 0.8rem;
    font-weight: 600;
    height: 24px;
    line-height: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticker-name {
    color: var(--white);
}

.ticker-prize {
    color: #4caf50;
    font-weight: 800;
    margin-left: 8px;
}

/* POPUPS / MODAIS (OVERLAYS AND CARDS) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

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

.glass-card {
    background: radial-gradient(circle at top left, rgba(12, 38, 25, 0.95) 0%, rgba(5, 18, 12, 0.98) 100%);
    border: 2px solid var(--accent-gold);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 
                0 0 30px rgba(12, 184, 96, 0.2);
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    padding: 25px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Glassmorphism background decor */
.glass-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,0.03) 0%, transparent 60%);
    pointer-events: none;
}

/* Scale Up Animation for Modals */
.animate-scale-up {
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* Icons & Typography for Modals */
.modal-header-decor {
    margin-bottom: 12px;
}

.modal-icon {
    font-size: 3rem;
    display: inline-block;
}

.warning-icon {
    filter: drop-shadow(0 0 10px rgba(255, 170, 0, 0.5));
    animation: rotateWarning 3s infinite linear;
}

@keyframes rotateWarning {
    0%, 80%, 100% { transform: rotate(0deg); }
    85% { transform: rotate(-15deg); }
    90% { transform: rotate(15deg); }
    95% { transform: rotate(-15deg); }
}

.win-icon {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.7));
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.modal-message {
    font-size: 1.05rem;
    color: var(--white);
    margin-bottom: 10px;
    line-height: 1.4;
}

.modal-submessage {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.4;
}

.highlight-loss {
    color: #ff5722;
    text-shadow: 0 0 10px rgba(255, 87, 34, 0.3);
}

/* Modals Buttons */
.modal-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.btn-glow {
    background: linear-gradient(135deg, #ffd700 0%, #ff8800 100%);
    color: #041a0f;
    box-shadow: 0 5px 20px rgba(255, 136, 0, 0.4), 
                0 0 10px rgba(255, 215, 0, 0.2) inset;
    animation: btnPulse 1.5s infinite;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 136, 0, 0.6), 
                0 0 15px rgba(255, 215, 0, 0.4) inset;
}

/* Win Modal Specifics */
.win-modal {
    border-color: #ffd700;
    box-shadow: 0 15px 50px rgba(0,0,0,0.9), 0 0 40px rgba(255, 215, 0, 0.4);
}

.prize-card {
    background: linear-gradient(135deg, rgba(255,215,0,0.1) 0%, rgba(255,111,0,0.1) 100%);
    border: 2px dashed var(--accent-gold);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.prize-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.prize-value {
    font-size: 2.4rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    line-height: 1.1;
    margin-bottom: 5px;
}

.prize-desc {
    font-size: 0.85rem;
    color: var(--white);
    font-weight: 600;
}

.urgency-counter {
    background-color: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: inline-block;
}

.btn-win-cta {
    background: linear-gradient(135deg, #00c853 0%, #00b0ff 100%);
    color: var(--white);
    font-size: 1.1rem;
    box-shadow: 0 5px 25px rgba(0, 200, 83, 0.4);
    border: 1px solid rgba(255,255,255,0.2);
    animation: btnPulse 1.5s infinite;
}

.btn-win-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 200, 83, 0.7);
    filter: brightness(1.1);
}

/* Micro animations */
.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-pulse {
    animation: pulseGlow 1.5s infinite alternate;
}

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

@keyframes pulseGlow {
    0% { transform: scale(1); text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    100% { transform: scale(1.03); text-shadow: 0 0 20px rgba(255, 215, 0, 0.9), 0 0 10px #ff6f00; }
}

/* Confetti Styles */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.confetti-piece {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #ffd700;
    opacity: 0.7;
    animation: confettiFall 4s infinite ease-out;
}

@keyframes confettiFall {
    0% { transform: translateY(-30px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(300px) rotate(360deg); opacity: 0; }
}
