/* Main tournament wrapper */
#twrapper						{ display:flex; flex-direction: row; }

/* Set default values for ::before and ::after */
#twrapper *:before, #twrapper *:after { content: ""; display: block; position: absolute; box-sizing: inherit; -webkit-box-sizing: inherit; }

/* Bracket round styles */
.bround							{ display: flex; flex-direction: column; justify-content: center !important; margin-right: 0; padding: 0; position: relative; min-width: 180px; }

/* Bracket round spacers */
.bround .spacer					{ flex-grow:1; min-height: 10px; }
.bround .spacer:first-child		{ flex-grow:.5; }
.bround .spacer:last-child		{ flex-grow:.5; }

.bround .rspacer					{ flex-grow:1; }
.bround .rspacer:first-child		{ flex-grow:.5; }
.bround .rspacer:last-child		{ flex-grow:.5; }

/* Setup match data */
.bmatch1						{ background-color: #999; border-right: 1px solid #aaa; float: left; font-weight: bold; padding: 2px; text-align: center; width: 30px }
.bmatch2						{ padding: 2px; text-align: center !important; min-width: 100px }

/* Setup match col */
.bgame							{ border: 1px solid #aaa; text-align: center; line-height: 18px; font-size: 11px !important; position: relative; width: 150px; }

/* round title */
.brtitle						 { font-weight: bold; padding: 3px; text-align: center; width: 180px }

/* curved lines */
.bgame-top:after				{ border-top: 2px solid black; border-right: 2px solid black; border-radius: 0 4px 0 0; top: 50%; right: 0px; width: 30px; }
.bgame-bottom:after				{ border-top: none; border-bottom: 2px solid black; border-right: 2px solid black; border-radius: 0 0 4px 0; bottom: 50%; right: 30px; }

/* Default :before or :after */
.bgame:after					{ height: 100%; right: -20px; width: 20px; }
.bgame.gbef:before				{ border-top: 2px solid black; top: 50%; left: -14px; width: 14px; }
.spacer:after					{ border-right: 2px solid black; position: relative !important; margin: 0 0 0 -13px; width: 2px; }
.spacer:before					{ border-right: 2px solid black; position: relative !important; margin: 0 0 0 -13px; width: 2px; }

/* Fix styles for upper bracket */
.bgame.mbar-1.gbef:before		{ border-top: 0; }
.spacer.mbar-2:after			{ height: 50%; bottom: -95%; }
.spacer.mbar-3:after			{ height: 50%; bottom: -100%; }
.spacer.mbar-4.s8:after			{ height: 80%; bottom: -65%; }

/* 16-players bracket Run line-fix for few things */
.spacer.mbar-3.s16:after		{ height: 50%; bottom: -90%; }
.spacer.LB-3.s16.r2:after		{ height: 50%; bottom: -99%; }
.spacer.mbar-4.s16:after		{ height: 90%; bottom: -70%; }
.spacer.mbar-5.s16:after		{ height: 90%; bottom: -70%; }

/* 32-players bracket Run line-fix for few things */
.spacer.UB-3.s32:after			{ height: 50%; bottom: -90%; }
.spacer.UB-4.s32:after			{ height: 10%; bottom: -90%; }
.spacer.mbar-4.s32:after		{ height: 50%; bottom: -75%; }
.spacer.mbar-4.s32.r1:after		{ border-right: none !important; }
.spacer.mbar-4.s32.r1:before	{ height: 75%; bottom: -70%; }
.spacer.mbar-4.s32.r2:after		{ height: 50%; bottom: -80%; }
.spacer.UB-5.s32.r1:after		{ height: 90%; bottom: -60%; }
.spacer.LB-5.s32.r1:after		{ height: 80%; bottom: -70%; }
.spacer.mbar-7.s32.r1:after		{ height: 90%; bottom: -70%; }
.spacer.mbar-5.s32:after		{ height: 50%; bottom: -85%; }

/* 64 players fixes */
.spacer.mbar-4.s64:after		{ height: 50%; bottom: -75%; }
.spacer.mbar-4.s64.r1:after		{ border-right: none !important; }
.spacer.mbar-4.s64.r1:before	{ height: 75%; bottom: -70%; }
.spacer.mbar-5.s64.r1:after		{ height: 95%; bottom: -50%; }
.spacer.mbar-5.s64.r2:after		{ height: 50%; bottom: -75%; }
.spacer.mbar-6.s64.r1:after		{ height: 98%; bottom: -50%; }

/* Single Elimination */
.spacer.SE-4:before				{ height: 90%; bottom: -70%; }
.spacer.SE-4.r2:before			{ height: 50%; bottom: -80%; }
.spacer.SE-4.r1:after			{ height: 50% !important; bottom: -20% !important; }
.spacer.SE-5.r1:after			{ height: 90%; bottom: -60%; }
.spacer.SE-3:after				{ height: 55%; bottom: -85%; }


.spacer.LB-2:after, .spacer.LB-4:after, .spacer.LB-6:after, .spacer.LB-8:after,
.spacer.LB-1:before, .spacer.LB-4:before, .spacer.LB-5:before, .spacer.LB-7:before,
.spacer.SE-4:after, .spacer.s8.UB-4:after, .spacer.s16.UB-5:after {  
	border-right: 0 !important; border-left: 0 !important;
}

/* Clear connector corners */
.bgame.fcorner:after { border-radius: 0 !important; border-right: 0 !important;  }

/* This will fix annoying 2 pixel bug on even rounds under lb */
.bgame.gbef.fborder:before   {  margin-top: -2px !important; }

/* Clear styles for final match */
.bgame.gbef.flast:after, .bgame-top.gbef.flast:after   {  border-top: 0 !important; border-right: 0 !important; }
