@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Inter:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1438 50%, #0f0c29 100%);
    background-color: #0a0e27;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

/* Advanced Scrollbar (Global) */
html {
    /* Firefox */
    scrollbar-width: thin; /* auto | thin | none */
    scrollbar-color: #667eea rgba(26, 20, 56, 0.35); /* thumb | track */
    /* Reserve space only on the scrollbar side to avoid left-side gap */
    scrollbar-gutter: stable;
    /* Ensure overscroll areas match site theme on mobile */
    height: 100%;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1438 50%, #0f0c29 100%);
    background-color: #0a0e27;
    overscroll-behavior-y: contain;
}

/* Footer */
.site-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    background: rgba(26, 20, 56, 0.6);
    border-top: 1px solid rgba(138, 43, 226, 0.3);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.85);
}

/* Footer brand (© 2025 BallPulls) */
.footer-brand {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.18);
    letter-spacing: 0.3px;
}

.footer-link {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(102,126,234,0.25), rgba(118,75,162,0.25));
    border: 1px solid rgba(138, 43, 226, 0.4);
    transition: all 0.2s ease;
}

.footer-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(102, 126, 234, 0.25);
}

/* Elegant disclaimer pill */
.footer-disclaimer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    color: #ffd700;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 18px rgba(255, 215, 0, 0.12) inset;
}

.footer-disclaimer .icon {
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.35));
}

.tos-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tos-body ul {
    margin-left: 20px;
    display: grid;
    gap: 8px;
}

/* WebKit Browsers: Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 20, 56, 0.35);
    border-radius: 12px;
    margin: 2px; /* creates rounded track ends */
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    border: 2px solid rgba(10, 14, 39, 0.6);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35), inset 0 0 6px rgba(255, 255, 255, 0.12);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #8aa0f5, #8a69d3);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Touch-friendly adjustments */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: rgba(15, 12, 41, 0.95);
    border-right: 1px solid rgba(138, 43, 226, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(138, 43, 226, 0.3);
}

.sidebar-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(138, 43, 226, 0.1);
    color: #fff;
    border-left-color: #764ba2;
}

.nav-item.active {
    background: rgba(138, 43, 226, 0.2);
    color: #fff;
    border-left-color: #667eea;
}

.nav-icon {
    font-size: 1.5rem;
    margin-right: 12px;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-bar {
    position: sticky;
    top: 0;
    background: rgba(15, 12, 41, 0.95);
    border-bottom: 1px solid rgba(138, 43, 226, 0.3);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn-auth {
    padding: 8px 20px;
    border: 1px solid rgba(138, 43, 226, 0.5);
    background: transparent;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-auth:hover {
    background: rgba(138, 43, 226, 0.2);
    border-color: #764ba2;
}

.btn-auth.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
}

.btn-auth.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu span {
    font-weight: 600;
    color: #ffd700;
}

.btn-logout {
    padding: 8px 15px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Stats Panel */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(26, 20, 56, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(138, 43, 226, 0.6);
}

.stat-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glow-card {
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.2);
}

/* Header */
.header {
    text-align: center;
    margin: 40px 0;
}

.title {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 10px;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    display: block;
    font-size: 3rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

/* Countdown */
.countdown-section {
    background: rgba(26, 20, 56, 0.6);
    border: 2px solid rgba(138, 43, 226, 0.4);
    border-radius: 25px;
    padding: 40px;
    margin: 40px 0;
    backdrop-filter: blur(15px);
}

.countdown-label {
    text-align: center;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    font-weight: 600;
}

.countdown-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.time-block {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border: 2px solid rgba(138, 43, 226, 0.5);
    border-radius: 15px;
    padding: 20px 30px;
    text-align: center;
    min-width: 120px;
}

.time-value {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.time-label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.time-separator {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: rgba(138, 43, 226, 0.8);
    font-weight: 700;
}

/* Control Panel */
.control-panel {
    text-align: center;
    margin: 50px 0;
}

.ticket-selector {
    margin-bottom: 30px;
}

.ticket-selector label {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.ticket-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ticket-btn {
    font-family: 'Orbitron', sans-serif;
    background: rgba(26, 20, 56, 0.6);
    border: 2px solid rgba(138, 43, 226, 0.4);
    color: #fff;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.ticket-btn:hover {
    background: rgba(138, 43, 226, 0.3);
    border-color: rgba(138, 43, 226, 0.8);
    transform: translateY(-3px);
}

.ticket-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    box-shadow: 0 5px 25px rgba(102, 126, 234, 0.5);
}

.generate-btn {
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border: none;
    color: #0a0e27;
    padding: 20px 50px;
    border-radius: 50px;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.4);
}

.generate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.6);
}

.btn-icon {
    font-size: 1.8rem;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20%, 100% { left: 100%; }
}

/* Loading */
.loading-container {
    text-align: center;
    padding: 60px 0;
}

.loader {
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
    position: relative;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.loader-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: #764ba2;
    animation-delay: -0.5s;
}

.loader-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: #ffd700;
    animation-delay: -1s;
}

.loader-ball {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: ballPulse 1s infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes ballPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.loading-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Results */
.results-section {
    margin: 50px 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.results-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-share {
    padding: 12px 30px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: #fff;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-share:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
}

.tickets-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.ticket {
    background: rgba(26, 20, 56, 0.6);
    border: 2px solid rgba(138, 43, 226, 0.4);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    animation: ticketAppear 0.5s ease-out backwards;
}

@keyframes ticketAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.numbers-display {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.number-ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

.number-ball.powerball {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.5);
    border: 3px solid #ffd700;
}

/* Achievement Popup */
.achievement-popup {
    position: fixed;
    top: -200px;
    right: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.6);
    z-index: 10000;
    transition: top 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 300px;
}

.achievement-popup.show {
    top: 80px;
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.achievement-icon {
    font-size: 3rem;
}

.achievement-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Alert variants for achievement-style popup */
.achievement-popup.alert {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.35);
}

.achievement-popup.success {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.6);
    border: 2px solid rgba(16, 185, 129, 0.5);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(26, 20, 56, 0.95);
    border: 2px solid rgba(138, 43, 226, 0.5);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

/* Larger modal for history details */
.modal-content.large {
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    /* Advanced scrollbar styling */
    scrollbar-width: thin;                 /* Firefox */
    scrollbar-color: #764ba2 rgba(26, 20, 56, 0.4);
    scrollbar-gutter: stable both-edges;   /* Modern browsers */
}

/* WebKit (Chrome/Edge/Safari) scoped scrollbar for the details modal */
.modal-content.large::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.modal-content.large::-webkit-scrollbar-track {
    background: rgba(26, 20, 56, 0.6);
    border-radius: 10px;
    box-shadow: inset 0 0 6px rgba(102, 126, 234, 0.25);
}

.modal-content.large::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.45);
}

.modal-content.large::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7da0f8, #8a60c9);
}

.modal-content.large::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, #5679d6, #6b3fb0);
}

.modal-content.large::-webkit-scrollbar-corner {
    background: rgba(26, 20, 56, 0.6);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #fff;
}

.modal-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#authForm input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    background: rgba(15, 12, 41, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
}

#authForm input:focus {
    outline: none;
    border-color: #764ba2;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

.modal-switch {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.modal-switch:hover {
    color: #fff;
}

/* Page Styles */
.page-header {
    text-align: center;
    margin: 40px 0 60px;
}

.page-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.page-icon {
    font-size: 3.5rem;
}

.page-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

/* History Page */
.login-required, .info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

/* Enhanced Login Card */
.login-card {
    background: rgba(26, 20, 56, 0.6);
    border: 2px solid rgba(138, 43, 226, 0.4);
    border-radius: 24px;
    padding: 40px 32px;
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.15);
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.login-card h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 22px;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(closest-side, rgba(102,126,234,0.15), transparent 60%);
    transform: rotate(15deg);
}

.info-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 12px rgba(102, 126, 234, 0.6));
}

/* CTA Button for Login */
.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(102, 126, 234, 0.5);
}

.btn-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: shine 2.8s infinite;
}

.btn-cta::after {
    content: '›';
    font-size: 1.2rem;
    opacity: 0.9;
}

.history-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 25px;
    background: rgba(26, 20, 56, 0.6);
    border: 2px solid rgba(138, 43, 226, 0.4);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(138, 43, 226, 0.3);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.loading-simple {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 60px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* History Details Modal */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.detail-ticket {
    background: rgba(15, 12, 41, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.detail-ticket h3 {
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    margin-bottom: 10px;
}

/* Removed confidence text styling */

.history-card {
    background: rgba(26, 20, 56, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
}

.history-card:hover {
    transform: translateY(-3px);
    border-color: rgba(138, 43, 226, 0.6);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.history-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 5px;
}

.history-draw-date {
    color: rgba(255, 215, 0, 0.8);
    font-size: 0.9rem;
    margin-top: 3px;
}

.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-badge.checked {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.history-tickets {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.history-ticket {
    background: rgba(15, 12, 41, 0.6);
    padding: 15px;
    border-radius: 10px;
}

.ticket-mini-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-ball {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    font-size: 0.9rem;
    font-weight: 700;
}

.mini-ball.matched {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

.powerball-mini {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 2px solid #ffd700;
}

.powerball-mini.matched {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 2px solid #ffd700;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.history-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-action {
    padding: 8px 20px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.5);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-action:hover {
    background: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

/* Analytics Page */
.analytics-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card-small {
    background: rgba(26, 20, 56, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
}

.stat-value-large {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 10px 0;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
}

.chart-card {
    background: rgba(26, 20, 56, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 15px;
    padding: 25px;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card h3 {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.chart-card canvas {
    height: 300px !important;
}

.hot-cold-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.number-stat {
    background: rgba(15, 12, 41, 0.6);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.number-stat.hot {
    border: 2px solid rgba(239, 68, 68, 0.5);
}

.number-stat.cold {
    border: 2px solid rgba(59, 130, 246, 0.5);
}

.number-stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.number-stat-freq {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.draws-table {
    max-height: 400px;
    overflow-y: auto;
}

.draw-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(15, 12, 41, 0.4);
    border-radius: 10px;
    margin-bottom: 10px;
}

.draw-date {
    font-weight: 600;
    min-width: 150px;
}

.draw-numbers {
    display: flex;
    gap: 8px;
}

.draw-ball {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    font-size: 0.9rem;
    font-weight: 700;
}

.powerball-draw {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 2px solid #ffd700;
}

.heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 5px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    z-index: 10;
}

.heatmap-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.heatmap-freq {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Checker Page */
.checker-form {
    max-width: 600px;
    margin: 0 auto 50px;
}

.form-card {
    background: rgba(26, 20, 56, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 20px;
    padding: 40px;
}

.form-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.form-input, .number-input, .powerball-input {
    width: 100%;
    padding: 15px;
    background: rgba(15, 12, 41, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
}

.number-inputs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.number-input {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.powerball-input {
    max-width: 150px;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-check {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border: none;
    color: #0a0e27;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-check:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

.checker-results {
    max-width: 1000px;
    margin: 0 auto;
}

.checker-results h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-align: center;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: rgba(26, 20, 56, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.summary-icon {
    font-size: 3rem;
}

.summary-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.summary-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.match-card {
    background: rgba(26, 20, 56, 0.6);
    border: 2px solid rgba(16, 185, 129, 0.5);
    border-radius: 15px;
    padding: 25px;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.match-stats {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 5px;
}

.match-prize {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 10px;
}

.match-prize.major {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #0a0e27;
}

.match-prize.medium {
    background: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    border: 2px solid #f59e0b;
}

.match-prize.minor {
    background: rgba(16, 185, 129, 0.3);
    color: #10b981;
    border: 2px solid #10b981;
}

.match-numbers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.match-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    background: rgba(102, 126, 234, 0.3);
    border: 2px solid rgba(102, 126, 234, 0.5);
}

.match-ball.matched {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

.match-ball.powerball-match {
    background: rgba(239, 68, 68, 0.3);
    border: 2px solid rgba(239, 68, 68, 0.5);
}

.match-ball.powerball-match.matched {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 3px solid #ffd700;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

.no-matches {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px;
    text-align: center;
}

/* Profile Page */
.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    background: rgba(26, 20, 56, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
}

.profile-info h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.profile-info p {
    color: rgba(255, 255, 255, 0.7);
    margin: 5px 0;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.profile-stat-card {
    background: rgba(26, 20, 56, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
}

.profile-stat-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.profile-stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.profile-stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.achievements-section {
    margin-top: 50px;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.achievement-count {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.achievement-card {
    background: rgba(26, 20, 56, 0.6);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    gap: 20px;
    transition: all 0.3s ease;
}

.achievement-card.unlocked {
    border-color: rgba(16, 185, 129, 0.5);
}

.achievement-card.locked {
    opacity: 0.5;
}

.achievement-card:hover {
    transform: translateY(-3px);
}

.achievement-card-icon {
    font-size: 3rem;
}

.achievement-card-content h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.achievement-card-content p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.achievement-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.locked-badge {
    background: rgba(138, 43, 226, 0.2);
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(138, 43, 226, 0.3);
}

/* Share Page */
.share-page {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1438 50%, #0f0c29 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-container {
    max-width: 800px;
    width: 100%;
}

.share-header {
    text-align: center;
    margin-bottom: 40px;
}

.share-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    margin-bottom: 10px;
}

.share-tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

.share-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.share-content {
    background: rgba(26, 20, 56, 0.8);
    border: 2px solid rgba(138, 43, 226, 0.4);
    border-radius: 25px;
    padding: 40px;
}

.share-info {
    text-align: center;
    margin-bottom: 40px;
}

.share-info h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    margin-bottom: 10px;
}

.share-date {
    color: rgba(255, 255, 255, 0.7);
    margin: 10px 0;
}

.share-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.share-tickets {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.share-ticket-card {
    background: rgba(15, 12, 41, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 15px;
    padding: 25px;
}

.share-ticket-card h3 {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 20px;
    text-align: center;
}

/* Removed confidence bar styles */

.share-cta {
    text-align: center;
    padding: 40px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    margin-bottom: 30px;
}

.share-cta h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.share-cta p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
}

.btn-generate-own {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #0a0e27;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-generate-own:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

.share-disclaimer {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 2rem;
    }
    
    .tickets-container {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .hot-cold-container {
        grid-template-columns: 1fr;
    }
    
    .number-inputs {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Advanced Mobile Enhancements */
html {
    font-size: clamp(14px, 1.8vw, 16px);
}

body {
    -webkit-tap-highlight-color: transparent;
}

/* Fluid headings */
.title, .page-title {
    font-size: clamp(1.75rem, 5.5vw, 3rem);
}

.subtitle, .page-subtitle {
    font-size: clamp(1rem, 3.8vw, 1.5rem);
}

/* Layout paddings */
.top-bar {
    padding: clamp(10px, 3vw, 15px) clamp(16px, 4vw, 30px);
}

.container {
    padding: clamp(16px, 4vw, 30px);
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* Sidebar: mobile sizing and overlay */
.sidebar {
    height: 100dvh;
}

@media (max-width: 768px) {
    .sidebar {
        width: 80vw;
        max-width: 320px;
    }
    .menu-toggle {
        font-size: 2rem;
        padding: 8px 10px;
    }
    /* Overlay when sidebar is open */
    .sidebar.show + .main-content::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 900;
        backdrop-filter: blur(1px);
    }
}

/* Tickets and number balls */
.tickets-container {
    gap: clamp(16px, 4vw, 30px);
}

.number-ball {
    width: clamp(44px, 12vw, 60px);
    height: clamp(44px, 12vw, 60px);
    font-size: clamp(1rem, 4vw, 1.5rem);
}

/* Forms and inputs */
.number-inputs {
    gap: clamp(8px, 2vw, 12px);
}

@media (max-width: 480px) {
    .number-inputs {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Buttons: touch ergonomics */
button, .btn-primary, .btn-auth, .btn-logout, .btn-share, .btn-generate-own {
    min-height: clamp(44px, 12vw, 48px);
}

.btn-auth, .btn-primary, .btn-logout {
    padding: 10px 18px;
}

/* Modals: mobile-friendly sizing */
.modal-content {
    padding: clamp(20px, 5vw, 40px);
    width: min(95%, 600px);
}

.modal-content.large {
    max-width: min(95vw, 900px);
    max-height: 85svh;
}

/* Achievement popup: avoid overlap on small screens */
@media (max-width: 480px) {
    .achievement-popup {
        right: 12px;
        width: calc(100vw - 24px);
        max-width: 360px;
    }
}
