/* ============================================================
   tien-len.css  —  Toàn bộ CSS cho game Tiến Lên
   Prefix bắt buộc: tl-  cho MỌI class
   Không dùng transform: rotate() để giả lập layout
   ============================================================ */

/* ── Layout dọc (mặc định, mobile + desktop không fullscreen) */

.tl-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  gap: 12px;
}

.tl-board {
  flex: 1;
  position: relative;
  min-height: 300px;
}

.tl-opponents {
  position: absolute;
  inset: 0;
  z-index: 10;
}

/* Slot đối thủ */
.tl-player-slot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Vị trí mặc định (layout dọc) - có thể điều chỉnh theo thiết kế */
.tl-player-slot:nth-child(1) { top: 10px; left: 10px; }
.tl-player-slot:nth-child(2) { top: 10px; left: 50%; transform: translateX(-50%); }
.tl-player-slot:nth-child(3) { top: 10px; right: 10px; }

.tl-player-name {
  font-size: 0.75rem;
  color: var(--text-sub);
  white-space: nowrap;
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  border-radius: 4px;
}

.tl-card-count-badge {
  background: var(--gold);
  color: #000;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 6px;
}

.tl-my-turn .tl-player-name {
  color: var(--gold);
  font-weight: bold;
  border: 1px solid var(--gold);
}

/* Khu vực giữa bàn */
.tl-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  text-align: center;
}

.tl-center-label {
  color: rgba(255,255,255,0.4);
  font-style: italic;
  font-size: 0.85rem;
}

/* ── Quạt bài */

.tl-fan {
  position: relative;
  height: 100px;
  display: flex;
  justify-content: center;
}

/* Reset margin từ card.css */
.tl-fan .card {
  margin: 0 !important;
}

.tl-fan-card {
  position: absolute;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* ── Khu vực bài người chơi chính */

.tl-hand-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-top: 20px;
}

.tl-hand {
  width: 100%;
  display: flex;
  justify-content: center;
  min-height: 110px;
}

.tl-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  z-index: 20;
}

.tl-btn-play, .tl-btn-pass {
  margin: 0;
  width: 120px;
}

.tl-btn-play:disabled {
  background: #555;
  cursor: not-allowed;
  transform: none;
}

.tl-btn-pass:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #555;
  color: #555;
}

.tl-sidebar {
  display: none;
}

/* ── Layout ngang fullscreen ──────────────────────────────── */

body.is-fullscreen.is-tienlen .tl-screen {
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}

body.is-fullscreen.is-tienlen .tl-board {
  flex: 1;
  height: 100%;
}

body.is-fullscreen.is-tienlen .tl-hand-area {
  flex-direction: column;
  width: 250px;
  flex-shrink: 0;
  justify-content: center;
  margin-top: 0;
}

body.is-fullscreen.is-tienlen .tl-sidebar {
  display: flex;
  flex-direction: column;
  width: 60px;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-start;
  padding-top: 12px;
}

/* Vị trí đối thủ fullscreen (3 người còn lại) */
body.is-fullscreen.is-tienlen .tl-player-slot:nth-child(1) { top: 20%; left: 10%; transform: none; }
body.is-fullscreen.is-tienlen .tl-player-slot:nth-child(2) { top: 10%; left: 50%; transform: translateX(-50%); }
body.is-fullscreen.is-tienlen .tl-player-slot:nth-child(3) { top: 20%; right: 10%; left: auto; transform: none; }
