/* Togel Payout Front End — tema gelap + emas ala screenshot referensi */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #f0b12a;
  --gold-dim: #c9971f;
  --bg: #000;
  --panel: #101010;
  --row: #1b1b1d;
  --row-alt: #161618;
  --line: #2e2e2e;
  --text: #f2f2f2;
  --muted: #b9b9b9;
  --red: #cf1f2e;
  --blue: #1a3fd6;
  --orange: #b34700;
  --yellow: #f3d515;
  --accent: var(--red);
}
body[data-mode="NO_DISKON"] { --accent: var(--red); --accent-text: #fff; }
body[data-mode="DISKON"]    { --accent: var(--blue); --accent-text: #fff; }
body[data-mode="BB"]        { --accent: var(--orange); --accent-text: #fff; }
body[data-mode="BB_DISKON"] { --accent: var(--yellow); --accent-text: #111; }

html, body { background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; font-size: 15px; }
body { padding-bottom: 60px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 12px 16px; }
body.wap .wrap { max-width: 480px; }

/* Header */
.site-head { text-align: center; padding: 18px 8px 10px; background: radial-gradient(1200px 240px at 50% -60px, #221a08, #000); }
.site-head h1 { color: var(--gold); font-size: 22px; letter-spacing: 1px; text-transform: uppercase; }
.site-head .test-note { color: #777; font-size: 11px; margin-top: 4px; }
.wap-btn { margin-top: 10px; background: var(--gold); color: #4a2f00; border: none; border-radius: 8px;
  padding: 8px 20px; font-size: 14px; cursor: pointer; font-weight: bold; }
.wap-btn:hover { background: #ffc93e; }

/* Pasaran + info box */
select, input[type="text"] { font: inherit; }
.pasaran-select { background: #181818; color: #fff; border: 1px solid #555; border-radius: 6px;
  padding: 10px 12px; min-width: 260px; font-size: 15px; }
.info-box { border: 2px dashed var(--gold); border-radius: 4px; padding: 10px 14px; margin: 14px 0;
  display: inline-block; min-width: 300px; }
.info-box .date { color: #ddd; font-size: 13px; margin-bottom: 4px; }
.info-box .title { color: #fff; font-size: 15px; }

/* Mode buttons */
.mode-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.mode-btn { background: #000; color: #fff; border: 2px solid #555; border-radius: 4px;
  padding: 8px 16px; font-weight: bold; font-size: 13px; cursor: pointer; }
.mode-btn[data-mode="NO_DISKON"] { border-color: var(--red); }
.mode-btn[data-mode="DISKON"]    { border-color: var(--blue); }
.mode-btn[data-mode="BB"]        { border-color: var(--orange); }
.mode-btn[data-mode="BB_DISKON"] { border-color: var(--yellow); }
.mode-btn.active[data-mode="NO_DISKON"] { background: var(--red); }
.mode-btn.active[data-mode="DISKON"]    { background: var(--blue); }
.mode-btn.active[data-mode="BB"]        { background: var(--orange); }
.mode-btn.active[data-mode="BB_DISKON"] { background: var(--yellow); color: #111; }

/* Jenis game chips */
.section-label { color: #eee; font-size: 14px; margin: 12px 0 8px; }
.section-divider { margin: 26px 0 8px; padding: 10px 12px; border-top: 1px solid #333;
  color: #9aa; font-size: 13px; }
.section-divider code { color: var(--gold); }
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { background: #000; color: #fff; border: 1px solid #ddd; border-radius: 999px;
  padding: 8px 18px; font-size: 13px; font-weight: bold; cursor: pointer; white-space: nowrap; }
.chip.active { background: #2c2c2e; border-color: #2c2c2e; }
.chip:hover:not(.active) { border-color: var(--gold); }

/* Tabs */
.tab-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 0; }
.tab-btn { background: #000; color: #fff; border: 1px solid #ddd; border-radius: 3px;
  padding: 9px 16px; font-size: 13px; font-weight: bold; cursor: pointer; }
.tab-btn.active { background: #2c2c2e; border-color: #2c2c2e; }

/* Bet table */
.bet-panel { margin-top: 10px; }
table.bet { width: 100%; border-collapse: collapse; }
table.bet thead th { background: var(--accent); color: var(--accent-text, #fff); text-align: left;
  padding: 12px 10px; font-size: 14px; font-weight: bold; }
table.bet td { padding: 9px 10px; border-bottom: 1px solid #000; font-size: 14px; }
table.bet tbody tr:nth-child(odd)  { background: var(--row); }
table.bet tbody tr:nth-child(even) { background: var(--row-alt); }
table.bet .no-col { width: 56px; }

.digit-box { width: 34px; height: 30px; text-align: center; border: none; border-radius: 4px;
  margin-right: 6px; font-size: 15px; background: #fff; color: #111; }
.nominal-input, .free-input { width: 210px; height: 30px; border: none; border-radius: 3px;
  padding: 0 8px; background: #fff; color: #111; font-size: 14px; }
.free-input { width: 190px; }
#betPanel input.invalid { outline: 2px solid var(--red); }
.sel-input { height: 30px; border-radius: 3px; border: 1px solid #888; background: #fff; color: #111;
  padding: 0 6px; min-width: 110px; font-size: 14px; }
.lines-note { color: var(--gold); font-size: 11px; margin-left: 6px; }

.total-row td { background: #141414; font-weight: bold; padding: 14px 10px; }

/* Submit */
.submit-wrap { text-align: center; margin: 22px 0; }
.submit-btn { background: #f8c02c; color: #3a2800; border: none; border-radius: 999px;
  padding: 13px 44px; font-size: 14px; font-weight: bold; letter-spacing: 1px; cursor: pointer; }
.submit-btn:hover { background: #ffd35a; }

/* Payout reference table */
table.ref { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.ref th { background: #4a4a4c; color: #fff; text-align: left; padding: 12px 10px; font-size: 14px; }
table.ref td { padding: 11px 10px; font-size: 14px; border-bottom: 1px solid #000; }
table.ref tbody tr:nth-child(odd)  { background: #1a1a1c; }
table.ref tbody tr:nth-child(even) { background: #151517; }

/* Kotak section (BBFS / Pola / Fast2D) */
.box { border: 1px solid var(--gold); border-radius: 8px; padding: 12px 16px 16px; margin: 14px 0; }
.box h3 { color: var(--gold); font-size: 15px; font-weight: normal; margin-bottom: 10px; }
.box .grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.box label { display: block; color: #eee; font-size: 13px; margin-bottom: 6px; }
.box input { width: 100%; height: 30px; border: none; border-radius: 3px; padding: 0 8px;
  background: #fff; color: #111; font-size: 14px; }
.box input[disabled], .box input[readonly] { background: #d6d6d6; color: #333; }
/* BBFS/FAST2D: kotak output tetap PUTIH (bukan abu-abu POLA) */
.box input.out-white[readonly] { background: #fff; color: #111; }
.box.total { background: #2a2a2c; border: none; }
body.wap .box .grid5 { grid-template-columns: 1fr 1fr; }

.gen-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 12px 0; }
.gen-row .field label { display: block; color: #eee; font-size: 13px; margin-bottom: 6px; }
.gen-row input { height: 30px; border: none; border-radius: 3px; padding: 0 8px; background: #fff; color: #111; }
.gen-btn { background: #c47a12; color: #fff; border: none; border-radius: 999px; padding: 9px 22px;
  font-size: 14px; cursor: pointer; font-weight: bold; }
.gen-btn:hover { background: #dd8d1c; }
.check-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0 4px; color: #fff; font-size: 14px; }
.check-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: #1a56db; }

/* FAST 2D grid */
.f2d-grid { border-collapse: collapse; margin: 10px 0; }
.f2d-grid td, .f2d-grid th { border: 1px solid var(--gold); width: 42px; height: 38px;
  text-align: center; font-size: 14px; color: #fff; }
.f2d-grid .cb-cell { border-color: transparent; }
.f2d-grid td.num { cursor: pointer; user-select: none; }
.f2d-grid td.num.sel { background: var(--gold); color: #201400; font-weight: bold; }
.f2d-grid input { width: 15px; height: 15px; accent-color: #1a56db; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: none;
  align-items: center; justify-content: center; z-index: 50; }
.modal-overlay.show { display: flex; }
.modal { background: #17171a; border: 1px solid var(--gold); border-radius: 10px;
  max-width: 680px; width: 92%; max-height: 80vh; overflow: auto; padding: 20px; }
.modal h3 { color: var(--gold); margin-bottom: 12px; }
.modal table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal th { text-align: left; color: #bbb; padding: 6px; border-bottom: 1px solid #333; }
.modal td { padding: 6px; border-bottom: 1px solid #242428; }
.modal .m-total { margin-top: 12px; font-size: 15px; font-weight: bold; color: var(--gold); }
.modal .m-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: flex-end; }
.modal button { border: none; border-radius: 6px; padding: 9px 18px; cursor: pointer; font-weight: bold; }
.modal .save { background: var(--gold); color: #3a2800; }
.modal .close { background: #333; color: #fff; }
.modal .warn { color: #ff9d9d; font-size: 12px; margin-top: 8px; }

/* Panel bawah: config & riwayat */
details.tool { margin: 18px 0; border: 1px solid #333; border-radius: 8px; background: #0d0d0f; }
details.tool summary { cursor: pointer; padding: 12px 14px; color: var(--gold); font-size: 14px; }
details.tool .tool-body { padding: 0 14px 14px; }
details.tool textarea { width: 100%; min-height: 260px; background: #101014; color: #cde;
  border: 1px solid #333; border-radius: 6px; font-family: Consolas, monospace; font-size: 12px; padding: 10px; }
details.tool .tool-actions { display: flex; gap: 8px; margin-top: 10px; }
details.tool .tool-actions button { border: none; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-weight: bold; }
.cfg-apply { background: var(--gold); color: #3a2800; }
.cfg-reset, .hist-clear { background: #333; color: #fff; }
.cfg-msg { color: #8f8; font-size: 12px; margin-left: 8px; align-self: center; }
.cfg-msg.err { color: #f88; }
/* Kalkulator hadiah + tes bot */
.calc-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.calc-row .field label { display: block; color: #eee; font-size: 13px; margin-bottom: 6px; }
.calc-row select.sel-input { min-width: 240px; }
.calc-out { margin-top: 12px; font-size: 14px; color: #eee; }
.calc-out .muted, .muted { color: #999; font-size: 12px; }
table.kv td { padding: 5px 14px 5px 0; border-bottom: 1px solid #242428; }
table.kv td:first-child { color: #aaa; }
pre.fact { white-space: pre-wrap; word-break: break-word; background: #101014; border: 1px solid #333;
  border-radius: 6px; padding: 10px; font-size: 12px; color: #cde; margin-top: 8px; font-family: Consolas, monospace; }
details.tool textarea.small { min-height: 56px; }

/* ── Editor form payout (back-office) ── */
.pe-root { color: #eee; font-size: 13px; }
.pe-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid #2a2a2e; margin-bottom: 12px; }
.pe-bar select { background: #181818; color: #fff; border: 1px solid #555; border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.pe-bar label { color: #ddd; }
.pe-del { padding: 5px 12px; font-size: 12px; }
.pe-bm { display: flex; align-items: center; gap: 8px; margin: 6px 0 16px; color: #eee; }
.pe-bm input { width: 16px; height: 16px; accent-color: var(--gold); }
.pe-block { border: 1px solid #2e2e2e; border-radius: 10px; padding: 14px 16px; margin: 14px 0; background: #0e0e10; }
.pe-block > h3 { color: var(--gold); font-size: 15px; margin-bottom: 4px; }
.pe-hint { color: #8b8b93; font-size: 11px; margin: 4px 0 10px; line-height: 1.4; }
.pe-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pe-mode h5 { color: #ddd; font-size: 13px; margin-bottom: 6px; }
.pe-tbl { width: 100%; border-collapse: collapse; }
.pe-tbl th { text-align: left; color: #9a9aa2; font-weight: normal; font-size: 11px; padding: 4px 6px; border-bottom: 1px solid #2a2a2e; }
.pe-tbl td { padding: 4px 6px; border-bottom: 1px solid #1c1c20; color: #ccc; }
.pe-tbl td:first-child { white-space: nowrap; }
.pe-sec { border-top: 1px solid #232327; padding-top: 12px; margin-top: 12px; }
.pe-sec h4 { color: #e6e6ea; font-size: 13px; margin-bottom: 2px; }
.pe-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 12px; margin-top: 8px; }
.pe-field label { display: block; color: #9a9aa2; font-size: 11px; margin-bottom: 3px; }
.pe-num { display: inline-flex; align-items: center; gap: 3px; width: 100%; }
.pe-num input { width: 100%; background: #17171b; color: #fff; border: 1px solid #333; border-radius: 5px; padding: 5px 7px; font-size: 13px; }
.pe-num input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.pe-suf { color: #7a7a82; font-size: 12px; }
.pe-ok { border: 1px solid #232327; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.pe-ok-t { color: #cfcfd6; font-size: 12px; margin-bottom: 4px; }
.pe-ok .pe-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .pe-modes { grid-template-columns: 1fr; } .pe-grid { grid-template-columns: 1fr 1fr; } }

.hist-item { border-bottom: 1px solid #242428; padding: 8px 2px; font-size: 13px; color: #ddd; }
.hist-item .h-head { color: var(--gold); }
.hist-empty { color: #777; font-size: 13px; padding: 6px 2px; }

@media (max-width: 760px) {
  .nominal-input { width: 130px; }
  .digit-box { width: 28px; margin-right: 4px; }
  .box .grid5 { grid-template-columns: 1fr 1fr; }
  .f2d-grid td, .f2d-grid th { width: 30px; height: 30px; font-size: 12px; }
}
