/* Cricket-specific styles */

.cricket-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .cricket-layout {
    grid-template-columns: 1fr;
  }
}

/* Scoreboard */
.cricket-scoreboard {
  padding: 1rem;
}

.scoreboard-header,
.scoreboard-footer {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.scoreboard-footer {
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-size: 1.2rem;
}

.target-col {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.player-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.5rem;
  text-align: center;
}

.player-name-col {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.3rem;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.08);
}

.player-name-col.active {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
}

/* Target rows */
.target-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.target-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.5rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 140ms ease;
}

.target-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.target-row.all-closed {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.target-row.all-closed .target-label {
  color: #fca5a5;
}

.target-label {
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  color: #fff;
}

.target-label.bull {
  font-size: 1.1rem;
}

.marks-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.5rem;
}

.marks-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  min-height: 50px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mark indicators: /, X, ⊗ (circle with X) */
.marks-cell[data-marks="0"] {
  color: rgba(255, 255, 255, 0.15);
}

.marks-cell[data-marks="1"]::before {
  content: '/';
  color: #fbbf24; /* yellow */
}

.marks-cell[data-marks="2"]::before {
  content: 'X';
  color: #f97316; /* orange */
}

.marks-cell[data-marks="3"]::before {
  content: '⊗';
  color: #22c55e; /* green - closed */
  font-size: 2rem;
}

.marks-cell.closed {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
}

/* Points cells in footer */
.points-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: #34d399;
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

/* Throw panel targets grid */
.targets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.target-btn {
  padding: 0.8rem 0.5rem;
  border-radius: 0.6rem;
  border: none;
  cursor: pointer;
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 140ms ease;
}

.target-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  transform: translateY(-2px);
}

.target-btn.selected {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.target-btn.bull {
  font-size: 0.9rem;
  grid-column: span 2;
}

/* Collapsible cards */
.card-collapsible {
  padding: 1.1rem 1.1rem 1.2rem;
}

.card-header-tight {
  align-items: flex-start;
  gap: 0.6rem;
}

.card-toggle {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  padding: 0.35rem 0.65rem;
  border-radius: 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.card-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.collapsible-body.collapsed {
  display: none;
}

/* Status bar */
.status-bar {
  min-height: 2rem;
  margin-bottom: 0.8rem;
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 220ms ease-in-out, transform 220ms ease-in-out;
  transform: translateY(-4px);
}

.status-bar.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Keypad connection pill next to title */
.status-pill {
  display:inline-flex;
  align-items:center;
  gap:0.4rem;
  padding:0.25rem 0.55rem;
  border-radius:999px;
  font-size:0.82rem;
  border:1px solid var(--border-subtle);
}
.status-connected {
  background: linear-gradient(135deg,#22c55e,#16a34a);
  color:#fff;
  border-color: rgba(255,255,255,0.18);
}
.status-disconnected {
  background: rgba(220,38,38,0.12);
  color:#fff;
  border-color: rgba(220,38,38,0.3);
}
.status-connecting {
  background: rgba(234,179,8,0.15);
  color:#fef3c7;
  border-color: rgba(234,179,8,0.35);
}

/* Modal styles */
.modal { display:none; position:fixed; inset:0; z-index:1200; }
.modal[aria-hidden="false"] { display:block; }
.modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.5); }
.modal-panel { position:relative; width:min(760px,95%); margin:6vh auto; background:linear-gradient(180deg,#08121a,#06101a); border-radius:8px; padding:1rem; border:1px solid rgba(255,255,255,0.04); box-shadow:0 8px 30px rgba(2,6,23,0.6); color:var(--text-main); }
.modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:0.6rem; }
.modal-title { font-weight:700; font-size:1.05rem; }
.modal-close { background:transparent; border:none; color:var(--text-subtle); font-size:1.1rem; cursor:pointer; }
.modal-body { max-height:60vh; overflow:auto; font-size:0.95rem; }
.modal-panel .btn-primary { padding:0.5rem 0.8rem; border-radius:6px; cursor:pointer; background: linear-gradient(135deg,var(--primary),var(--accent)); color:#fff; border:none; }

/* Responsive adjustments */
@media (max-width: 700px) {
  .targets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .target-btn.bull {
    grid-column: span 1;
  }
  
  .scoreboard-header,
  .scoreboard-footer,
  .target-row {
    grid-template-columns: 70px 1fr;
  }
  
  .target-label {
    font-size: 1.1rem;
  }
  
  .marks-cell {
    font-size: 1.4rem;
    min-height: 40px;
  }
}

/* Remote game video styling */
.remote-video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

#remoteVideosRow {
  display: none; /* Hidden by default for local games */
}

/* Show videos only when it's a remote game - JavaScript will add this class */
body.remote-game #remoteVideosRow {
  display: grid;
}
.btn-icon {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid var(--accent-info);
  color: var(--accent-info);
  padding: 0.4rem 0.6rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
}

.btn-icon:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.25);
}

.btn-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}