/* ─── Bankroll Sim Page ──────────────────────────────────────────────────── */

.sim-wrapper {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem 4rem;
}

.sim-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.sim-card h2 {
  color: var(--color-accent);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

/* ── Settings row ── */
.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
}

.setting-group label {
  display: block;
  color: #bbb;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.sim-control {
  background: #222628;
  border: 1px solid var(--color-secondary);
  border-radius: 4px;
  color: #f0f0f0;
  font-size: 0.875rem;
  padding: 0.4rem 0.6rem;
  outline: none;
  transition: border-color 0.15s;
  min-width: 180px;
}

.sim-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 0.15rem rgba(98, 168, 172, 0.2);
}

.sim-multiselect {
  min-width: 320px;
  height: 130px;
  padding: 0.2rem 0;
}

.sim-multiselect option {
  padding: 0.3rem 0.6rem;
}

.sim-multiselect option:checked {
  background: var(--color-primary);
  color: var(--color-accent);
}

.run-btn {
  background: var(--color-secondary);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.44rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.run-btn:hover:not(:disabled)  { background: var(--color-accent); }
.run-btn:disabled               { opacity: 0.5; cursor: default; }

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 540px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-box {
  background: #1a1e1f;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
}

.stat-box .box-label {
  display: block;
  color: var(--color-accent);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.stat-box .box-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f0f0f0;
}

.box-value.negative { color: #e05c5c; }
.box-value.positive { color: #4caf82; }

/* ── Threshold table ── */
.thresh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.thresh-table th {
  color: var(--color-accent);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.thresh-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  color: #ddd;
}

.thresh-table tr:last-child td { border-bottom: none; }

.thresh-good { color: #4caf82; font-weight: 600; }
.thresh-ok   { color: #e8b84b; font-weight: 600; }
.thresh-low  { color: #e05c5c; font-weight: 600; }

/* ── Chart ── */
#sim-chart {
  width: 100%;
  min-height: 100px;
}

.run-note {
  color: #555;
  font-size: 0.75rem;
  margin-top: 0.6rem;
  text-align: center;
}

/* ── Inline list inputs ── */
.list-input {
  background: #1a1e1f;
  border: 1px solid #3a3e3f;
  border-radius: 3px;
  color: #f0f0f0;
  font-size: 0.82rem;
  padding: 0.25rem 0.4rem;
  outline: none;
  transition: border-color 0.15s;
}

.list-input:focus { border-color: var(--color-accent); }

.tourn-list-table input.entries-input { width: 56px;  max-width: 56px; }
.tourn-list-table input.adv-input    { width: 58px;  max-width: 58px; opacity: 0.75; font-size: 0.78rem; padding: 0.2rem 0.3rem; }

/* ── Max button in column header ── */
.col-entries { white-space: nowrap; }

.max-btn {
  background: var(--color-primary);
  border: 1px solid var(--color-secondary);
  border-radius: 3px;
  color: var(--color-accent);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  margin-left: 0.4rem;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s;
}

.max-btn:hover { background: var(--color-secondary); color: #fff; }

/* ── Table scroll wrapper ── */
.table-scroll { overflow-x: auto; }

/* ── Load error ── */
.load-error {
  color: #e05c5c;
  font-size: 0.8rem;
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* ── Tournament list table ── */
.tourn-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.tourn-list-table th {
  color: var(--color-accent);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0.4rem;
  text-align: left;
  white-space: nowrap;
}

.tourn-list-table td {
  padding: 0.4rem 0.4rem;
  border-bottom: 1px solid var(--color-border);
  color: #ddd;
  font-size: 0.83rem;
}

.tourn-list-table tfoot td {
  border-bottom: none;
  border-top: 1px solid var(--color-border);
  padding-top: 0.6rem;
}

.footer-label { color: #888; font-size: 0.78rem; font-weight: 600; }
.footer-value { color: #f0f0f0; font-weight: 700; }

.adv-group-header {
  text-align: center !important;
  border-bottom: none !important;
  padding-bottom: 0.1rem !important;
  color: var(--color-accent);
}

.adv-group-empty {
  border-bottom: none !important;
}

.adv-cell { color: #666; }

.remove-btn {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.remove-btn:hover { color: #e05c5c; background: rgba(224,92,92,0.1); }

/* ── Run row ── */
.run-row {
  display: flex;
  justify-content: flex-end;
}
