/* shell-game.css
 * Styles for card-game UI elements: score panel + modals.
 *
 * These are designed to be additive and not interfere with existing shell.css.
 */



.cg-score-panel {
  position: relative;
  flex: 0 0 180px;
  /* fixed left column */
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  /* clean */
  resize: horizontal;
  /* LET USER DRAG TO RESIZE */
  box-sizing: border-box;
  width: 180px;
  min-width: 180px;
  max-width: 500px;
  /* allow wide expansion */
  background: #f0f5f0;
  border-right: 2px solid #ccc;
  padding: 8px 10px;
  padding-right: 6px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}



.cg-score-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: -3px;
  /* tiny handle */
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  background: rgba(0, 0, 0, 0);
}

.cg-score-panel.hidden {
  display: none;
}

.cg-score-header {
  font-weight: 600;
  margin-bottom: 6px;
}

.cg-score-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cg-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px;
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid #dde3dd;
}

.cg-score-name {
  font-weight: 500;
}

.cg-score-value {
  font-variant-numeric: tabular-nums;
}

/* Shared modal base */

.cg-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9998;
}

.cg-modal-backdrop.hidden {
  display: none;
}

.cg-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  min-width: 320px;
  max-width: 480px;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

.cg-modal.hidden {
  display: none;
}

.cg-modal-inner {
  padding: 14px 16px 12px;
}

/* Lobby: green felt style */

.cg-modal-lobby {
  background: radial-gradient(circle at top left, #2f7b3b 0, #145321 60%, #0b3b17 100%);
  color: #fdfdfd;
}

.cg-modal-lobby .cg-modal-inner {
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.cg-modal-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.cg-modal-subtitle {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 10px;
}

.cg-player-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.cg-player-row {
  justify-content: flex-start;
  gap: 8px;
  /* uniform spacing between radio, name, host badge */
  display: flex;
  padding: 4px 6px;
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
}

.cg-player-name {
  font-weight: 500;
}

.cg-player-host {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

/* Rules + summary: neutral white panel */

.cg-modal-rules,
.cg-modal-summary {
  background: #ffffff;
  color: #222;
}

.cg-modal-rules .cg-modal-inner,
.cg-modal-summary .cg-modal-inner {
  border: 1px solid #ccd2dd;
}

.cg-rules-form {
  margin-top: 8px;
}

.cg-field-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.cg-field-row label {
  font-size: 12px;
  margin-bottom: 2px;
}

.cg-field-row select {
  padding: 4px 6px;
  font-size: 13px;
}

.cg-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.cg-btn-primary,
.cg-btn-secondary {
  border-radius: 999px;
  border: none;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
}

.cg-btn-primary {
  background: #2563eb;
  color: #fff;
}

.cg-btn-primary:hover {
  background: #1d4ed8;
}

.cg-btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.cg-btn-secondary:hover {
  background: #d1d5db;
}

/* Summary */

.cg-summary-body {
  font-size: 13px;
}

.cg-summary-header {
  font-weight: 600;
  margin-bottom: 8px;
}

.cg-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.cg-summary-table th,
.cg-summary-table td {
  border: 1px solid #e5e7eb;
  padding: 2px 6px;
  text-align: left;
}

.cg-summary-meta {
  font-size: 12px;
  color: #4b5563;
}

/* Make stage container hold score panel + iframe horizontally */
.stage {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

#stageFrame {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  border: none;
}

#gameScorePanel {
  position: relative;
  /* required for handle positioning */
}

#cgScoreResizeHandle {
  /* dynamically inserted by JS, but style here if needed */
}

/* Make the main area 3 columns: chat | score | stage */
.bw-main {
  display: grid;
  grid-template-columns: var(--chat-width, 280px) auto 1fr;
  grid-template-rows: 1fr;
  height: 100%;
}

/* When chat panel collapsed */
body.chat-collapsed .bw-main {
  grid-template-columns: 0px auto 1fr;
}

/* Score panel slot */
.score-panel-slot {
  width: auto;
  /* width controlled by gameScorePanel */
  position: relative;
  overflow: visible;
  background: none;
  padding: 0;
}