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

:root {
    --primary: #6c63ff;
    --primary-dark: #4a42d4;
    --secondary: #00d4aa;
    --red: #ff4757;
    --green: #2ed573;
    --violet: #a855f7;
    --bg-dark: #0a0e1a;
    --bg-card: #141b2d;
    --bg-card-hover: #1a2340;
    --text: #e4e4e7;
    --text-dim: #8b8fa3;
    --border: #2a3050;
    --gold: #ffd700;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    animation: float 15s infinite;
    opacity: 0.3;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 20s; }
.particle:nth-child(2) { left: 30%; animation-delay: 2s; animation-duration: 18s; }
.particle:nth-child(3) { left: 50%; animation-delay: 4s; animation-duration: 22s; }
.particle:nth-child(4) { left: 70%; animation-delay: 1s; animation-duration: 16s; }
.particle:nth-child(5) { left: 90%; animation-delay: 3s; animation-duration: 19s; }

@keyframes float {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    50% { opacity: 0.5; }
    100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* Header */
header {
    background: linear-gradient(135deg, #141b2d 0%, #1a1040 100%);
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 4px 30px rgba(108, 99, 255, 0.2);
}

.logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 5px 0;
}

.logo .fa-trophy {
    font-size: 2rem;
    color: var(--gold);
    animation: pulse 2s infinite;
}

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

.subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: var(--secondary);
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Main */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

section:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.1);
}

section h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Period Section */
.period-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.period-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px 15px;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.period-btn:hover {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.1);
}

.period-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px rgba(108, 99, 255, 0.4);
}

.period-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
}

.countdown {
    font-family: 'Orbitron', sans-serif;
    color: var(--gold);
    font-weight: 700;
}

/* History Section */
.hint {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 15px;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.num-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Orbitron', sans-serif;
}

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

.num-btn.red {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: white;
}

.num-btn.green {
    background: linear-gradient(135deg, #2ed573, #7bed9f);
    color: white;
}

.num-btn.violet {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    color: white;
}

.num-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.history-display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
}

.history-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 40px;
    align-items: center;
}

.history-list .empty-msg {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.9rem;
}

.history-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.history-item.red { background: var(--red); }
.history-item.green { background: var(--green); }
.history-item.violet { background: var(--violet); }

.history-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.action-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.action-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

/* Predict Button */
.predict-section {
    text-align: center;
    margin: 25px 0;
}

.predict-btn {
    position: relative;
    padding: 16px 50px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    letter-spacing: 1px;
}

.predict-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(108, 99, 255, 0.4);
}

.predict-btn:active {
    transform: translateY(-1px);
}

.btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: rotate 3s linear infinite;
}

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

/* Results Section */
.results-section.hidden {
    display: none;
}

.result-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence {
    background: rgba(0, 212, 170, 0.15);
    color: var(--secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

/* Number Prediction */
.predicted-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    text-align: center;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin: 10px 0;
}

.number-probabilities {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.prob-item {
    text-align: center;
    padding: 6px 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.prob-item.highlight {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.1);
}

.prob-item .prob-num {
    font-weight: 700;
    font-size: 1rem;
    display: block;
}

.prob-item .prob-pct {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* Color Prediction */
.color-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.color-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    animation: colorPulse 2s infinite;
}

@keyframes colorPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(108, 99, 255, 0.5); }
}

.color-circle.red { background: var(--red); }
.color-circle.green { background: var(--green); }
.color-circle.violet { background: var(--violet); }

#predictedColor {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

.color-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-label {
    width: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.red-text { color: var(--red); }
.green-text { color: var(--green); }
.violet-text { color: var(--violet); }

.bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.red-bar { background: var(--red); }
.green-bar { background: var(--green); }
.violet-bar { background: var(--violet); }

.bar-value {
    width: 35px;
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: right;
}

/* Big Small Prediction */
.bigsmall-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.bs-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    border-radius: 12px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    min-width: 100px;
}

.bs-option.active {
    border-color: var(--secondary);
    background: rgba(0, 212, 170, 0.1);
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.2);
}

.bs-option i {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.bs-option span {
    font-weight: 600;
}

.bs-range {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.bs-percent {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: var(--secondary);
    margin-top: 5px;
}

.bs-vs {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Strategy Card */
.strategy-content {
    font-size: 0.95rem;
    line-height: 1.6;
}

.strategy-content .strategy-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.strategy-content .strategy-tip:last-child {
    border-bottom: none;
}

.strategy-content .tip-icon {
    color: var(--gold);
    margin-top: 3px;
}

.strategy-content .tip-text strong {
    color: var(--secondary);
}

/* Prediction Log */
.prediction-log {
    max-height: 300px;
    overflow-y: auto;
}

.prediction-log::-webkit-scrollbar {
    width: 6px;
}

.prediction-log::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.empty-log {
    color: var(--text-dim);
    text-align: center;
    font-style: italic;
}

.log-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.log-entry .log-time {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.log-entry .log-prediction {
    display: flex;
    gap: 10px;
    align-items: center;
}

.log-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.log-badge.red { background: rgba(255, 71, 87, 0.2); color: var(--red); }
.log-badge.green { background: rgba(46, 213, 115, 0.2); color: var(--green); }
.log-badge.violet { background: rgba(168, 85, 247, 0.2); color: var(--violet); }
.log-badge.big { background: rgba(0, 212, 170, 0.2); color: var(--secondary); }
.log-badge.small { background: rgba(108, 99, 255, 0.2); color: var(--primary); }

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

.disclaimer {
    margin-top: 5px;
    color: var(--red);
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 600px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .stats-bar {
        gap: 15px;
    }

    .stat-value {
        font-size: 1rem;
    }

    .number-pad {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .num-btn {
        padding: 10px;
        font-size: 1.1rem;
    }

    .predicted-number {
        font-size: 3rem;
    }

    .bigsmall-result {
        gap: 10px;
    }

    .bs-option {
        padding: 10px 15px;
        min-width: 80px;
    }

    .predict-btn {
        padding: 14px 35px;
        font-size: 1rem;
    }

    .number-probabilities {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 400px) {
    main {
        padding: 10px;
    }

    section {
        padding: 15px;
    }

    .period-buttons {
        flex-wrap: wrap;
    }

    .period-btn {
        min-width: 60px;
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}
