/* ============================
   Bullsy Platform UI (Shared)
   ============================ */

/* Card / layout */
.bullsy-card{
  background:#1f2a3a;
  border-radius:18px;
  padding:22px;
  color:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}

.bullsy-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px;
}

.bullsy-title{
  font-weight:900;
  letter-spacing:.08em;
  font-size:22px;
  text-transform:uppercase;
}

.bullsy-subtitle{
  opacity:.85;
  margin-top:6px;
}

/* Panel */
.bullsy-panel{
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
  border-radius:16px;
  padding:16px;
  margin-top:12px;
}

.bullsy-panel-title{
  margin:0 0 10px 0;
  font-size:20px;
  font-weight:800;
}

/* Inputs / buttons */
.bullsy-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}

.bullsy-input{
  flex:1;
  min-width:260px;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:#5d8f92;
  color:#fff;
  outline:none;
}

.bullsy-input::placeholder{
  color:rgba(255,255,255,.75);
}

.bullsy-actions{
  display:flex;
  gap:12px;
  margin:16px 0 6px 0;
  flex-wrap:wrap;
}

.bullsy-btn{
  border:0;
  border-radius:999px;
  padding:12px 18px;
  font-weight:900;
  letter-spacing:.04em;
  cursor:pointer;
}

.bullsy-btn-primary{background:#9e3434; color:#fff;}
.bullsy-btn-secondary{background:#2b3a52; color:#fff; border:1px solid rgba(255,255,255,.12);}
.bullsy-btn-ghost{background:transparent; color:#fff; border:1px solid rgba(255,255,255,.18);}

/* ============================
   Roster Pills (checkbox + name)
   ============================ */
.bullsy-pill-list{
  list-style:none;
  padding:0;
  margin:12px 0 0 0;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Target both your generic list + the specific 21 roster list */
.bullsy-pill-list li,
#bullsy21-player-roster li{
  display:inline-flex;
  align-items:center;
  gap:10px;

  /* Key: ensure checkbox + label stay on same line */
  white-space:nowrap;

  padding:10px 14px;
  border-radius:999px;

  background: rgba(123,183,176,.95);
  color:#0b141d;
  font-weight:800;

  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

/* Let the pill size to content, but don't get comically tiny */
.bullsy-pill-list li{ min-width: 120px; }

/* checkbox sizing + alignment */
.bullsy-pill-list input[type="checkbox"],
#bullsy21-player-roster input[type="checkbox"]{
  width:18px;
  height:18px;
  margin:0;
  flex:0 0 auto;
}

/* label stays inline */
.bullsy-pill-list label,
#bullsy21-player-roster label{
  margin:0;
  display:inline-block;
  white-space:nowrap;
}

/* ============================
   Status + scorepad
   ============================ */
.bullsy-status{margin:10px 0 6px 0; font-size:18px;}
.bullsy-status-label{opacity:.9; font-weight:700;}
.bullsy-status-player{font-weight:900; margin-left:6px;}
.bullsy-status-phase{margin-left:10px; opacity:.85;}

.bullsy-scorepad{margin:12px 0 16px 0; text-align:center;}
.bullsy-scorepad-label{opacity:.85; margin-bottom:10px;}
.bullsy-scorepad-buttons{display:flex; justify-content:center; gap:12px; flex-wrap:wrap;}

/* 
  Axe Royale score buttons
  ------------------------
  • Fixed-size, touch-friendly targets for fast gameplay
  • Uses flexbox to guarantee true visual centering of numbers
  • Square with softened corners to match Bullsy UI language
  • Typography optimized for both single- and double-digit scores
*/
.bullsy-score-btn {
  width: 58px;
  height: 58px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 14px;
  border: 0;

  background: #8f2f2f;
  color: #ffffff;

  font-size: 20px;
  font-weight: 800;
  line-height: 1;

  cursor: pointer;
}

/* ============================
   Table (Hard Reset — fixes border issues)
   ============================ */

/* wrapper safety (prevents theme responsive table weirdness) */
.bullsy-table-wrap{ overflow-x:auto; }

/* Force consistent table behavior even if theme overrides */
.bullsy-table{
  width:100% !important;
  table-layout: fixed;
  border-collapse: separate !important;
  border-spacing: 0 !important;

  border:1px solid rgba(255,255,255,.12) !important;
  border-radius:14px !important;
  overflow:hidden !important;

  background: rgba(0,0,0,0.10) !important;
}

/* Remove any theme borders first */
.bullsy-table th,
.bullsy-table td{
  border:0 !important;
  color:#fff !important;
}

/* Header */
.bullsy-table thead th{
  background: rgba(255,255,255,.08) !important;
  padding:16px 18px !important;
  text-align:left !important;
  text-transform:uppercase;
  letter-spacing:.06em;
  font-size:14px;

  border-bottom:1px solid rgba(255,255,255,.12) !important;
}

/* Body cells */
.bullsy-table tbody td{
  padding:16px 18px !important;
  border-bottom:1px solid rgba(255,255,255,.10) !important;
}

/* No bottom border on last row */
.bullsy-table tbody tr:last-child td{
  border-bottom:0 !important;
}

/* Vertical dividers */
.bullsy-table thead th + th,
.bullsy-table tbody td + td{
  border-left:1px solid rgba(255,255,255,.10) !important;
}

.bullsy-winner{margin-top:14px; font-size:18px; font-weight:800;}

/* Footer */
.bullsy-footer{margin-top:18px; opacity:.85;}

/* ============================
   Modal
   ============================ */
.bullsy-modal{position:fixed; inset:0; z-index:9999;}
.bullsy-modal-backdrop{position:absolute; inset:0; background:rgba(0,0,0,.62);}

.bullsy-modal-card{
  position:relative;
  max-width:680px;
  margin:10vh auto;
  border-radius:22px;
  background:linear-gradient(180deg,#5b514b 0%, #0d1b2a 65%);
  padding:22px;
  color:#fff;
  z-index:1;
  box-shadow:0 18px 45px rgba(0,0,0,.35);
}

.bullsy-modal-close{
  position:absolute;
  top:14px; right:14px;
  width:44px; height:44px;
  border-radius:999px;
  border:0;
  background:#9e3434;
  color:#fff;
  font-size:22px;
  cursor:pointer;  
  display: flex;
  align-items: center;
  justify-content: center;

  line-height: 1;        /* kill font baseline drift */
  padding: 0;            /* remove any default padding */
}
.bullsy-modal-close:hover{
  filter: brightness(1.08);
}

.bullsy-modal-body{text-align:center; padding:26px 10px 12px;}
.bullsy-modal-icon{font-size:44px; margin-bottom:10px;}

.bullsy-modal-badge{
  display:inline-block;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  font-weight:900;
  letter-spacing:.08em;
  margin:10px 0 18px;
}

.bullsy-modal-title{
  font-size:42px;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
  margin-bottom:12px;
}

.bullsy-modal-message{opacity:.92; font-size:18px;}
.bullsy-modal-actions{text-align:center; margin-top:18px;}

/* ==========================================
   Bullsy Select Control
   Consistent, accessible, cross-browser
   ========================================== */

.bullsy-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 100%;
  max-width: 280px;
  padding: 12px 44px 12px 14px;

  background-color: #2b3340;
  color: #ffffff;

  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;

  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;

  cursor: pointer;

  /* Custom arrow */
  background-image:
    linear-gradient(45deg, transparent 50%, #ffffff 50%),
    linear-gradient(135deg, #ffffff 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

/* Hover */
.bullsy-select:hover {
  border-color: rgba(255,255,255,0.35);
}

/* Focus (keyboard + accessibility) */
.bullsy-select:focus {
  outline: none;
  border-color: #6fb6b1;
  box-shadow: 0 0 0 2px rgba(111,182,177,0.25);
}

/* Disabled state */
.bullsy-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Dropdown options (limited control, but improved contrast) */
.bullsy-select option {
  background: #1f2632;
  color: #ffffff;
}
/* Target Type Gate (shared platform UI)
   Purpose: Force the user to pick 5/6/10-ring target before playing any game. */
.bullsy-target-gate {
  margin-top: 16px;
}

.bullsy-target-gate .bullsy-muted {
  opacity: .9;
  font-size: 14px;
  line-height: 1.35;
}

.bullsy-target-gate.is-locked #bullsy-target-type,
.bullsy-target-gate.is-locked #bullsy-target-confirm {
  display: none;
}

.bullsy-target-gate.is-locked #bullsy-target-change {
  display: inline-flex;
}
/* Axe Royale: clear separation between Setup and Gameplay */
.bullsy-gameplay-header{
  margin: 14px 0 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}

.bullsy-gameplay-title{
  margin:0 0 10px 0;
  font-size:20px;
  font-weight:800;
  text-transform: uppercase;
}

.bullsy-gameplay-help{
  margin-top: 6px;
  opacity: .9;
  font-size: 14px;
  line-height: 1.35;
}

/* When in play mode, dim/lock setup instead of leaving it interactive */
.bullsy-is-playing #bullsy-ar-setup-area{
  opacity: .35;
  pointer-events: none;
  filter: blur(.2px);
}

/* OPTIONAL: make the game area “pop” a bit more once visible */
#bullsy-ar-game-area{
  margin-top: 16px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.08);
}
/* ========== GAME STATE: SUDDEN DEATH ========== */
.bullsy-is-sudden-death .bullsy-status-phase{
  font-weight: 900;
  letter-spacing: .5px;
}

.bullsy-is-sudden-death .bullsy-scorepad-label{
  font-weight: 800;
}
.bullsy-pulse{
  animation: bullsyPulse 1.2s ease-in-out infinite;
}
.bullsy-game-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin: 0 0 12px;
}
.bullsy-status-phase{
  opacity: .9;
  font-weight: 700;
}
.bullsy-is-gameover #bullsy-ar-game-area{
  opacity: .35;
  pointer-events: none;
  filter: grayscale(1);
}
/* Axe Royale actions bar stays visible during gameplay */
.bullsy-game-axe-royale #bullsy-ar-actions{
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin: 0 0 14px 0;
}

/* When game is over, grey out gameplay area */
.bullsy-game-axe-royale.bullsy-is-gameover #bullsy-ar-game-area{
  opacity: .35;
  pointer-events: none;
  filter: grayscale(.2);
}

/* Optional: draw attention to New Game */
.bullsy-game-axe-royale .bullsy-pulse{
  animation: bullsyPulse 1.1s ease-in-out infinite;
}
@keyframes bullsyPulse{
  0%,100%{ transform: scale(1); }
  50%{ transform: scale(1.04); }
}
/* Axe Royale table: stop long names from wrecking the layout */
.bullsy-game-axe-royale .bullsy-table td:first-child,
.bullsy-game-axe-royale .bullsy-table th:first-child{
  max-width: 160px;               /* adjust 140–200 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Make the table horizontally scrollable on small screens */
@media (max-width: 768px){
  .bullsy-game-axe-royale .bullsy-table-wrap{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .bullsy-game-axe-royale .bullsy-table{
    min-width: 640px;             /* prevents column squish */
  }
}
.bullsy-game-axe-royale .bullsy-table td:first-child{
  position: relative;
}
.bullsy-game-axe-royale .bullsy-table td:first-child[title]{
  cursor: help;
}
.bullsy-game-axe-royale .bullsy-table td:first-child{
  position: relative;
}
.bullsy-game-axe-royale .bullsy-table td:first-child[title]{
  cursor: help;
}

.bullsy-table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Keep tables readable + stable */
.bullsy-table{
  width: 100%;
  border-collapse: collapse;
}

/* Utility: hide any column on mobile by adding .bullsy-hide-mobile */
@media (max-width: 640px){

  /* Tighten spacing globally on phones */
  .bullsy-table th,
  .bullsy-table td{
    padding: 8px 10px;
    font-size: 14px;
  }

  /* Make the first column (usually PLAYER) wrap nicely without blowing width */
  .bullsy-table td:first-child{
    white-space: normal;
    overflow: hidden;

    /* 2-line clamp for long names */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  /* Keep non-name columns compact (numbers shouldn't wrap) */
  .bullsy-table td:not(:first-child),
  .bullsy-table th:not(:first-child){
    white-space: nowrap;
  }

  /* Optional: slightly smaller headers on mobile */
  .bullsy-table th{
    font-size: 12px;
    letter-spacing: .04em;
  }

  /* Hide helper class */
  .bullsy-table .bullsy-hide-mobile{
    display: none !important;
  }
}
