@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #9945FF;
    --primary-dark: #7d2bdb;
    --secondary: #14F195;
    --success: #14F195;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(17, 17, 27, 0.8);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --sol-purple: #9945FF;
    --sol-cyan: #14F195;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0f;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    overflow-x: hidden;
    position: relative;
    margin: 0;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(153, 69, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(20, 241, 149, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(153, 69, 255, 0.1) 0%, transparent 50%);
    animation: backgroundShift 20s ease infinite;
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

/* Floating particles */
.particle {
    position: fixed;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
    animation: float 15s infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

.container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 
        0 0 0 1px var(--glass-border),
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 650px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Header */
header {
    background: rgba(17, 17, 27, 0.95);
    backdrop-filter: blur(20px);
    padding: 6px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(153, 69, 255, 0.2);
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(153, 69, 255, 0.05) 0%, transparent 70%);
    animation: headerGlow 10s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10%, 10%); }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sol-logo {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 12px rgba(153, 69, 255, 0.6));
}

.game-title {
    font-size: 0.95em;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(135deg, var(--sol-cyan) 0%, var(--sol-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 2px 8px rgba(153, 69, 255, 0.4));
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.score-item {
    background: linear-gradient(135deg, rgba(153, 69, 255, 0.2) 0%, rgba(20, 241, 149, 0.2) 100%);
    padding: 3px 8px;
    border-radius: 5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(153, 69, 255, 0.3);
    transition: all 0.3s ease;
}

.score-item:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(153, 69, 255, 0.3) 0%, rgba(20, 241, 149, 0.3) 100%);
    box-shadow: 0 8px 24px rgba(153, 69, 255, 0.4);
    border-color: rgba(153, 69, 255, 0.5);
}

.score-item .label {
    font-size: 0.55em;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-item .value {
    font-size: 0.9em;
    font-weight: 800;
    display: block;
    margin-top: 1px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main Content */
main {
    padding: 8px;
}

/* Chart Container */
.chart-container {
    position: relative;
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.9) 0%, rgba(17, 17, 27, 0.9) 100%);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 8px 32px rgba(153, 69, 255, 0.2);
    border: 1px solid rgba(153, 69, 255, 0.2);
    height: 220px;
}

#priceChart {
    width: 100%;
    height: 100%;
    border-radius: 16px;
}

.prediction-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1em;
    display: none;
    animation: slideInRight 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.prediction-badge.active {
    display: block;
}

.prediction-badge.up {
    background: linear-gradient(135deg, var(--sol-cyan) 0%, #0ec77d 100%);
    color: #000;
    box-shadow: 0 8px 32px rgba(20, 241, 149, 0.4);
    font-weight: 900;
}

.prediction-badge.down {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
}

@keyframes slideInRight {
    from {
        transform: translateX(100px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Game Status */
.game-status {
    text-align: center;
    margin-bottom: 8px;
    padding: 6px;
    background: var(--glass);
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.game-status p {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.7em;
}

.game-status .positive {
    color: var(--success);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.game-status .negative {
    color: var(--danger);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Timer */
.timer-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer {
    background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 
        0 8px 32px rgba(245, 158, 11, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 100%;
}

.timer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: timerGlow 2s ease-in-out infinite;
}

@keyframes timerGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(5%, 5%); }
}

.timer-value {
    display: block;
    font-size: 2.2em;
    font-weight: 900;
    position: relative;
    z-index: 1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.timer.urgent {
    animation: urgentPulse 0.5s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(245, 158, 11, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 48px rgba(245, 158, 11, 0.8), 0 0 60px rgba(245, 158, 11, 0.6);
    }
}

/* Prediction Buttons */
.prediction-buttons {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    margin-bottom: 8px;
    align-items: stretch;
}

.btn {
    padding: 10px 8px;
    border: none;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.btn:active:not(:disabled) {
    transform: translateY(-4px) scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-down {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.btn-down:hover:not(:disabled) {
    box-shadow: 0 16px 48px rgba(239, 68, 68, 0.5);
}

.btn-up {
    background: linear-gradient(135deg, var(--sol-cyan) 0%, #0ec77d 100%);
    color: #000;
    border: 2px solid rgba(20, 241, 149, 0.3);
    font-weight: 900;
}

.btn-up:hover:not(:disabled) {
    box-shadow: 0 16px 48px rgba(20, 241, 149, 0.5);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px 48px;
    font-size: 1.1em;
    border: 2px solid rgba(99, 102, 241, 0.3);
}

.btn .arrow {
    font-size: 1.2em;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.btn span {
    position: relative;
    z-index: 1;
}

.btn .multiplier {
    font-size: 0.45em;
    opacity: 0.9;
    margin-top: 0;
    font-weight: 700;
}

.btn.pulse {
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Result Display */
.result-display {
    text-align: center;
    padding: 16px;
    background: var(--glass);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
}

.result-animation {
    font-size: 2.8em;
    margin-bottom: 8px;
    animation: resultBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
}

@keyframes resultBounce {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.result-content h2 {
    font-size: 1.3em;
    margin-bottom: 8px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.result-content p {
    font-size: 0.8em;
    margin-bottom: 10px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.result-content.win h2 {
    background: linear-gradient(135deg, var(--sol-cyan) 0%, var(--sol-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(153, 69, 255, 0.3);
}

.result-content.lose h2 {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.65em;
    font-weight: 500;
    border-top: 1px solid var(--glass-border);
}

footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.x-link {
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.x-logo {
    width: 14px;
    height: 14px;
    fill: var(--text-secondary);
    transition: all 0.3s ease;
}

.x-link:hover .x-logo {
    fill: #ffffff;
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(153, 69, 255, 0.6));
}

/* Confetti Canvas */
#confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Price Flash Effects - removed, no longer needed */

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
    }
    
    .logo-section {
        justify-content: center;
    }
    
    .game-title {
        font-size: 1.3em;
    }
    
    .sol-logo {
        width: 28px;
        height: 28px;
    }
    
    .prediction-buttons {
        grid-template-columns: 1fr;
    }
    
    .score-board {
        gap: 8px;
        width: 100%;
        justify-content: center;
    }
    
    .chart-container {
        height: 220px;
    }
    
    main {
        padding: 16px;
    }
    
    .btn {
        padding: 20px 16px;
        font-size: 1em;
    }
    
    header {
        padding: 12px 16px;
    }
    
    .score-item {
        padding: 6px 12px;
        flex: 1;
        min-width: 80px;
    }
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}
