/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f0;
  color: #1a1a1a;
  margin: 0;
}

a { color: #2563eb; }

/* ---- Nav ---- */
.app-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #1a1a2e;
  color: #e2e8f0;
}
.app-nav .app-title { font-weight: 700; font-size: 1.1rem; margin-right: auto; }
.app-nav a { color: #93c5fd; text-decoration: none; }
.app-nav a:hover { text-decoration: underline; }

/* ---- Flash ---- */
.flash {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}
.flash-notice { background: #dcfce7; color: #166534; border-left: 4px solid #22c55e; }
.flash-alert  { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }

/* ---- Main ---- */
main { padding: 2rem 1.5rem; max-width: 900px; margin: 0 auto; }

/* ---- Auth forms ---- */
.auth-container { max-width: 400px; margin: 3rem auto; background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.auth-container h1 { margin-top: 0; font-size: 1.5rem; }
.field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input { padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 1rem; }
.field input:focus { outline: 2px solid #2563eb; border-color: transparent; }
.field small { color: #6b7280; font-size: 0.8rem; }
.actions { margin-top: 1.25rem; }
.actions input[type=submit] { background: #1a1a2e; color: #fff; border: none; padding: 0.6rem 1.5rem; border-radius: 6px; font-size: 1rem; cursor: pointer; }
.actions input[type=submit]:hover { background: #2d2d4e; }

/* ---- Error messages ---- */
.error-messages { background: #fee2e2; border: 1px solid #fca5a5; border-radius: 6px; padding: 0.75rem 1rem; margin-bottom: 1rem; }
.error-messages ul { margin: 0; padding-left: 1.25rem; font-size: 0.9rem; color: #991b1b; }

/* ---- Admin ---- */
.admin-container h1 { font-size: 1.75rem; margin-bottom: 1.5rem; }
.admin-section { background: #fff; border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.admin-section h2 { margin-top: 0; font-size: 1.2rem; }

/* ---- Buttons ---- */
.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: 6px; border: none; cursor: pointer; font-size: 0.9rem; text-decoration: none; }
.btn-primary   { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-secondary:hover { background: #4b5563; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.btn-link { background: none; border: none; color: #93c5fd; cursor: pointer; font-size: inherit; padding: 0; text-decoration: underline; }

/* ---- Table ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th { text-align: left; padding: 0.5rem 0.75rem; background: #f1f5f9; border-bottom: 2px solid #94a3b8; }
.data-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #94a3b8; word-break: break-all; }
.data-table code { font-size: 0.78rem; background: #f1f5f9; padding: 0.2rem 0.4rem; border-radius: 4px; }

/* ---- Page header ---- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.page-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ---- Games list ---- */
.games-list { display: flex; flex-direction: column; gap: 0.75rem; }
.game-card { background: #fff; border-radius: 8px; padding: 1rem 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; justify-content: space-between; align-items: center; }
.game-card-title { font-weight: 600; font-size: 1.05rem; text-decoration: none; color: #1a1a2e; }
.game-card-title:hover { text-decoration: underline; }
.game-card-meta { font-size: 0.85rem; color: #6b7280; display: flex; gap: 1rem; }
.muted { color: #9ca3af; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 0.75rem; }
.empty-state { color: #6b7280; font-style: italic; }

/* ---- Scorecard ---- */
.scorecard-wrapper { overflow-x: auto; }
.scorecard { border-collapse: collapse; width: 100%; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.scorecard th, .scorecard td { padding: 0.65rem 1rem; border-bottom: 1px solid #94a3b8; text-align: center; vertical-align: middle; }
.scorecard th { background: #1a1a2e; color: #f1f5f9; font-size: 0.9rem; white-space: nowrap; text-align: center; }
.scorecard th.round-col { text-align: left; min-width: 130px; }
.scorecard .round-label { text-align: left; white-space: nowrap; min-width: 130px; }
.scorecard th.actions-col { text-align: center; width: 80px; }
.scorecard .actions-cell { text-align: center; }
.round-number { font-weight: 600; font-size: 0.9rem; }
.round-delete-btn { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 0.8rem; margin-left: 0.5rem; padding: 0; line-height: 1; vertical-align: middle; opacity: 0.7; }
.round-delete-btn:hover { opacity: 1; }
.score-cell { min-width: 80px; }
.score-link { display: inline-block; min-width: 3rem; padding: 0.25rem 0.5rem; border-radius: 5px; text-decoration: none; color: #1a1a2e; font-weight: 500; transition: background 0.15s; }
.score-link:hover { background: #dbeafe; color: #1d4ed8; }
.score-value { font-size: 1rem; }
.scorecard .total-row td { background: #f1f5f9; font-weight: 700; border-top: 2px solid #94a3b8; }
.scorecard tbody tr:last-child td { border-bottom: none; }
.scorecard tbody tr:not(.total-row):hover td { background: #f8fafc; }

/* ---- Burn states ---- */
.burn-cell { background: #fee2e2 !important; }
.burn-cell .score-link { color: #b91c1c; }
.burn-cell .score-link:hover { background: #fecaca; }
.burned-header { color: #9ca3af; }
.burn-badge { font-size: 0.75rem; margin-left: 0.25rem; }
.burned-total { color: #dc2626; }
.game-over-banner {
  background: #fef3c7; border: 2px solid #f59e0b; border-radius: 8px;
  padding: 1rem 1.5rem; margin-bottom: 1.5rem;
  font-size: 1.25rem; font-weight: 700; text-align: center; color: #92400e;
}
.score-cell { position: relative; }

/* ---- Player checkboxes ---- */
.player-checkboxes { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.5rem 0; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; cursor: pointer; }
.checkbox-label input { width: 1rem; height: 1rem; }


