:root {
    --primary-color: #0093E9; /* Blue */
    --primary-gradient: linear-gradient(135deg, #0093E9 0%, #80D0C7 100%);
    --secondary-color: #ffffff;
    --text-color: #333333;
    --accent-color: #FF9800; /* Orange-yellow for totals */
    --bg-color: #f0f2f5;
    --table-header-bg: #e1e8ed;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Header */
header {
    background: var(--primary-gradient);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: auto;
    padding: 0 15px;
}

header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header #branding h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 1px;
}

header a {
    color: white;
    text-decoration: none;
}

/* Tabs */
.game-tabs {
    display: flex;
    justify-content: center;
    background: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.game-tab {
    padding: 10px 25px;
    margin: 0 5px;
    text-decoration: none;
    color: #555;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.game-tab:hover {
    background-color: #f5f5f5;
    color: #0093E9;
}

.game-tab.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 147, 233, 0.3);
}

/* Main Content */
.main-display {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.game-title {
    font-size: 2em;
    margin-bottom: 10px;
    color: #333;
}

.draw-info {
    color: #777;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.result-balls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.ball {
    width: 60px;
    height: 60px;
    line-height: 60px;
    background: white;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border: 2px solid #eee;
    display: inline-block;
}

.operator {
    font-size: 24px;
    color: #bbb;
    margin: 0 5px;
}

.total-ball {
    width: 70px;
    height: 70px;
    line-height: 70px;
    background: var(--accent-color);
    color: white;
    font-size: 28px;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

/* Result Type Specific Colors */
.total-ball.type-bao { 
    background: linear-gradient(135deg, #ff4d4f 0%, #f5222d 100%); 
    box-shadow: 0 4px 12px rgba(245, 34, 45, 0.4);
}
.total-ball.type-shun { 
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%); 
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}
.total-ball.type-dui { 
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%); 
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
}
.total-ball.type-ban { 
    background: linear-gradient(135deg, #faad14 0%, #d48806 100%); 
    box-shadow: 0 4px 12px rgba(250, 173, 20, 0.4);
}
.total-ball.type-za { 
    background: linear-gradient(135deg, #ab47bc 0%, #8e24aa 100%); /* Purple */
    box-shadow: 0 4px 12px rgba(142, 36, 170, 0.4);
}

.result-type-badge {
    display: inline-block;
    padding: 5px 15px;
    background: #e0f7fa;
    color: #006064;
    border-radius: 15px;
    font-size: 14px;
    margin-top: 10px;
}

/* Recent History Table Section */
.history-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 30px;
    overflow: hidden;
}

#history-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.trend-btn {
    color: #0093E9;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 15px;
    border: 1px solid #0093E9;
    border-radius: 20px;
    transition: all 0.3s;
}

.trend-btn:hover {
    background-color: #f0f9ff;
}

.trend-btn .arrow {
    margin-left: 5px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

th {
    background-color: transparent;
    color: #495057;
    font-weight: 600;
    padding: 15px;
    font-size: 15px;
    text-align: center;
    border: none;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* Removed rounded corners as requested */

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

th {
    background-color: #ffffff;
    color: #333;
    font-weight: normal;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    white-space: nowrap;
}

td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
    color: #444;
}

tbody tr:hover {
    background-color: #f9fbfc;
}

.small-ball {
    width: 30px;
    height: 30px;
    line-height: 30px;
    background: white;
    border-radius: 50%;
    display: inline-block;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid #ddd;
    margin: 0 2px;
    color: #555;
}

.small-total {
    background: var(--accent-color);
    color: white;
    border: none;
}

.small-total.type-bao { background: #ff4d4f; }
.small-total.type-shun { background: #1890ff; }
.small-total.type-dui { background: #52c41a; }
.small-total.type-ban { background: #faad14; }
.small-total.type-za { background: #8e24aa; }

/* Large Ball Types for Canada36 */
.ball.total-ball.type-bao { background: #ff4d4f; border-color: #ff4d4f; color: white; }
.ball.total-ball.type-shun { background: #1890ff; border-color: #1890ff; color: white; }
.ball.total-ball.type-dui { background: #52c41a; border-color: #52c41a; color: white; }
.ball.total-ball.type-ban { background: #faad14; border-color: #faad14; color: white; }
.ball.total-ball.type-za { background: #8e24aa; border-color: #8e24aa; color: white; }

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; 
    padding: 0;
    border: 1px solid #888;
    width: 90%; 
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: slideIn 0.3s;
}

.modal-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow-x: auto;
}

/* Calculation Table Styles */
.calc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border: 1px solid #dee2e6;
}

.calc-table th, .calc-table td {
    border: 1px solid #dee2e6;
    padding: 12px;
    text-align: center;
    vertical-align: middle;
}

.calc-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.calc-zone-title {
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.calc-zone-desc {
    font-size: 0.85em;
    color: #666;
}

.calc-numbers {
    font-family: monospace;
    font-size: 1.1em;
    color: #333;
}

.calc-sum {
    font-weight: bold;
    color: #333;
}

.calc-result-ball {
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background-color: #d32f2f; /* Red for results */
    color: white;
    font-size: 20px;
    font-weight: bold;
    display: inline-block;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.calc-final-row {
    background-color: #fff3e0;
}

.calc-final-equation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2em;
    font-weight: bold;
}

.calc-operator {
    color: #666;
}

.calc-total-ball {
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    background-color: #d32f2f;
    color: white;
    font-size: 24px;
    font-weight: bold;
    display: inline-block;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.calc-total-ball.type-bao { 
    background: linear-gradient(135deg, #ff4d4f 0%, #f5222d 100%); 
    box-shadow: 0 4px 12px rgba(245, 34, 45, 0.4);
}
.calc-total-ball.type-shun { 
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%); 
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}
.calc-total-ball.type-dui { 
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%); 
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
}
.calc-total-ball.type-ban { 
    background: linear-gradient(135deg, #faad14 0%, #d48806 100%); 
    box-shadow: 0 4px 12px rgba(250, 173, 20, 0.4);
}
.calc-total-ball.type-za { 
    background: linear-gradient(135deg, #ab47bc 0%, #8e24aa 100%);
    box-shadow: 0 4px 12px rgba(142, 36, 170, 0.4);
}

.calc-draw-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.calc-draw-number {
    display: inline-block;
    color: #007bff;
    font-weight: bold;
    font-size: 1.1em;
}

.calc-draw-number.ignored {
    color: #999;
    font-weight: normal;
}

.calc-draw-number.zone1 { color: #007bff; }
.calc-draw-number.zone2 { color: #ff9800; }
.calc-draw-number.zone3 { color: #d32f2f; } /* Wait, image uses single color but maybe alternating is better? Image uses blue, yellow, red for the final balls, but the list of numbers is just blue numbers. I'll stick to blue numbers but maybe highlight positions? The image just lists them. */

@keyframes fadeIn {
    from {opacity: 0} 
    to {opacity: 1}
}

@keyframes slideIn {
    from {transform: translateY(-50px); opacity: 0}
    to {transform: translateY(0); opacity: 1}
}

/* Top Navigation */
.top-nav {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
    font-size: 14px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.top-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    font-weight: bold;
    font-size: 18px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Segoe UI', sans-serif;
}

.divider {
    color: #ddd;
    font-size: 16px;
}

.nav-left .home-link {
    color: #555;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.nav-left .home-link:hover {
    color: #0093E9;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-greeting {
    color: #555;
    margin-right: 10px;
}

.nav-btn {
    text-decoration: none;
    padding: 6px 15px;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-block; /* Ensure it renders as a button-like element */
    cursor: pointer;
}

.nav-btn:not(.login):not(.register):not(.logout) {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.nav-btn:not(.login):not(.register):not(.logout):hover {
    background-color: #e2e6ea;
    border-color: #dae0e5;
}


.nav-btn.login {
    color: #0093E9;
    border: 1px solid #0093E9;
}

.nav-btn.login:hover {
    background-color: #e6f4ff;
}

.nav-btn.register {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.nav-btn.register:hover {
    opacity: 0.9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-btn.logout {
    color: #666;
}

.nav-btn.logout:hover {
    color: #d9534f;
}

/* Auth Pages */
.auth-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 0 15px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 40px;
    border: 1px solid #f0f0f0;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.auth-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus {
    border-color: #0093E9;
    box-shadow: 0 0 0 3px rgba(0, 147, 233, 0.1);
    outline: none;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.2s;
}

.auth-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: #666;
}

.auth-footer a {
    color: #0093E9;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

.flash-message.error {
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.flash-message.success {
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.view-rules-btn {
    display: inline-block;
    margin-left: 10px;
    padding: 5px 15px;
    background-color: #17a2b8;
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.view-rules-btn:hover {
    background-color: #138496;
}

/* Dashboard Styles */
.dashboard-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
    gap: 30px;
    min-height: 600px;
}

.dash-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    padding: 20px 0;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.dash-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dash-menu li {
    margin: 0;
}

.dash-menu a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.dash-menu a:hover, .dash-menu a.active {
    background-color: #f8f9fa;
    color: #0093E9;
    border-left-color: #0093E9;
}

.dash-menu a.logout-link {
    color: #dc3545;
    margin-top: 10px;
    border-top: 1px solid #eee;
}

.dash-menu a.logout-link:hover {
    background-color: #fff5f5;
    border-left-color: #dc3545;
}

.dash-main {
    flex: 1;
}

.dash-welcome {
    background: linear-gradient(135deg, #0093E9 0%, #80D0C7 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 147, 233, 0.2);
}

.dash-welcome h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.dash-welcome p {
    margin: 0;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #f0f0f0;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    color: #888;
    font-size: 14px;
    font-weight: 500;
}

.section-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.action-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #f0f0f0;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    border-color: #0093E9;
}

.action-card h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.action-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.recent-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    overflow: hidden;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-info h5 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 15px;
}

.recent-meta {
    font-size: 12px;
    color: #999;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-completed { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.status-running { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.status-failed { background: #fff1f0; color: #f5222d; border: 1px solid #ffa39e; }
.status-pending { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-top: 40px;
    color: #6c757d;
    font-size: 14px;
}

footer p {
    margin: 0;
}

/* Original Code Styles */
.original-code-container {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
    text-align: center;
}

/* Trend Chart Styles */
.trend-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 20px;
    margin: 20px auto;
    max-width: 1400px;
}

.trend-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.control-left .game-title {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.game-tabs-small {
    display: flex;
    gap: 10px;
}

.tab-link {
    padding: 5px 15px;
    border-radius: 20px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    background: #f5f5f5;
    transition: all 0.2s;
}

.tab-link:hover, .tab-link.active {
    background: var(--primary-color);
    color: white;
}

.limit-form label {
    color: #666;
    font-size: 14px;
    margin-right: 5px;
}

.limit-form select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    color: #333;
}

.trend-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.trend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
    table-layout: fixed;
}

.trend-table th, .trend-table td {
    border: 1px solid #e0e0e0;
    padding: 8px 4px;
    white-space: nowrap;
}

.trend-table thead tr {
    background: #f8f9fa;
}

.trend-table th {
    font-weight: 600;
    color: #555;
}

/* Specific Column Styles */
.trend-table td:nth-child(1) { /* Expect */
    background: #fcfcfc;
    color: #666;
}

.trend-table td.total-cell {
    font-weight: bold;
    color: var(--primary-color);
    background: #f0f9ff;
}

/* Attributes */
.cell-attr {
    color: #e0e0e0; /* Inactive color */
}

.cell-attr.active {
    color: #333;
    font-weight: bold;
}

/* For specific attribute colors if needed */
.cell-attr.active-big { color: #f5222d; font-weight: bold; } 
.cell-attr.active-small { color: #1890ff; font-weight: bold; } 
.cell-attr.active-odd { color: #fa8c16; font-weight: bold; } 
.cell-attr.active-even { color: #52c41a; font-weight: bold; } 

.cell-attr.active-leopard {
    background-color: #ff4d4f;
    color: white !important;
    border-radius: 4px;
}

/* Tail/Numbers Matrix */
.cell-tail {
    color: #f0f0f0;
    width: 25px;
}

.cell-tail.active {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* Remainders */
.cell-rem {
    color: #666;
}

.trend-footer {
    color: #999;
    font-size: 13px;
    text-align: center;
    margin-top: 10px;
}

/* Prediction Badges */
.pred-badges {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.pred-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.badge-blue {
     background-color: #e6f7ff;
     color: #1890ff;
     border: 1px solid #91d5ff;
 }

 /* Table Scroll Wrapper */
 .table-scroll-wrapper {
     overflow-x: auto;
     margin-bottom: 20px;
 }
 
 /* Column Specifics */
.col-expect {
    width: 90px;
    max-width: 90px;
    background: #f9f9f9;
    padding: 4px 6px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}
 
.col-time {
    width: 70px;
    max-width: 70px;
    color: #888;
    padding: 4px 6px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}
 
 /* Headers */
 .group-sum { background: #e6f7ff !important; color: #1890ff; }
 .group-attr { background: #fff7e6 !important; color: #fa8c16; }
 .group-tail { background: #f6ffed !important; color: #52c41a; }
 .group-rem { background: #fff0f6 !important; color: #eb2f96; }
 
 .stat-row th {
     font-size: 11px;
     color: #999;
     padding: 4px;
     font-weight: normal;
 }
 
 .stat-cell {
     background: #fff;
 }
 
 .highlight-stat {
     color: #333;
     font-weight: bold;
 }
 
 .num-header { width: 20px; }
 .attr-header { width: 25px; }
 .tail-header { width: 20px; }
 .rem-header { width: 20px; }
 
 /* Trend Cells */
 .cell-sum {
     width: 20px;
     height: 20px;
     padding: 2px !important;
 }
 
 .ball-trend {
     display: block;
     width: 20px;
     height: 20px;
     line-height: 20px;
     border-radius: 50%;
     margin: 0 auto;
     font-size: 12px;
 }
 
 .cell-sum.active .ball-trend {
     background: var(--primary-color);
     color: white;
     font-weight: bold;
     box-shadow: 0 2px 4px rgba(0,0,0,0.2);
 }
 
 .cell-sum.active-mid-ball .ball-trend {
     background: #ff4d4f; /* Red for middle numbers usually */
     color: white;
     font-weight: bold;
 }

 /* Canada36 Types */
 .ball-trend.type-bao { background: #ff4d4f; color: white; }
 .ball-trend.type-shun { background: #1890ff; color: white; }
 .ball-trend.type-dui { background: #52c41a; color: white; }
 .ball-trend.type-ban { background: #faad14; color: white; }
 .ball-trend.type-za { background: #8e24aa; color: white; }
 
 .cell-edge-bg {
     background-color: #fcfcfc;
 }
 
 /* More Attribute Colors */
 .cell-attr.active-mid { color: #722ed1; font-weight: bold; }
 .cell-attr.active-edge { color: #13c2c2; font-weight: bold; }
 .cell-attr.active-dragon { color: #f5222d; font-weight: bold; }
 .cell-attr.active-tiger { color: #fa8c16; font-weight: bold; }

 .original-code-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.original-code-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 800px;
    margin: 0 auto;
}

.code-badge {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    background: #f8f9fa;
    border-radius: 50%;
    font-size: 12px;
    color: #666;
    text-align: center;
    border: 1px solid #e9ecef;
    font-family: monospace;
}

/* Trend Page Styles */
.trend-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin: 20px auto;
    max-width: 1400px; /* Wider for trend table */
}

/* Enhanced Trend Controls */

/* Content Card (Generic container for forms/tables in dashboard) */
.content-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-control, .form-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-control:focus, .form-select:focus {
    border-color: #0093E9;
    box-shadow: 0 0 0 3px rgba(0, 147, 233, 0.1);
    outline: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #007bb5;
    box-shadow: 0 4px 12px rgba(0, 147, 233, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #555;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* Specific Inputs */
.small-input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
}
.code-editor {
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fcfcfc;
    color: #333;
    line-height: 1.5;
    min-height: 300px;
    resize: vertical;
}

.code-editor:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Strategy Config Builder */
.mode-switch {
    display: flex;
    gap: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.mode-switch label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
}

.config-section {
    margin-top: 25px;
    padding: 20px;
    background: #fcfcfc;
    border: 1px solid #eee;
    border-radius: 8px;
}

.config-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    border-left: 3px solid #0093E9;
    padding-left: 10px;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}


.bet-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.bet-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: white;
    padding: 8px 15px;
    border: 1px solid #eee;
    border-radius: 20px;
    transition: all 0.2s;
}

.bet-options label:hover {
    border-color: #0093E9;
    color: #0093E9;
}

.hint {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
}

/* Result Attributes Badges */
.result-attributes {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.attr-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.attr-badge:hover {
    transform: translateY(-2px);
}

.attr-big { background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%); } /* Orange */
.attr-small { background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%); } /* Blue */
.attr-odd { background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%); } /* Green */
.attr-even { background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%); } /* Purple */
.attr-dtl { background: linear-gradient(135deg, #607D8B 0%, #455A64 100%); } /* Grey */
.attr-extreme { background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%); } /* Red */

/* Prediction Badges */
.pred-badges {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}

.pred-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: white;
    font-weight: bold;
}

.badge-green { background-color: #52c41a; }
.badge-red { background-color: #f5222d; }
.badge-blue { background-color: #1890ff; }

/* Result Icons */
.result-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-icon {
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.icon-waiting {
    background-color: #FF9800;
    color: white;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.icon-success {
    background-color: #52c41a;
}

.icon-fail {
    background-color: #f5222d;
}

.icon-partial {
    background-color: #95de64; /* Lighter green for partial success */
}




