/* ==========================================================================
   Billiards App
   ========================================================================== */
.billiards-wrap {
  background-color: #ffffff;
  border: 1px solid #eae2e0;
  border-radius: 10px;
  padding: 20px;
  margin: 25px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* --- Setup screen (mode selection) --- */
.bil-setup {
  text-align: center;
  padding: 20px 10px 10px;
}

.bil-mode-cards {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.bil-mode-card {
  background-color: #fcfbfa;
  border: 1px solid #eae2e0;
  border-radius: 10px;
  padding: 22px;
  width: 220px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.bil-mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: #a83232;
}

.bil-mode-card h3 {
  color: #1a1a1a;
  margin-bottom: 8px;
}

.bil-mode-card p {
  font-size: 0.88rem;
  color: #666;
  margin-bottom: 0;
}

/* --- Game screen --- */
.bil-game {
  display: none;
}

.bil-game.active {
  display: block;
}

.bil-setup.hidden {
  display: none;
}

.bil-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 15px;
}

.bil-scoreboard {
  display: flex;
  gap: 25px;
}

.bil-score {
  text-align: center;
}

.bil-score .name {
  display: block;
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bil-score .value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #4a3e3d;
}

.bil-score.active-turn .value {
  color: #a83232;
}

.bil-score.active-turn .name {
  color: #a83232;
  font-weight: 700;
}

.bil-timer {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4a3e3d;
  font-variant-numeric: tabular-nums;
}

.bil-timer.low-time {
  color: #a83232;
}

.bil-status {
  text-align: center;
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 10px;
  min-height: 1.3em;
}

.bil-table-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

#billiardsCanvas {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  touch-action: none;
  cursor: crosshair;
}

.bil-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.bil-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(35, 28, 27, 0.88);
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  color: #ffffff;
  padding: 20px;
}

.bil-overlay.visible {
  display: flex;
}

.bil-overlay h2 {
  color: #ffffff;
  margin-bottom: 10px;
}

.bil-overlay p {
  color: #e8e0de;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .bil-hud {
    justify-content: center;
    text-align: center;
  }
  .bil-scoreboard {
    justify-content: center;
    width: 100%;
  }
}
