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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #49249d;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.header-nav {
    display: flex;
    gap: 10px;
}

.match-info-bar {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 10px 15px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #007bff;
}

.match-details {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.match-category {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.match-round, .match-court, .match-time {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.match-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

/* Title row with logo */
.title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 80px;
    width: auto;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    font-weight: 700;
}

/* (removed) one-minute alert banner styles no longer used */

.category-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-selector label {
    font-weight: 600;
    color: #2c3e50;
}

.category-selector select {
    padding: 10px 15px;
    border: 2px solid #3498db;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.main-content {
    display: grid;
    gap: 20px;
}

.player-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.player {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.red-player {
    border-left: 6px solid #e74c3c;
}

.blue-player {
    border-left: 6px solid #3498db;
}

.player h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
    color: #2c3e50;
}

.player input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

/* Name field with logo */
.name-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.name-field .name-logo {
    height: 24px;
    width: auto;
}

.name-field input[type="text"] {
    flex: 1;
}

.player input:focus {
    outline: none;
    border-color: #3498db;
}

.timer-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

.main-timer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
}

.timer-section {
    text-align: center;
    position: relative;
    padding-bottom: 36px; /* space for cue ball at bottom */
}

.timer-label {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.timer-value {
    font-size: 6.5em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin-bottom: 20px;
    padding: 30px;
    border-radius: 15px;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
}

.red-section .timer-value {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.blue-section .timer-value {
    background: #042fc4;
    color: white;
}

.timer-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.adjust-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.cue-ball {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff, #cccccc);
    border: 2px solid #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    margin: 10px auto 0;
}

/* Used balls under timers */
.used-balls {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    min-height: 20px;
}

.used-ball {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.used-ball.red { background: #e74c3c; }
.used-ball.blue { background: #2e86de; }

.center-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    min-width: 200px;
}

/* Played sequence (mixed red/blue order) */
.played-sequence {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.sequence-label {
    font-size: 0.9rem;
    color: #555;
}

.sequence-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 18px;
}

.seq-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.seq-dot.red { background: #e74c3c; }
.seq-dot.blue { background: #2e86de; }

.cue-controls {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

/* Locked timer visual state in control view */
.locked-timer {
    pointer-events: none;
    opacity: 0.6;
    filter: grayscale(20%);
}

.cue-label {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
}

.cue-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.end-counter {
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.jack-timer {
    padding: 15px;
    background: #49249d;
    color: white;
    border: 3px solid #49249d;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.end-counter span {
    font-size: 2em;
    font-weight: 700;
    color: #e74c3c;
    margin: 0 10px;
}

#jackTimer {
    font-size: 2.2em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #ffffff;
    margin: 10px 0;
}

/* Jack timer label (first div inside .jack-timer) */
.jack-timer > div:first-child {
    font-size: 1.4em;
    font-weight: 700;
    color: #ffffff;
}

.score-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.score-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.side-score {
    text-align: center;
    padding: 20px;
    border-radius: 15px;
}

.red-score {
    background: transparent;
    color: inherit;
}

.blue-score {
    background: transparent;
    color: inherit;
}

.score-display {
    font-size: 13px;
    color: #000000;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.winner-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #FFD700;
    color: #333;
    font-weight: 700;
    font-size: 0.95em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.score-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

/* Penalties controls under scores */
.penalties-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.penalties-label {
    font-weight: 600;
}

.penalties-display {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
}

/* Special timers section */
.special-timers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.timer-group {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.timer-group h4 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.timer-group .timer-value {
    font-size: 2.5em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#penaltyTimer {
    background: #ffffff !important;
    color: #2c3e50 !important;
}

#penaltyTimer.one-minute {
    background: #ffffff !important;
    color: #2c3e50 !important;
    animation: none !important;
}

#penaltyTimer.warning {
    background: #ffffff !important;
    color: #2c3e50 !important;
    animation: none !important;
}

#penaltyTimer.critical {
    background: #ffffff !important;
    color: #2c3e50 !important;
    animation: none !important;
}

/* Control panel */
.control-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.panel-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.panel-section h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #3498db;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn.small {
    padding: 6px 12px;
    font-size: 0.9em;
}

.btn.start {
    background: #2ecc71;
}

.btn.stop {
    background: #e74c3c;
}

.btn.reset {
    background: #f39c12;
}

.btn.active {
    box-shadow: inset 0 0 0 2px #2c3e50;
}

/* Timer states */
.warning {
    animation: pulse 1s infinite;
    color: #f39c12;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.critical {
    animation: blink 1s infinite;
    color: #e74c3c;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.7; }
}

.expired {
    background: #2c3e50 !important;
    color: white !important;
    animation: none;
}

.one-minute {
    color: #f39c12;
}

/* Deactivated balls state */
.deactivated-balls {
    opacity: 0.5;
    filter: grayscale(50%);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .main-timer {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .center-info {
        order: -1;
    }
}

/* Estilos para notificaciones */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: #4CAF50;
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
    font-weight: 500;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .player-section {
        grid-template-columns: 1fr;
    }
    
    .score-board {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .timer-value {
        font-size: 4em !important;
        padding: 20px !important;
    }
    
    .score-display {
        font-size: 3.5em;
    }
}

/* ===== Card buttons (Yellow/Red Cards in timer) ===== */
.card-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
}

.btn.small.card-btn-yellow,
.btn.small.card-btn-red {
    background: rgba(255, 255, 255, 0.85);
    color: #6c757d;
    border: 2px solid #dee2e6;
    font-weight: 600;
    transition: all 0.2s ease;
    opacity: 0.7;
    filter: grayscale(40%);
}

.btn.small.card-btn-yellow:hover,
.btn.small.card-btn-red:hover {
    opacity: 1;
    filter: none;
    transform: translateY(-1px);
}

.btn.small.card-btn-yellow.active {
    background: linear-gradient(135deg, #fff3cd, #ffe599);
    color: #7a5d00;
    border-color: #ffc107;
    opacity: 1;
    filter: none;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3), 0 4px 10px rgba(255, 193, 7, 0.4);
    font-weight: 700;
}

.btn.small.card-btn-red.active {
    background: linear-gradient(135deg, #f8d7da, #f1959b);
    color: #721c24;
    border-color: #dc3545;
    opacity: 1;
    filter: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3), 0 4px 10px rgba(220, 53, 69, 0.4);
    font-weight: 700;
    animation: card-pulse 1.8s infinite;
}

@keyframes card-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3), 0 4px 10px rgba(220, 53, 69, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.15), 0 4px 14px rgba(220, 53, 69, 0.5); }
}

/* ===== App Footer (DiegoR.Tech) ===== */
.app-footer {
    display: none;
    margin-top: 40px;
    padding: 18px 20px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.3px;
}

.app-footer a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}

.app-footer a:hover {
    color: #ffd700;
    border-bottom-color: #ffd700;
}
