/* ===== CSS Variables & Reset ===== */
:root {
    /* Modern Palette - Indigo/Violet Theme */
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-depth: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);

    --secondary-color: #ec4899;
    /* Pink 500 */
    --secondary-depth: #db2777;

    --accent-color: #8b5cf6;
    /* Violet 500 */

    /* Glassmorphism Surface Colors */
    --surface-light: rgba(255, 255, 255, 0.7);
    --surface-glass: rgba(255, 255, 255, 0.65);
    --surface-border: rgba(255, 255, 255, 0.4);

    --text-main: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-light: #64748b;

    /* Background Gradient (Mesh like - Original Indigo) */
    --bg-gradient: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    --bg-base: #0f172a;
    /* Slate 900 */

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Ball Colors (Vibrant Gradients) */
    --ball-1: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
    --ball-2: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    --ball-3: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    --ball-4: linear-gradient(135deg, #9ca3af 0%, #4b5563 100%);
    --ball-5: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
    --bonus-ball: linear-gradient(135deg, #c084fc 0%, #7c3aed 100%);
}

[data-theme="dark"] {
    --surface-light: rgba(30, 41, 59, 0.7);
    --surface-glass: rgba(15, 23, 42, 0.6);
    --surface-border: rgba(148, 163, 184, 0.1);

    --text-main: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-light: #64748b;

    --bg-base: #020617;
}

[data-theme="light"] {
    --surface-light: rgba(255, 255, 255, 0.96);
    --surface-glass: rgba(255, 255, 255, 0.94);
    --surface-border: rgba(15, 23, 42, 0.1);

    /* Light mode: high-contrast text on light background */
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #64748b;
    --text-heading: #0f172a;
    --text-subheading: #1e293b;
    --icon-primary: #334155;
    --icon-muted: #64748b;

    --bg-base: #f1f5f9;
    --bg-gradient: radial-gradient(circle at 0% 0%, #e2e8f2 0%, transparent 55%),
        radial-gradient(circle at 100% 0%, #f1e5ff 0%, transparent 45%),
        radial-gradient(circle at 50% 100%, #e0e7ff 0%, transparent 50%);

    --primary-glow: rgba(99, 102, 241, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: var(--bg-base);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Glass Components Class ===== */
.glass-panel {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-md);
}

/* ===== Header (Floating & Glass) ===== */
.app-header {
    background: rgba(15, 23, 42, 0.1);
    /* Transparent for mesh bg to show */
    padding: 1rem 1.5rem 0.5rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-logo {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.app-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    margin-top: 0.5rem;
}

.auth-section {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ===== Tab Navigation (Bottom Bar) ===== */
.tab-nav {
    display: flex;
    justify-content: space-around;
    background: rgba(15, 23, 42, 0.95);
    /* Dark slate background */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    gap: 0;
    position: fixed;
    bottom: 50px;
    /* Shifted up for Ad Banner */
    left: 0;
    width: 100%;
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.4);
    position: relative;
    max-width: 168px;
    /* Prevent too wide on desktop */
}

.tab-btn:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
}

.tab-btn.active {
    background: transparent;
    color: white;
    box-shadow: none;
}

.tab-icon {
    font-size: 1.6rem;
    transition: transform 0.2s ease;
    margin-bottom: 2px;
}

/* Adjust Admin Icon Brightness */
#admin-tab-btn .tab-icon {
    filter: none;
}

.tab-btn.active .tab-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

.tab-label {
    display: none;
}

/* ===== Main Content ===== */
.app-content {
    padding: 1rem;
    padding-bottom: calc(5rem + 50px);
    /* Increased for Ad Banner */
    max-width: 600px;
    margin: 0 auto;
}

.tab-content {
    display: none;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ===== Section Header ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    color: white;
}

.refresh-btn:hover {
    background: var(--primary-color);
    transform: rotate(180deg);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.refresh-icon {
    font-size: 1.25rem;
}

/* ===== Draw Info ===== */
.draw-info {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-md);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Shine effect */
.draw-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.6s;
}

.draw-info:hover::before {
    left: 100%;
}

.draw-number {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 600;
}

.draw-number span {
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 800;
}

/* ===== Predictions Container ===== */
.predictions-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.prediction-card {
    background: rgba(255, 255, 255, 0.95);
    /* Solid light background */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    /* Slightly less rounded than 24px */
    padding: 1.25rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    /* Softer shadow */
    transition: all 0.3s ease;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

[data-theme="dark"] .prediction-card {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Premium Card (Refined Gold & Luxury Design) */
.prediction-card.premium-card {
    background: linear-gradient(135deg, #fffdf5 0%, #fff9e1 50%, #fef3c7 100%);
    border: 2.5px solid #facc15 !important;
    /* Brighter, Lighter Gold Border */
    box-shadow:
        0 8px 25px rgba(250, 204, 21, 0.2),
        inset 0 0 15px rgba(255, 255, 255, 0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] .prediction-card.premium-card {
    background: linear-gradient(135deg, #1f1a05 0%, #3d3101 50%, #1f1a05 100%);
    border: 2.5px solid #b45309 !important;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(251, 191, 36, 0.05);
}

.prediction-card.premium-card .name-text {
    background: linear-gradient(to bottom, #854d0e, #422006);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900 !important;
}

[data-theme="dark"] .prediction-card.premium-card .name-text {
    background: linear-gradient(to bottom, #fde68a, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Ensure content stays above shine effect */
.prediction-card.premium-card>* {
    position: relative;
    z-index: 1;
}

.prediction-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--primary-color);
}

[data-theme="dark"] .prediction-card:hover {
    background: rgba(30, 41, 59, 0.8);
}

.model-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    /* Dark text for default white card */
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    position: relative;
}

[data-theme="dark"] .model-name {
    color: var(--text-main);
}

.model-brand-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    /* Important for ellipsis */
}

.model-brand-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    /* Make white background transparent and blend with card color */
    mix-blend-mode: multiply;
    border-radius: 8px;
    padding: 2px;
}

.model-brand-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.name-text {
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.version-text {
    font-size: 0.7rem;
    color: #64748b;
    /* Darker gray for default white card */
    font-weight: 500;
}

[data-theme="dark"] .version-text {
    color: var(--text-muted);
}

.model-brand-badges {
    display: flex;
    gap: 4px;
    align-items: center;
}

.premium-badge {
    font-size: 0.65rem;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    padding: 2px 6px;
    border-radius: 4px;
    color: #000;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
    white-space: nowrap;
}

.model-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 400px;
    max-width: 90vw;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #f1f5f9;
    padding: 1.25rem 1.5rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.7;
    z-index: 1000;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    margin-bottom: 1rem;
    text-align: left;
    white-space: normal;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 24px;
    border-width: 10px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.98) transparent transparent transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.model-name:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.model-badge {
    padding: 0.35rem 0.85rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.model-badge.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-badge.clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.5);
}

/* ===== Lotto Balls (3D Glossy) ===== */
.lotto-balls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}


.ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    color: white;
    position: relative;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15), inset 0 -3px 6px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Glossy highlight */
.ball::after {
    content: '';
    position: absolute;
    top: 6%;
    left: 18%;
    width: 35%;
    height: 25%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.1));
    border-radius: 50%;
    filter: blur(0.5px);
}

.ball.range-1 {
    background: var(--ball-1);
}

.ball.range-2 {
    background: var(--ball-2);
}

.ball.range-3 {
    background: var(--ball-3);
}

.ball.range-4 {
    background: var(--ball-4);
}

.ball.range-5 {
    background: var(--ball-5);
}

.ball.bonus {
    background: var(--bonus-ball);
}

/* ===== Results Section ===== */
.results-header {
    position: relative;
    text-align: center;
    margin-top: 2rem;
    /* Increased to move content down */
    margin-bottom: 1rem;
    padding: 1rem;
    /* Slightly more padding */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.lotto-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-color);
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.qr-scan-header-btn {
    position: absolute;
    right: 1.5rem;
    top: 0.5rem;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.6rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    z-index: 5;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
    animation: qrPulse 2s infinite ease-in-out;
}

@keyframes qrPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.6));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2));
    }
}

.qr-scan-header-btn:hover {
    transform: scale(1.2) rotate(5deg);
    color: #818cf8;
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.8));
    animation-play-state: paused;
}

.qr-scan-header-btn:active {
    transform: scale(0.9);
}

.results-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.header-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    z-index: 100;
    pointer-events: auto;
}

.header-nav-btn:active {
    transform: scale(0.9);
}

.header-nav-btn:hover:not(:disabled) {
    background: white;
    color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.header-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.results-date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.15rem;
}

.results-container {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-top: 1.25rem;
    /* Separated from header */
}

.result-numbers-section {
    padding: 1rem 0.5rem;
    text-align: center;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

/* Draw result balls: main numbers on first row, bonus on second row */
.result-balls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    margin: 0.4rem 0;
}

.result-balls-row.main {
    flex-wrap: nowrap;
}

.result-balls-row.bonus {
    margin-top: 0.65rem;
}

.result-balls-row .ball {
    display: inline-flex;
}

.bonus-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.bonus-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
}

.result-balls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: nowrap;
}

.plus-sign {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 300;
    margin: 0 0.3rem;
}

.prize-section {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1.25rem 1rem;
    /* Increased padding */
    text-align: center;
    margin: 1rem;
    /* Increased margin */
    border-radius: 16px;
    box-shadow: inset 0 0 40px rgba(99, 102, 241, 0.2), 0 10px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.prize-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
}

.prize-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


.prize-amount {

    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 0.4rem;
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    /* Amber Gold */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.4));
}

.prize-detail-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.3rem;
    background: rgba(255, 255, 255, 0.1);
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 1.5rem 2rem;
}

.detail-btn,
.buy-btn {
    padding: 1rem;
    border: none;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-family: inherit;
}

.detail-btn {
    background: rgba(30, 41, 59, 0.05);
    /* very light gray */
    color: var(--text-main);
    border: 1px solid var(--surface-border);
}

[data-theme="dark"] .detail-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.buy-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
    background: var(--primary-depth);
}

/* ===== Settings ===== */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-group {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.setting-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-item label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.setting-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid transparent;
    border-radius: 14px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-height: 48px;
}

[data-theme="dark"] .setting-input {
    background: rgba(30, 41, 59, 0.5);
    border-color: transparent;
    color: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.setting-input::placeholder {
    color: var(--text-light);
    opacity: 1.0;
    /* Increased for better visibility on dark background */
    transition: opacity 0.3s;
}

.setting-input:focus::placeholder {
    opacity: 0.5;
}

.setting-input:hover:not(:focus) {
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .setting-input:hover:not(:focus) {
    background: rgba(30, 41, 59, 0.65);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px var(--primary-glow), 0 8px 16px rgba(99, 102, 241, 0.15);
    color: #1e293b;
    transform: translateY(-1px);
}

[data-theme="dark"] .setting-input:focus {
    background: rgba(30, 41, 59, 0.8);
    color: #f1f5f9;
    box-shadow: 0 0 0 4px var(--primary-glow), 0 8px 16px rgba(99, 102, 241, 0.25);
}

/* Custom styling for select dropdowns in settings */
select.setting-input {
    cursor: pointer;
    padding-right: 3rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
}

[data-theme="dark"] select.setting-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a5b4fc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
}

select.setting-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
}

.save-btn,
.action-btn {
    width: 100%;
    padding: 1rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.save-btn:hover,
.action-btn:hover {
    transform: translateY(-2px);
    background: var(--secondary-depth);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.4);
}

.info-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* ===== Toggle Switch ===== */
.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 32px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

/* ===== Loading ===== */
.loading {
    padding: 3rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading p {
    color: var(--text-muted);
    font-weight: 600;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* ===== Error Message ===== */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    font-weight: 600;
    margin: 1rem 0;
    backdrop-filter: blur(8px);
}

/* ===== Responsive Utilities ===== */
@media (min-width: 768px) {
    .app-content {
        padding: 2.5rem;
    }

    .lotto-balls {
        gap: 1rem;
    }

    .ball {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }

    .predictions-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 380px) {
    .ball {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }

    .app-title {
        font-size: 1.25rem;
    }

    .results-title,
    .next-draw-title {
        font-size: 1.35rem;
        /* Reduced from 1.5rem */
    }

    .results-title-row {
        gap: 0.5rem;
        /* Reduced from 1rem */
    }
}

@media (max-width: 480px) {

    .results-title,
    .next-draw-title {
        white-space: nowrap;
        font-size: 1.5rem;
    }

    .results-title-row {
        gap: 0.75rem;
    }
}

/* ===== Debug Console ===== */
.debug-section {
    margin-top: 2rem;
    border-top: 1px solid var(--surface-border);
    padding-top: 1.5rem;
    display: none;
}

.debug-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.debug-console {
    background: #1e1e1e;
    /* VS Code terminal like background */
    border-radius: 12px;
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #d4d4d4;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-line {
    margin-bottom: 0.5rem;
    line-height: 1.4;
    word-break: break-all;
}

.debug-line:last-child {
    margin-bottom: 0;
}

.debug-line.request {
    color: #4ec9b0;
    /* Mintish green */
}

.debug-line.response-ok {
    color: #60a5fa;
    /* Blue */
}

.debug-line.response-error {
    color: #f87171;
    /* Red */
}

.debug-line.text-muted {
    color: #6e7681;
}

.debug-timestamp {
    color: #569cd6;
    margin-right: 0.5rem;
    opacity: 0.7;
}

[data-theme="light"] .debug-console {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

[data-theme="light"] .debug-line.request {
    color: #059669;
}

[data-theme="light"] .debug-line.response-ok {
    color: #2563eb;
}

/* ===== Authentication Styles ===== */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.auth-btn {
    padding: 0.65rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px var(--primary-glow);
    white-space: nowrap;
}

.auth-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.auth-btn.small {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.auth-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

.user-name-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.user-name-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 400px;
    width: 90%;
    box-sizing: border-box;
    /* ADDED */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.modal-close:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg) scale(1.1);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-size: 1.4rem;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.65rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}

/* Modern Input Fields */
.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid transparent;
    border-radius: 14px;
    font-size: 0.9rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-height: 48px;
}

/* Dark Mode Input Styles */
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Placeholder Styling */
.form-group input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.form-group input:focus::placeholder {
    opacity: 0.5;
}

/* Hover State */
.form-group input:hover:not(:focus),
.form-group select:hover:not(:focus) {
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .form-group input:hover:not(:focus),
[data-theme="dark"] .form-group select:hover:not(:focus) {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Enhanced Focus State with Glow */
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px var(--primary-glow), 0 8px 16px rgba(99, 102, 241, 0.15);
    color: #1e293b;
    transform: translateY(-1px);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus {
    background: rgba(30, 41, 59, 0.8);
    color: #f1f5f9;
    box-shadow: 0 0 0 4px var(--primary-glow), 0 8px 16px rgba(99, 102, 241, 0.25);
}

/* Custom Select Dropdown Styling */
.form-group select {
    cursor: pointer;
    padding-right: 3rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
}

[data-theme="dark"] .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a5b4fc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
}

/* Select Focus Animation */
.form-group select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
}

/* Date Input Specific Styling */
.form-group input[type="date"] {
    position: relative;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Disabled State */
.form-group input:disabled,
.form-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(148, 163, 184, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px var(--primary-glow);
    margin-top: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    background: var(--primary-depth);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.modal-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.modal-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.25rem;
}

.modal-switch a:hover {
    text-decoration: underline;
}

/* Form Section Divider */
.form-section-divider {
    height: 1px;
    background: var(--surface-border);
    margin: 2rem 0 1.5rem 0;
}

.form-section-title {
    color: var(--text-main);
    font-size: 1.0rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.form-section-note {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Profile Modal Tabs */
.profile-modal-content {
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.profile-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--surface-border);
    padding-bottom: 0;
}

.profile-tab {
    flex: 1;
    padding: 0.75rem 0.2rem;
    /* Reduced horizontal padding */
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    bottom: -2px;
    white-space: nowrap;
    /* Prevent wrapping */
}

.profile-tab:hover {
    color: var(--text-main);
    background: rgba(99, 102, 241, 0.05);
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.profile-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.profile-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.auth-required-notice {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.auth-required-notice p {
    color: #fbbf24;
    font-size: 0.85rem;
    margin: 0;
}

/* Next Draw Card Styling (New) */
.next-draw-card {
    background: rgba(255, 255, 255, 0.05);
    /* Lighter glass */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 1rem 0.5rem;
    text-align: center;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.next-draw-card::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    filter: blur(30px);
    z-index: 0;
}

.next-draw-card::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
    filter: blur(30px);
    z-index: 0;
}

.next-draw-subtitle {
    color: #a78bfa;
    /* Violet-400 */
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.next-draw-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
}

.next-draw-action {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Override action button for this card */
.next-draw-card .action-btn {
    width: 80%;
    max-width: 300px;
    background: linear-gradient(90deg, #ec4899 0%, #d946ef 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.next-draw-card .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
}

/* Match result header label with next draw subtitle style */
.lotto-label {
    color: #a78bfa;
    /* Violet-400 */
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Prediction Settings Labels (Muted Gray) */
.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item label {
    color: #cbd5e1;
    /* Slate-300 - darker gray */
    font-weight: 500;
    display: block;
    margin-bottom: 0.35rem;
}

/* Light mode override for labels */
[data-theme="light"] .setting-item label {
    color: #475569;
    /* Slate-600 - soft dark gray for light mode */
}

/* ===== Lotto Loader Animation ===== */
.lotto-loader-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
}

.lotto-machine-glass {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.4);
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    box-shadow:
        inset 0 0 20px rgba(255, 255, 255, 0.2),
        0 0 15px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(2px);
    z-index: 10;
}

/* Glossy reflection */
.lotto-machine-glass::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 30%;
    height: 15%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    filter: blur(2px);
}

.lotto-ball-spin {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: inset -2px -2px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Define colors for spinning balls - Speed increased */
.spin-1 {
    background: #fcd34d;
    top: 50%;
    left: 50%;
    animation: orbit1 0.5s infinite ease-in-out;
}

.spin-2 {
    background: #60a5fa;
    top: 50%;
    left: 50%;
    animation: orbit2 0.6s infinite ease-in-out;
}

.spin-3 {
    background: #f87171;
    top: 50%;
    left: 50%;
    animation: orbit3 0.7s infinite ease-in-out;
}

.spin-4 {
    background: #9ca3af;
    top: 50%;
    left: 50%;
    animation: orbit4 0.55s infinite ease-in-out;
}

.spin-5 {
    background: #4ade80;
    top: 50%;
    left: 50%;
    animation: orbit5 0.75s infinite ease-in-out;
}

.spin-6 {
    background: #c084fc;
    top: 50%;
    left: 50%;
    animation: orbit1 0.65s infinite ease-in-out reverse;
}

.spin-7 {
    background: #fbbf24;
    top: 50%;
    left: 50%;
    animation: orbit2 0.8s infinite ease-in-out reverse;
}

.spin-8 {
    background: #2563eb;
    top: 50%;
    left: 50%;
    animation: orbit3 0.6s infinite ease-in-out reverse;
}

.spin-9 {
    background: #dc2626;
    top: 50%;
    left: 50%;
    animation: orbit4 0.7s infinite ease-in-out reverse;
}

.spin-10 {
    background: #16a34a;
    top: 50%;
    left: 50%;
    animation: orbit5 0.5s infinite ease-in-out reverse;
}

/* Orbital animations - simulating mixing */
@keyframes orbit1 {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translate(25px) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg) translate(25px) rotate(-360deg);
    }
}

@keyframes orbit2 {
    0% {
        transform: translate(-50%, -50%) rotate(72deg) translate(35px) rotate(-72deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(432deg) translate(35px) rotate(-432deg);
    }
}

@keyframes orbit3 {
    0% {
        transform: translate(-50%, -50%) rotate(144deg) translate(20px) rotate(-144deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(504deg) translate(20px) rotate(-504deg);
    }
}

@keyframes orbit4 {
    0% {
        transform: translate(-50%, -50%) rotate(216deg) translate(30px) rotate(-216deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(576deg) translate(30px) rotate(-576deg);
    }
}

@keyframes orbit5 {
    0% {
        transform: translate(-50%, -50%) rotate(288deg) translate(28px) rotate(-288deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(648deg) translate(28px) rotate(-648deg);
    }
}

/* ===== Mobile Responsive Header ===== */
@media (max-width: 600px) {
    .app-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .logo-container {
        margin-bottom: 0;
        padding: 0.35rem 0.75rem;
        gap: 0.5rem;
    }

    .app-logo {
        width: 24px;
        height: 24px;
    }

    .app-title {
        font-size: 1.1rem;
    }

    .app-subtitle {
        display: none;
    }

    .auth-section {
        position: static;
        width: auto;
        justify-content: flex-end;
        margin-top: 0;
        gap: 0.35rem;
    }

    .auth-btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
    }

    .auth-btn.small {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }
}

/* ===== Personalization Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--surface-glass);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--surface-border);
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideUp 0.3s;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .modal-content {
    background: rgba(30, 41, 59, 0.95);
}

.close-btn {
    color: var(--text-muted);
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
}

.ai-settings-icon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: white;
    transition: all 0.3s;
    z-index: 10;
    padding: 0;
    animation: slowRotate 8s infinite linear;
}

.ai-settings-icon-svg {
    width: 24px;
    height: 24px;
    display: block;
}

@keyframes slowRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.ai-settings-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
    animation-play-state: paused;
}


/* ===== More Menu Overlay ===== */
.more-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding-bottom: calc(5rem + 50px);
    /* Increased for Ad Banner */
    padding-right: 1rem;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.more-menu-content {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 0.5rem;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: slideUpMenu 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpMenu {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.more-menu-item {
    background: transparent;
    border: none;
    padding: 1rem;
    width: 100%;
    text-align: left;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.more-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .more-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.menu-icon {
    font-size: 1.15rem;
}

/* ===== Community Post Styles ===== */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.post-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-actions-menu {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
    align-items: center;
}

.post-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.4rem;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: scale(1.1);
}

.post-edit-container {
    animation: fadeIn 0.3s ease;
}

.post-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-main);
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
}

.post-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
}

.cancel-btn {
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* ===== Personalization Modal Overrides ===== */
#personalization-modal .settings-container {
    gap: 0.15rem;
}

#personalization-modal .setting-item {
    gap: 0.05rem;
}

#personalization-modal .setting-input {
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
}

/* ===== Splash Screen ===== */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-base);
    background-image: var(--bg-gradient);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    visibility: visible;
    opacity: 1;
}

#splash-screen.hidden {
    visibility: hidden;
    opacity: 0;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-logo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    animation: splashPulse 2s infinite ease-in-out;
}

.splash-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.splash-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.splash-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
    font-weight: 300;
}

.splash-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto;
    animation: splashSpin 1s linear infinite;
}



@keyframes splashPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 50px rgba(99, 102, 241, 0.5);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    }
}

@keyframes splashSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Active Mode Highlighting for Prediction Buttons */
.action-btn {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0.9;
}

.action-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.action-btn.active-mode {
    opacity: 1 !important;
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 10px 20px rgba(0, 0, 0, 0.3) !important;
    z-index: 10;
}

.action-btn.inactive-mode {
    opacity: 0.5 !important;
    transform: scale(0.95);
    filter: grayscale(0.5);
    box-shadow: none !important;
}

/* ===== Ad Banner Styles ===== */
.ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ad-banner-placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

/* ===== Notice Modal Improvements ===== */
.notice-modal-wrapper {
    z-index: 3000 !important;
}

.notice-modal-content {
    background: #1e1b4b !important;
    border: 1px solid #4f46e5 !important;
    max-width: 400px !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: 85vh !important;
    overflow: hidden !important;
    /* Container doesn't scroll */
}

.notice-modal-content .modal-header {
    padding: 15px 20px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

.notice-modal-content .modal-title {
    color: white !important;
    font-size: 1.1rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

.notice-modal-content .scrollable-body {
    padding: 0 !important;
    flex-grow: 1 !important;
    overflow-y: auto !important;
    /* Only body scrolls */
    -webkit-overflow-scrolling: touch;
}

.notice-modal-content .notice-text-content {
    padding: 20px !important;
}

.notice-modal-content #notice-modal-content {
    color: #e0e7ff !important;
    line-height: 1.6 !important;
    white-space: pre-wrap !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
}

.notice-modal-content .notice-date-container {
    margin-top: 15px !important;
    font-size: 0.8rem !important;
    color: #9ca3af !important;
    text-align: right !important;
}

.notice-modal-content .modal-footer {
    padding: 10px 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: rgba(0, 0, 0, 0.2) !important;
    flex-shrink: 0 !important;
}

.notice-modal-content .dont-show-label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #c7d2fe !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    margin: 0 !important;
}

.notice-modal-content .dont-show-label input {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
}

.notice-modal-content .action-btn.small {
    width: auto !important;
    height: auto !important;
    padding: 8px 18px !important;
    font-size: 0.9rem !important;
    margin: 0 !important;
}