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

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #0a0a0a;
	--bg-highlight: #550066;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --accent: #4a90e2;
    --accent-hover: #5ba3ff;
    --border: #333333;
    --success: #4caf50;
    --nav-height: 64px;
    --card-bg: #242424;
	--super-accent: #ff4081;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navigation */
.nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    height: var(--nav-height);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-item.active {
    color: var(--accent);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

/* Main Content */
.content {
    flex: 1;
    overflow-y: visible;
}

.page {
    display: none;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.page.active {
    display: block;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Hero Section */
.section-headline {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Draws Container */
.draws-container {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding: 4px 0 4px 20px;
    margin-left: -20px;
    margin-right: -20px;
}

.draws-container::after {
    content: '';
    padding-right: 20px;
    flex-shrink: 0;
}

.draws-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.draw-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    min-width: 280px;
    max-width: 280px;
    scroll-snap-align: start;
    flex-shrink: 0;
    scroll-margin-left: 20px;
    display: flex;
    flex-direction: column;
}

.draw-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: left;
}

.draw-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.draw-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
    flex-grow: 1;
}

.closing-date {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}

.draw-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 13px;
}

.draw-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.draw-info-label {
    color: var(--text-secondary);
}

.draw-info-value {
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e8e8e8;
}

/* CTA Section */
.cta-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-top: 32px;
}

.cta-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.cta-section p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Draws Section */
.draws-section {
    margin-bottom: 24px;
}

.draws-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
}

.badge-open {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-closed {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-winner {
    background: #fff3e0;
    color: #f57c00;
}

/* Responsive */
@media (min-width: 768px) {
    .nav {
        position: static;
        border-top: none;
        border-bottom: 1px solid var(--border);
        height: auto;
        padding: 0;
    }

    .nav-item {
        flex-direction: row;
        gap: 8px;
        padding: 16px 24px;
    }

    .nav-item span {
        font-size: 14px;
    }

    .content {
        padding-bottom: 20px;
    }

    .page {
        padding: 40px 20px;
    }
}

/* Footer */
.footer {
    background: linear-gradient(to bottom, transparent, var(--bg-highlight));
    display: flex;
	flex-direction: column;
    padding: 24px 20px;
    text-align: center;
    margin-top: auto;
	font-size: 12px;
    position: relative;
}

.footer a {
	text-decoration: none;
	color:inherit;
}

.footer .see-prizes {
	font-weight: 600;

}

#logout-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--super-accent);
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#logout-btn:hover {
    background: #ff5a99;
    transform: translateY(-50%) scale(1.05);
}

/* Draw selection checkboxes */
.draw-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.draw-checkbox-label:hover {
    background: rgba(74, 144, 226, 0.2);
}

.draw-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.draw-checkbox-label span {
    font-size: 14px;
    font-weight: 500;
}

/* Sticky update button */
.update-entries-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    z-index: 100;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.update-entries-sticky.hidden {
    display: none;
}

#update-entries-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

/* Form Styles */
.form-container {
    max-width: 500px;
    margin: 0 auto;
}

.entry-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.sticky-label {
    position: sticky;
    top: 58px;
    background: var(--bg-secondary);
    padding: 12px 20px;
    z-index: 9;
    margin: 0 -20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sticky-label label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    margin: 0;
}

.selection-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    /* transition: all 0.1s; */
    position: relative;
    border: 2px solid transparent;
}

.checkbox-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.checkbox-item:hover {
    background: var(--bg-secondary);
}

.checkbox-item.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    background: rgba(74, 144, 226, 0.1);
}

.checkbox-item.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-item.disabled:hover {
    background: var(--card-bg);
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
    display: none;
}

.checkbox-item label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    font-size: 14px;
}

.checkbox-single {
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.checkbox-single label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-single input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--accent);
}

.email-consent-note {
    text-align: center;
    margin: 16px 24px 0 24px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.terms-link {
    color: var(--accent);
    text-decoration: none;
}

.terms-link:hover {
    text-decoration: underline;
}

.form-message {
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.form-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.form-message.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid #f44336;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(64, 32, 128, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.overlay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.overlay-close:hover {
    color: var(--text-primary);
}

.overlay-content h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: var(--text-primary);
}

.overlay-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Countdown */
.countdown {
    text-align: center;
    margin: 0 auto;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding: 16px 20px;
    z-index: 10;
    border-bottom: 1px solid var(--border);
	white-space: nowrap;
}

.countdown #countdown-draw-name {
    font-weight: 700;
    margin-bottom: 8px;
}

.countdown #countdown-timer {
    font-weight: 700;
    color: var(--super-accent);
    display: inline-block;
}

/* Entries Page */
#sphere-livestream {
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 12px;
    margin-bottom: 20px;
    display: block;
    box-shadow: 0 0 16px var(--bg-highlight);
}

.live-stream-live {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.live-stream-live.hidden {
    display: none;
}

.live-indicator {
    background: white;
    color: black;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.live-indicator::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    margin-right: 4px;
}

.draw-status-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.draw-status-headline {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.upcoming-draw-info,
.live-draw-info {
    display: none;
}

.upcoming-draw-info.active,
.live-draw-info.active {
    display: block;
}

.upcoming-draw-info > div:first-child,
.live-draw-info > div:first-child {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.draw-status-timer {
    font-size: 48px;
    font-weight: 700;
    color: var(--super-accent);
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
}

.user-code {
    font-size: 64px;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    text-shadow: 0 0 20px rgba(74, 144, 226, 0.5);
    transition: all 0.3s ease;
}

.user-code.winner {
    color: var(--success);
    text-shadow: 0 0 30px rgba(76, 175, 80, 0.8);
    animation: winnerPulse 1.5s ease-in-out infinite;
}

@keyframes winnerPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.entries-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 80px;
}

.entry-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.entry-card.winner {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), var(--card-bg));
}

.entry-card.past {
    opacity: 0.6;
}

.entry-card.not-entered {
    border: 2px dashed rgba(255, 193, 7, 0.3);
}

.entry-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    background: rgba(74, 144, 226, 0.05);
    position: relative;
}

.entry-card.selected::after {
    content: '✓';
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    z-index: 1;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.entry-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.entry-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.entry-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.entry-badge.open {
    background: rgba(74, 144, 226, 0.2);
    color: var(--accent);
}

.entry-badge.closed {
    background: rgba(160, 160, 160, 0.2);
    color: var(--text-secondary);
}

.entry-badge.winner {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
}

.entry-badge.not-entered {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.entry-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.entry-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.entry-info-label {
    color: var(--text-secondary);
}

.entry-info-value {
    font-weight: 500;
    color: var(--text-primary);
}

.lucky-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    font-family: "Courier New", monospace;
    letter-spacing: 4px;
}

.lucky-number.winner {
    color: var(--success);
}

.lucky-number.pending {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: normal;
}

.no-entries {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.no-entries h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.no-entries p {
    margin-bottom: 20px;
}

.magic-link-notice {
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    text-align: center;
}

.magic-link-notice p {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.magic-link-notice a {
    color: var(--accent);
    text-decoration: underline;
}
