/* DIME landing v2 — bagian "reserve": sirkuit fee → cadangan bonus → top-up, cincin HUD, kalkulator.
   Semua selektor di bawah #reserve supaya tidak bentrok dengan modul lain. */

#reserve { --ring: clamp(300px, 28vw, 380px); --nw: 152px; overflow: hidden; }

/* ---------- Kepala ---------- */
#reserve .rs-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; }
#reserve .rs-head .sub { margin: 0; max-width: 470px; justify-self: end; }
@media (max-width: 900px) { #reserve .rs-head { grid-template-columns: 1fr; gap: 0; } #reserve .rs-head .sub { margin-top: 22px; justify-self: start; } }

/* ---------- Sirkuit (desktop: horizontal) ---------- */
#reserve .rs-circuit {
  position: relative; margin-top: 76px; padding: 34px 0 26px;
  display: grid; align-items: center; justify-items: center;
  grid-template-columns: auto minmax(26px, 1fr) auto minmax(26px, 1fr) auto minmax(26px, 1fr) var(--ring) minmax(26px, 1fr) auto;
  grid-template-rows: calc(var(--ring) / 2) calc(var(--ring) / 2);
  grid-template-areas:
    "pons . fee . split . ring . top"
    "pons . fee . team  . ring . top";
}
/* garis ukur tipis di belakang sirkuit, seperti kertas skema */
#reserve .rs-circuit::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 48px) 0 0 / 100% 7px no-repeat,
              repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 48px) 0 100% / 100% 7px no-repeat; }
#reserve .rs-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }

#reserve [data-n="pons"] { grid-area: pons; }
#reserve [data-n="fee"] { grid-area: fee; }
#reserve [data-n="split"] { grid-area: split; align-self: end; transform: translateY(50%); }
#reserve [data-n="team"] { grid-area: team; align-self: end; margin-bottom: 4px; }
#reserve [data-n="ring"] { grid-area: ring; }
#reserve [data-n="top"] { grid-area: top; }

/* ---------- Node (pelat kecil) ---------- */
#reserve .rs-node { --chamfer: 9px; position: relative; z-index: 2; width: var(--nw); padding: 13px 14px 14px;
  display: flex; flex-direction: column; gap: 7px; outline: none; cursor: default;
  transition: border-color .35s var(--ease), opacity .35s var(--ease); }
#reserve .rs-node:hover, #reserve .rs-node:focus-visible, #reserve .rs-node.hot { border-color: rgba(255,255,255,.3); }
#reserve .rs-node::before { width: 46%; }
#reserve .n-k { font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
#reserve .n-t { font: 500 13.5px/1.3 var(--sans); color: var(--text); letter-spacing: -0.01em; }
#reserve .n-t b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--white); }
#reserve .n-v { font: 400 11.5px/1.2 var(--mono); color: var(--steel); font-variant-numeric: tabular-nums; }
#reserve .n-v a { color: var(--steel-2); border-bottom: 1px solid var(--hair-2); pointer-events: auto; }
#reserve .n-v a:hover { color: var(--white); border-color: var(--white); }
#reserve .n-v i { font-style: normal; font-size: 8px; color: var(--steel-2); margin-right: 2px; }
#reserve .n-v i.s { margin-left: 8px; color: var(--dim); }

/* pita detak beli/jual (hiasan, tanpa angka) */
#reserve .n-tape { display: block; height: 22px; overflow: hidden; margin-top: 2px; }
#reserve .n-tape svg { width: 100%; height: 22px; display: block; }
#reserve .n-tape line { stroke: rgba(255,255,255,.14); stroke-width: 1; vector-effect: non-scaling-stroke; }
#reserve .n-tape .tp { animation: rs-tape 14s linear infinite; animation-play-state: paused; }
#reserve .n-tape .tp rect.u { fill: rgba(255,255,255,.78); }
#reserve .n-tape .tp rect.d { fill: rgba(255,255,255,.3); }
#reserve.rs-on .n-tape .tp { animation-play-state: running; }
@keyframes rs-tape { to { transform: translateX(-120px); } }

/* pembagi 90/10 */
#reserve .rs-split { width: 96px; align-items: center; text-align: center; padding: 12px 10px 13px; }
#reserve .n-big { font: 300 24px/1 var(--sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--white); display: inline-flex; align-items: baseline; gap: 5px; }
#reserve .n-big b { font-weight: 300; }
#reserve .n-big b + i + b { font-weight: 500; }
#reserve .n-big i { font-style: normal; color: var(--dim); font-size: 18px; }
#reserve .rs-team { opacity: .62; }
#reserve .rs-team:hover, #reserve .rs-team.hot, #reserve .rs-team:focus-visible { opacity: 1; }

/* ---------- Kabel ---------- */
#reserve .wire { fill: none; stroke: rgba(255,255,255,.26); stroke-width: 1; stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len);
  transition: stroke .35s var(--ease); }
#reserve .wire.dim { stroke: rgba(255,255,255,.13); }
#reserve .wire.bright { stroke: rgba(255,255,255,.42); }
#reserve .wire.hot { stroke: rgba(255,255,255,.95); filter: drop-shadow(0 0 3px rgba(230,238,255,.8)); }
#reserve .rs-circuit.drawn .wire { stroke-dashoffset: 0; transition: stroke-dashoffset 1.15s var(--ease-io) var(--wd, 0s), stroke .35s var(--ease); }
#reserve .w-end { fill: var(--ink); stroke: rgba(255,255,255,.5); stroke-width: 1; opacity: 0; transition: opacity .5s var(--ease) calc(var(--wd, 0s) + .9s); }
#reserve .rs-circuit.drawn .w-end { opacity: 1; }
#reserve .w-lab { font: 500 9.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; fill: var(--dim); opacity: 0; transition: opacity .6s var(--ease) calc(var(--wd, 0s) + .7s), fill .35s; }
#reserve .w-lab.b { fill: var(--steel-2); }
#reserve .w-lab.hot { fill: var(--white); }
#reserve .rs-circuit.drawn .w-lab { opacity: 1; }
#reserve .pulse { fill: #fff; filter: drop-shadow(0 0 3px rgba(235,242,255,.95)); }
#reserve .pulse.dim { fill: rgba(255,255,255,.45); filter: none; }

/* ---------- Cincin cadangan ---------- */
#reserve .rs-ring { position: relative; width: var(--ring); aspect-ratio: 1; z-index: 2; outline: none; }
#reserve .rs-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#reserve .d-face { fill: url(#rs-face); }
#reserve .d-hair { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 1; }
#reserve .d-hair.b { stroke: rgba(255,255,255,.22); }
#reserve .d-tick { stroke: rgba(255,255,255,.34); stroke-width: 1; }
#reserve .d-tick.m { stroke: rgba(255,255,255,.7); }
#reserve .d-ticks { transform-box: view-box; transform-origin: 220px 220px; animation: rs-spin 180s linear infinite; animation-play-state: paused; }
#reserve .d-dots { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 1; stroke-dasharray: 1 6; transform-box: view-box; transform-origin: 220px 220px; animation: rs-spin 260s linear infinite reverse; animation-play-state: paused; }
#reserve.rs-on .d-ticks, #reserve.rs-on .d-dots { animation-play-state: running; }
@keyframes rs-spin { to { transform: rotate(360deg); } }
#reserve .seg { fill: none; stroke: rgba(255,255,255,.09); stroke-width: 9; transition: stroke .5s var(--ease); }
#reserve .seg.f { transition-delay: calc(var(--i) * 26ms); }
#reserve .rs-ring.go .seg.f { stroke: #fff; filter: drop-shadow(0 0 4px rgba(225,235,255,.65)); }
#reserve .rs-ring.go .seg.p { stroke: rgba(255,255,255, calc(.09 + .75 * var(--k))); }
#reserve .d-lab { font: 500 9.5px var(--mono); letter-spacing: .12em; fill: var(--dim); }
#reserve .d-needle { transform-box: view-box; transform-origin: 220px 220px; transform: rotate(0deg); transition: transform 1.6s var(--ease-io); }
#reserve .d-needle line { stroke: #fff; stroke-width: 1.2; filter: drop-shadow(0 0 3px rgba(235,242,255,.95)); }
#reserve .d-needle path { fill: #fff; }
#reserve .rs-ring.go .d-needle { transform: rotate(var(--a, 0deg)); }
#reserve .d-hot { fill: none; stroke: rgba(255,255,255,0); stroke-width: 1; transition: stroke .35s var(--ease); }
#reserve .rs-ring.hot .d-hot, #reserve .rs-ring:hover .d-hot, #reserve .rs-ring:focus-visible .d-hot { stroke: rgba(255,255,255,.55); }

#reserve .rs-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; pointer-events: none; }
#reserve .rs-ring-c .big-num { font-size: calc(var(--ring) * .145); letter-spacing: -0.045em; }
#reserve .rs-of { font: 400 12.5px/1.45 var(--sans); color: var(--muted); max-width: calc(var(--ring) * .5); }
#reserve .rs-of b { color: var(--text); font-weight: 500; font-family: var(--mono); font-size: 12px; }

/* ---------- Baris jejak (penjelasan saat hover) ---------- */
#reserve .rs-trace { display: flex; align-items: baseline; gap: 18px; padding: 16px 0 0; min-height: 52px; }
#reserve .rs-trace .label { flex: none; color: var(--steel-2); }
#reserve .t-line { font-size: 14.5px; color: var(--muted); transition: opacity .25s var(--ease); }
#reserve .t-line.sw { opacity: 0; }

/* ---------- Kalkulator ---------- */
#reserve .rs-calc { --chamfer: 18px; margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
#reserve .c-in { padding: 34px 40px 36px; border-right: 1px solid var(--hair); display: flex; flex-direction: column; gap: 30px; }
#reserve .c-out { padding: 34px 40px 32px; display: flex; flex-direction: column; }
#reserve .c-amt-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
#reserve .c-amt { font: 300 clamp(40px, 4.4vw, 56px)/1 var(--sans); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; color: var(--white); }

/* penggeser presisi: rel 1px, pegangan bergaris seperti vernier */
#reserve .c-slider { position: relative; padding-bottom: 6px; }
#reserve .c-slider input { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 0; background: transparent; cursor: ew-resize; touch-action: pan-y; display: block; }
#reserve .c-slider input:focus { outline: none; }
#reserve .c-slider input::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(90deg, #fff 0 var(--p, 0%), rgba(255,255,255,.18) var(--p, 0%)); }
#reserve .c-slider input::-moz-range-track { height: 1px; background: rgba(255,255,255,.18); }
#reserve .c-slider input::-moz-range-progress { height: 1px; background: #fff; }
#reserve .c-slider input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 24px; margin-top: -11.5px; border-radius: 2px;
  border: 1px solid rgba(255,255,255,.9); background: linear-gradient(90deg, transparent 0 6px, #fff 6px 7px, transparent 7px) , #0b0c0e;
  box-shadow: 0 0 10px rgba(225,235,255,.35); transition: box-shadow .2s, transform .2s var(--ease); }
#reserve .c-slider input::-moz-range-thumb { width: 12px; height: 22px; border-radius: 2px; border: 1px solid rgba(255,255,255,.9);
  background: linear-gradient(90deg, transparent 0 5px, #fff 5px 6px, transparent 6px), #0b0c0e; box-shadow: 0 0 10px rgba(225,235,255,.35); }
#reserve .c-slider input:active::-webkit-slider-thumb, #reserve .c-slider input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(255,255,255,.08), 0 0 16px rgba(225,235,255,.6); }
#reserve .c-ruler { position: relative; height: 26px; margin: 0 7px; }
#reserve .c-ruler i { position: absolute; top: 0; width: 1px; height: 5px; background: rgba(255,255,255,.2); transform: translateX(-.5px); }
#reserve .c-ruler i.m { height: 9px; background: rgba(255,255,255,.42); }
#reserve .c-ruler i.on { background: rgba(255,255,255,.75); }
#reserve .c-ruler span { position: absolute; top: 14px; transform: translateX(-50%); font: 400 10.5px/1 var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
#reserve .c-ruler span:first-of-type { transform: none; }
#reserve .c-ruler span:last-of-type { transform: translateX(-100%); }

#reserve .c-tiers { display: flex; flex-direction: column; gap: 14px; }
#reserve .c-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#reserve .c-chips button { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--hair-2); background: rgba(255,255,255,.015);
  border-radius: 999px; font: 500 13px/1 var(--sans); color: var(--muted); cursor: pointer; transition: border-color .2s, color .2s, background .2s, box-shadow .2s; }
#reserve .c-chips button em { font: 400 11.5px/1 var(--mono); font-style: normal; color: var(--dim); }
#reserve .c-chips button:hover { border-color: rgba(255,255,255,.3); color: var(--text); }
#reserve .c-chips button[aria-checked="true"] { border-color: rgba(255,255,255,.85); color: var(--white); background: rgba(255,255,255,.06); box-shadow: 0 0 14px rgba(225,235,255,.14); }
#reserve .c-chips button[aria-checked="true"] em { color: var(--steel-2); }
#reserve .c-note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--dim); max-width: 460px; }

/* meter "reserve draw": batang bersegmen, gema cincin HUD */
#reserve .c-draw { margin-top: auto; padding-top: 22px; border-top: 1px solid var(--hair); display: flex; flex-direction: column; gap: 12px; }
#reserve .c-draw-h { display: flex; justify-content: space-between; align-items: baseline; }
#reserve .c-draw-v { font: 400 13px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
#reserve .c-draw-bar { position: relative; height: 7px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.1) 0 5px, transparent 5px 8px); }
#reserve .c-draw-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; min-width: 0; background: repeating-linear-gradient(90deg, #fff 0 5px, transparent 5px 8px);
  filter: drop-shadow(0 0 3px rgba(225,235,255,.6)); transition: width .5s var(--ease); }
#reserve .c-rows { margin: 0; display: flex; flex-direction: column; }
#reserve .c-rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
#reserve .c-rows > div:first-child { padding-top: 0; }
#reserve .c-rows dt { font-size: 14px; color: var(--muted); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#reserve .c-rows dt span { font: 400 12px/1 var(--mono); color: var(--steel-2); }
#reserve .c-rows dt em { font: 400 11px/1 var(--mono); font-style: normal; color: var(--dim); letter-spacing: .02em; }
#reserve .c-rows dd { margin: 0; font: 400 14px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
#reserve .c-bonus dd { color: var(--white); }
#reserve .c-credit { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 16px; padding: 22px 0 18px; border-bottom: 1px solid var(--hair-2); }
#reserve .c-credit .label { grid-column: 1 / -1; color: var(--steel-2); }
#reserve .c-credit .big-num { font-size: clamp(46px, 5vw, 68px); grid-column: 1; }
#reserve .c-exact { grid-column: 2; font: 400 11.5px/1.4 var(--mono); color: var(--dim); text-align: right; padding-bottom: 6px; font-variant-numeric: tabular-nums; }
#reserve .c-src { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; font: 400 11.5px/1.3 var(--mono); color: var(--dim); }
#reserve .c-src i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); flex: none; }
#reserve .c-src.ok i { background: #fff; border-color: #fff; box-shadow: 0 0 6px rgba(255,255,255,.8); }
#reserve .c-src.busy i { animation: pulse 1s ease-in-out infinite; }
#reserve .c-warn { margin: 16px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }

/* ---------- Pembacaan instrumen ---------- */
#reserve .rs-read { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--hair-2); }
#reserve .rs-read .r { position: relative; padding: 24px 28px 4px; display: flex; flex-direction: column; gap: 12px; }
#reserve .rs-read .r:first-child { padding-left: 0; }
#reserve .rs-read .r + .r { border-left: 1px solid var(--hair); }
#reserve .rs-read .r::before { content: ''; position: absolute; top: -1px; left: 0; width: 28px; height: 1px; background: #fff; box-shadow: var(--edge-glow); }
#reserve .rs-read .r + .r::before { left: 28px; }
#reserve .rs-read b { font: 300 clamp(30px, 3vw, 42px)/1 var(--sans); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--white); }
#reserve .rs-read a { font: 400 12px/1.3 var(--mono); color: var(--dim); align-self: flex-start; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
#reserve .rs-read a:hover { color: var(--text); border-color: var(--hair-2); }
#reserve .rs-team-line { margin: 34px 0 0; font-size: 13px; color: var(--dim); }
#reserve .rs-team-line b { color: var(--steel-2); font-weight: 500; }

/* ---------- Tablet & HP: sirkuit vertikal ---------- */
@media (max-width: 1100px) {
  #reserve { --ring: clamp(260px, 64vw, 340px); --nw: 210px; }
  #reserve .rs-circuit { max-width: 560px; margin-left: auto; margin-right: auto; padding: 28px 0;
    grid-template-columns: 1fr 1fr; grid-template-rows: auto; row-gap: 46px;
    grid-template-areas: "pons pons" "fee fee" "split team" "ring ring" "top top"; }
  #reserve .rs-circuit::before { border: 0; }
  #reserve [data-n="split"], #reserve [data-n="team"] { align-self: center; transform: none; margin: 0; }
  #reserve .rs-team { width: 150px; }
}
@media (max-width: 760px) {
  #reserve .rs-circuit { margin-top: 52px; row-gap: 40px; }
  #reserve { --nw: min(240px, 72vw); }
  #reserve .rs-calc { grid-template-columns: 1fr; margin-top: 40px; }
  #reserve .c-in { padding: 26px 20px 26px; border-right: 0; border-bottom: 1px solid var(--hair); gap: 26px; }
  #reserve .c-out { padding: 24px 20px 24px; }
  #reserve .c-credit { grid-template-columns: 1fr; }
  #reserve .c-exact { grid-column: 1; text-align: left; padding: 0; }
  #reserve .rs-read { grid-template-columns: 1fr; margin-top: 40px; }
  #reserve .rs-read .r, #reserve .rs-read .r:first-child { padding: 20px 0 18px; }
  #reserve .rs-read .r + .r { border-left: 0; border-top: 1px solid var(--hair); }
  #reserve .rs-read .r + .r::before { left: 0; }
  #reserve .rs-trace { flex-direction: column; gap: 10px; min-height: 84px; }
}

/* ---------- Gerak dikurangi: tampilkan keadaan akhir ---------- */
@media (prefers-reduced-motion: reduce) {
  #reserve .wire, #reserve .rs-circuit.drawn .wire { stroke-dasharray: none; stroke-dashoffset: 0; transition: none; }
  #reserve .w-end, #reserve .w-lab { opacity: 1; transition: none; }
  #reserve .seg, #reserve .d-needle, #reserve .c-draw-bar i { transition: none; }
  #reserve .d-ticks, #reserve .d-dots, #reserve .n-tape .tp { animation: none; }
  #reserve .pulse { display: none; }
}
