/* =========================================================
   M.U.N.I.T. — TURNIEJ PIŁKI V1.1
   ========================================================= */

.game-card .tournament-btn {
  width: 100% !important;
  min-height: 31px !important;
  height: 31px !important;
  margin-top: 5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: 1px solid #D8C98E !important;
  border-radius: 10px !important;
  background: #FFF9E6 !important;
  color: #6F5B18 !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  letter-spacing: .04em !important;
}

.game-card .tournament-btn:hover {
  background: #FFF3C6 !important;
}

.game-card .tournament-btn span:first-child {
  font-size: 14px !important;
  line-height: 1 !important;
}

.tournament-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(22,31,34,.36);
  backdrop-filter: blur(5px);
}

.tournament-overlay.hidden {
  display: none !important;
}

.tournament-modal {
  width: min(94vw, 520px);
  max-height: min(88dvh, 760px);
  overflow: auto;
  box-sizing: border-box;
  padding: 18px;
  border: 1px solid #DDE6E1;
  border-radius: 22px;
  background: #FCFDFB;
  box-shadow: 0 22px 60px rgba(37,50,57,.20);
}

.tournament-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tournament-head h2 {
  margin: 4px 0 3px;
  color: #253239;
  font-size: 20px;
  line-height: 1.15;
}

.tournament-head p {
  margin: 0;
  color: #708087;
  font-size: 10px;
  line-height: 1.45;
}

.tournament-kicker {
  color: #8B7426;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .10em;
}

.tournament-close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid #DFE7E3;
  border-radius: 11px;
  background: #FFF;
  color: #53646B;
  font-size: 20px;
}

.tournament-size-title {
  margin-top: 18px;
  color: #53646B;
  font-size: 10px;
  font-weight: 850;
}

.tournament-size-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 7px;
}

.tournament-size-btn {
  min-height: 40px;
  border: 1px solid #DDE6E1;
  border-radius: 11px;
  background: #F5F7F5;
  color: #53646B;
  font-size: 12px;
  font-weight: 900;
}

.tournament-size-btn.active {
  border-color: #9D8B49;
  background: #FFF5CF;
  color: #6F5B18;
}

.tournament-create-btn {
  width: 100%;
  margin-top: 12px;
}

.tournament-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0 10px;
  color: #94A09C;
  font-size: 9px;
}

.tournament-divider::before,
.tournament-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: #E4EAE6;
}

.tournament-join-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.tournament-code {
  color: #315D63;
  font-size: 13px;
  letter-spacing: .12em;
}

.tournament-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #E3E9E5;
}

.tournament-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #53646B;
  font-size: 10px;
  font-weight: 900;
}

.tournament-member-list {
  display: grid;
  gap: 5px;
}

.tournament-member {
  min-height: 36px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid #E2E8E4;
  border-radius: 11px;
  background: #FFF;
}

.tournament-member-number {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #EFF4F1;
  color: #53646B;
  font-size: 9px;
  font-weight: 900;
}

.tournament-member strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #34464B;
  font-size: 10px;
}

.tournament-member em {
  color: #8B7426;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
}

.tournament-online-list {
  display: grid;
  gap: 5px;
}

.tournament-online-player {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid #DDE7E2;
  border-radius: 11px;
  background: #FFF;
  color: #415257;
  text-align: left;
}

.tournament-online-player strong {
  color: #477C83;
  font-size: 8px;
}

.tournament-empty {
  padding: 10px;
  border-radius: 11px;
  background: #F4F7F5;
  color: #829095;
  font-size: 9px;
  line-height: 1.45;
}

.tournament-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid #DFE7E3;
  border-radius: 13px;
  background: #FFF;
}

.tournament-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.tournament-table th,
.tournament-table td {
  padding: 7px 6px;
  border-bottom: 1px solid #EDF1EF;
  text-align: center;
  white-space: nowrap;
}

.tournament-table th:nth-child(2),
.tournament-table td:nth-child(2) {
  text-align: left;
}

.tournament-table thead th {
  color: #7B898E;
  font-size: 7px;
  letter-spacing: .04em;
}

.tournament-table tbody td {
  color: #4B5D62;
}

.tournament-table tr.place-1 {
  background: #FFF9E5;
}

.tournament-table tr.place-2 {
  background: #F7F9F8;
}

.tournament-table tr.place-3 {
  background: #FBF4EC;
}

.tournament-match-list {
  display: grid;
  gap: 5px;
}

.tournament-match-row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr auto;
  align-items: center;
  gap: 5px;
  min-height: 35px;
  padding: 6px 8px;
  border: 1px solid #E1E8E4;
  border-radius: 11px;
  background: #FFF;
  color: #4C5E63;
  font-size: 9px;
}

.tournament-match-row > span:first-child {
  text-align: right;
}

.tournament-match-row b {
  color: #9AA6A2;
  font-size: 7px;
  text-align: center;
}

.tournament-match-row em {
  color: #477C83;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
}

.tournament-actions {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.tournament-champion {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #D9C675;
  border-radius: 16px;
  background: linear-gradient(180deg,#FFF9DD 0%,#FFFDF4 100%);
}

.tournament-champion > span {
  font-size: 34px;
}

.tournament-champion div {
  display: grid;
  gap: 2px;
}

.tournament-champion small {
  color: #947A22;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .09em;
}

.tournament-champion strong {
  color: #4A4021;
  font-size: 15px;
}

.tournament-champion em {
  color: #7B6B31;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.tournament-return-btn {
  position: fixed;
  z-index: 350;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(90vw, 360px);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #D8C46A;
  border-radius: 15px;
  background: #FFF6C9;
  color: #5C4A0D;
  box-shadow: 0 12px 34px rgba(37,50,57,.24);
  font-size: 10px;
}

.tournament-return-btn.hidden {
  display: none !important;
}

.tournament-return-btn span {
  font-size: 18px;
}

body.tournament-match-active #rematchBtn,
body.tournament-match-active #backLobbyBtn {
  display: none !important;
}

.tournament-invite-modal {
  max-width: 390px;
}

.tournament-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 390px) {
  .tournament-modal {
    padding: 14px;
    border-radius: 18px;
  }

  .tournament-size-grid {
    gap: 4px;
  }

  .tournament-size-btn {
    min-height: 36px;
  }

  .tournament-match-row {
    grid-template-columns: 1fr 18px 1fr;
  }

  .tournament-match-row em {
    grid-column: 1 / -1;
    text-align: center;
  }
}

/* =========================================================
   M.U.N.I.T. — TURNIEJ PIŁKI V2
   profesjonalny panel turniejowy
   ========================================================= */

.tournament-config-section {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #E4EAE6;
}

.tournament-config-title {
  margin-bottom: 7px;
  color: #68787E;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .08em;
}

.tournament-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.tournament-mode-btn {
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px;
  border: 1px solid #DDE6E1;
  border-radius: 13px;
  background: #F7F9F7;
  color: #53646B;
  text-align: center;
}

.tournament-mode-btn strong {
  font-size: 10px;
  font-weight: 950;
}

.tournament-mode-btn small {
  color: #879499;
  font-size: 7px;
  line-height: 1.25;
}

.tournament-mode-btn.active {
  border-color: #91B4AE;
  background: #EDF4F1;
  color: #315D63;
  box-shadow: inset 0 0 0 1px rgba(71,124,131,.06);
}

.tournament-time-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
  transition: opacity .16s ease;
}

.tournament-time-options.disabled {
  opacity: .38;
  pointer-events: none;
}

.tournament-time-btn {
  min-height: 36px;
  border: 1px solid #DDE6E1;
  border-radius: 10px;
  background: #FFF;
  color: #53646B;
  font-size: 9px;
  font-weight: 900;
}

.tournament-time-btn.active {
  border-color: #91B4AE;
  background: #EDF4F1;
  color: #315D63;
}

.tournament-swap-option {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #E3E9E5;
  border-radius: 11px;
  background: #FFF;
  color: #4E6065;
}

.tournament-swap-option input {
  width: 17px;
  height: 17px;
  accent-color: #477C83;
}

.tournament-swap-option span {
  display: grid;
  gap: 1px;
}

.tournament-swap-option strong {
  font-size: 9px;
}

.tournament-swap-option small {
  color: #89969A;
  font-size: 7px;
}

.tournament-rules-preview,
.tournament-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 12px;
}

.tournament-rules-preview span,
.tournament-summary-strip span {
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid #E1E8E4;
  border-radius: 10px;
  background: #F7F9F7;
  color: #607076;
  font-size: 7px;
  text-align: center;
}

.tournament-rules-preview b {
  display: block;
  margin-top: 2px;
  color: #315D63;
  font-size: 9px;
}

.tournament-summary-strip {
  grid-template-columns: repeat(4, 1fr);
}

.tournament-summary-strip span {
  display: grid;
  gap: 2px;
}

.tournament-summary-strip small {
  color: #89969A;
  font-size: 6.5px;
  font-weight: 900;
  letter-spacing: .05em;
}

.tournament-summary-strip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #415257;
  font-size: 8px;
  white-space: nowrap;
}

.tournament-table-pro {
  min-width: 465px;
}

.tournament-table-pro td:nth-child(7),
.tournament-table-pro td:nth-child(8) {
  font-variant-numeric: tabular-nums;
}

.tournament-round-section .tournament-section-title em {
  padding: 4px 6px;
  border-radius: 999px;
  background: #FFF5E5;
  color: #9A6A2C;
  font-size: 6.5px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: .04em;
}

.tournament-round-section .tournament-section-title em.done {
  background: #EAF3EF;
  color: #315D63;
}

.tournament-match-score {
  color: #253239;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.tournament-round-note,
.tournament-wait-host {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 11px;
  background: #F2F6F4;
  color: #708087;
  font-size: 8px;
  line-height: 1.4;
  text-align: center;
}

.tournament-podium {
  display: grid;
  grid-template-columns: 1.08fr 1fr 1fr;
  gap: 7px;
  margin-top: 14px;
}

.tournament-podium-place {
  min-width: 0;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 1px solid #E2E8E4;
  border-radius: 14px;
  background: #FFF;
  text-align: center;
}

.tournament-podium-place.place-1 {
  border-color: #D7C15D;
  background: linear-gradient(180deg,#FFF7CF 0%,#FFFDF4 100%);
  box-shadow: 0 7px 18px rgba(122,98,30,.10);
}

.tournament-podium-place > span {
  font-size: 24px;
}

.tournament-podium-place small {
  color: #91804C;
  font-size: 6.5px;
  font-weight: 950;
  letter-spacing: .06em;
}

.tournament-podium-place strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #3E4F54;
  font-size: 10px;
  white-space: nowrap;
}

.tournament-podium-place em {
  color: #315D63;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.tournament-podium-place b {
  color: #89969A;
  font-size: 7px;
}

.tournament-match-strip {
  position: fixed;
  z-index: 340;
  top: max(7px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(88vw, 330px);
  min-height: 31px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(212,194,101,.75);
  border-radius: 999px;
  background: rgba(24,31,34,.94);
  box-shadow: 0 7px 20px rgba(20,28,31,.20);
  color: #EDF3EF;
  backdrop-filter: blur(7px);
  white-space: nowrap;
}

.tournament-match-strip span {
  color: #F4D96C;
  font-size: 8px;
  font-weight: 950;
}

.tournament-match-strip strong {
  font-size: 8px;
  font-weight: 950;
}

.tournament-match-strip em {
  max-width: 95px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #C9D7D1;
  font-size: 7px;
  font-style: normal;
}

.tournament-match-strip b {
  color: #9CB4AC;
  font-size: 6.5px;
  font-weight: 800;
}

.tournament-match-strip.finished {
  border-color: rgba(145,180,174,.72);
  background: rgba(32,56,58,.96);
}

@media (max-width: 420px) {
  .tournament-summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .tournament-podium {
    grid-template-columns: 1fr;
  }

  .tournament-podium-place {
    grid-template-columns: 30px auto auto auto;
    justify-content: start;
    text-align: left;
  }

  .tournament-podium-place > span {
    grid-row: 1 / span 2;
  }

  .tournament-match-strip {
    width: min(92vw, 330px);
    gap: 4px;
    padding-left: 7px;
    padding-right: 7px;
  }

  .tournament-match-strip b {
    display: none;
  }
}
