/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: white;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-wrap: wrap;
    gap: 15px;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 20px;
    background: linear-gradient(to right, #ff8a00, #e52e71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #ffcc00;
}

h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #ffcc00;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

/* User Info Styles */
.user-info {
    display: flex;
    gap: 10px;
    align-items: center;
    
}

.user-info span {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Game Area Styles */
#gameArea {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 300px;
    margin: 20px auto;
    overflow: hidden;
    border: 2px solid #ff8800;
    border-radius: 10px;
    box-shadow: 0 0 20px #000;
    background: #030617;
}

.sky {
    position: absolute;
    width: 200%;
    height: 200%; 
    background: #030617;
    will-change: transform;
    transform: translate(0%, -50%); 
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(8px);
    animation: moveClouds linear infinite;
}

@keyframes moveClouds {
    from { left: -300px; }
    to { left: 700px; }
}

#plane {
    position: absolute;
    width: 15%;
    bottom: 0;
    left: 0;
    z-index: 10;
    transform: rotate(-15deg);
    will-change: transform;
    transition: transform 0.1s linear;
}

#trailCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#score {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: clamp(24px, 6vw, 48px);
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    font-weight: bold;
    z-index: 20;
}

/* Countdown Styles */
/* Countdown Styles */
#countdownContainer {
    position: absolute;
    bottom: 15px;
    right: 20px;
    z-index: 20;
    display: flex;
    align-items: center;
}

#countdownDashes {
    position: relative;
    width: 60px;
    height: 60px;
    margin-right: 10px;
    transition: transform 0.5s ease;
}

.dash {
    position: absolute;
    width: 4px;
    height: 12px;
    background-color: #fff;
    border-radius: 2px;
    top: 0;
    left: 50%;
    margin-left: -2px;
    transform-origin: 50% 30px;
    transition: background-color 0.3s;
}

#dash1 { transform: rotate(0deg); }
#dash2 { transform: rotate(45deg); }
#dash3 { transform: rotate(90deg); }
#dash4 { transform: rotate(135deg); }
#dash5 { transform: rotate(180deg); }
#dash6 { transform: rotate(225deg); }
#dash7 { transform: rotate(270deg); }
#dash8 { transform: rotate(315deg); }

.dash.orange {
    background-color: #ff8800;
}

#countdown {
    font-size: clamp(30px, 8vw, 60px);
    color: #fff;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
}

/* Explosion Styles */
#explosion {
    position: absolute;
    bottom: 0; 
    left: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #fff7ae 0%, #ffb300 40%, #ff3d00 70%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 40px 20px rgba(255, 120, 0, 1);
    opacity: 0;
    z-index: 30;
    will-change: transform, opacity;
}

/* Bet Controls Styles */
/* Add to existing button styles */
.start-btn {
    background: #f06514;
    box-shadow: 0 4px 15px rgba(0, 180, 155, 0.4);
}

.stop-btn {
    background: linear-gradient(to right, #ff416c, #ff4b2b);
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.4);
}

/* Ensure both buttons have same basic styles */
#start-btn, #stop-btn {
    min-width: 200px;
    padding: 10px 20px;
    font-size: 16px;
    transition: all 0.3s ease;
}

/* Button container to maintain layout */
.bet-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    min-height: 60px; /* Prevent layout shift */
}

.bet-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    
}

.bet-input {
    padding: 5px;
    border-radius: 5px;
    border: 2px solid #ff8800;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    width: 60px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bet-input:focus {
    outline: none;
    border-color: #ffcc00;
    background: rgba(255, 255, 255, 0.15);
}

.bet-input:hover {
    background: rgba(255, 255, 255, 0.15);
}

.quick-bets {
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 8px;
    font-size: 12px;
    background: #2e335b;
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Button Styles */
.btn {
    background: #2e335b;
    color: white;
    border: none;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-width: 50px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

.btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}



.logout-btn {
    background: #2e335b;
}

.back-btn {
    background: linear-gradient(to right, #667eea, #764ba2);
}

/* History Section Styles */
.history-section {
    margin-top: 40px;
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.history-item span:first-child {
    color: #ffcc00;
    font-weight: bold;
}

.history-item span:nth-child(2) {
    color: #00b09b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
       
        gap: 10px;
        text-align: center;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .user-info {
        
        gap: 10px;
    }
    
    .bet-controls {
        
        gap: 15px;
    }
    
    .bet-input-group {
       
        gap: 10px;
    }
    
    .quick-bets {
        justify-content: center;
    }
    
    .btn {
        
        max-width: 100px;
    }
    
    #gameArea {
        height: 250px;
    }
    
    #plane {
        width: 20%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    #gameArea {
        height: 200px;
    }
    
    #plane {
        width: 30%;
    }
     .user-info {
        
        gap: 10px;
    }
}