:root {
  --blue: #2176b6;
  --border-color: #dddddd;
  --text-color: #ffffff;
  --table-hover-color: #f3f3f3;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.container {
  /* display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; */
  /* gap: 40px;
  padding: 20px 0; */

  min-height: 100vh;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
.container * {
  font-family: sans-serif;

}


.container .title-wrapper {
  margin: 30px 0 80px;
  text-align: center;
}
.container .title-wrapper #reset-btn {
  font-size: 13px;
  padding: 3px 10px;
  background-color: rgb(252, 75, 75);
  color: #fff;
}

.container button:not(.accordion) {
  display: inline-block;
  outline: 0;
  cursor: pointer;
  padding: 5px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  vertical-align: middle;
  border: 1px solid;
  border-radius: 6px;
  color: #24292e;
  background-color: #fafbfc;
  border-color: #1b1f2326;
  box-shadow: rgba(27, 31, 35, 0.04) 0px 1px 0px 0px,
    rgba(255, 255, 255, 0.25) 0px 1px 0px 0px inset;
  transition: 0.2s cubic-bezier(0.3, 0, 0.5, 1);
  transition-property: color, background-color, border-color;
}

.container button:not(.accordion):hover {
  background-color: #f3f4f6;
  border-color: #1b1f2326;
  transition-duration: 0.1s;
}

.container .form-wrapper {
  display: flex;
  flex-direction: column;

  min-height: 100vh;

}

.container .form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 4px;

  min-width: 400px;
  gap: 20px;
  padding: 30px;
  margin: auto;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
.container .form.error * {
  color: red;
  border-color: red;
}

.container .form .btn-wrapper {
  display: flex;
  gap: 10px;
  margin: 10px 0;
  align-items: center;
}

.container .form .btn-wrapper button:disabled {
  background-color: rgb(218, 218, 218);
}

.container .form .inputs {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  max-height: 300px;
}

.container .form .inputs input {
  width: 100px;
  margin: 10px 10px 0 5px;
}

.container .form .form-control {
  width: 100%;
  border: none;
}
.container .form .form-control:not(:last-of-type)::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 20px;
  background-color: black;
}

.container .form .games-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px 40px;
}
.container .form .games-info .selection-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.container .form .form-control .title {
  display: flex;
  justify-content: space-between;
  gap: 100px;
  
}

.container .select-form {
  display: flex;
  gap: 20px;
}

.container select {
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
}

.container select:hover {
  border-color: #999;
}

.container select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.season-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  /* padding: 20px 0; */
  margin: 50px 0;
}

.tabs-wrapper ul {
  display: flex;
  list-style: none;
  justify-content: space-evenly;
  padding: 0;
  margin: 80px 0px;
}

.tabs-wrapper li {
  cursor: pointer;
  transition: all 0.2s ease-in;
  border-bottom: 3px solid transparent;
}
.tabs-wrapper .active {
  border-bottom-color: var(--blue);
}

#games-form {
  max-width: 1200px;
  width: 100%;
}

.game-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 5px;

  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 2px;
  position: relative;
  min-height: 60px;
  min-width: 120px;
}


.game-wrapper.played {
  border: 1px solid var(--blue);
}

.game-wrapper .team {
  display: flex;
  gap: 5px;
  padding: 4px;
}

.team label {
  font-weight: bold;
}

.team input {
  width: 50px;
}

.table-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  margin: 50px 0;
}

table {
  border-collapse: collapse;
}

.table-regular-season {
  min-width: 400px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

.table-regular-season thead tr {
  background-color: var(--blue);
  color: var(--text-color);
  text-align: left;
}

.table-regular-season th,
.table-regular-season td {
  padding: 12px 15px;
  white-space: nowrap;
}

.table-regular-season tbody tr {
  border: 1px solid var(--border-color);
}

.table-regular-season tbody tr:hover {
  background-color: var(--table-hover-color);
}

.table-regular-season tbody tr.winner {
  position: relative;
}

.table-regular-season tbody tr.winner::after {
  content: "";
  position: absolute;
  background-image: url("https://icons.veryicon.com/png/o/business/business-style-icon/trophy-18.png");
  background-size: cover;
  height: 30px;
  width: 30px;
  top: 50%;
  left: -35px;
  transform: translateY(-50%);
}

.table-regular-season tbody tr.loser {
  position: relative;
}

/* .table-regular-season tbody tr.loser::after {
  content: "X";
  position: absolute;
  font-weight: bold;
  font-size: 20px;
  top: 50%;
  left: -25px;
  color: red;
  transform: translateY(-50%);
} */

.table-regular-season button.comparison-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.3s ease;
}


.modern-table tbody tr:last-of-type {
  border-bottom: 2px solid var(--blue);
}


/* KITAIP PADARYTI */
.modern-table .condition-began-0 {
  border-top: 2px solid green;
}
.modern-table .condition-end-0 {
  border-bottom: 2px solid green;
}
.modern-table .condition-began-1 {
  border-top: 2px solid purple;
}
.modern-table .condition-end-1 {
  border-bottom: 2px solid purple;
}
.modern-table .condition-began-2 {
  border-top: 2px solid yellow;
}
.modern-table .condition-end-2 {
  border-bottom: 2px solid yellow;
}


.accordion-parent {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  flex-direction: column;

  width: 100%;
}

.accordion-item {
  width: 100%;
  padding: 0 0;
  margin: 0;
  border-bottom: 1px #d1d1cf dashed;
  background-color: white;
  overflow: hidden;
}

.accordion-item.inner:last-of-type,
.accordion-item.inner:last-of-type .display {
  border-bottom: none;
}

.accordion-tab-wrapper {
  display: flex;
  flex-flow: row nowrap;
  width: 100%;
}

.accordion-item .accordion-title {
  padding-bottom: 15px;
  padding-right: 5%;
  margin: 0;
  padding-top: 1rem;
  padding-left: 1rem;
  cursor: pointer;
  user-select: none;
  font-size: 18px;
  font-weight: bold;
}

.accordion-item .accordion-mark {
  display: inline-block;
  color: darkblue;
  padding-bottom: 15px;
  padding-right: 8px;
  margin: 0;
  padding-top: 1rem;
  padding-left: 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 25px;
  font-size: 18px;
  transition: transform .2s ease-in-out;
}

.accordion-item .display,
.accordion-item.inner .accordion-item.display {
  padding: 0 3rem;
  max-height: 0px;
  transition: max-height 0.3s ease;
  overflow: hidden;
}
.accordion-item.inner .accordion-item.display {
  padding: 0;
}

.accordion-item.active .display,
.accordion-item.inner.active .accordion-item.display {
  max-height: 500px;
  transition: max-height 1s ease;
  overflow: hidden;
}

.accordion-item.active > .accordion-tab-wrapper .accordion-mark{
	transform: rotate(90deg) translate(-0.2rem, -0.3rem);
  transition: transform .2s ease-in-out;
}


.accordion-item.inner .games,
.panel.games {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  flex: 1;
  padding: 20px;
  gap: 15px;
}



.modern-table th:nth-child(2),
.modern-table td:nth-child(2) {
  display: flex;
  justify-content: space-between;
  width: 150px;
}

.container .modern-table button {
  background-color: var(--blue);
  color: var(--text-color);
}

.container .modern-table button:hover {
  background-color: #7b7b7b;
}

.old-table thead tr {
  border: 1px solid var(--border-color);
}

.old-table th button:hover {
  background-color: rgb(230, 230, 230);
}

.old-table tbody td.empty-cell {
  background-color: rgb(214, 214, 214);
}

.old-table th,
.old-table td {
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  width: 80px;
  text-align: center;
}

.old-table tr th:nth-child(-n + 2) {
  background-color: var(--blue);
  color: var(--text-color);
}

.old-table .rounds-data {
  padding: 0;
}

.old-table tbody td {
  padding: 5px;
}

.old-table .inner-table {
  min-height: 80px;
}

.old-table .inner-table tbody.hidden {
  display: none;
}

.old-table .inner-table tbody.expanded {
  display: table-row-group;
}

.old-table .rounds-data tr,
.old-table .rounds-data td {
  border: none;
}

.old-table .rounds-data td:not(.empty-cell):not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.old-table .rounds-data tfoot tr:first-child td:not(.empty-cell) {
  border-top: 1px solid var(--border-color);
}

.old-table .rounds-data td {
  min-width: 90px;
  width: 90px;
}

.old-table .rounds-data td p {
  margin: 3px;
}

.old-table .rounds-data .empty-cell {
  border: none;
}

.old-table tbody .btn-wrapper {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  gap: 5px;
  margin: 10px 2px;
}

.old-table tbody .expand-btn {
  padding: 4px;
}

.playoffs-table .playoffs-header {
  display: flex;
  flex-direction: row;
  gap: 50px;

  padding: 0;
  margin: 0;
}

.playoffs-table .playoffs-header li {
  flex-grow: 1;
  text-align: center;
  list-style: none;
  padding: 20px;  
}

.playoffs-table .playoffs-games {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  gap: 50px;
  align-items: center;
  width: 100%;
  margin-bottom: 250px;
}

.playoffs-table .playoffs-games .grid-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}


.playoffs-table .playoffs-games .game-result-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-items: center;
  position: relative;
  border: 1px solid black;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


.playoffs-table .playoffs-games .grid-wrapper.fight-for-third {
  flex-direction: column;
  position: absolute;
  top: 110%;
  height: auto;
  width: auto;
  right: 0;
  margin: 30px 0;
}

.game-result-wrapper .pair-id {
  grid-row: span 2;
  background-color: lightblue;
  border-right: 1px solid black;
}

.game-result-wrapper span,
.game-result-wrapper .info-btn-wrapper {
  padding: 10px;
  white-space: nowrap;
  align-self: stretch;
  justify-self: stretch;
}

.game-result-wrapper .info-btn-wrapper button {
  padding: 3px 10px;
}

.game-result-wrapper .info-btn-wrapper:first-of-type,
.game-result-wrapper span:nth-child(-n+4):not(.pair-id) {
  border-bottom: 1px solid black;
}


.playoffs-table .playoffs-games .grid-wrapper:not(.finals):not(.fight-for-third) .game-result-wrapper:after {
  content: '';
  position: absolute;
  width: 25px;
  height: 1px;
  background-color: black;
  right: 0px;
  transform: translateX(25px); 
}


.playoffs-table .playoffs-games .grid-wrapper:not(.first-row):not(.fight-for-third)::before {
  content: '';
  position: absolute;
  height: calc(25px + 50%);
  width: 1px;
  left: -25px;
  background-color: black;
  transform: translateX(-2px); 
}

.playoffs-table .playoffs-games .grid-wrapper:not(.first-row):not(.fight-for-third) .game-result-wrapper::before {
  content: '';
  position: absolute;
  width: 25px;
  height: 1px;
  background-color: black;
  left: 0;
  transform: translateX(-25px); 
}


.game-result-wrapper .teams-wrapper div {
  gap: 10px;  
  margin: 4px;
}

.winner-container {
  background-color: #fff;
  padding: 20px 30px;
  border-color: var(--border-color);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.winner-container .winner {
  font-size: 20px;
  font-weight: bold;
}


.game-result-wrapper .teams-wrapper p {
  margin: 0;
}

@media (min-width: 1000px) {
  .playoffs-table .playoffs-games .grid-wrapper:not(.first-row).right::before {
    left: 100%;
    transform: translateX(25px);
  }

  .playoffs-table .playoffs-games .grid-wrapper.first-row.right .game-result-wrapper::after {
    left: 0;
    transform: translateX(-25px);
  }

  .playoffs-table .playoffs-games .grid-wrapper.finals:not(.fight-for-third)::before {
    content: none;
  }

  .playoffs-table .playoffs-games .grid-wrapper.finals .game-result-wrapper::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 1px;
    background-color: black;
    right: 0;
    transform: translateX(25px);   }

  /* .playoffs-table .playoffs-games .grid-wrapper.first-row.right .game-result-wrapper::before {
    content: none;
  } */
}


.modern-table .relegation * {
  border-top: 1px solid red;
}

.container button.clicked,
.container button.clicked:hover {
  background-color: #2182ab;
  color: white;
}