/* =========================
   BOARD PAGE STYLES
   (container + grid + payouts)
   ========================= */

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header {
  text-align: center;
  margin-bottom: 30px;
}

.header img {
  height: 80px;
  margin-bottom: 10px;
}

.header h1 {
  color: #2a3f5f;
  font-size: 2.5em;
  margin-bottom: 10px;
}

/* board wrapper helpers */
.grid-wrapper { margin: 0 auto; }
.board-scroll { width: 100%; margin: 0 auto 1.5rem; }
.board-scroll table { margin: 0 auto; }

/* table */
.squares-table {
  border-collapse: collapse;
  margin: 0 auto;
  background: white;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.squares-table td {
  width: 65px;
  height: 65px;
  border: 1px solid #ccc;
  text-align: center;
  position: relative;
  font-size: 11px;
  padding: 2px;
  vertical-align: middle;
}

.team-header {
  background: #2a3f5f;
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.nfc-header { background: #232B85; }
.afc-header { background: #DB2824; }

/* square states */
.square-available {
  background: #f0f9ff;
  cursor: pointer;
  transition: all 0.3s ease;
}
.square-available:hover {
  background: #cce5ff;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
}
.square-pending {
  background: #ff9966;
  font-weight: bold;
  color: #6c1f00;
}
.square-confirmed {
  background: #99ff66;
  font-weight: bold;
  color: #155724;
}
.square-locked {
  background: #ffc0c0;
  opacity: 0.7;
  cursor: not-allowed;
}

.square-number {
  display: block;
  font-size: 10px;
  color: #666;
}

.square-name {
  display: block;
  font-weight: bold;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.square-status {
  display: block;
  font-size: 9px;
  margin-top: 2px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* controls */
.controls { text-align: center; margin: 30px 0; }

.submit-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 18px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

/* payouts/rules */
.info-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 40px;
}

.info-box {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 10px;
  border-left: 4px solid #2a3f5f;
}

.info-box h3 { color: #2a3f5f; margin-bottom: 15px; }

.info-box ul { list-style: none; padding: 0; }

.info-box li {
  padding: 8px 0;
  border-bottom: 1px dotted #ddd;
}

.payout-amount {
  float: right;
  font-weight: bold;
  color: #28a745;
}

/* floating pill */
.selection-count {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2a3f5f;
  color: white;
  padding: 15px 25px;
  border-radius: 50px;
  display: none;
  z-index: 1000;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* ===============================
   PHONE (<=768px) — board + wrap
   =============================== */
@media (max-width: 768px) {
  .container {
    margin: 0 auto 14px;
    padding: 16px 10px 20px;
    border-radius: 12px;
  }

  .header img { height: 60px; margin-bottom: 6px; }

  .header h1 {
    font-size: 1.55rem;
    line-height: 1.15;
    margin-bottom: 6px;
  }

  .grid-wrapper { margin: 0 -6px 10px; }

  .board-scroll {
    margin: 0;
    width: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .board-scroll table {
    width: 100%;
    table-layout: fixed;
    margin: 0 auto;
  }

  /* allow wrapping + allow row height to grow */
  .squares-table td {
    width: auto;
    height: auto;
    min-height: 34px;
    padding: 2px;
    font-size: 8px;
    line-height: 1.1;

    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: middle;
    text-align: center;

    overflow: visible;
  }

  .square-number { font-size: 8px; margin-bottom: 1px; }

  .square-name {
    display: block;
    font-size: 9px;
    line-height: 1.1;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .square-status { font-size: 7px; margin-top: 1px; }
  .team-header { font-size: 9px; padding: 2px 0; }

  .submit-btn {
    width: 100%;
    font-size: 1rem;
    padding: 12px 18px;
    border-radius: 999px;
  }

  .info-section {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 18px;
  }

  .selection-count {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 10px;
    padding: 10px 18px;
    font-size: 0.85rem;
  }
}
