:root {
    /* Cyber-Neko Palette (Neon Night) */
    --bg-primary: #050510;
    /* Void Black */
    --bg-secondary: #0F0F23;
    /* Dark Navy */
    --text-primary: #39ff14;
    /* Terminal Green */
    --text-secondary: #64748b;
    /* System Gray */
    --accent: #00f3ff;
    /* Cyber Cyan */
    --accent-hover: #00c2cc;
    --highlight: #ff00ff;
    /* Glitch Magenta */
    --success: #00ff9d;
    /* Neon Green */
    --warning: #facc15;
    /* Warning Yellow */
    --danger: #ff0055;
    /* Error Red */

    --card-bg: rgba(15, 15, 35, 0.9);

    --font-heading: 'Press Start 2P', cursive;
    /* English Headings */
    --font-zh-heading: 'Noto Sans TC', sans-serif;
    /* Chinese Headings */
    --font-mono: 'VT323', monospace;
    --font-body: 'Noto Sans TC', sans-serif;
    /* Body Text (Chinese) */
}

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


button,
input,
select,
textarea,
a {
    touch-action: manipulation;
}

body {
    font-family: var(--font-body);
    font-weight: 500;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 60px;
    /* Space for hidden footer */
}

/* Typography Overrides for Chinese Retro Feel */
h1,
h2,
h3,
h4,
h5,
h6 {
    text-transform: uppercase;
    text-shadow: 2px 2px 0px #000, 0 0 10px rgba(255, 0, 255, 0.6);
    letter-spacing: 2px;
    /* Extra spacing for retro feel */
}

h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    /* Responsive font size */
    margin-bottom: 2rem;
    background: linear-gradient(180deg, #fff 0%, #ff00ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(255, 0, 255, 0.8));
    line-height: 1.4;
}

/* For Chinese Titles, use Noto Sans Black */
h2,
.strategy-title {
    font-family: var(--font-zh-heading);
    font-weight: 900;
    /* Extra bold for blocky look */
    letter-spacing: 1px;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 3px solid var(--accent);
    /* Thicker line */
    padding-bottom: 0.5rem;
    text-shadow: 0 0 8px var(--accent);
}

.subtitle {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-size: clamp(1rem, 4vw, 1.5rem);
    display: block;
    margin-top: 0.5rem;
}

/* CRT Overlay Effect */
body::before {
    content: " ";
    display: block;
    position: fixed;
    /* FIXED: Covers entire viewport even when scrolling */
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    /* Scanlines: Strengthened visibility based on feedback (0.25 -> 0.35 opacity, stronger RGB) */
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.35) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.1), rgba(0, 255, 0, 0.05), rgba(0, 0, 255, 0.1));
    z-index: 9999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

body::after {
    content: " ";
    display: block;
    position: fixed;
    /* FIXED: Covers entire viewport */
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    /* Adjusted Vignette: Slightly stronger than previous test (0.2 -> 0.3), still wide range (90%) */
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 90%, rgba(5, 5, 16, 0.3) 100%);
    pointer-events: none;
    z-index: 9998;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    /* Reduced padding for mobile */
    position: relative;
    z-index: 10;
}

/* Terminal Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--accent);
    /* No border-radius for strict pixel look */
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Corner Decor */
.card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 20px;
    height: 20px;
    border-top: 3px solid var(--accent);
    border-left: 3px solid var(--accent);
}

.card::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-bottom: 3px solid var(--accent);
    border-right: 3px solid var(--accent);
}

.full-width-card {
    width: 100%;
    margin-bottom: 2rem;
}

/* Main layout grid - Mobile First Approach */
.main-split-view {
    display: grid;
    grid-template-columns: 1fr;
    /* Default to single column (mobile) */
    /* Default to single column (mobile) */
    /* Default to single column (mobile) */
    gap: 2.5rem;
    margin-bottom: 2.5rem;
    margin-top: 1.5rem;
    margin-top: 1.5rem;
    margin-top: 1.5rem;
}

/* Desktop layout */
@media (min-width: 900px) {
    .main-split-view {
        grid-template-columns: 1fr 1fr;
    }
}

/* BIG SWITCH Buttons (Arcade Style) */
.toggle-buttons,
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    height: 80px;
    /* Massive buttons */
}

.toggle-btn,
.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border: 4px solid var(--text-secondary);
    /* Thick borders */
    color: var(--text-secondary);
    font-family: var(--font-zh-heading);
    font-weight: 900;
    font-size: 1.8rem;
    /* Large text */
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: none;
    box-shadow: inset 0 0 0 0 var(--accent);
}

.toggle-btn.active,
.tab.active {
    background: rgba(255, 0, 255, 0.15);
    color: var(--highlight);
    border-color: var(--highlight);
    text-shadow: 0 0 10px var(--highlight);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4), inset 0 0 20px rgba(255, 0, 255, 0.2);
    transform: translateY(-2px);
}

/* Strategy Grid & Cards */
.strategy-grid {
    display: grid;
    /* FIX: min() ensures it never exceeds container width on super small screens */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    /* Mobile friendly column size */
    gap: 1.5rem;
}

.strategy-card {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--text-secondary);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

/* Colorful Borders Cycle */
.strategy-card:nth-child(4n+1):hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent);
}

.strategy-card:nth-child(4n+2):hover {
    border-color: var(--highlight);
    box-shadow: 0 0 15px var(--highlight);
}

.strategy-card:nth-child(4n+3):hover {
    border-color: var(--success);
    box-shadow: 0 0 15px var(--success);
}

.strategy-card:nth-child(4n+4):hover {
    border-color: var(--warning);
    box-shadow: 0 0 15px var(--warning);
}

.strategy-title {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

/* Input Fields - Retro Console Style */
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 1rem;
    background: #000;
    border: 2px solid var(--text-secondary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1.5rem;
    /* Larger input text */
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    background: #080808;
}

/* Results & Tickets */
.tickets-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Stack visually on mobile */
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.ticket {
    background: #000;
    border: 2px solid var(--text-secondary);
    border-left: 8px solid var(--highlight);
    padding: 1.5rem;
    box-shadow: 8px 8px 0px rgba(15, 15, 35, 0.8);
}

/* Pixel Orbs */
.ball {
    width: 3.5rem;
    height: 3.5rem;
    /* Larger balls */
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #000 60%);
    /* Shine effect */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px currentColor;
    /* Glow based on color */
    margin: 0.25rem;
}

.ball.z1 {
    color: var(--accent);
    border-color: var(--accent);
}

.ball.z2 {
    color: var(--highlight);
    border-color: var(--highlight);
}

/* Hidden Backtest Trigger */
.backtest-hidden-trigger {
    position: fixed;
    bottom: 10px;
    left: 10px;
    opacity: 0.3;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    /* Reduced size as requested (hidden feature) */
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10001;
    /* Above mask */
    transition: opacity 0.3s;
}

.backtest-hidden-trigger:hover {
    opacity: 1;
    color: var(--accent);
}

/* Backtest Modal (Hidden Archive) */
#backtest-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    /* Deep dark bg */
    backdrop-filter: blur(5px);
}

.modal-content-archive {
    background-color: #000;
    margin: 5% auto;
    padding: 2rem;
    border: 2px solid var(--warning);
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(255, 200, 0, 0.2);
    position: relative;
}

/* Mascot - Mobile Safe Position */
#neko-mascot {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 9990;
    pointer-events: none;
    /* Let clicks pass through */
}

.neko-container {
    width: 100px;
    /* Slightly smaller on mobile default */
    height: 100px;
}

@media (min-width: 768px) {
    .neko-container {
        width: 140px;
        height: 140px;
    }

    #neko-mascot {
        bottom: 2rem;
        right: 2rem;
        gap: 1rem;
    }
}

.neko-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.4));
}

/* ========================================= */
/*       NEW UI REFINEMENTS (APPENDED)       */
/* ========================================= */

/* SMART PICK GIANT BUTTON */
.btn-smart-pick {
    background: linear-gradient(180deg, #ff00ff 0%, #b300b3 100%);
    color: #fff !important;
    border: 4px solid #fff !important;
    font-size: 2rem !important;
    padding: 1.5rem 2rem;
    width: 100%;
    min-height: 100px;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: pulse-glow 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    cursor: pointer;
}

.btn-smart-pick:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.5);
    background: linear-gradient(180deg, #ff33ff 0%, #d900d9 100%);
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 15px rgba(255, 0, 255, 0.6);
        border-color: #fff;
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 0, 255, 0.9);
        border-color: #ffff00;
    }

    100% {
        box-shadow: 0 0 15px rgba(255, 0, 255, 0.6);
        border-color: #fff;
    }
}

/* Force Single Line Config Groups */
.range-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap !important;
}

.range-input-group input {
    width: 120px !important;
    flex: 1;
    text-align: center;
}

/* PIXEL ART RANGE SLIDER */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    margin: 10px 0;
    background: transparent;
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 16px;
    cursor: pointer;
    background: #000;
    border: 2px solid var(--text-secondary);
    image-rendering: pixelated;
    background-image: repeating-linear-gradient(90deg, var(--text-secondary) 0, var(--text-secondary) 2px, transparent 2px, transparent 6px);
}

input[type="range"]::-webkit-slider-thumb {
    height: 32px;
    width: 20px;
    border: 2px solid #fff;
    background: var(--accent);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -10px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.8);
}

/* Toggle Text Size Reduction */
.toggle-btn small {
    font-size: 0.9rem;
    /* Increased from 0.75rem */
    opacity: 0.8;
    display: block;
    margin-top: 2px;
    line-height: 1.2;
}

/* Ticket Horizontal Flow override */
.ticket-numbers {
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .ticket-numbers {
        justify-content: center;
    }
}

/* ========================================= */
/*       HIGH CONTRAST OVERRIDES (APPENDED)  */
/* ========================================= */

:root {
    /* Cyber-Neko Palette (High Contrast Neon) */
    --bg-primary: #020205;
    /* Deep Void Black */
    --bg-secondary: #0a0a1a;
    /* Darker Navy */
    --text-primary: #39ff14;
    /* Terminal Green */
    --text-secondary: #94a3b8;
    /* Lighter Slate */
    --accent: #00ffff;
    /* Electric Cyan */
    --accent-hover: #00d1d1;
    --highlight: #ff00ff;
    /* Hot Pink */
    --success: #00ff00;
    /* Pure Green */
    --warning: #ffcc00;
    /* Bright Yellow */
    --danger: #ff0055;
    /* Error Red */

    --card-bg: rgba(5, 5, 20, 0.95);
    /* More opaque */
}

/* ========================================= */
/*       GLOBAL SKILLS FIXES (RE-APPLIED)    */
/* ========================================= */

/* 1. Horizontal Balls Fix */
.ticket-numbers {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    justify-content: center !important;
    /* Reverted to center */
    gap: 0.5rem !important;
    width: 100% !important;
}

.ticket-numbers .zone1,
.ticket-numbers .zone2 {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    /* Keep logical center */
    /* Remove gap to let parent handle it if needed, or keep local gap */
    gap: 0.5rem !important;
    /* FIX: Force integer pixel rendering for children */
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* 2. Better Slider Design (Cyberpunk Bar) */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    margin: 10px 0;
    background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: #1e1e2e;
    border: 1px solid var(--accent);
    border-radius: 6px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    image-rendering: auto !important;
    /* Disable pixelated for smooth slider */
    background-image: none !important;
    /* Remove pixel dash */
}

input[type="range"]::-webkit-slider-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px;
    /* Center it */
    box-shadow: 0 0 10px var(--accent);
    border: 2px solid #fff;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px var(--accent);
}

/* 3. Brighter Text & Better Readability */
body {
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
    /* Subtle shadow for contrast */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-shadow: 2px 2px 0px #000, 0 0 15px rgba(255, 0, 255, 0.5);
}

/* Make sure Strategy Headers are readable */
.strategy-header {
    background: rgba(255, 255, 255, 0.05);
    /* Slight highlight */
}

.strategy-brief {
    color: #e2e8f0 !important;
    /* Brighter grey/white */
}

.label-hint {
    color: var(--accent) !important;
    opacity: 0.9 !important;
}

/* Root Brightness Override */
:root {
    --text-primary: #ffff00;
    /* Bright Neon Yellow */
    --text-secondary: #00ffff;
    /* Bright Cyan */
}

/* ========================================= */
/*       STRATEGY COLLAPSE LOGIC (MISSING)   */
/* ========================================= */

.strategy-details {
    display: none;
    /* Hidden by default */
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--text-secondary);
    animation: fadeIn 0.3s ease-in-out;
}

.strategy-card.expanded .strategy-details {
    display: block;
    /* Show when expanded */
}

.expand-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--accent);
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.strategy-card.expanded .expand-icon {
    transform: rotate(180deg);
}

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

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

/* ========================================= */
/*       STRATEGY COLLAPSE LOGIC (MISSING)   */
/* ========================================= */

.strategy-details {
    display: none;
    /* Hidden by default */
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--text-secondary);
    animation: fadeIn 0.3s ease-in-out;
}

.strategy-card.expanded .strategy-details {
    display: block;
    /* Show when expanded */
}

.expand-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--accent);
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.strategy-card.expanded .expand-icon {
    transform: rotate(180deg);
}

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

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

/* ========================================= */
/*       FINAL UI HARMONIZATION (APPENDED)   */
/* ========================================= */

/* 1. Red-Gold Balls (Super Bright) */
.ball,
.ball.z1,
.ball.z2 {
    background: radial-gradient(circle at 30% 30%, #ffdf00, #ff0000 70%) !important;
    border: 2px solid #ffff00 !important;
    color: #fff !important;
    text-shadow: 0 0 5px #000, 0 0 10px #ff0000 !important;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 0, 0.5) !important;
}

/* 2. Unified Button Styles (Arcade/Neon) */
/* Apply Smart Pick style to Update button if it exists */
.btn-update,
#update-data-btn {
    background: linear-gradient(180deg, #00ffff 0%, #008b8b 100%);
    color: #000 !important;
    border: 2px solid #fff !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
    font-family: var(--font-zh-heading);
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: none;
}

/* Control Group Spacing */
.control-group {
    margin-bottom: 1.5rem;
}

.btn-update:hover,
#update-data-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.8);
    background: linear-gradient(180deg, #e0ffff 0%, #00ced1 100%);
}

/* 3. Larger Toggle Text */
.advanced-toggle {
    font-size: 1.5rem !important;
    /* Much bigger */
    padding: 1rem !important;
    margin-top: 2rem !important;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--text-secondary);
    cursor: pointer;
    text-align: center;
    color: var(--accent);
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.25rem !important;
}

.toggle-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-hint-row {
    width: 100%;
    display: flex;
    justify-content: center;
}

.advanced-toggle .toggle-hint {
    font-size: 1rem !important;
    opacity: 0.8;
}

/* 4. Compact Collapsed Cards */
.strategy-card {
    min-height: auto !important;
    /* Remove fixed height if any */
    padding: 0.75rem 1rem !important;
    /* Tighter padding by default */
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(10, 10, 20, 0.95) 100%);
}

.strategy-card.expanded {
    padding: 1.5rem !important;
    /* Expand padding when open */
    background: rgba(0, 0, 0, 0.95);
}

.strategy-title {
    font-size: 1.1rem !important;
    /* Slightly smaller title for compactness */
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.strategy-icon {
    font-size: 1.2rem !important;
}

/* Hide extra info in collapsed state to save space */
.strategy-card:not(.expanded) .strategy-brief {
    display: none;
}

.strategy-card:not(.expanded) .strategy-current {
    font-size: 1rem !important;
}

/* Fix Update Button Selector and Override Inline Styles */
#btn-update-data {
    background: linear-gradient(180deg, #00ffff 0%, #008b8b 100%) !important;
    color: #000 !important;
    border: 2px solid #fff !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.6) !important;
    font-family: var(--font-zh-heading) !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-shadow: none !important;
    padding: 0.5rem 1rem !important;
    /* Override inline padding */
    font-size: 1rem !important;
    /* Override inline font-size */
    margin-top: 1rem !important;
    border-radius: 4px !important;
    /* Slight rounded corners */
}

#btn-update-data:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.8) !important;
    background: linear-gradient(180deg, #e0ffff 0%, #00ced1 100%) !important;
}

/* ========================================= */
/*       FINAL POLISH: CONTRAST & COMPACT    */
/* ========================================= */

/* 1. Zone 2 High Contrast Ball (Electric Blue/Purple) */
.ball.z2 {
    background: radial-gradient(circle at 30% 30%, #00ffff, #0000ff 70%) !important;
    border: 2px solid #00ffff !important;
    color: #fff !important;
    text-shadow: 0 0 5px #000, 0 0 10px #00ffff !important;
    box-shadow: 0 0 15px rgba(0, 0, 255, 0.8), inset 0 0 10px rgba(0, 255, 255, 0.5) !important;
}

/* 2. Ultra Compact Collapsed Cards */
.strategy-card:not(.expanded) {
    padding: 0.5rem 0.75rem !important;
    min-height: auto !important;
    margin-bottom: 0.5rem !important;
    border-color: rgba(255, 255, 255, 0.2);
}

.strategy-card:not(.expanded) .strategy-icon {
    font-size: 1rem !important;
}

.strategy-card:not(.expanded) .strategy-title {
    font-size: 0.95rem !important;
}

.strategy-card:not(.expanded) .expand-icon {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
}

/* 3. Minimum Readability */
html {
    font-size: 16px;
    /* Base size */
}

body {
    min-width: 320px;
}



/* 4. Power Glow Header */
h1 {
    animation: neon-pulse 3s infinite alternate;
}

@keyframes neon-pulse {
    0% {
        text-shadow: 2px 2px 0px #000, 0 0 10px rgba(255, 0, 255, 0.6);
        filter: drop-shadow(0 0 2px rgba(255, 0, 255, 0.5));
    }

    100% {
        text-shadow: 2px 2px 0px #000, 0 0 25px rgba(255, 0, 255, 1), 0 0 50px rgba(255, 0, 255, 0.8);
        filter: drop-shadow(0 0 15px rgba(255, 0, 255, 0.8));
    }
}

/* ========================================= */
/*       EMERGENCY LAYOUT FIXES              */
/* ========================================= */

/* 1. Mobile Order: Results MUST be TOP */
/* REMOVED OLD MOBILE FIXES */

/* 2. Compact Cards: Hide Icons when Collapsed */
.strategy-card:not(.expanded) .strategy-icon {
    display: none !important;
}

.strategy-card:not(.expanded) {
    padding: 0.5rem 1rem !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* 3. Advanced Toggle Fix */
.advanced-strategies.collapsed {
    display: none !important;
}

/* 4. Pixel-Art Spacing */
.btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}



/* ========================================= */
/*       USER FEEDBACK FIXES (BLOCK 2)       */
/* ========================================= */

/* 1. HIDE MASCOTS (User Request) */
#neko-mascot {
    display: none !important;
}

/* 2. REMOVE STRATEGY ICONS (Global) */
.strategy-icon {
    display: none !important;
}

/* 3. RESPONSIVE LATEST NUMBERS */
.latest-numbers-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    justify-content: flex-start;
}

/* Zone Separator with Glow */
.zone-separator {
    width: 2px;
    height: 28px;
    background: #fff;
    margin: 0 8px;
    box-shadow: 0 0 10px #fff, 0 0 20px var(--accent);
    animation: pulse-line 2s infinite;
}

@keyframes pulse-line {
    0% {
        opacity: 0.6;
        box-shadow: 0 0 5px #fff;
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 15px #fff, 0 0 25px var(--accent);
    }

    100% {
        opacity: 0.6;
        box-shadow: 0 0 5px #fff;
    }
}

@media (max-width: 600px) {
    .latest-numbers-wrapper {
        justify-content: center;
        /* Center on mobile */
        margin-top: 0.5rem;
    }
}

/* 4. SUPER GLOW HEADER */
h1 {
    color: #ffffff !important;
    /* Force White */
    text-shadow:
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #00ffff,
        0 0 40px #00ffff,
        0 0 80px #00ffff !important;
    animation: neon-flicker 2s infinite alternate;
}

@keyframes neon-flicker {

    0%,
    19%,
    21%,
    23%,
    25%,
    54%,
    56%,
    100% {
        opacity: 1;
        text-shadow:
            0 0 5px #fff,
            0 0 10px #fff,
            0 0 20px #00ffff,
            0 0 40px #00ffff,
            0 0 80px #00ffff;
    }

    20%,
    24%,
    55% {
        opacity: 0.5;
        text-shadow: none;
    }
}

/* 5. STRATEGY HEADER LAYOUT (Badge to Right) */
.strategy-title-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    gap: 1rem;
}

.strategy-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

/* Global Text Glow */
body {
    text-shadow: 0 0 2px rgba(100, 255, 218, 0.3);
}

.label-icon {
    text-shadow: 0 0 5px var(--accent);
}

/* ========================================= */
/*       MOBILE LAYOUT REFFACTOR             */
/* ========================================= */

/* ========================================= */
/*       HEADER BUTTON REFACTOR              */
/* ========================================= */

.subtitle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Push button to far right */
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    /* Added spacing to prevent overlap with card below */
}

.subtitle {
    margin: 0 !important;
}

.btn-update-mini {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.85rem;
    /* Increased from 0.6rem */
    padding: 8px 12px;
    /* Increased padding slightly to match font */
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    text-shadow: 0 0 5px var(--accent);
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.2);
    /* Hidden by default until JS logic ready? Or visible always */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-3px);
    /* Move up slightly as requested */
}

.btn-update-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0.3;
}

.btn-update-mini:hover {
    background: rgba(251, 191, 36, 0.2);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
    transform: translateY(-1px);
}

.btn-update-mini:active {
    transform: translateY(1px);
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
}

.btn-update-mini:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
    box-shadow: none;
}

/* Enhanced Main Title Readability */
header h1 {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.8) !important;
    /* Stronger outline */
    text-shadow:
        2px 2px 0px #000,
        0 0 10px rgba(0, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.5) !important;
    letter-spacing: 1px;
}

/* Mobile Ticket Scaling */
@media (max-width: 400px) {
    .ticket {
        /* FIXED: Removed transform: scale(0.9) to prevent blurry text */
        width: 100%;
        margin: 0 auto;
        padding: 1rem !important;
        /* Reduce padding instead of scaling */
        min-width: unset !important;
    }

    .latest-numbers-wrapper {
        gap: 2px !important;
    }

    .ball.small {
        width: 32px !important;
        /* Slightly larger targets */
        height: 32px !important;
        font-size: 0.9rem !important;
        /* Increased from 0.8rem */
    }
}

/* 2. Compact Cards: Hide Icons when Collapsed */
.strategy-card:not(.expanded) .strategy-icon {
    display: none !important;
}

/* Zone Label (I / II) */
.zone-label {
    font-size: 1rem;
    font-weight: 900;
    color: var(--warning);
    margin-right: 4px;
    font-family: var(--font-zh-heading);
    text-shadow: 0 0 5px var(--warning);
}

/* ========================================= */
/*       LAYOUT OVERLAP FIX (FINAL)          */
/* ========================================= */

/* Switch to Flex Gap Model for Stacking */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 2.5rem !important;
    /* Enforce global spacing */
}

/* Reset Card Margins (let Container Gap handle it) */
.card {
    margin-bottom: 0 !important;
}

/* Ensure Full Width Card still has spacing if needed, but handled by inline currently */
.full-width-card {
    margin-bottom: 2rem !important;
}

/* ========================================= */
/*       USER REQUESTED PALETTE (OXFORD)     */
/* ========================================= */

:root {
    /* 1. Oxford Blue (Deep Background) */
    --bg-primary: #070F34;

    /* 2. Zaffre (Strong Blue Accents) */
    --bg-secondary: #0313A6;

    /* Card BG: Oxford Blue with slight transparency */
    --card-bg: rgba(7, 15, 52, 0.95);

    /* 3. Fluorescent Cyan (Primary Text & Accent) */
    --text-primary: #34EDF3;
    --accent: #34EDF3;
    --active-cyan: #34EDF3;

    /* 4. Hollywood Cerise (Highlight/Pink) */
    --highlight: #F715AB;
    --hot-pink: #F715AB;

    /* 5. Dark Violet (Secondary Text/Borders) */
    --text-secondary: #c0b0ff;
    /* Lighter tint of Violet for readability */
    --deep-violet: #9201CB;

    /* Map Functional Colors */
    --success: var(--active-cyan);
    --warning: var(--hot-pink);
    --danger: #ff0055;
    /* Keep red for critical errors */
}

/* --- Global Overrides for New Palette --- */

body {
    background-color: var(--bg-primary) !important;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(3, 19, 166, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(146, 1, 203, 0.2) 0%, transparent 40%) !important;
}

/* Card Styling */
.card,
.strategy-card {
    border: 1px solid var(--deep-violet) !important;
    background: var(--card-bg) !important;
    box-shadow: 0 0 15px rgba(3, 19, 166, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.5) !important;
}

.card:hover,
.strategy-card:hover {
    border-color: var(--active-cyan) !important;
    box-shadow: 0 0 25px rgba(52, 237, 243, 0.2) !important;
}

/* Headings */
h1,
h2,
h3,
.strategy-title {
    color: var(--active-cyan) !important;
    text-shadow: 2px 2px 0px var(--bg-secondary), 0 0 10px rgba(52, 237, 243, 0.6) !important;
}

h1 {
    background: linear-gradient(180deg, #fff 0%, var(--active-cyan) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Buttons */
.btn-smart-pick,
button.action-btn {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--deep-violet) 100%) !important;
    border: 2px solid var(--active-cyan) !important;
    color: var(--active-cyan) !important;
    text-shadow: 0 0 5px var(--active-cyan);
}

.btn-smart-pick:hover {
    background: linear-gradient(135deg, var(--deep-violet) 0%, var(--hot-pink) 100%) !important;
    border-color: #fff !important;
    color: #fff !important;
    box-shadow: 0 0 30px var(--hot-pink) !important;
}

/* Lottery Balls (The fun part) */
.ball,
.ball.small {
    /* Standard Ball: Cyan Glow Gradient (Preserved) */
    background: radial-gradient(circle at 30% 30%, #fff, var(--active-cyan) 80%) !important;
    color: var(--bg-primary) !important;
    /* Dark text */
    border: 2px solid var(--active-cyan) !important;
    box-shadow: 0 0 10px var(--active-cyan) !important;

    /* Layout & Size Restoration */
    width: 3rem !important;
    height: 3rem !important;
    border-radius: 50% !important;

    /* Font Correction (Fixes Blurry Text) */
    font-weight: normal !important;
    /* Pixel fonts must be normal weight */
    font-family: var(--font-mono) !important;
    font-size: 1.5rem !important;
    text-shadow: none !important;

    /* SHARPNESS FIX: Hardware Antialiasing & GPU Layer */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
    /* Force GPU layer to fix sub-pixel blur from centering */
    backface-visibility: hidden;
    /* Prevent micro-jitter */

    /* Centering */
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 4px !important;
}

.ball.small {
    width: 2.2rem !important;
    height: 2.2rem !important;
    font-size: 1rem !important;
    /* SHARPNESS FIX: Ensure small balls also have GPU layers */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Ensure Ticket balls (now using .small class for inheritance match) stay BIG */
.ticket .ball.small,
.ticket-numbers .ball.small {
    width: 3rem !important;
    height: 3rem !important;
    font-size: 1.5rem !important;
}

.ball.z1 {
    /* Special/Zone 1: Hollywood Cerise Glow */
    background: radial-gradient(circle at 30% 30%, #fff, var(--hot-pink) 80%) !important;
    color: var(--bg-primary) !important;
    border: 2px solid var(--hot-pink) !important;
    box-shadow: 0 0 15px var(--hot-pink) !important;
}

.ball.z2 {
    /* Zone 2: Zaffre/Violet Glow */
    background: radial-gradient(circle at 30% 30%, #e0e0ff, var(--deep-violet) 80%) !important;
    color: #fff !important;
    /* White text on darker violet ball */
    border: 2px solid var(--deep-violet) !important;
    box-shadow: 0 0 15px var(--deep-violet) !important;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5) !important;
}

/* Ensure Latest Numbers match exactly */
.latest-numbers-wrapper .ball {
    width: 3rem !important;
    height: 3rem !important;
    font-size: 1.5rem !important;
}

/* Sliders */
input[type="range"]::-webkit-slider-thumb {
    background: var(--hot-pink) !important;
    border-color: #fff !important;
    box-shadow: 0 0 10px var(--hot-pink) !important;
}

/* LIGHT SABER SLIDER (Global) */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    height: 30px;
    /* Hit area */
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    /* Thin beam */
    cursor: pointer;
    background: #fff;
    /* Core is always white hot */
    box-shadow:
        0 0 5px var(--accent),
        0 0 10px var(--accent),
        0 0 20px var(--accent),
        0 0 40px var(--accent);
    /* Massive Neon Glow */
    border: none !important;
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    height: 24px;
    width: 12px;
    border-radius: 2px;
    background: #000;
    border: 2px solid #fff;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -10px;
    /* Center on 4px track: (4 - 24) / 2 = -10 */
    box-shadow: 0 0 10px #fff;
    /* Handheld glow */
    position: relative;
    z-index: 2;
}

input[type="range"]:focus::-webkit-slider-runnable-track {
    background: #fff;
    box-shadow:
        0 0 5px var(--highlight),
        0 0 15px var(--highlight),
        0 0 30px var(--highlight),
        0 0 60px var(--highlight);
    /* Color shift on focus? Or keep cyan. Let's shift to Pink for interaction feedback */
}

/* ========================================= */
/*       STYLE ENRICHMENTS & SVG ICONS       */
/* ========================================= */

/* SVG Icons Base */
.icon-inline,
.icon-title,
.icon-mini,
.icon-btn-lg {
    display: inline-block;
    vertical-align: middle;
}

.icon-inline {
    width: 1.25em;
    height: 1.25em;
    margin-right: 0.25em;
    color: var(--highlight);
    filter: drop-shadow(0 0 2px var(--highlight));
}

.icon-title {
    width: 1.5em;
    height: 1.5em;
    margin-right: 0.5em;
    color: var(--accent);
    filter: drop-shadow(0 0 5px var(--accent));
}

.icon-mini {
    width: 1.2em;
    height: 1.2em;
    margin-right: 0.25em;
}

.icon-btn-lg {
    width: 2rem;
    height: 2rem;
    margin-right: 0.5rem;
}

/* Mobile Icon-Only Button */
@media (max-width: 600px) {
    .btn-update-mini .btn-text {
        display: none;
    }

    .btn-update-mini .icon-mini {
        margin-right: 0;
        width: 1.5rem;
        height: 1.5rem;
    }

    .btn-update-mini {
        padding: 8px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }
}

/* Retro-CRT Enrichment */
.card,
.strategy-card {
    border-image-source: linear-gradient(45deg, var(--accent), var(--highlight), var(--accent));
    border-image-slice: 1;
    border-image-width: 2px;
    box-shadow:
        0 0 10px rgba(0, 243, 255, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.8) !important;
    background:
        linear-gradient(rgba(18, 16, 16, 0.95), rgba(0, 0, 0, 0.95)),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 255, 0.05) 3px);
    background-size: 100% 100%, 100% 4px;
}

/* Glitch Text Effect for Headings on Hover */
h1:hover {
    animation: glitch-skew 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-2deg);
    }

    40% {
        transform: skew(2deg);
    }

    60% {
        transform: skew(-1deg);
    }

    80% {
        transform: skew(1deg);
    }

    100% {
        transform: skew(0deg);
    }
}

/* Neon Borders for Inputs */
input:focus,
select:focus {
    box-shadow: 0 0 15px var(--accent), inset 0 0 10px var(--accent);
    border-color: #fff;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border: 1px solid var(--accent);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Close Modal Button (Cyberpunk Style) */
.close-modal-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.close-modal-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 10px var(--danger);
    transform: scale(1.1);
}

.close-modal-btn:active {
    transform: scale(0.95);
}

/* Toast Notifications (Cyberpunk Style) */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
    /* Allow clicking through container */
}

.toast-notification {
    pointer-events: auto;
    min-width: 300px;
    max-width: 400px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--accent);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8), 0 0 5px var(--accent);
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    position: relative;
    overflow: hidden;
    animation: toast-slide-in 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    backdrop-filter: blur(5px);
}

.toast-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
}

/* Toast Variants */
.toast-success {
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8), 0 0 5px var(--success);
}

.toast-success::before {
    background: var(--success);
}

.toast-error {
    border-color: var(--danger);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8), 0 0 5px var(--danger);
}

.toast-error::before {
    background: var(--danger);
}

.toast-info {
    border-color: var(--accent);
}

.toast-info::before {
    background: var(--accent);
}

/* Glitch Animation */
@keyframes toast-slide-in {
    0% {
        transform: translateX(100%) skewX(-10deg);
        opacity: 0;
    }

    60% {
        transform: translateX(-5%) skewX(5deg);
        opacity: 1;
    }

    100% {
        transform: translateX(0) skewX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Error Text Utility */
.error-text {
    color: var(--danger);
    font-family: 'Share Tech Mono', monospace;
    text-shadow: 0 0 5px rgba(248, 113, 113, 0.5);
    padding: 1rem;
    text-align: center;
    border: 1px dashed var(--danger);
    background: rgba(248, 113, 113, 0.1);
}