/* ============================================
   CASINO JACKPOT DISPLAY - MAIN STYLES
   Premium Casino Look
   ============================================ */

/* Local fonts — no CDN dependency. */
@font-face {
    font-family: 'Bebas Neue';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('../assets/fonts/BebasNeue-Regular.ttf') format('truetype');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: block;
    src: url('../assets/fonts/Montserrat-700.ttf') format('truetype');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 800;
    font-display: block;
    src: url('../assets/fonts/Montserrat-800.ttf') format('truetype');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 900;
    font-display: block;
    src: url('../assets/fonts/Montserrat-900.ttf') format('truetype');
}
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('../assets/fonts/Oswald-400.ttf') format('truetype');
}
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 500;
    font-display: block;
    src: url('../assets/fonts/Oswald-500.ttf') format('truetype');
}
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 600;
    font-display: block;
    src: url('../assets/fonts/Oswald-600.ttf') format('truetype');
}
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 700;
    font-display: block;
    src: url('../assets/fonts/Oswald-700.ttf') format('truetype');
}

:root {
    /* Gold Theme */
    --gold-light: #FFD700;
    --gold-main: #FFA500;
    --gold-dark: #CC8400;
    --gold-glow: rgba(255, 215, 0, 0.8);

    /* Jackpot Colors */
    --mega-primary: #FF0066;
    --mega-secondary: #FF3399;
    --mega-glow: rgba(255, 0, 102, 0.8);

    --major-primary: #00CCFF;
    --major-secondary: #66DDFF;
    --major-glow: rgba(0, 204, 255, 0.8);

    --minor-primary: #00FF88;
    --minor-secondary: #66FFAA;
    --minor-glow: rgba(0, 255, 136, 0.8);

    /* Background */
    --bg-dark: #0a0a1a;

    /* Text */
    --text-white: #FFFFFF;
    --text-shadow-gold: 0 0 10px var(--gold-glow), 0 0 20px var(--gold-glow), 0 0 40px var(--gold-main);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    font-family: 'Montserrat', sans-serif;
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ============================================
   PIXI CANVAS CONTAINER
   ============================================ */

#pixi-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#pixi-container canvas {
    display: block;
}

#coin-animation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.jackpot-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 15px 60px;
}

/* Canvas-only layout: jackpot cards live on the Pixi canvas, DOM
   container only holds the recent-wins panel pinned to the bottom. */
.jackpot-container-canvas-only {
    justify-content: flex-end;
    pointer-events: none;
}
.jackpot-container-canvas-only .recent-wins {
    pointer-events: auto;
}

/* ============================================
   JACKPOTS WRAPPER
   ============================================ */

.jackpots-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    padding: 10px 0;
}

.jackpots-wrapper.single-jackpot {
    justify-content: center;
}

.jackpots-wrapper.single-jackpot .jackpot-card {
    padding: 40px 60px;
}

.jackpots-wrapper.single-jackpot .jackpot-name {
    font-size: clamp(2rem, 5vw, 4rem);
}

.jackpots-wrapper.single-jackpot .digit {
    font-size: clamp(5rem, 15vw, 12rem);
}

.jackpots-wrapper.dual-jackpots {
    justify-content: center;
    gap: 20px;
}

.jackpots-wrapper.triple-jackpots {
    justify-content: center;
    gap: 12px;
}

.jackpots-wrapper.triple-jackpots .jackpot-card {
    padding: 12px 30px;
}

.jackpots-wrapper.triple-jackpots .jackpot-name {
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    margin-bottom: 5px;
}

.jackpots-wrapper.triple-jackpots .digit {
    font-size: clamp(2rem, 6vw, 4.5rem);
}

.jackpots-wrapper.triple-jackpots .currency-symbol {
    font-size: clamp(1.5rem, 4vw, 3rem);
}

.jackpots-wrapper.triple-jackpots .separator {
    font-size: clamp(1.5rem, 5vw, 3.5rem);
}

/* ============================================
   JACKPOT CARD
   ============================================ */

.jackpot-card {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.9) 0%, rgba(40, 20, 60, 0.9) 100%);
    border-radius: 16px;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.jackpot-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--card-color), transparent 30%);
    animation: cardRotate 4s linear infinite;
    opacity: 0.3;
}

@keyframes cardRotate {
    100% { transform: rotate(360deg); }
}

.jackpot-card::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.98) 0%, rgba(35, 15, 55, 0.98) 100%);
    border-radius: 13px;
    z-index: 1;
}

/* Jackpot Types */
.jackpot-card.mega {
    --card-color: var(--mega-primary);
    border-color: var(--mega-primary);
    box-shadow: 0 0 40px var(--mega-glow), inset 0 0 40px rgba(255, 0, 102, 0.15);
}

.jackpot-card.major {
    --card-color: var(--major-primary);
    border-color: var(--major-primary);
    box-shadow: 0 0 40px var(--major-glow), inset 0 0 40px rgba(0, 204, 255, 0.15);
}

.jackpot-card.minor {
    --card-color: var(--minor-primary);
    border-color: var(--minor-primary);
    box-shadow: 0 0 40px var(--minor-glow), inset 0 0 40px rgba(0, 255, 136, 0.15);
}

.jackpot-card:hover {
    transform: scale(1.01);
}

.jackpot-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

/* ============================================
   JACKPOT NAME - Premium Font
   ============================================ */

.jackpot-name {
    font-family: 'Bebas Neue', 'Oswald', sans-serif;
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 8px;
    font-weight: 400;
}

.jackpot-card.mega .jackpot-name {
    color: var(--mega-primary);
    text-shadow: 0 0 15px var(--mega-glow), 0 0 30px var(--mega-glow);
}

.jackpot-card.major .jackpot-name {
    color: var(--major-primary);
    text-shadow: 0 0 15px var(--major-glow), 0 0 30px var(--major-glow);
}

.jackpot-card.minor .jackpot-name {
    color: var(--minor-primary);
    text-shadow: 0 0 15px var(--minor-glow), 0 0 30px var(--minor-glow);
}

/* ============================================
   JACKPOT AMOUNT - DIGIT DISPLAY
   ============================================ */

.jackpot-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-wrap: nowrap;
}

.currency-symbol {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.8rem, 5vw, 4rem);
    font-weight: 800;
    margin-right: 8px;
}

.jackpot-card.mega .currency-symbol {
    color: var(--mega-secondary);
    text-shadow: 0 0 20px var(--mega-glow);
}

.jackpot-card.major .currency-symbol {
    color: var(--major-secondary);
    text-shadow: 0 0 20px var(--major-glow);
}

.jackpot-card.minor .currency-symbol {
    color: var(--minor-secondary);
    text-shadow: 0 0 20px var(--minor-glow);
}

.digit-container {
    display: inline-flex;
    position: relative;
}

.digit {
    font-family: 'Oswald', 'Montserrat', sans-serif;
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1;
    display: inline-block;
    min-width: 0.6em;
    text-align: center;
    position: relative;
    transition: transform 0.1s ease;
}

.digit.updating {
    animation: digitFlip 0.3s ease-out;
}

@keyframes digitFlip {
    0% { transform: translateY(-15px); opacity: 0; }
    50% { transform: translateY(3px); }
    100% { transform: translateY(0); opacity: 1; }
}

.jackpot-card.mega .digit {
    color: #FFFFFF;
    text-shadow:
        0 0 10px var(--mega-glow),
        0 0 25px var(--mega-glow),
        0 0 50px var(--mega-primary),
        0 0 100px var(--mega-primary);
}

.jackpot-card.major .digit {
    color: #FFFFFF;
    text-shadow:
        0 0 10px var(--major-glow),
        0 0 25px var(--major-glow),
        0 0 50px var(--major-primary),
        0 0 100px var(--major-primary);
}

.jackpot-card.minor .digit {
    color: #FFFFFF;
    text-shadow:
        0 0 10px var(--minor-glow),
        0 0 25px var(--minor-glow),
        0 0 50px var(--minor-primary),
        0 0 100px var(--minor-primary);
}

.separator {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 700;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   RECENT WINS PANEL
   ============================================ */

.recent-wins {
    flex-shrink: 0;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.recent-wins-header {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--gold-light);
    text-shadow: 0 0 10px var(--gold-glow);
    letter-spacing: 0.2em;
    margin-bottom: 12px;
    text-align: center;
}

.recent-wins-list {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.win-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(20, 20, 40, 0.8);
    border-radius: 10px;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 280px;
}

.win-item.mega {
    border-color: var(--mega-primary);
    box-shadow: 0 0 15px rgba(255, 0, 102, 0.3);
}

.win-item.major {
    border-color: var(--major-primary);
    box-shadow: 0 0 15px rgba(0, 204, 255, 0.3);
}

.win-item.minor {
    border-color: var(--minor-primary);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.win-type-badge {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 400;
}

.win-item.mega .win-type-badge {
    background: var(--mega-primary);
    color: white;
}

.win-item.major .win-type-badge {
    background: var(--major-primary);
    color: white;
}

.win-item.minor .win-type-badge {
    background: var(--minor-primary);
    color: white;
}

.win-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.win-amount {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    font-weight: 600;
    color: white;
}

.win-info {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    gap: 15px;
}

.win-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.win-info .label {
    color: rgba(255, 255, 255, 0.4);
}

/* Empty state - no wins yet */
/* Placeholder for a jackpot type that hasn't been won yet.
   Keeps the type-coloured border but drops the glow, switches to a
   dashed outline, and fades the contents — visually communicates
   "slot is reserved" without competing with real wins for attention. */
.win-item.empty {
    border-style: dashed;
    box-shadow: none;
    opacity: 0.55;
    background: rgba(255, 255, 255, 0.02);
}

.win-item.empty .win-type-badge {
    opacity: 0.7;
    filter: saturate(0.6);
}

.win-item.empty .win-amount {
    color: rgba(255, 255, 255, 0.55);
    font-style: italic;
    font-size: 0.95em;
}

.win-item.empty .win-info {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* ============================================
   CELEBRATION OVERLAY
   ============================================ */

.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.celebration-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Neo Effects Layer - inside overlay, behind text */
#neo-effects-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#neo-effects-container canvas {
    width: 100%;
    height: 100%;
}

.winner-announcement {
    text-align: center;
    z-index: 2;
    position: relative;
    animation: winnerBounce 0.5s ease-out;
}

@keyframes winnerBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.winner-announcement h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 10vw, 8rem);
    color: var(--gold-light);
    text-shadow: var(--text-shadow-gold);
    margin-bottom: 20px;
    letter-spacing: 0.2em;
    animation: winnerPulse 0.4s ease-in-out infinite;
}

/* Jackpot title colors by type */
.winner-announcement h2.mega {
    color: var(--mega-primary);
    text-shadow: 0 0 20px var(--mega-glow), 0 0 40px var(--mega-glow), 0 0 80px var(--mega-primary);
}

.winner-announcement h2.major {
    color: var(--major-primary);
    text-shadow: 0 0 20px var(--major-glow), 0 0 40px var(--major-glow), 0 0 80px var(--major-primary);
}

.winner-announcement h2.minor {
    color: var(--minor-primary);
    text-shadow: 0 0 20px var(--minor-glow), 0 0 40px var(--minor-glow), 0 0 80px var(--minor-primary);
}

@keyframes winnerPulse {
    0%, 100% { transform: scale(1); text-shadow: var(--text-shadow-gold); }
    50% { transform: scale(1.03); text-shadow: 0 0 20px var(--gold-glow), 0 0 40px var(--gold-glow), 0 0 80px var(--gold-main); }
}

.winner-amount {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 700;
    color: #FFFFFF;
    text-shadow:
        0 0 15px var(--gold-glow),
        0 0 40px var(--gold-glow),
        0 0 80px var(--gold-main);
}

/* Winning tickets list in celebration overlay */
.winning-tickets {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.winning-ticket {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 12px 25px;
    border: 2px solid;
    animation: ticketAppear 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.winning-ticket.mega {
    border-color: var(--mega-primary);
    box-shadow: 0 0 30px var(--mega-glow), 0 0 60px rgba(255, 0, 102, 0.4);
    padding: 18px 40px;
    border-width: 3px;
}

.winning-ticket.major {
    border-color: var(--major-primary);
    box-shadow: 0 0 25px var(--major-glow);
    padding: 15px 32px;
    border-width: 2px;
}

.winning-ticket.minor {
    border-color: var(--minor-primary);
    box-shadow: 0 0 20px var(--minor-glow);
    padding: 12px 25px;
    border-width: 2px;
}

.winning-ticket .ticket-type {
    font-family: 'Bebas Neue', sans-serif;
    padding: 5px 12px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.winning-ticket.mega .ticket-type {
    background: var(--mega-primary);
    color: white;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    padding: 6px 15px;
}

.winning-ticket.major .ticket-type {
    background: var(--major-primary);
    color: white;
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    padding: 5px 13px;
}

.winning-ticket.minor .ticket-type {
    background: var(--minor-primary);
    color: white;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    padding: 5px 12px;
}

.winning-ticket .ticket-info {
    font-family: 'Montserrat', sans-serif;
    color: rgba(255, 255, 255, 0.9);
}

.winning-ticket.mega .ticket-info {
    font-size: clamp(0.95rem, 1.8vw, 1.2rem);
}

.winning-ticket.major .ticket-info {
    font-size: clamp(0.85rem, 1.6vw, 1.05rem);
}

.winning-ticket.minor .ticket-info {
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
}

.winning-ticket .ticket-amount {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    color: white;
}

.winning-ticket.mega .ticket-amount {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.winning-ticket.major .ticket-amount {
    font-size: clamp(1.3rem, 2.7vw, 1.9rem);
}

.winning-ticket.minor .ticket-amount {
    font-size: clamp(1.2rem, 2.5vw, 1.7rem);
}

@keyframes ticketAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shine animation for recent wins */
.win-item.shine {
    position: relative;
    overflow: hidden;
}

.win-item.shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shineEffect 0.8s ease-out;
}

@keyframes shineEffect {
    to {
        left: 100%;
    }
}

/* ============================================
   PERFORMANCE OVERRIDES
   ----------------------------------------------
   text-shadow blur radius is in px, not em. When .digit grows
   3x in single-jackpot mode (12rem vs 4.5rem in triple), the
   100px blur produces an enormous paint area that re-rasterises
   every time the digit text changes (20Hz). The conic-gradient
   on ::before also scales with card size and repaints every
   frame of its 4s rotation. Both are scoped down for single.
   ============================================ */

/* Smaller blur radii for single-jackpot digits (visually similar
   glow, ~4x less paint area). */
.jackpots-wrapper.single-jackpot .jackpot-card.mega .digit {
    text-shadow:
        0 0 8px var(--mega-glow),
        0 0 20px var(--mega-glow),
        0 0 40px var(--mega-primary);
}

.jackpots-wrapper.single-jackpot .jackpot-card.major .digit {
    text-shadow:
        0 0 8px var(--major-glow),
        0 0 20px var(--major-glow),
        0 0 40px var(--major-primary);
}

.jackpots-wrapper.single-jackpot .jackpot-card.minor .digit {
    text-shadow:
        0 0 8px var(--minor-glow),
        0 0 20px var(--minor-glow),
        0 0 40px var(--minor-primary);
}

/* Kill the rotating conic-gradient halo in single mode — at full
   card size it's the single most expensive per-frame paint. The
   static box-shadow border glow already carries the look. */
.jackpots-wrapper.single-jackpot .jackpot-card::before {
    animation: none;
    opacity: 0.15;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .jackpot-container {
        padding: 15px 30px;
    }

    .jackpot-card {
        padding: 15px 25px;
    }

    .jackpots-wrapper {
        gap: 12px;
    }
}

@media (max-height: 700px) {
    .jackpot-container {
        padding: 10px 40px;
    }

    .jackpot-card {
        padding: 10px 25px;
    }

    .jackpot-name {
        margin-bottom: 5px;
        font-size: clamp(0.9rem, 2vw, 1.5rem);
    }

    .jackpots-wrapper.triple-jackpots .digit {
        font-size: clamp(1.8rem, 5vw, 3.5rem);
    }

    .footer {
        padding: 5px 0;
    }
}

@media (max-height: 600px) {
    .recent-wins {
        padding: 10px 0;
    }

    .recent-wins-header {
        font-size: clamp(0.8rem, 1.5vw, 1rem);
        margin-bottom: 8px;
    }

    .win-item {
        padding: 8px 12px;
        min-width: 240px;
    }

    .win-amount {
        font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    }
}

@media (max-height: 500px) {
    .recent-wins {
        display: none;
    }

    .jackpots-wrapper {
        gap: 8px;
    }

    .jackpots-wrapper.triple-jackpots .jackpot-card {
        padding: 8px 20px;
    }

    .jackpots-wrapper.triple-jackpots .jackpot-name {
        font-size: clamp(0.8rem, 1.8vw, 1.2rem);
    }

    .jackpots-wrapper.triple-jackpots .digit {
        font-size: clamp(1.5rem, 4vw, 2.8rem);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

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