﻿/* Arah desain: mengikuti tokogame.ai.id sesuai permintaan pemilik.
   Cyan cerah berpola doodle, kartu putih berbatas hitam tebal + bayangan keras,
   tombol utama gradasi koral ke pink, pilihan aktif mint.
   Judul Playfair Display, isi Quicksand. Dial: ENERGY 3, RHYTHM 2, MOTION 1. */

:root {
  --cyan: #2ad4ee;
  --ink: #111;
  --muted: #27272a;
  --coral: #ff7a59;
  --pink: #ff4f9a;
  --mint: #7ff0c4;
  --sun: #ffe066;
  --card: #fff;
  --bd: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-s: 3px 3px 0 var(--ink);
  --grad: linear-gradient(135deg, var(--coral), var(--pink));
}

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

html { -webkit-text-size-adjust: 100%; }

/* Doodle: candle mini, garis zigzag, plus, lingkaran. Alasan: identitas tokogame + tema trading. */
body {
  margin: 0;
  font: 600 16px/1.55 'Quicksand', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--cyan);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260' fill='none' stroke='white' stroke-opacity='.55' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 40v28M12 48h16v14H12z'/><path d='M60 30v34M52 40h16v16H52z'/><path d='M150 30l10 12 10-12 10 12 10-12'/><circle cx='220' cy='50' r='11'/><path d='M40 130h24M52 118v24'/><path d='M120 120c10-14 20 14 30 0s20 14 30 0'/><circle cx='214' cy='140' r='7'/><path d='M30 210v24M22 218h16v10H22z'/><path d='M96 200l14-14 14 14M110 186v34'/><path d='M170 220h30M185 205v30'/><circle cx='240' cy='215' r='9'/></svg>");
  background-size: 260px 260px;
  min-height: 100vh;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 14px 40px; }
[hidden] { display: none !important; }

h1, h2, .brand, .v-word, .bs-word { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; margin: 0; }
h2 { font-size: 22px; margin-bottom: 10px; }
p { margin: 0 0 10px; }

.top { padding: 14px 0 6px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 0; }
.brand { font-size: 32px; letter-spacing: -.5px; text-shadow: 2px 2px 0 #fff; }

.card {
  background: var(--card);
  border: var(--bd);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 18px;
}

.risk {
  background: var(--sun);
  border: var(--bd);
  border-radius: 12px;
  box-shadow: var(--shadow-s);
  padding: 10px 14px;
  margin: 8px 0 16px;
  font-size: 14px;
}

.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.hint { font-size: 13px; color: var(--muted); font-weight: 600; }
.note { font-size: 14px; color: var(--muted); }
.err { color: #9b0030; font-weight: 700; }
.calc { font-weight: 700; background: #f4f4f5; border: 2px dashed var(--ink); border-radius: 10px; padding: 8px 12px; }
.calc:empty { display: none; }

/* Saldo */
.balances { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.bal { margin: 0; padding: 12px 14px; }
.bal strong { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.bal-total { background: var(--mint); }
.bal-total .lbl { color: var(--ink); }

/* Tombol */
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 18px;
  background: #fff; color: var(--ink);
  border: var(--bd); border-radius: 12px; box-shadow: var(--shadow-s);
  font-weight: 700; text-decoration: none;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-main { background: var(--grad); }
.btn-small { min-height: 44px; padding: 6px 14px; font-size: 14px; }
.btn-danger { background: #ffd3df; }

:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 7px #fff; }

/* Tab */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 18px; }
.tab {
  min-height: 48px; padding: 6px 4px; background: #fff; border: var(--bd); border-radius: 12px;
  box-shadow: var(--shadow-s); font-weight: 700; font-size: 15px;
}
.tab.on { background: var(--mint); }

/* Segmen pilihan */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  min-height: 44px; padding: 6px 14px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; font-weight: 700;
}
.seg button.on { background: var(--mint); box-shadow: var(--shadow-s); }

/* Form */
label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; background: #fff;
  border: 2px solid var(--ink); border-radius: 10px;
}
textarea { resize: vertical; }
.field { margin-bottom: 12px; min-width: 0; }
.field.grow { flex: 1; min-width: 140px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 4px; }

.controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.controls .field { margin: 0; }
.controls select { min-width: 160px; }

.state { font-weight: 700; }
.state.bad { background: #ffd3df; }

/* Verdict */
.verdict-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.verdict { margin: 0 0 18px; padding: 20px; }
.verdict.long { background: var(--mint); }
.verdict.short { background: #ffb3cc; }
.verdict.wait { background: var(--sun); }
.v-word { font-size: clamp(44px, 12vw, 72px); line-height: 1; margin: 4px 0 12px; }
.v-conf { margin: 8px 0; font-size: 18px; }
.v-summary { font-size: 16px; }
.meter { height: 18px; background: #fff; border: var(--bd); border-radius: 10px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--ink); }
.meter-fill.loss { background: var(--pink); }
.meter-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 14px; }
.meter-row .lbl { margin: 0; }

.pricebox { margin: 0 0 18px; }
.price { display: block; font-size: 30px; font-weight: 700; overflow-wrap: anywhere; }
.chip { display: inline-block; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 8px; font-size: 14px; background: #fff; margin-bottom: 10px; }
.chip.up { background: var(--mint); }
.chip.down { background: #ffb3cc; }
.sr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 2px dashed var(--ink); padding-top: 10px; }
.sr-list { list-style: none; padding: 0; margin: 0; font-weight: 700; font-size: 14px; }
.sr-list li { padding: 2px 0; overflow-wrap: anywhere; }

/* Grafik */
#chart { width: 100%; height: auto; aspect-ratio: 900 / 420; display: block; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; }
.sw { display: inline-block; width: 18px; height: 10px; margin-right: 6px; border: 2px solid var(--ink); vertical-align: middle; }
.sw-up { background: var(--mint); }
.sw-down { background: #ff6f9f; }
.sw-e20 { background: var(--coral); }
.sw-e50 { background: #0e7490; }
.sw-e200 { background: var(--ink); }
.sw-res { background: #fff; border-style: dashed; }
.sw-sup { background: var(--sun); border-style: dashed; }

/* Pola dan indikator */
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 10px 0; border-bottom: 2px dashed var(--ink); }
.plain li:last-child { border: 0; }
.tag { display: inline-block; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 8px; font-size: 13px; font-weight: 700; margin-left: 6px; background: #fff; }
.tag.up { background: var(--mint); }
.tag.down { background: #ffb3cc; }
.tag.flat { background: var(--sun); }
.inds { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.inds li { border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; background: #fafafa; }
.ind-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ind-head strong { font-family: 'Playfair Display', serif; font-size: 17px; }
.ind-val { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.inds p { margin: 6px 0 0; font-size: 14px; }

/* Bot */
.botcard { text-align: center; }
.bigswitch {
  width: min(100%, 360px); min-height: 150px; border: var(--bd); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink);
  background: #e4e4e7; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 14px;
  transition: transform .08s, box-shadow .08s, background .15s;
}
.bigswitch:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.bigswitch[aria-checked='true'] { background: var(--mint); }
.bs-word { font-size: 64px; line-height: 1; }
.bs-sub { font-size: 14px; font-weight: 700; }
.breaker { margin: 12px 0 0; padding: 12px; background: #ffd3df; border: var(--bd); border-radius: 12px; text-align: left; }
.breaker .btn { margin-top: 8px; }

.list > p { margin: 0; }
.item { border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; background: #fafafa; }
.item:last-child { margin-bottom: 0; }
.item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.item .instr { white-space: pre-wrap; background: #fff; border: 2px dashed var(--ink); border-radius: 8px; padding: 6px 10px; margin-top: 8px; font-size: 14px; }
.pnl-up { font-weight: 700; color: #00663f; }
.pnl-down { font-weight: 700; color: #9b0030; }

.logs { list-style: none; padding: 0; margin: 0; max-height: 360px; overflow: auto; border: 2px solid var(--ink); border-radius: 10px; }
.logs li { padding: 6px 10px; border-bottom: 1px solid #d4d4d8; font-size: 14px; display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.logs li:last-child { border: 0; }
.logs time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.logs .error { background: #ffd3df; }
.logs .warn { background: var(--sun); }
.logs .order { background: var(--mint); }

.manual { margin-top: 14px; }
.manual summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.steps { padding-left: 22px; margin: 0; }
.steps li { margin-bottom: 8px; }

.foot { text-align: center; font-size: 13px; padding: 10px 14px; margin: 0; }

/* Dialog */
.dlg { border: var(--bd); border-radius: 16px; box-shadow: 8px 8px 0 var(--ink); padding: 20px; width: min(92vw, 440px); background: #fff; color: var(--ink); }
.dlg::backdrop { background: rgba(17, 17, 17, .55); }
.dlg .row { justify-content: flex-end; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  max-width: min(92vw, 520px); padding: 12px 18px; background: var(--ink); color: #fff;
  border: 3px solid #fff; border-radius: 12px; font-weight: 700; z-index: 20;
}
.toast.bad { background: #9b0030; }

/* Masuk */
.login { min-height: 100vh; display: grid; place-items: center; padding: 14px; }
.login-card { width: min(100%, 420px); }
.login-card .btn { width: 100%; margin-top: 8px; }

@media (max-width: 720px) {
  .verdict-row { grid-template-columns: 1fr; }
  .balances { grid-template-columns: 1fr 1fr; }
  .bal-total { grid-column: 1 / -1; }
  .brand { font-size: 26px; }
  .tab { font-size: 14px; }
  .meter-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

