:root {
  --bg: #07111f;
  --panel: #0d1b2e;
  --panel-2: #12233a;
  --text: #ecf4ff;
  --muted: #90a4bd;
  --line: rgba(255,255,255,0.09);
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 18px 55px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.18), transparent 35%),
    radial-gradient(circle at top right, rgba(34,197,94,0.12), transparent 30%),
    var(--bg);
}
.app-shell { width: min(1500px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 40px; }
.hero { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: stretch; margin-bottom: 18px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-weight: 800; margin: 0 0 8px; font-size: 12px; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 52px); line-height: 1.02; }
.subtitle { color: var(--muted); max-width: 850px; line-height: 1.6; margin: 14px 0 0; }
.hero-card, .panel, .stat-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  box-shadow: var(--shadow);
  border-radius: 22px;
}
.hero-card { padding: 22px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.hero-card span, .stat-card span { color: var(--muted); font-size: 13px; }
.hero-card strong { font-size: 24px; }
.hero-card small { color: var(--muted); }
.panel { padding: 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.controls-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
label { display: flex; flex-direction: column; gap: 7px; color: #c9d8ea; font-size: 13px; font-weight: 700; }
label small { color: var(--muted); font-weight: 500; }
input, select {
  width: 100%;
  background: rgba(3,8,16,0.72);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  outline: none;
}
input:focus, select:focus { border-color: rgba(56,189,248,0.65); box-shadow: 0 0 0 4px rgba(56,189,248,0.1); }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.btn {
  border: 0;
  border-radius: 15px;
  padding: 12px 18px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, #0284c7, #38bdf8); box-shadow: 0 12px 28px rgba(56,189,248,0.18); }
.btn.success { background: linear-gradient(135deg, #15803d, #22c55e); box-shadow: 0 12px 28px rgba(34,197,94,0.18); }
.btn.ghost { background: rgba(255,255,255,0.07); border: 1px solid var(--line); }
.btn.small { padding: 8px 12px; border-radius: 12px; font-size: 12px; }
.account-line { display: flex; gap: 20px; margin-top: 15px; color: var(--muted); flex-wrap: wrap; }
.account-line strong { color: var(--text); }
.stats-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 18px; min-height: 105px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card strong { font-size: 28px; }
.stat-card.win strong { color: var(--accent-2); }
.stat-card.loss strong { color: var(--danger); }
.explanation h2, .panel h2 { margin: 0 0 14px; }
.logic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.logic-grid > div { background: rgba(255,255,255,0.045); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.logic-grid h3 { margin: 0 0 8px; }
.logic-grid p { margin: 0; color: var(--muted); line-height: 1.55; }
.section-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.section-title h2 { margin: 0; }
.section-title span { color: var(--muted); font-size: 13px; }
.table-wrap { width: 100%; overflow: auto; border-radius: 16px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 980px; background: rgba(3,8,16,0.35); }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #b9c9dd; background: rgba(255,255,255,0.055); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
td { color: #e9f2ff; font-size: 13px; }
tr:hover td { background: rgba(56,189,248,0.045); }
.empty { text-align: center; color: var(--muted); padding: 28px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-weight: 800; font-size: 12px; }
.badge-win { background: rgba(34,197,94,0.14); color: #86efac; }
.badge-loss { background: rgba(239,68,68,0.14); color: #fca5a5; }
.badge-even { background: rgba(56,189,248,0.14); color: #7dd3fc; }
.badge-odd { background: rgba(168,85,247,0.14); color: #d8b4fe; }
.logs { display: grid; gap: 9px; max-height: 230px; overflow: auto; }
.log-item { border: 1px solid var(--line); background: rgba(255,255,255,0.045); border-radius: 14px; padding: 11px 12px; color: #dbeafe; }
.log-item small { color: var(--muted); display: block; margin-top: 4px; }
.log-item.error { border-color: rgba(239,68,68,0.3); }
.log-item.success { border-color: rgba(34,197,94,0.3); }
@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; }
  .controls-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .controls-grid, .logic-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { align-items: flex-start; flex-direction: column; }
}
