/* =========================
   Base Layout
========================= */

body {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fafafa;
    margin: 0;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* =========================
   Forms & Buttons
========================= */

input, select, button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

button {
    background: #2c7be5;
    color: white;
    border: none;
    font-weight: 600;
}

button:hover {
    opacity: 0.95;
}

/* =========================
   Tables
========================= */

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
    background: white;
}

th, td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: center;
}

th {
    background: #f2f2f2;
    font-weight: 600;
}

.current-round {
    background: #fff9d6;
}

/* =========================
   Scores
========================= */

.score-positive {
    color: #2e7d32;
    font-weight: 600;
}

.score-negative {
    color: #c62828;
    font-weight: 600;
}

.cell-editable {
    cursor: pointer;
}

/* =========================
   Status Bar
========================= */

.status-bar {
    margin: 16px 0;
    padding: 14px;
    background: #f3f3f3;
    border-radius: 10px;
    font-size: 15px;
}

/* =========================
   Player Selection
========================= */

.player-btn {
    padding: 12px;
    margin: 6px 0;
    background: #eee;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
}

.player-btn.selected {
    background: #ccc;
    opacity: 0.6;
}

.selected-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f2f2f2;
    border-radius: 999px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.chip button {
    width: auto;
    padding: 4px 8px;
    font-size: 14px;
    border-radius: 8px;
    background: #e74c3c;
}

/* =========================
   Utility
========================= */

.hidden {
    display: none;
}

/* =========================
   Player List
========================= */

.player-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.player-list li {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-list li:last-child {
    border-bottom: none;
}

.player-delete {
    color: #e74c3c;
    text-decoration: none;
    font-weight: bold;
}

.btn {
    display: block;
    text-align: center;
    padding: 12px;
    background: #2c7be5;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

/* =========================
   Bid Buttons
========================= */

.bid-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.bid-buttons button {
  aspect-ratio: 1 / 1;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
}

.bid-buttons button.is-active {
  background: #2c7be5;
  color: white;
  border-color: #2c7be5;
}

.bid-buttons button.is-disabled {
  background: #f5f5f5;
  color: #bbb;
  border-color: #ddd;
  pointer-events: none;
}


/* =========================
   Results Screen
========================= */

.results-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-card {
  background: #f6f6f6;
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 14px;
  transition: all 0.2s ease;
}

.result-card.made {
  border: 2px solid #2e7d32;
  background: #e8f5e9;
}

.result-card.missed {
  border: 2px solid #c62828;
  background: #ffebee;
}

.result-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.result-sub {
  font-size: 13px;
  color: #666;
}

.result-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-lite {
  width: 100%;
  background: #eee;
  color: #000;
  border: 1px solid #ccc;
  font-weight: 500;
}

.btn-made.active {
  background: #2e7d32;
  color: white;
}

.btn-missed.active {
  background: #c62828;
  color: white;
}

.cell-total {
  font-size: 11px;
  color: #444;
}


/* =========================
   Score Cell Layout
========================= */

.cell-score {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.cell-divider {
  color: #bbb;
  font-weight: normal;
}

.cell-total {
  font-weight: 500;
  color: #333;
}

/* Keep colour only on delta */
.score-positive .cell-delta {
  color: #2e7d32;
}

.score-negative .cell-delta {
  color: #c62828;
}


/* =========================
   Split Score Cell
========================= */

.score-cell {
  padding: 0;
}

.score-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

.score-delta {
  border-right: 1px solid #ddd;
  padding: 6px 4px;
  font-weight: 600;
}

.score-total {
  padding: 6px 4px;
  font-size: 13px;
  color: #555;
}

/* Delta colouring */
.score-positive .score-delta {
  color: #2e7d32;
}

.score-negative .score-delta {
  color: #c62828;
}




/* =========================
   Modal
========================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 300px;
}




.status-bar table {
  width: 100%;
  border-collapse: collapse;
}

.status-bar table th,
.status-bar table td {
  border: 1px solid #ddd;
  padding: 6px;
  text-align: center;
}