/* ========================================
   BASKETBALL SHOT - Tiro al Aro
   Estilos CSS
   ======================================== */

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

body {
    font-family: 'Arial', sans-serif;
    background: #1a1a2e;
    color: #fff;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 80px 0 20px 0;
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */

#game-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ========================================
   PANTALLAS
   ======================================== */

.screen {
    display: none;
    min-height: 600px;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ========================================
   PANTALLA DE INICIO
   ======================================== */

.menu-content {
    text-align: center;
    max-width: 700px;
    padding: 30px 20px;
    width: 100%;
}

.game-title {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s infinite;
}

.game-subtitle {
    font-size: 1.3em;
    color: #ffd700;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0 30px 0;
}

.info-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.5);
}

.card-icon {
    font-size: 3em;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.info-card h3 {
    color: #ffd700;
    font-size: 1.2em;
    margin-bottom: 12px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.info-card p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 0.95em;
    margin-bottom: 8px;
}

.scoring-card {
    grid-column: 1 / -1;
}

.scoring-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 8px 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.score-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    min-width: 70px;
    text-align: center;
}

.score-badge.gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.4);
}

.score-badge.silver {
    background: linear-gradient(135deg, #4CAF50, #81C784);
    color: white;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.score-badge.bronze {
    background: linear-gradient(135deg, #2196F3, #64B5F6);
    color: white;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* ========================================
   BOTONES
   ======================================== */

.game-btn {
    padding: 16px 50px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    min-width: 250px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd700 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.primary-btn:hover::before {
    width: 300px;
    height: 300px;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.5);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.control-btn {
    padding: 10px 20px;
    font-size: 1em;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid white;
    border-radius: 25px;
    cursor: pointer;
    margin: 0 5px;
    transition: all 0.3s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* ========================================
   PANTALLA DE JUEGO
   ======================================== */

#game-screen {
    position: relative;
    background: linear-gradient(to bottom, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
    padding: 0;
}

/* Gradas */
.stands {
    position: absolute;
    top: 0;
    width: 15%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        #2c3e50 0px,
        #2c3e50 40px,
        #34495e 40px,
        #34495e 80px
    );
    z-index: 1;
}

.left-stands {
    left: 0;
    border-right: 3px solid #555;
}

.right-stands {
    right: 0;
    border-left: 3px solid #555;
}

.stands::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 20px,
        rgba(255, 255, 255, 0.05) 20px,
        rgba(255, 255, 255, 0.05) 21px
    );
}

/* HUD */
#hud {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    z-index: 100;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hud-item .label {
    font-weight: bold;
    color: #ffd700;
}

.hud-item span:last-child {
    color: white;
    font-size: 1.1em;
}

/* Campo de baloncesto */
#court {
    position: relative;
    width: 100%;
    height: 600px;
    background: linear-gradient(to right, 
        transparent 0%, 
        transparent 15%, 
        #d4a574 15%, 
        #d4a574 85%, 
        transparent 85%, 
        transparent 100%
    );
    overflow: hidden;
}

/* Líneas de la cancha */
.court-lines {
    position: absolute;
    width: 70%;
    height: 100%;
    left: 15%;
    top: 0;
}

.three-point-line {
    position: absolute;
    right: 10%;
    top: 15%;
    width: 45%;
    height: 70%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-left: none;
    border-radius: 0 50% 50% 0;
}

.free-throw-line {
    position: absolute;
    right: 25%;
    top: 35%;
    width: 2px;
    height: 30%;
    background: rgba(255, 255, 255, 0.3);
}

.key {
    position: absolute;
    right: 25%;
    top: 35%;
    width: 15%;
    height: 30%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-right: none;
}

/* Canasta */
#basket-container {
    position: absolute;
    right: 10%;
    top: 30%;
    width: 120px;
    height: 150px;
    z-index: 50;
}

#backboard {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 100px;
    background: linear-gradient(to right, #333, #555);
    border: 2px solid #222;
    border-radius: 3px;
}

#rim {
    position: absolute;
    top: 80px;
    right: 10px;
    width: 70px;
    height: 8px;
    background: linear-gradient(to bottom, #ff6b35, #d45d2f);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

#rim::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #222;
    border-radius: 4px;
}

#net {
    position: absolute;
    top: 88px;
    right: 15px;
    width: 60px;
    height: 40px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 5px,
        rgba(255, 255, 255, 0.3) 5px,
        rgba(255, 255, 255, 0.3) 6px
    );
    clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%);
    opacity: 0.7;
}

/* Balón */
#ball {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #ff8c42, #d45d2f);
    border-radius: 50%;
    cursor: grab;
    z-index: 60;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

#ball:active {
    cursor: grabbing;
}

#ball::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0%,
        transparent 45%,
        rgba(0, 0, 0, 0.3) 48%,
        rgba(0, 0, 0, 0.3) 52%,
        transparent 55%,
        transparent 100%
    );
}

#ball::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0%,
        transparent 45%,
        rgba(0, 0, 0, 0.3) 48%,
        rgba(0, 0, 0, 0.3) 52%,
        transparent 55%,
        transparent 100%
    );
}

/* Línea de trayectoria */
#trajectory-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 55;
    display: none;
}

/* Controles del juego */
.game-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
}

/* ========================================
   PANTALLA DE GAME OVER
   ======================================== */

.stats-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: bold;
    color: #ffd700;
}

.stat-value {
    font-size: 1.2em;
    color: #4CAF50;
}

/* Récords */
.records-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    max-width: 500px;
}

.records-display h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #ffd700;
}

.record-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
    border-radius: 5px;
}

.record-item.best-record {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    font-weight: bold;
}

.record-rank {
    min-width: 30px;
}

.record-score {
    flex: 1;
    text-align: center;
    font-weight: bold;
}

.record-date {
    font-size: 0.9em;
    opacity: 0.8;
}

.no-records {
    text-align: center;
    opacity: 0.7;
    padding: 20px;
}

/* ========================================
   ANIMACIONES
   ======================================== */

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

@keyframes fadeUpOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

@keyframes scaleIn {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE - MÓVIL
   ======================================== */

@media (max-width: 768px) {
    .game-title {
        font-size: 2em;
    }
    
    .game-subtitle {
        font-size: 1.1em;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .info-card {
        padding: 15px;
    }
    
    .card-icon {
        font-size: 2.5em;
    }
    
    .game-btn {
        min-width: 200px;
        padding: 14px 30px;
        font-size: 1em;
    }
    
    #court {
        height: 500px;
    }
    
    .info-section p {
        font-size: 0.9em;
    }
    
    #hud {
        flex-direction: column;
        gap: 5px;
        padding: 8px 15px;
    }
    
    .hud-item {
        font-size: 0.9em;
    }
    
    #basket-container {
        width: 100px;
        height: 130px;
    }
    
    #rim {
        width: 60px;
        top: 70px;
    }
    
    #net {
        width: 50px;
        height: 35px;
        top: 78px;
    }
    
    #ball {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 480px) {
    .screen {
        min-height: 500px;
    }
    
    #court {
        height: 450px;
    }
    
    .game-title {
        font-size: 1.5em;
    }
    
    .game-info {
        padding: 15px;
    }
    
    .info-section h3 {
        font-size: 1em;
    }
    
    .info-section p {
        font-size: 0.85em;
    }
    
    .stands {
        width: 10%;
    }
    
    #basket-container {
        width: 80px;
        height: 110px;
        right: 8%;
    }
    
    #rim {
        width: 50px;
        top: 60px;
    }
    
    #net {
        width: 40px;
        height: 30px;
        top: 68px;
        right: 20px;
    }
}
