       * { box-sizing: border-box; }
        body { font-family: 'Segoe UI', sans-serif; background: #1a1a1a; color: #fff; margin: 0; display: flex; flex-direction: column; height: 100vh; }
        header { background: #17283be6; padding: 10px 20px; display: flex; align-items: center; gap: 20px; border-bottom: 2px solid #17283be6; flex-wrap: wrap; }
        header h1 { margin: 0; font-size: 1.2rem; margin-right: auto; }
        header select, header div { padding: 6px 12px; border-radius: 4px; border: 1px solid #555; background: #333; color: #fff; font-size: 0.9rem; }
        .main-content { display: flex; flex: 1; }
        .field-container { flex: 1; display: flex; flex-direction: column; padding: 15px; background: linear-gradient(135deg, #01071a, #0536b1, #000000); min-width: 0; align-items: center; }
        .controls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; padding: 10px; background: #222; border-radius: 6px; align-items: center; width: 100%; max-width: 600px; }
        .btn-draw, .btn-formation, .btn-add, .btn-clear, .btn-clear-field, .btn-reset { background: #333; border: 1px solid #555; color: #fff; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.85rem; }
        .btn-draw.active, .btn-formation.active { background: #3498db; border-color: #2980b9; }
        .color-picker { width: 36px; height: 30px; border: 1px solid #555; border-radius: 4px; cursor: pointer; background: none; padding: 2px; }
        
        .pitch { 
            position: relative; 
            background-image: url('http://insideaction.ru/assets/img/img/TTboard_long.jpg'); 
            background-size: cover; 
            background-position: center; 
            width: 600px; 
            height: 1100px; 
            border: 1px solid rgba(255,255,255,0.2); 
            box-shadow: inset 0 0 100px rgb(68 121 201 / 30%); 
            user-select: none; 
            margin: 0 auto; 
            overflow: hidden; 
        }
        .pitch.drawing { cursor: crosshair; }
        .pitch.attaching { cursor: copy; }
        .pitch.detaching { cursor: not-allowed; }
        .pitch.moving { cursor: move; }
        
        .bench-zone-indicator {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 18.2%;
            background: rgba(0, 0, 0, 0.5);
            border-top: 2px dashed rgba(255, 255, 255, 0.4);
            pointer-events: none;
            display: flex;
            justify-content: space-around;
            align-items: center;
            color: rgba(255,255,255,0.6);
            font-size: 14px;
            font-weight: bold;
            text-transform: uppercase;
            z-index: 1;
        }
        
        #drawLayer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; }
        #drawCanvas { width: 100%; height: 100%; display: block; pointer-events: none; }
        .pitch.drawing #drawCanvas, .pitch.attaching #drawCanvas, .pitch.moving #drawCanvas { pointer-events: all; }
        
        #playersField { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; pointer-events: none; }
        
        .player-on-field { 
            pointer-events: all; position: absolute; width: 54px; height: 54px; border-radius: 50%; 
            display: flex; flex-direction: column; align-items: center; justify-content: center; 
            font-size: 0.7rem; font-weight: bold; color: #fff; cursor: grab; 
            box-shadow: 0 3px 8px rgba(0,0,0,0.6); transform: translate(-50%, -50%); z-index: 30; border: 2px solid #fff; 
        }
        .player-on-field.dragging { cursor: grabbing; z-index: 100; transform: translate(-50%, -50%) scale(1.15); }
        .player-on-field.blue { background: linear-gradient(135deg, #3498db, #2980b9); }
        .player-on-field.red { background: linear-gradient(135deg, #e74c3c, #c0392b); }
        .player-on-field .number { font-size: 1.1rem; line-height: 1; margin-bottom: 2px; }
        .player-on-field .name { font-size: 0.65rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48px; }
        .player-on-field .position-badge { position: absolute; top: -6px; right: -6px; background: #2c3e50; color: #fff; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; border: 2px solid #fff; }
        
        .player-on-field .remove-btn { 
            position: absolute; top: -8px; left: -8px; background: #e74c3c; color: #fff; border: 2px solid #fff; 
            border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; 
            font-size: 0.8rem; cursor: pointer; opacity: 0; transition: opacity 0.2s, transform 0.2s; z-index: 40; 
        }
        .player-on-field:hover .remove-btn, .player-on-field.touch-active .remove-btn { opacity: 1; }
        @media (hover: none) { .player-on-field .remove-btn { opacity: 1; } }
        
        .ball { position: absolute; font-size: 20px; background: radial-gradient(circle at 20% 20%, #fff, #ddd, #555); border-radius: 50%; transform: translate(-50%, -50%); cursor: grab; z-index: 25; box-shadow: 0 3px 6px rgba(0,0,0,0.5); pointer-events: all; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
        .ball.dragging { cursor: grabbing; z-index: 100; transform: translate(-50%, -50%) scale(1.2); }
        
        .tooltip { position: fixed; background: rgba(0,0,0,0.9); color: #fff; padding: 12px 18px; border-radius: 6px; font-size: 0.9rem; z-index: 1000; pointer-events: none; display: none; border: 1px solid #555; text-align: center; }
        .modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.75); display: none; align-items: center; justify-content: center; z-index: 2000; }
        .modal.active { display: flex; }
        .modal-content { background: #2c3e50; padding: 25px; border-radius: 8px; width: 320px; display: flex; flex-direction: column; gap: 12px; }
        .modal-content h3 { margin: 0 0 10px 0; text-align: center; }
        .modal-content input, .modal-content select { padding: 10px; border-radius: 4px; border: 1px solid #555; background: #333; color: #fff; }
        .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; }
        .modal-actions button { padding: 8px 20px; border-radius: 4px; border: none; cursor: pointer; font-weight: bold; }
        #cancelModal { background: #555; color: #fff; }
        #confirmAdd { background: #3498db; color: #fff; }
        
        .container-main { max-width: 100%; padding: 0 8px; }
        .row { margin: 0; }
        .col-12 { padding: 0 4px; }
        .mstat-footer { padding: 10px 0; background: #1a1a1a; border-top: 1px solid #333; margin-top: auto; }
        .mstat-footer p { color: #666; font-size: 0.7rem; margin: 0; text-align: center; }
        
        @media (max-width: 768px) {
            .pitch { width: 100%; height: auto; aspect-ratio: 600/1100; min-height: 400px; }
            .player-on-field { width: 36px; height: 36px; }
            .player-on-field .number { font-size: 0.7rem; }
            .player-on-field .name { font-size: 0.4rem; max-width: 28px; }
            .bench-zone-indicator { font-size: 10px; }
        }
		header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.2rem;
}

header h1 a {
    display: flex;
    align-items: center;
}

header h1 img {
    max-height: 40px;
    display: block;
}

header h1 span {
    white-space: nowrap;
}
		/* Для очень маленьких экранов */
		@media (max-width: 425px) {
			.player-on-field .position-badge {
				display: none;
			}
			.player-on-field .name { 
				display: none;
			}
			.ball { 
			font-size: 15px;
			box-shadow: 0 1px 5px black;
			width: 20px;
			height: 20px;
			}
		}
