/* CSS for 3D Basketball Shooting Game */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0b0e14;
    font-family: 'Outfit', sans-serif;
    color: #fff;
}

/* Home Link */
.home-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    z-index: 100;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    transition: all 0.3s ease;
}

.home-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateX(-3px);
}

/* Language Selector */
.lang-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 30px;
}

.lang-selector button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.lang-selector button.active {
    background: #ff5722;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 87, 34, 0.5);
}

/* Canvas Container */
#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Swipe Indicator Canvas & Hint */
#swipe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none; /* Let clicks pass through */
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 80px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#swipe-overlay.hidden {
    opacity: 0;
}

.swipe-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 90%;
    width: 380px;
}

.animated-ball {
    font-size: 2.5rem;
    color: #ff5722;
    margin-bottom: 12px;
    animation: bounceSwipe 1.5s infinite ease-in-out;
}

.swipe-hint span {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.swipe-hint small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

@keyframes bounceSwipe {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-25px) scale(0.95);
        text-shadow: 0 10px 15px rgba(255, 87, 34, 0.4);
    }
}

/* HUD System */
#hud {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 20px;
    width: 90%;
    max-width: 600px;
    justify-content: space-between;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#hud.hud-hidden {
    opacity: 0;
    transform: translate(-50%, -20px);
}

.hud-item {
    background: rgba(15, 22, 36, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px 20px;
    min-width: 110px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.hud-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.hud-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
}

.center-stats {
    flex-grow: 1;
    max-width: 180px;
    position: relative;
    overflow: visible;
}

.multiplier-tag {
    position: absolute;
    bottom: -22px;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(255, 87, 34, 0.4);
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.multiplier-tag.active {
    opacity: 1;
    transform: scale(1.1);
}

/* Overlays (Main Menu & Game Over) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: rgba(7, 10, 18, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    background: rgba(20, 27, 45, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    width: 90%;
    max-width: 460px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(1);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay.hidden .overlay-content {
    transform: scale(0.85);
}

/* Logo Styling */
.logo-container {
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 4rem;
    color: #ff5722;
    filter: drop-shadow(0 0 15px rgba(255, 87, 34, 0.6));
    animation: spinSlow 10s linear infinite;
    margin-bottom: 10px;
}

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

.overlay h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 1px;
}

.overlay h1 span {
    color: #ff5722;
    font-size: 2.6rem;
    font-weight: 900;
}

.subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* Buttons */
.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 16px 40px;
    border-radius: 35px;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    margin-bottom: 25px;
    letter-spacing: 1.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: #fff;
    box-shadow: 0 10px 25px rgba(255, 87, 34, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 87, 34, 0.6);
}

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

/* Guide */
.controls-guide {
    text-align: left;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.controls-guide h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.controls-guide ul {
    list-style: none;
}

.controls-guide li {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
}

.controls-guide li:last-child {
    margin-bottom: 0;
}

.controls-guide li i {
    color: #ff5722;
    margin-right: 12px;
    margin-top: 3px;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* GameOver Panel Specific */
#gameover-overlay h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff5722;
    letter-spacing: 2px;
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(255, 87, 34, 0.4);
}

.final-score-box {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 0;
    margin-bottom: 25px;
}

.final-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    letter-spacing: 1.5px;
}

.final-value {
    display: block;
    font-size: 3.5rem;
    font-weight: 900;
    color: #ff9800;
    text-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 30px;
}

.stat-col {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 10px;
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-lbl {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-val {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Loading Screen */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0b0e14;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 87, 34, 0.2);
    border-left-color: #ff5722;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

#loading-screen p {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

/* Clean score popup animation inside 3D environment */
.score-popup {
    position: absolute;
    transform: translate(-50%, -50%);
    font-weight: 900;
    color: #ff9800;
    pointer-events: none;
    z-index: 4;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(255, 152, 0, 0.8), 0 0 2px #000;
    animation: floatUpAndFade 1.2s forwards cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes floatUpAndFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -30px) scale(0.6);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -120px) scale(1);
    }
}

/* Responsiveness */
@media (max-width: 480px) {
    .home-link {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    #hud {
        top: 80px;
        gap: 10px;
    }
    .hud-item {
        padding: 8px 12px;
        min-width: 90px;
    }
    .hud-value {
        font-size: 1.4rem;
    }
    .overlay-content {
        padding: 30px 20px;
    }
    .overlay h1 {
        font-size: 1.8rem;
    }
    .overlay h1 span {
        font-size: 2.2rem;
    }
    .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    .final-value {
        font-size: 2.8rem;
    }
}

/* Shooting Power Bar */
#shot-bar-container {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 240px;
    background: rgba(10, 15, 25, 0.65);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    z-index: 100;
    display: none; /* Hidden by default, shown during charge */
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
}

#shot-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, 
        #ff3333 0%, 
        #ffcc00 50%, 
        #00ff66 70%, 
        #00ff66 85%, 
        #ffcc00 90%, 
        #ff3333 100%
    );
    border-radius: 10px;
}

#shot-bar-indicator {
    position: absolute;
    left: -2px;
    width: 28px;
    height: 8px;
    background: #ffffff;
    border: 2px solid #111111;
    border-radius: 4px;
    box-shadow: 0 0 10px #ffffff;
    bottom: 0%; /* Moves from 0% to 100% in JS */
    transform: translateY(4px); /* Center height alignment */
}
