/* Fuentes personalizadas */
@font-face {
    font-family: 'Rubik';
    src: url('../assets/fonts/rubik-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Contenedor Principal */
.app-container {
    max-width: 100vw;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: clamp(0.8rem, 2vh, 1.5rem) clamp(1rem, 3vw, 2rem);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-sound-control {
    margin-top: clamp(0.8rem, 2vh, 1.2rem);
    display: flex;
    justify-content: center;
}

.sound-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.sound-toggle input[type="checkbox"] {
    width: clamp(14px, 3vw, 16px);
    height: clamp(14px, 3vw, 16px);
    cursor: pointer;
    accent-color: #ffc107;
}

.sound-toggle:hover {
    color: #ffc107;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #ffc107;
}

.logo i {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #ffd700;
}

.logo-icon {
    width: clamp(2rem, 5vw, 3.2rem);
    height: clamp(2rem, 5vw, 3.2rem);
}

.logo h1 {
    font-family: 'Rubik', sans-serif;
    font-size: clamp(1rem, 3vw, 1.8rem);
    font-weight: 400;
    letter-spacing: clamp(1px, 0.3vw, 2px);
    color: #ffc107;
    text-transform: uppercase;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2rem);
}

.header-buttons {
    display: flex;
    gap: clamp(0.5rem, 2vw, 1rem);
    flex-wrap: wrap;
}

.btn-header {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    padding: clamp(0.15rem, 0.4vw, 0.25rem) clamp(0.3rem, 0.8vw, 0.4rem);
    border-radius: clamp(3px, 0.6vw, 4px);
    font-weight: 500;
    font-size: clamp(0.35rem, 0.8vw, 0.5rem);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: clamp(0.08rem, 0.2vw, 0.15rem);
    text-transform: uppercase;
    letter-spacing: clamp(0.05px, 0.04vw, 0.3px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.btn-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-header.btn-primary {
    background: linear-gradient(145deg, #4ecdc4 0%, #44a08d 100%);
}

.btn-header.btn-danger {
    background: linear-gradient(145deg, #ff6b6b 0%, #ee5a52 100%);
}

/* Main Content */
.app-main {
    flex: 1;
    padding: clamp(1rem, 3vh, 2.5rem) clamp(0.5rem, 2vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 3vh, 2.5rem);
}

/* Timer Section */
.timer-section {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

/* Layout responsivo con altura uniforme */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: clamp(1rem, 3vw, 2.5rem);
    align-items: start;
    justify-items: center;
    width: 100%;
    max-width: 100vw;
}

/* Forzar posiciones específicas */
.team1-card {
    grid-column: 1 !important;
}

.timer-section {
    grid-column: 2 !important;
}

.team2-card {
    grid-column: 3 !important;
}


.timer-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: clamp(15px, 2.5vw, 25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    width: 100%;
    max-width: min(90vw, 500px);
    min-width: 280px;
}

.timer-header {
    background: rgba(255, 107, 107, 0.1);
    border-bottom: 1px solid rgba(255, 107, 107, 0.2);
    padding: clamp(1rem, 3vw, 2rem);
    text-align: center;
}

.timer-period-switch .period-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.timer-header .period-switch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.switch-track {
    position: relative;
    width: 80px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    border: 2px solid rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
}

.switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.switch-thumb.second-period {
    left: 46px;
}

.switch-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    pointer-events: none;
}

.switch-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.period-text {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    padding: clamp(0.4rem, 1.5vw, 0.8rem) clamp(0.8rem, 3vw, 1.5rem);
    border-radius: clamp(10px, 2vw, 18px);
    font-weight: 700;
    font-size: clamp(0.9rem, 2.5vw, 1.4rem);
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    color: #ffffff;
    letter-spacing: clamp(0.3px, 0.1vw, 0.8px);
}

/* Timer Main Section */
.timer-main {
    padding: 1.5rem;
    text-align: center;
}

.time-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.5rem, 2vw, 1.5rem);
}

.time-digit-group {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-controls-inline {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.time-digits {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    font-family: 'Rubik', 'Courier New', monospace;
    color: #ffd700;
    letter-spacing: clamp(0.05em, 0.2vw, 0.15em);
    line-height: 1;
    margin-bottom: clamp(0.2rem, 0.5vw, 0.5rem);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.time-separator {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    font-family: 'Rubik', 'Courier New', monospace;
    color: #ffd700;
    margin: 0 clamp(0.3rem, 1.5vw, 0.8rem);
}

.time-controls {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.btn-time-adjust {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 32px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.btn-time-adjust:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.btn-time-adjust.up:hover {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
    color: #2ecc71;
}

.btn-time-adjust.down:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #ffc107;
}

.btn-time-adjust:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-time-adjust:disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
}


.timer-period-switch {
    background: rgba(255, 107, 107, 0.05);
    border-top: 1px solid rgba(255, 107, 107, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem;
    display: flex;
    justify-content: center;
}

.timer-controls {
    background: rgba(255, 255, 255, 0.05);
    padding: clamp(0.8rem, 2vw, 1.2rem);
    display: flex;
    gap: clamp(1rem, 3vw, 2rem);
    justify-content: center;
    align-items: center;
}

.timer-keyboard-hint {
    text-align: center;
    margin-top: 0.8rem;
    opacity: 0.7;
    font-size: 0.85rem;
    color: #ffffff;
}

.timer-keyboard-hint kbd {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    color: #ffd700;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Rubik', 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    border: 1px solid #444;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-right: 0.3rem;
}

.btn-large {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 140px;
}

/* Botones tipo icono para timer */
.btn-icon {
    padding: clamp(0.8rem, 2vw, 1.2rem);
    border-radius: 50%;
    width: clamp(60px, 8vw, 80px);
    height: clamp(60px, 8vw, 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    transition: all 0.3s ease;
    min-width: auto;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-icon i {
    margin: 0;
}

/* Botones secundarios más pequeños */
.btn-icon-small {
    padding: clamp(0.6rem, 1.5vw, 0.9rem);
    border-radius: 50%;
    width: clamp(45px, 6vw, 60px);
    height: clamp(45px, 6vw, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.9rem, 2.2vw, 1.3rem);
    transition: all 0.3s ease;
    min-width: auto;
    opacity: 0.9;
}

.btn-icon-small:hover {
    transform: scale(1.05);
    opacity: 1;
}

.btn-icon-small i {
    margin: 0;
}

/* Color picker styles */
.team-color-picker {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.color-picker-label {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: clamp(4px, 1vw, 8px);
    padding: 0;
    cursor: pointer;
    color: #ffc107;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    width: clamp(30px, 6vw, 40px);
    height: clamp(25px, 5vw, 35px);
}

.color-picker-label:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
}

.color-picker-confirm {
    background: rgba(46, 204, 113, 0.2) !important;
    border-color: #2ecc71 !important;
    color: #2ecc71 !important;
}

.color-picker-confirm:hover {
    background: rgba(46, 204, 113, 0.3) !important;
}

.color-picker-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    pointer-events: auto;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 8px;
}

.color-picker-input::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
}

/* Formulario de exclusiones */
.expulsion-form {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 107, 107, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.form-row {
    display: flex;
    gap: 0.5rem;
    align-items: end;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 60px;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffd700;
    text-transform: uppercase;
}

.input-group input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
}

.input-group input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.input-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Teams Section - ya definido arriba */

.team-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: clamp(15px, 2.5vw, 25px);
    padding: clamp(1.2rem, 3vw, 2.5rem);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: min(90vw, 450px);
    min-width: 250px;
}

.team1-card {
    border-left: 4px solid var(--team1-color, #f59e0b);
}

.team2-card {
    border-right: 4px solid var(--team2-color, #10b981);
}

/* Nuevo diseño de header para equipos */
.team-header-new {
    background: rgba(255, 255, 255, 0.03);
    border-radius: clamp(8px, 1.5vw, 15px);
    padding: clamp(0.8rem, 2vw, 1.3rem);
    margin-bottom: clamp(1rem, 2.5vw, 2rem);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.team-name-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(0.5rem, 1.5vw, 1rem);
    gap: clamp(0.5rem, 1vw, 0.8rem);
}

.team-name-main {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.team-controls {
    display: flex;
    align-items: center;
    gap: clamp(0.4rem, 1vw, 0.6rem);
    flex-shrink: 0;
}

.team-score-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-score-main {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.team-score {
    font-size: clamp(4rem, 10vw, 7rem);
    font-weight: 700;
    color: #ffd700;
    font-family: 'Rubik', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.score-controls {
    display: flex;
    flex-direction: column;
    gap: clamp(0.2rem, 0.8vw, 0.4rem);
    flex-shrink: 0;
}

.btn-score {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: clamp(30px, 6vw, 40px);
    height: clamp(25px, 5vw, 35px);
    border-radius: clamp(4px, 1vw, 8px);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.btn-score.up:hover {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
    color: #2ecc71;
}

.btn-score.down:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #ffc107;
}


/* Sección de exclusiones rediseñada */
.team-expulsions-section {
    background: rgba(255, 107, 107, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.2);
    overflow: hidden;
}

.expulsions-header-new {
    background: rgba(255, 107, 107, 0.1);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #ff6b6b;
    border-bottom: 1px solid rgba(255, 107, 107, 0.2);
}

.expulsion-form {
    padding: 1rem;
}

.form-inputs {
    display: flex;
    gap: clamp(0.5rem, 1.5vw, 1rem);
    align-items: end;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
    flex: 1;
}

.input-group label {
    font-size: 0.75rem;
    color: #ffffff;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-player {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.6rem;
    color: #ffffff;
    font-size: 1rem;
    text-align: center;
    min-width: 70px;
    max-width: 90px;
    font-weight: 600;
}

/* Ocultar botones spinner en input jugador */
.input-player::-webkit-outer-spin-button,
.input-player::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-player[type=number] {
    -moz-appearance: textfield;
}

.input-time {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem;
    color: #ffffff;
    font-size: 0.9rem;
    text-align: center;
    min-width: 50px;
    max-width: 80px;
}

.input-player:focus, .input-time:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.btn-expulsion {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    border: none;
    border-radius: 8px;
    padding: 0.7rem;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    min-width: 44px;
    height: 44px;
}

.btn-expulsion:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}


.team-name-input {
    font-size: clamp(1.4rem, 4vw, 2.4rem);
    font-weight: 700;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: clamp(0.5px, 0.15vw, 1.5px);
    background: transparent;
    border: none;
    outline: none;
    padding: clamp(0.3rem, 0.8vw, 0.5rem);
    font-family: inherit;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.team-name-input:not([readonly]) {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
}

.team-name-input:focus {
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
}

.btn-edit {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffc107;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    cursor: pointer;
    padding: 0;
    border-radius: clamp(4px, 1vw, 8px);
    transition: all 0.3s ease;
    opacity: 0.9;
    width: clamp(30px, 6vw, 40px);
    height: clamp(25px, 5vw, 35px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit:hover {
    opacity: 1;
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
}

.btn-edit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.3) !important;
}

.btn-edit:disabled:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}


.btn-save {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #2ecc71;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    cursor: pointer;
    padding: 0;
    border-radius: clamp(4px, 1vw, 8px);
    transition: all 0.3s ease;
    opacity: 1;
    font-weight: 600;
    width: clamp(30px, 6vw, 40px);
    height: clamp(25px, 5vw, 35px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-save:hover {
    background: rgba(46, 204, 113, 0.3);
}


.team-main-section {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.score-section {
    flex: 1;
    text-align: center;
}

.team-score {
    font-size: 3.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0.5rem 0;
    font-family: 'Rubik', 'Courier New', monospace;
    color: #ffffff;
}

.team-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.expulsions-compact {
    flex: 1;
}

.expulsions-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffd700;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.expulsion-controls {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
}

.input-compact {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    width: 50px;
}

.input-compact:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.btn-compact {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    min-width: auto;
}


/* Expulsions Section */
.expulsions-section {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.expulsions-section h4 {
    color: #ffd700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.expulsions-list {
    min-height: 40px;
}

.expulsions-compact .expulsions-list {
    /* Eliminamos el scroll, que se expanda naturalmente */
}

.expulsion-item {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

.expulsion-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    gap: 0.5rem;
}

.expulsion-player {
    font-weight: 700;
    color: #ffc107;
    font-size: 1.2rem;
}

.expulsion-time {
    color: #ff6b6b;
    font-weight: 700;
    font-family: 'Rubik', 'Courier New', monospace;
    font-size: 0.8rem;
}

.btn-remove-expulsion {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-remove-expulsion:hover {
    background: rgba(255, 107, 107, 0.2);
}

/* Keyboard Hint Section */

/* Efecto de parpadeo para tiempo finalizado - actualizado */
.time-digits.finished {
    animation: pulseRed 1s infinite;
}

/* Botones */
.btn {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    padding: clamp(0.6rem, 1.5vw, 1rem) clamp(1rem, 3vw, 2rem);
    border-radius: clamp(8px, 1.5vw, 15px);
    font-weight: 600;
    font-size: clamp(0.8rem, 2vw, 1.1rem);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(145deg, #4ecdc4 0%, #44a08d 100%);
}

.btn-secondary {
    background: linear-gradient(145deg, #a8a8a8 0%, #8a8a8a 100%);
}

.btn-success {
    background: linear-gradient(145deg, #56ab2f 0%, #a8e6cf 100%);
}

.btn-warning {
    background: linear-gradient(145deg, #f093fb 0%, #f5576c 100%);
}

.btn-danger {
    background: linear-gradient(145deg, #ff6b6b 0%, #ee5a52 100%);
}

.btn-info {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Efectos y Animaciones - ya definido arriba */

@keyframes pulseRed {
    0%, 100% {
        color: #ffd700;
    }
    50% {
        color: #ff6b6b;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: clamp(1.5rem, 3vh, 2rem);
        justify-items: center;
    }

    .timer-section {
        grid-column: 1;
        order: 1;
        width: 100%;
        max-width: 500px;
    }

    .team1-card {
        grid-column: 1;
        order: 2;
        width: 100%;
        max-width: 500px;
    }

    .team2-card {
        grid-column: 1;
        order: 3;
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .app-main {
        padding: clamp(0.8rem, 2vh, 1.5rem);
    }

    .header-content {
        flex-direction: column;
        gap: clamp(0.8rem, 2vh, 1.2rem);
        text-align: center;
    }

    .header-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .team-card {
        max-width: 100%;
        min-width: auto;
    }

    .timer-card {
        max-width: 100%;
        min-width: auto;
    }

    .team-main-section {
        flex-direction: column;
        gap: 1rem;
    }

    .team-score {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .time-digits {
        font-size: 3rem;
    }

    .time-separator {
        font-size: 3rem;
    }

    .time-adjustment {
        gap: 1rem;
        padding: 0.8rem;
    }

    .btn-adjust {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .time-digits {
        font-size: 3rem;
    }

    .time-separator {
        font-size: 3rem;
    }

    .timer-main {
        padding: 1rem;
    }

    .btn-time-adjust {
        width: 28px;
        height: 22px;
        font-size: 0.6rem;
    }

    .time-section {
        gap: 0.5rem;
    }

    .time-controls-inline {
        gap: 0.2rem;
    }

    .period-text {
        font-size: 1rem;
        padding: 0.4rem 1rem;
    }

    .team-score {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .form-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group {
        flex: none;
    }

    .btn-expulsion {
        margin-top: 0.5rem;
        min-width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .btn-arrow {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: clamp(0.8rem, 3vh, 1.2rem);
    }


    .timer-display,
    .time-config,
    .team-card,
    .keyboard-help {
        padding: clamp(0.8rem, 3vw, 1.2rem);
    }

    .form-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: clamp(0.8rem, 2vh, 1rem);
    }

    .input-group {
        flex: none;
        width: 100%;
    }

    .btn-header {
        padding: clamp(0.3rem, 1.2vw, 0.5rem) clamp(0.6rem, 2vw, 0.8rem);
        font-size: clamp(0.55rem, 2.2vw, 0.7rem);
        gap: clamp(0.1rem, 0.3vw, 0.25rem);
    }

    .btn {
        padding: clamp(0.8rem, 3vw, 1rem) clamp(1.2rem, 4vw, 1.5rem);
        font-size: clamp(0.8rem, 3vw, 1rem);
    }
}

    .time-separator {
        font-size: 2rem;
    }

    .team-score {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .timer-controls {
        flex-direction: row;
        gap: clamp(0.8rem, 4vw, 1.5rem);
    }

    .btn-icon {
        width: clamp(50px, 12vw, 70px);
        height: clamp(50px, 12vw, 70px);
        font-size: clamp(1rem, 4vw, 1.4rem);
    }

    .team-controls {
        flex-direction: column;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group {
        min-width: auto;
    }
}

/* Soporte para pantallas muy grandes */
@media (min-width: 1400px) {
    .main-content {
        grid-template-columns: 1fr 1.2fr 1fr;
        gap: clamp(2rem, 4vw, 4rem);
        max-width: 1600px;
        margin: 0 auto;
    }

    .timer-card {
        max-width: 600px;
    }

    .team-card {
        max-width: 550px;
    }
}