/* Tournament pages (giai-dau)
   extracted from views/pages/tournaments/*.php
*/

/* tournaments/show (games list v2)
   - STT thay cho Vòng
   - Bỏ dòng tiêu đề và cột "Xem"
   - Bấm vào Hòa/Thắng/Bại để xem ván
   - Thông tin Vòng hiển thị ở cuối dòng
*/

.tournament-games-title{
  margin:0 0 10px;
}

.tournament-empty{
  color:#666;
}

.tournament-games-list{
  width:100%;
  border:1px solid #ddd;
  border-radius:6px;
  background:#fff;
  overflow:hidden;
}

.tournament-game-item{
  display:grid;
  grid-template-columns:40px 1fr;
  column-gap:10px;
  padding:8px 10px;
  border-bottom:1px solid #eee;
}

.tournament-game-item:last-child{border-bottom:none;}

.tournament-game-idx{
  color:#333;
  font-size:14px;
  padding-top:2px;
}

.tournament-game-line1{
  display:grid;
  /* Giống demo: cố định 3 cột Tiên - KQ - Hậu để KQ không bị trôi ra quá xa.
     Cột cuối dùng 1fr để đẩy "Vòng" về bên phải mà không ảnh hưởng 3 cột đầu. */
  /* Thu gọn hơn vì tên kỳ thủ thường không quá dài (3-5 chữ) */
  grid-template-columns:160px 60px 160px 1fr;
  column-gap:4px;
  align-items:center;
  font-size:14px;
  /* Dùng UI font cho dễ nhìn trên Windows */
  font-family: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif;
}

/* Tên kỳ thủ: dùng <b> mặc định (không ép font-weight) */

/* Giữ 3 cột Tiên - KQ - Hậu thẳng hàng, tên dài không làm lệch cột */
.tournament-game-player{ min-width:0; }

.tournament-game-player a{
  text-decoration:none;
  color:var(--xq-link);
}

.tournament-game-player a:hover{ text-decoration:underline; }

.tournament-game-player a,
.tournament-game-player b{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.tournament-game-result{
  color:var(--xq-link);
  font-weight:400;
  text-decoration:underline;
  /* Demo để kết quả canh trái trong cột, nhìn sát hơn với tên Tiên */
  justify-self:start;
  white-space:nowrap;
}

.tournament-game-round{
  color:#666;
  font-size:13px;
  white-space:nowrap;
  justify-self:end;
}

@media (max-width: 640px){
  .tournament-game-item{ grid-template-columns:34px 1fr; }

  .tournament-game-line1{
    grid-template-columns: 1fr 52px 1fr;
    column-gap:4px;
    row-gap:4px;
  }

  .tournament-game-round{
    grid-column:1 / -1;
    justify-self:end;
  }
}
