/* Base style
   ========================================================================== */
   
/* Fonts */
@font-face {
   font-family: 'bpreplaybold';
   src: url('fonts/bpreplaybold-webfont.woff2') format('woff2'),
        url('fonts/bpreplaybold-webfont.woff') format('woff');
   font-weight: normal;
   font-style: normal;

}

html{ -webkit-user-select: none; -ms-user-select: none; user-select: none; background:#18141a;}

/*-- Percent Loader -- */
#mainLoader{position:absolute;z-index:5; display:none; font-size:35px; line-height:35px; color:#fff; text-align:center; width:100%; font-family:'bpreplaybold';}

/*-- Content Wrapper -- */
#mainHolder{position:absolute; width:100%;height:100%;}

/*-- Browser Not Support -- */
#notSupportHolder{ width:90%; margin:5% auto; position:relative; color:#fff; text-align:center; font-size:35px; font-family:'bpreplaybold'; display:none;}

/*-- Rotate Animation -- */
@-moz-keyframes spin { 50% { -moz-transform: rotate(0deg); } 100% { -moz-transform: rotate(0deg); } }
@-webkit-keyframes spin { 50% { -webkit-transform: rotate(90deg); } 100% { -webkit-transform: rotate(0deg); } }
@keyframes spin { 50% { -webkit-transform: rotate(90deg); transform:rotate(90deg); } 100% { -webkit-transform: rotate(90deg); transform:rotate(90deg); } }

/*-- Canvas Wrapper -- */
#canvasHolder{ display:none; width:100%; max-width:1280px; min-height:768px; margin:auto; position:relative;}
canvas{ position:absolute;}

/*-- Form Wrapper -- */
#editWrapper{ display:none; font-size:12px; font-family: Arial, Helvetica, sans-serif; }
#floatForm{ position:fixed; left:0; top:0; z-index:100; background:#0070EC; padding:15px; color:#FFF; width:280px; border:#fff solid 2px;}
#floatForm{ font-size:12px;}
#floatForm #boardEditWrapper, #floatForm #pathEditWrapper, #floatForm #playersEditWrapper, #floatForm #positionEditWrapper, #floatForm #homePathEditWrapper, #floatForm #nameEditWrapper{ background:#0A55B2; padding:10px;}
#floatForm #pathWrapper, #floatForm #positionWrapper, #floatForm #homePathWrapper{ border:#FFF solid 1px; padding:5px;}
#floatForm #playersDetailsEditWrapper, #floatForm #positionEditWrapper, #floatForm #homePathEditWrapper, #floatForm #nameEditWrapper{ background:#0070EC; padding:10px; }
#floatForm input.button, #floatForm select.half, #floatForm label{ width:49%;}
#floatForm .formRow, #floatForm .formRowLong{ height:25px; }
#floatForm .extraHeight{ height:55px; }
#floatForm .formRow input, #floatForm .formRow select{ float:right; width:48%;}
#floatForm .formRow label{ float:left; width:48%;}
#floatForm .divider{ margin:10px 0; padding:10px 10px; border:#FFF solid 1px;}

#floatForm input{ width:100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
#floatForm textarea{ float:left; width:100%; resize:none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;  }
#floatForm select, #floatForm option{ width:100%;}

/*-- Move Timer Styles -- */
.move-timer {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    font-family: 'bpreplaybold', Arial, sans-serif;
    font-weight: bold;
    text-align: center;
    user-select: none;
    pointer-events: none;
}

.move-timer-bg {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #FFFF00;
    border-radius: 15px;
    padding: 8px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.move-timer-text {
    color: #FFFF00;
    font-size: 36px;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
}

/* Timer warning state (10-6 seconds) */
.move-timer.warning .move-timer-bg {
    background: rgba(255, 0, 0, 0.9);
    border-color: #FF4444;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.4);
    transform: scale(1.1);
}

.move-timer.warning .move-timer-text {
    color: #FFFFFF;
    font-size: 48px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
}

/* Timer critical state (5-1 seconds) */
.move-timer.critical .move-timer-bg {
    background: rgba(255, 0, 0, 1);
    border-color: #FF0000;
    box-shadow: 0 6px 25px rgba(255, 0, 0, 0.6);
    transform: scale(1.2);
    animation: timerPulse 0.5s infinite alternate;
}

.move-timer.critical .move-timer-text {
    color: #FFFFFF;
    font-size: 52px;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 1);
    animation: timerBlink 0.3s infinite alternate;
}

/* Animations */
@keyframes timerPulse {
    0% { transform: scale(1.2); }
    100% { transform: scale(1.3); }
}

@keyframes timerBlink {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Temporizador del oponente (cuando no es tu turno) */
.opponent-timer {
    top: auto;
    bottom: 20px;
    right: 20px;
    left: auto;
}

.opponent-timer-bg {
    background: rgba(0, 0, 0, 0.7);
    border-color: #00A8FF;
}

.opponent-timer-label {
    font-size: 12px;
    color: #CCC;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.opponent-timer-text {
    color: #00A8FF;
    font-size: 32px;
}

.opponent-timer.warning .opponent-timer-bg {
    background: rgba(255, 152, 0, 0.9);
    border-color: #FF9800;
}

.opponent-timer.warning .opponent-timer-text {
    color: #FFFFFF;
}

.opponent-timer.critical .opponent-timer-bg {
    background: rgba(255, 0, 0, 0.9);
    border-color: #FF0000;
}

.opponent-timer.critical .opponent-timer-text {
    color: #FFFFFF;
}

/* Responsive design */
@media (max-width: 768px) {
    /* Temporizador del jugador - más compacto */
    .move-timer {
        top: 10px;
        left: 10px;
    }
    
    .move-timer-bg {
        padding: 5px 10px;
        border-width: 2px;
        border-radius: 10px;
    }
    
    .move-timer-text {
        font-size: 24px;
    }
    
    .move-timer.warning .move-timer-text {
        font-size: 30px;
    }
    
    .move-timer.critical .move-timer-text {
        font-size: 34px;
    }
    
    /* Temporizador del oponente - más pequeño y discreto */
    .opponent-timer {
        bottom: 10px;
        right: 10px;
        width: 35%;
        max-width: 160px;
    }
    
    .opponent-timer-bg {
        padding: 4px 8px;
        border-width: 2px;
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .opponent-timer-label {
        font-size: 10px !important;
        margin-bottom: 2px !important;
    }
    
    .opponent-timer-text {
        font-size: 18px;
    }
    
    .opponent-timer.warning .opponent-timer-text {
        font-size: 22px;
    }
    
    .opponent-timer.critical .opponent-timer-text {
        font-size: 24px;
    }
}

/*-- Faults Display Styles -- */
.faults-display {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 999;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid rgba(255, 165, 0, 0.8);
    border-radius: 10px;
    padding: 15px;
    font-family: 'bpreplaybold', Arial, sans-serif;
    min-width: 200px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
}

.faults-title {
    color: #FFA500;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    border-bottom: 2px solid #FFA500;
    padding-bottom: 5px;
}

.fault-item {
    color: #FFFFFF;
    font-size: 16px;
    padding: 8px 10px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.fault-item .fault-player-name {
    display: inline-block;
    width: 60%;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.fault-item .fault-count {
    display: inline-block;
    width: 35%;
    text-align: right;
    font-weight: bold;
    color: #FFFF00;
}

.fault-item.fault-warning .fault-count {
    color: #FFA500;
}

.fault-item.fault-critical {
    background: rgba(255, 0, 0, 0.3);
    border: 2px solid #FF0000;
    animation: faultPulse 1s infinite;
}

.fault-item.fault-critical .fault-count {
    color: #FF0000;
    font-size: 18px;
}

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

/* Responsive design para faltas */
@media (max-width: 768px) {
    .faults-display {
        top: 5px;
        right: 125px;
        padding: 4px;
        width: 26%;
        min-width: 100px;
        max-width: 120px;
        border-width: 1.5px;
        border-radius: 8px;
        box-sizing: border-box;
        pointer-events: none;
    }
    
    .faults-title {
        font-size: 10px;
        margin-bottom: 3px;
        padding-bottom: 2px;
        border-bottom-width: 1.5px;
    }
    
    .fault-item {
        font-size: 11px;
        padding: 2px 5px;
        margin: 3px 0;
    }
    
    .fault-item .fault-player-name {
        width: 55%;
        font-size: 10px;
    }
    
    .fault-item .fault-count {
        width: 40%;
        font-size: 12px;
    }
    
    .fault-item.fault-critical .fault-count {
        font-size: 13px;
    }
    
    /* En móvil, hacer las faltas más compactas y opcionales */
    /* Si ninguna falta es >= 2, reducir opacidad para que sea menos intrusivo */
    .faults-display.compact {
        opacity: 0.6;
        transform: scale(0.85);
        transition: all 0.3s ease;
    }
    
    .faults-display.compact:hover,
    .faults-display.compact:active {
        opacity: 1;
        transform: scale(1);
    }
    
    /* Alternativa: Mostrar solo el título como ícono cuando no hay faltas críticas */
    .faults-display.minimal {
        min-width: 50px;
        max-width: 50px;
        padding: 5px;
        border-radius: 50%;
    }
    
    .faults-display.minimal .faults-title {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }
    
    .faults-display.minimal .fault-item {
        display: none;
    }
}

/*-- Game Over Screen Styles -- */
.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-in-out;
}

.game-over-container {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 3px solid #3498db;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    max-width: 500px;
    width: 90%;
    position: relative;
    overflow: hidden;
}

.game-over-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(52, 152, 219, 0.1), rgba(155, 89, 182, 0.1));
    pointer-events: none;
}

.game-over-title {
    font-family: 'bpreplaybold', Arial, sans-serif;
    font-size: 48px;
    color: #ecf0f1;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

.game-over-scores {
    margin: 30px 0;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.score-item.winner {
    background: rgba(241, 196, 15, 0.2);
    border-left-color: #f1c40f;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(241, 196, 15, 0.3);
}

.score-item.winner .player-name {
    color: #f1c40f;
    font-weight: bold;
}

.player-name {
    font-family: 'bpreplaybold', Arial, sans-serif;
    font-size: 24px;
    color: #ecf0f1;
}

.player-score {
    font-family: 'bpreplaybold', Arial, sans-serif;
    font-size: 28px;
    color: #3498db;
    font-weight: bold;
}

.game-over-share {
    margin: 30px 0;
    color: #bdc3c7;
    font-family: 'bpreplaybold', Arial, sans-serif;
    font-size: 18px;
}

.share-icon {
    width: 40px;
    height: 40px;
    background: #3498db;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-icon:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.game-over-button {
    background: linear-gradient(45deg, #3498db, #2980b9);
    border: none;
    border-radius: 25px;
    padding: 15px 40px;
    color: white;
    font-family: 'bpreplaybold', Arial, sans-serif;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
    margin-top: 20px;
}

.game-over-button:hover {
    background: linear-gradient(45deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.6);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes titleGlow {
    from { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); }
    to { text-shadow: 2px 2px 20px rgba(52, 152, 219, 0.6); }
}

@keyframes scoreSlideIn {
    from { 
        opacity: 0; 
        transform: translateX(-50px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.score-item {
    animation: scoreSlideIn 0.6s ease-out;
}

.score-item:nth-child(2) {
    animation-delay: 0.2s;
}

/* Responsive design for game over */
@media (max-width: 768px) {
    .game-over-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .game-over-title {
        font-size: 36px;
    }
    
    .player-name {
        font-size: 20px;
    }
    
    .player-score {
        font-size: 24px;
    }
    
    .game-over-button {
        padding: 12px 30px;
        font-size: 18px;
    }
}

