body {
    background: radial-gradient(circle at top, #0f0f23, #000);
    font-family: Arial, sans-serif;
    color: #fff;
    display: flex;
    justify-content: center;
    padding-top: 40px;
    margin: 0; /* Added: Full-screen consistency */
}

.container {
    max-width: 360px; /* Changed: Responsive width */
    width: 100%; /* Added: Full on mobile */
    text-align: center;
    padding: 0 10px; /* Added: Side margins */
}

.title {
    font-size: 36px;
    margin-bottom: 25px;
    color: #06b6d4;
    text-shadow: 0 0 25px #06b6d4;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center; /* Added: Vertical alignment */
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Added: Wrap on small screens */
}

.input {
    background: #1b1b35;
    color: white;
    padding: 8px;
    border: none;
    border-radius: 8px;
    min-width: 80px; /* Added: Consistent sizing */
    transition: box-shadow 0.2s; /* Added: Smooth focus */
}

.input:focus {
    outline: none;
    box-shadow: 0 0 10px #06b6d4; /* Added: Glow on focus */
}

.btn {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 15px #8b5cf6;
    transition: transform 0.2s; /* Added: Smooth scale */
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active { /* Added: Pressed state */
    transform: scale(0.98);
}

.coin-area {
    margin-top: 40px;
    height: 180px;
    display: flex;
    justify-content: center;
    perspective: 1000px; /* Added: 3D space for the entire area */
}

.coin {
    width: 140px;
    height: 140px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s ease-out;
}

.face {
    position: absolute;
    width: 140px;
    height: 140px;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 0 10px white;
    border: 2px solid #fff; /* Added: Subtle border for definition */
}

.heads {
    background: linear-gradient(135deg, #ffd700, #b8860b);
    color: black;
}

.tails {
    background: linear-gradient(135deg, #9ca3af, #4b5563);
    transform: rotateY(180deg);
    color: white;
}

.result {
    margin-top: 30px;
    font-size: 28px;
    min-height: 40px;
    font-weight: bold; /* Added: Better visibility */
    text-shadow: 0 0 5px currentColor; /* Added: Glow effect */
    transition: color 0.3s; /* Added: Smooth color change */
}

/* New: Header styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(26, 26, 58, 0.8);
    border-radius: 10px;
    box-shadow: 0 0 10px #06b6d4;
}

.home-btn {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
}

.home-btn:hover {
    transform: scale(1.05);
}

.balance {
    font-size: 18px;
    color: #00ffae;
    font-weight: bold;
    text-shadow: 0 0 5px #00ffae;
}

/* Added: Media query for mobile */
@media (max-width: 480px) {
    .title {
        font-size: 28px;
    }
    
    .controls {
        flex-direction: column; /* Stack on very small screens */
        align-items: stretch;
        gap: 8px;
    }
    
    .input,
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .coin {
        width: 120px;
        height: 120px;
    }
    
    .face {
        width: 120px;
        height: 120px;
        font-size: 28px;
    }
    
    .result {
        font-size: 24px;
    }
}