/* ===== OGÓLNE STYLOWANIE STRONY ===== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

/* ===== TABELA: DOMYŚLNE KOLORY WIERSZY ===== */
tr {
    background-color: #ffffff;
}

tr:nth-child(even) {
    background-color: #e9ecef;
}

/* ===== STYLIZACJA TABELI WYNIKÓW ===== */
table#results,
table#matches {
    width: 100%;
    margin-bottom: 2rem;
    border-collapse: collapse;
}

table#results tr {
    font-weight: bold;
    font-size: 20px;
}

table#results td,
table#results th,
table#matches td,
table#matches th {
    padding: 0.5rem;
    vertical-align: middle;
    text-align: center;
    border: 1px solid #dee2e6;
}

table#results a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

table#results img {
    max-height: 30px;
    margin-right: 0.5rem;
}

span.max {
    font-size: 10px;
    color: #6c757d;
}

/* ===== RESPONSYWNOŚĆ: MOBILE ===== */
@media (max-width: 768px) {
    table#results tr {
        font-size: 14px;
    }

    table#results td,
    table#results th,
    table#matches td,
    table#matches th {
        font-size: 11px;
        padding: 0.1rem;
    }

    table#results img {
        max-height: 20px;
        margin-right: 0.25rem;
    }

    table#results a {
        font-size: 12px;
    }

    span.max {
        font-size: 6px;
    }
}

/* ===== NAJBLIŻSZY MECZ ===== */
.match-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #d1e7dd;
    border: 2px solid #0f5132;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 128, 0, 0.1);
}

.match-info {
    flex: 2;
    text-align: center;
    width: 100%;
}

.match-teams {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    font-size: 1.5rem;
    font-weight: bold;
}

.team-name {
    font-size: 36px;
    white-space: nowrap;
    color: #198754;
}

.vs {
    width: 100%;
    text-align: center;
    font-size: 24px;
    margin: 0 15px;
    white-space: nowrap;
    color: #000;
}

.team-logo {
    flex: 1;
    max-width: 100px;
    margin: 10px;
}

.team-logo img {
    max-height: 80px;
    width: auto;
    height: auto;
}

@media (max-width: 768px) {
    .match-container {
        flex-direction: column;
        align-items: center;
    }

    .match-teams {
        flex-direction: column;
    }

    .team-logo {
        max-width: 70px;
    }

    .team-logo img {
        max-height: 50px;
    }

    .team-name {
        font-size: 18px;
    }

    .vs {
        font-size: 18px;
    }
}

/* ===== ODLICZANIE – FLIP STYLE ===== */
.countdown {
  display: flex;
  justify-content: center;
  gap: 15px;
  font-family: 'Courier New', monospace;
  margin-bottom: 2rem 0;
  flex-wrap: nowrap;  /* <- najważniejsze */
  overflow-x: auto;   /* <- pozwala przewinąć na wąskich ekranach */
  padding: 0 1rem;    /* trochę oddechu po bokach */
}

.flip-unit {
  text-align: center;
}

.label {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 4px;
  display: block;
}

.flip-single {
  background: #000;
  color: #0f0;
  font-size: 32px;
  width: 60px;
  height: 60px;
  line-height: 60px;
  border-radius: 6px;
  box-shadow: 0 4px 0 #222;
  text-align: center;
  transform-style: preserve-3d;
  perspective: 600px;
}

.flip {
  animation: flipEffect 0.5s ease-in-out;
}

@keyframes flipEffect {
  0%   { transform: rotateX(0deg); }
  50%  { transform: rotateX(90deg); opacity: 0.5; }
  100% { transform: rotateX(0deg); opacity: 1; }
}

.card-face {
  background: #000;
  color: #0f0;
  font-size: 32px;
  height: 50%;
  line-height: 30px;
  overflow: hidden;
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

.card-face.top {
  top: 0;
  border-bottom: 1px solid #333;
}

.card-face.bottom {
  bottom: 0;
  border-top: 1px solid #333;
}

.card-flip {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.flip-top, .flip-bottom {
  background: #000;
  color: #0f0;
  font-size: 32px;
  line-height: 30px;
  height: 50%;
  overflow: hidden;
  position: absolute;
  width: 100%;
  left: 0;
  text-align: center;
  backface-visibility: hidden;
  border-radius: 4px;
}

.flip-top {
  top: 0;
  transform-origin: bottom;
  transform: rotateX(0deg);
  z-index: 2;
}

.flip-bottom {
  bottom: 0;
  transform-origin: top;
  transform: rotateX(90deg);
  z-index: 1;
}

.flip-card.animate .flip-top {
  animation: flipTop 0.3s forwards;
}

.flip-card.animate .flip-bottom {
  animation: flipBottom 0.3s 0.3s forwards;
}

@keyframes flipTop {
  0% { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}

@keyframes flipBottom {
  0% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

