html,
body {
  height: 100%;
  width: 100%;
    font-family: "Rubik", "Roboto", sans-serif !important;
}
body {
  display: flex;
  flex-direction: column;
  background-color: #00142c;
  color: #828fa0;
}
body > nav,
body > footer {
  flex-shrink: 1;
}
body > main {
  flex-shrink: 1;
  flex-grow: 1;
  overflow: auto;
}
footer {
  background-color: transparent;
  color: white;
  font-weight: 500;
  margin-top: 1em;
}

/* Material Design 3 color tokens (custom) */
:root {
    --md-primary: #1976d2;
    --md-primary-rgb: 25,118,210;
    --md-on-primary: #ffffff;
    --md-secondary: #455a64;
    --md-surface: #0f1b2b;
    --md-surface-alt: #14273d;
    --md-border: rgba(255,255,255,0.08);
    --md-radius-sm: 6px;
    --md-radius-md: 12px;
    --md-radius-lg: 18px;
    --md-shadow-sm: 0 2px 4px rgba(0,0,0,0.12);
    --md-shadow-md: 0 4px 12px rgba(0,0,0,0.18);
    --md-shadow-lg: 0 10px 28px rgba(0,0,0,0.24);
}

/* Elevation helper classes */
.elevate-sm { box-shadow: var(--md-shadow-sm); }
.elevate-md { box-shadow: var(--md-shadow-md); }
.elevate-lg { box-shadow: var(--md-shadow-lg); }

/* Button override to look more Material with our gradient */
.btn-primary, .btn-draw {
    background: linear-gradient(145deg, var(--md-primary) 0%, #2196f3 60%, #64b5f6 100%) !important;
    color: var(--md-on-primary) !important;
    border: none !important;
    border-radius: var(--md-radius-lg) !important;
    font-weight: 600;
    letter-spacing: .5px;
    transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s;
}
.btn-primary:hover, .btn-draw:hover {
    transform: translateY(-3px);
    box-shadow: var(--md-shadow-lg);
}
.btn-outline-secondary {
    border-radius: var(--md-radius-lg) !important;
    border-color: var(--md-border) !important;
    color: #cfd8dc !important;
}
.btn-outline-secondary:hover {
    background: var(--md-surface-alt) !important;
    border-color: #90a4ae !important;
}

/* Card refinement */
.card {
    border-radius: var(--md-radius-md) !important;
    border: 1px solid var(--md-border);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.card:hover {
    box-shadow: var(--md-shadow-md);
}

/* Navbar styling */
nav.navbar {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    background: linear-gradient(120deg, rgba(25,118,210,0.85), rgba(17,45,78,0.85)) !important;
    border-bottom: 1px solid var(--md-border);
}
nav .nav-link {
    font-weight: 500;
    letter-spacing: .4px;
    border-radius: var(--md-radius-sm);
    padding: .6rem 1rem;
    transition: background-color .25s;
}
nav .nav-link.active, nav .nav-link:hover {
    background: rgba(255,255,255,0.12);
}

/* Footer styling */
footer {
    background: linear-gradient(180deg, rgba(20,39,61,.6), rgba(15,27,43,.9));
    padding: 2.2rem 0;
    border-top: 1px solid var(--md-border);
}
footer .text-center { font-size: .85rem; letter-spacing: .6px; }

/* Draw area styling */
#raffle-draw {
    background: linear-gradient(135deg, #f6f9ff 0%, #e9f2ff 50%, #fff6f0 100%);
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.12);
}

/* ticket list improvements: hide native scrollbar, snap children to center */
#ticket-list {
    gap: 12px;
    padding: 18px 12px;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    display: flex;
    align-items: center;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    position: relative;
    min-height: 220px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

/* Only enable scroll snap when not animating - controlled by JS */
#ticket-list.snap-enabled {
    scroll-snap-type: x proximity; /* reduce strict snapping to avoid disappearance jitter */
    scroll-behavior: smooth;
}

#ticket-list::-webkit-scrollbar {
    display: none;
}

.ticket-item {
    min-width: 260px;
    max-width: 260px;
    flex: 0 0 auto;
    scroll-snap-align: center;
    margin: 0 8px;
}

.ticket-item .card {
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    backface-visibility: hidden;
    transform: translateZ(0);
    border: 1px solid rgba(16, 24, 40, 0.08);
    /* Only transition properties that don't conflict with animation */
    transition: box-shadow .2s ease, border-color .2s ease;
}

/* Only apply hover transform when NOT animating */
#ticket-list:not(.animating) .ticket-item .card:hover {
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.16);
    border-color: rgba(16, 24, 40, 0.12);
}

.item-code {
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 20px;
    color: #0b3b84;
}

.item-name {
    font-size: 14px;
    color: #334155;
}

.avatar {
    font-size: 18px;
}

.highlight-item .card {
    box-shadow: 0 0 20px rgba(255, 192, 32, 0.95), 0 6px 20px rgba(16, 24, 40, 0.12) !important;
    transform: scale(1.08) translateZ(0) !important;
    border: 3px solid rgba(255, 192, 32, 0.6) !important;
    /* No transition - instant visual feedback */
}

/* Ensure hover doesn't interfere with highlight */
.highlight-item .card:hover {
    transform: scale(1.08) translateZ(0) !important;
    box-shadow: 0 0 20px rgba(255, 192, 32, 0.95), 0 6px 20px rgba(16, 24, 40, 0.12) !important;
}

/* heading & button */
#raffle-draw h1 {
    font-weight: 800;
    letter-spacing: -1px;
}

.btn-draw {
    background: linear-gradient(90deg, #0066ff, #00a3ff);
    border: none;
    box-shadow: 0 8px 20px rgba(3, 102, 214, 0.18);
    transition: all 0.2s ease;
    font-weight: 600;
}

.btn-draw:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(3, 102, 214, 0.25);
}

.btn-draw:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.meta {
    font-size: 14px;
    color: #0f172a;
    opacity: .85;
}

/* modal: larger, centered and visually appealing */
.modal .modal-content {
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, #f6fbff 60%);
    border: none;
    box-shadow: 0 20px 60px rgba(2, 10, 40, 0.2);
    padding: 20px;
    /* added padding so content breathes */
}

/* dialog width only, let height wrap content */
.modal-dialog.modal-center {
    max-width: 60vw;
    width: 60vw;
    display: flex;
    align-items: center;
}

/* let modal height auto (wrap content) */
.modal-content {
    height: auto;
}

/* normal modal body padding and vertical spacing */
.modal-body {
    padding: 0;
    display: block;
}

/* winner banner */
#winner-banner {
    position: relative;
    text-align: center;
    padding: 28px 20px;
    background: linear-gradient(90deg, rgba(255, 243, 224, 0.9), rgba(240, 255, 250, 0.6));
}

/* Big uppercase congratulations */
#winner-banner .congrats {
    display: block;
    font-weight: 900;
    letter-spacing: 1px;
    color: #032a4d;
    text-transform: uppercase;
    font-size: 48px;
    /* large */
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

/* code and name styling */
#winner-banner .hero-code {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #032a4d;
    margin-top: 6px;
}

#winner-banner .hero-name {
    font-size: 20px;
    color: #086e53;
    margin-top: 6px;
}

/* details and CTAs */
#winner-details {
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
}

.winner-ctas {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 18px 0 28px;
}

.winner-ctas .btn {
    min-width: 160px;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Old modal styles for backward compatibility */
div#win_template {
  width: 100%;
  height: 100%;
  color: burlywood;
  position: relative;
}

div#win_template > img {
  width: 100%;
  object-fit: contain;
}
div#winner_name {
  position: absolute;
  bottom: 8em;
  z-index: 2;
  color: #000;
  width: 100%;
  text-align: center;
  text-shadow: 2px 2px 5px #000;
}
div#winner_greet {
  position: absolute;
  top: 4em;
  z-index: 2;
  width: 100%;
  color: #000;
}
#winner_code {
    font-size: 5rem;
    color: #000;
}

@media (max-width: 576px) {
    .ticket-item {
        min-width: 200px;
        max-width: 200px;
    }

    #raffle-draw {
        padding: 16px;
    }

    h1 {
        font-size: 36px !important;
    }
}
#raffle-draw {
    background: linear-gradient(135deg, #f6f9ff 0%, #e9f2ff 50%, #fff6f0 100%);
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.12);
}

/* ticket list improvements: hide native scrollbar, snap children to center */
#ticket-list {
    gap: 12px;
    padding: 18px;
    overflow-x: auto;
    display: flex;
    align-items: center;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
    /* Remove duplicate scroll snap here; controlled by .snap-enabled variant */
}

#ticket-list::-webkit-scrollbar {
    display: none;
}

.ticket-item {
    min-width: 260px;
    max-width: 260px;
    flex: 0 0 auto;
    scroll-snap-align: center;
    /* keep the highlighted item centered */
    margin: 0 8px;
}

.ticket-item .card {
    border-radius: 10px;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.ticket-item .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.12);
}

.item-code {
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 20px;
    color: #0b3b84;
}

.item-name {
    font-size: 14px;
    color: #334155;
}

.highlight-item .card {
    box-shadow: 0 0 18px rgba(255, 192, 32, 0.95), 0 6px 20px rgba(16, 24, 40, 0.12);
    transform: scale(1.06);
    border: 2px solid rgba(255, 192, 32, 0.15);
}

/* heading & button */
#raffle-draw h1 {
    font-weight: 800;
    letter-spacing: -1px;
}

.btn-draw {
    background: linear-gradient(90deg, #0066ff, #00a3ff);
    border: none;
    box-shadow: 0 8px 20px rgba(3, 102, 214, 0.18);
}

.btn-draw:hover {
    transform: translateY(-2px);
}

.meta {
    font-size: 14px;
    color: #0f172a;
    opacity: .85;
}

/* modal: larger, centered and visually appealing */
.modal .modal-content {
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, #f6fbff 60%);
    border: none;
    box-shadow: 0 20px 60px rgba(2, 10, 40, 0.2);
    padding: 20px;
    /* added padding so content breathes */
}

/* dialog width only, let height wrap content */
.modal-dialog.modal-center {
    max-width: 60vw;
    width: 60vw;
    display: flex;
    align-items: center;
}

/* let modal height auto (wrap content) */
.modal-content {
    height: auto;
}

/* normal modal body padding and vertical spacing */
.modal-body {
    padding: 0;
    display: block;
}

/* winner banner */
#winner-banner {
    position: relative;
    text-align: center;
    padding: 28px 20px;
    background: linear-gradient(90deg, rgba(255, 243, 224, 0.9), rgba(240, 255, 250, 0.6));
}

/* Big uppercase congratulations */
#winner-banner .congrats {
    display: block;
    font-weight: 900;
    letter-spacing: 1px;
    color: #032a4d;
    text-transform: uppercase;
    font-size: 48px;
    /* large */
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

/* code and name styling */
#winner-banner .hero-code {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #032a4d;
    margin-top: 6px;
}

#winner-banner .hero-name {
    font-size: 20px;
    color: #086e53;
    margin-top: 6px;
}

/* details and CTAs */
#winner-details {
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
}

.winner-ctas {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 18px 0 28px;
}

.winner-ctas .btn {
    min-width: 160px;
}

.modal-backdrop.show {
    opacity: 0.5;
}

@media (max-width: 576px) {
    .ticket-item {
        min-width: 200px;
        max-width: 200px;
    }

    #raffle-draw {
        padding: 16px;
    }

    h1 {
        font-size: 36px !important;
    }
}