/* ── Aviator Simulator Plugin Styles ── */
.avsim-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #0b0b0b;
  max-width: 860px;
  margin: 0 auto;
  box-sizing: border-box;
}
.avsim-wrap *, .avsim-wrap *::before, .avsim-wrap *::after { box-sizing: border-box; }

/* Tabs */
.avsim-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e1e0d9;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.avsim-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #898781;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.avsim-tab:hover { color: #0b0b0b; }
.avsim-tab.active { color: #0b0b0b; border-bottom-color: #0b0b0b; }

/* Panels */
.avsim-panel { display: none; }
.avsim-panel.active { display: block; }

/* Cards */
.avsim-card {
  background: #fff;
  border: 0.5px solid #e1e0d9;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 12px;
}
.avsim-card-title {
  font-size: 13px;
  font-weight: 500;
  color: #52514e;
  margin: 0 0 10px;
}

/* Metric bar */
.avsim-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.avsim-metric {
  background: #f9f9f8;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}
.avsim-metric-label {
  display: block;
  font-size: 11px;
  color: #898781;
  margin-bottom: 4px;
}
.avsim-metric-value {
  display: block;
  font-size: 20px;
  font-weight: 500;
  color: #0b0b0b;
}

/* Game grid */
.avsim-game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 600px) { .avsim-game-grid { grid-template-columns: 1fr; } }

/* Multiplier display */
.avsim-multiplier {
  font-size: 52px;
  font-weight: 500;
  text-align: center;
  padding: 1rem 0;
  letter-spacing: -1px;
  color: #898781;
  transition: color .2s;
}
.avsim-round-result { font-size: 13px; text-align: center; color: #52514e; min-height: 20px; }
.avsim-seed-display { font-family: monospace; font-size: 10px; color: #898781; text-align: center; word-break: break-all; margin-top: 6px; }
.avsim-center { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* History rows */
.avsim-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 0.5px solid #f0efec;
  font-size: 12px;
}
.avsim-history-row:last-child { border-bottom: none; }
.avsim-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.avsim-tag.win { background: #dcf5dc; color: #0a6b0a; }
.avsim-tag.loss { background: #fce8e8; color: #a32d2d; }

/* Controls */
.avsim-label { display: block; font-size: 12px; color: #52514e; margin: 10px 0 4px; }
.avsim-range { width: 100%; margin: 2px 0 4px; }
.avsim-input {
  width: 100%;
  padding: 7px 10px;
  border: 0.5px solid #c3c2b7;
  border-radius: 8px;
  font-size: 13px;
  color: #0b0b0b;
  background: #fff;
}
.avsim-input:focus { outline: none; border-color: #2a78d6; box-shadow: 0 0 0 3px rgba(42,120,214,.15); }

/* Strategy tabs */
.avsim-strategy-tabs { display: flex; gap: 4px; margin: 4px 0 10px; flex-wrap: wrap; }
.avsim-strat {
  padding: 5px 12px;
  border: 0.5px solid #c3c2b7;
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  color: #52514e;
  transition: background .12s;
}
.avsim-strat:hover { background: #f0efec; }
.avsim-strat.active { background: #0b0b0b; color: #fff; border-color: #0b0b0b; }

/* Buttons */
.avsim-btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.avsim-btn {
  padding: 7px 14px;
  border: 0.5px solid #c3c2b7;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #0b0b0b;
  transition: background .12s;
}
.avsim-btn:hover { background: #f0efec; }
.avsim-btn.primary { background: #0b0b0b; color: #fff; border-color: #0b0b0b; }
.avsim-btn.primary:hover { background: #333; }
.avsim-btn.danger { border-color: #d03b3b; color: #d03b3b; }
.avsim-btn.danger:hover { background: rgba(208,59,59,.08); }

/* Charts */
.avsim-chart-wrap { position: relative; width: 100%; height: 180px; }
.avsim-chart-sm { height: 140px; }
.avsim-chart-lg { height: 260px; }

/* Legend */
.avsim-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.avsim-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #52514e; }
.avsim-legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* Experiment grid */
.avsim-exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

/* Analysis grid */
.avsim-analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.avsim-analysis-item { background: #f9f9f8; border-radius: 8px; padding: 10px 12px; }
.avsim-analysis-item .avsim-label { margin-top: 0; }
.avsim-analysis-item .avsim-val { font-size: 16px; font-weight: 500; color: #0b0b0b; }

/* Verify steps */
.avsim-verify-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 0.5px solid #f0efec;
}
.avsim-verify-step:last-child { border-bottom: none; }
.avsim-step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #f0efec;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; color: #52514e;
  flex-shrink: 0;
}
.avsim-step-title { font-size: 13px; font-weight: 500; margin: 0 0 4px; }
.avsim-mono {
  font-family: monospace;
  font-size: 11px;
  background: #f9f9f8;
  padding: 6px 10px;
  border-radius: 6px;
  word-break: break-all;
  color: #52514e;
  line-height: 1.6;
  margin: 0;
}
.avsim-mono.avsim-highlight { background: #e6f1fb; color: #185fa5; }
.avsim-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Info / warning boxes */
.avsim-info-box {
  background: #e6f1fb;
  border: 0.5px solid #b5d4f4;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #185fa5;
  line-height: 1.7;
  margin-bottom: 12px;
}
.avsim-warning-box {
  background: #faeeda;
  border: 0.5px solid #fac775;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #633806;
  line-height: 1.7;
  margin-bottom: 12px;
}

/* Illusion */
.avsim-illusion-steps { display: flex; flex-direction: column; gap: 8px; }
.avsim-illusion-step { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #52514e; }
.avsim-illusion-step p { margin: 3px 0 0; line-height: 1.5; }
.avsim-illusion-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 600px) { .avsim-illusion-grid { grid-template-columns: 1fr; } }

/* Export bar */
.avsim-export-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 0.5px solid #e1e0d9;
}

/* Utilities */
.avsim-muted { color: #898781; margin: 0; }
.avsim-green { color: #0ca30c; }
.avsim-red { color: #d03b3b; }
