[hidden] { display: none !important; }
:root {
  --bg: #12062b;
  --ink: #1a1026;
  --yellow: #ffd23f;
  --pink: #ff3fa4;
  --cyan: #33e1ff;
  --green: #7aff5a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg) radial-gradient(circle at 50% 30%, #3d1466 0%, var(--bg) 70%);
  color: #fff; font-family: system-ui, sans-serif;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
#stage { position: fixed; inset: 0; display: grid; place-items: center; }
#game { display: block; border-radius: 6px; box-shadow: 0 0 60px rgba(255, 63, 164, 0.25); }

#topbar { position: fixed; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
#topbar button {
  width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--ink);
  background: rgba(255, 255, 255, 0.85); font-size: 15px; cursor: pointer; padding: 0;
}
#topbar.hide { display: none; }
#pauseBtn { display: none; }
#pauseBtn.show { display: block; }

/* Kontrol sentuh */
#touch { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 4; }
#touch.show { display: block; }
#touch button {
  pointer-events: auto; position: absolute; border: 3px solid var(--ink); border-radius: 50%;
  font-family: "Bangers", Impact, sans-serif; letter-spacing: 1px; color: #fff;
  text-shadow: 2px 2px 0 var(--ink); font-size: 15px; opacity: 0.55; touch-action: none;
}
#touch button.on { opacity: 0.95; transform: scale(0.92); filter: brightness(1.25); }
.pad { position: absolute; left: max(14px, env(safe-area-inset-left)); bottom: 14px; width: 170px; height: 170px; }
.pad button { width: 58px; height: 58px; background: rgba(42, 23, 72, 0.85); font-size: 20px !important; }
.pad .up { left: 56px; top: 0; }
.pad .left { left: 0; top: 56px; }
.pad .right { left: 112px; top: 56px; }
.pad .down { left: 56px; top: 112px; font-size: 12px !important; }
.actions { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: 14px; width: 200px; height: 180px; }
.actions button { width: 72px; height: 72px; }
.actions .punch { right: 0; bottom: 54px; background: #ff3b3b; }
.actions .kick { right: 78px; bottom: 0; background: #2f6bff; }
.actions .special { right: 78px; bottom: 98px; background: #a23bff; }
.actions .dodge { right: 150px; bottom: 54px; width: 58px; height: 58px; font-size: 12px; background: #2fd37a; }


/* ---------- Layar menu (Markas, buat petarung, hasil) ---------- */
:root {
  --panel: rgba(26, 13, 52, 0.94);
  --panel-2: #2a1748;
  --line: #5a3d8a;
  --muted: #c9b8ff;
  --display: "Bangers", Impact, sans-serif;
}
.screen {
  position: fixed; inset: 0; z-index: 6; overflow: auto;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(18, 6, 43, 0.62);
  touch-action: pan-y; user-select: text;
}
.screen[hidden] { display: none; }
.panel { background: var(--panel); border: 4px solid var(--ink); border-radius: 18px; box-shadow: 0 8px 0 var(--ink); padding: 18px; }
h1, h2, legend, .btn, .tabs button, .lv, .coins b { font-family: var(--display); letter-spacing: 1px; font-weight: 400; }
h2 { margin: 6px 0 8px; font-size: 24px; color: var(--yellow); text-shadow: 2px 2px 0 var(--ink); }
h2 small { font-family: system-ui, sans-serif; font-size: 14px; color: #fff; text-shadow: none; margin-left: 8px; }
.logo { margin: 0; font-size: clamp(34px, 6vw, 56px); line-height: 0.95; color: var(--yellow); text-shadow: 3px 3px 0 var(--ink), -1px -1px 0 var(--ink); }
.logo span { display: block; color: var(--pink); font-size: 0.7em; }
.lead { margin: 8px 0 14px; max-width: 60ch; color: #fff; line-height: 1.45; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.4; margin: 6px 0; }
.hint.small { font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.row.center { justify-content: center; }

.btn {
  border: 3px solid var(--ink); border-radius: 12px; background: var(--yellow); color: var(--ink);
  font-size: 22px; padding: 8px 18px; cursor: pointer; box-shadow: 0 4px 0 var(--ink);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.big { font-size: 28px; padding: 8px 28px; background: var(--green); }
.btn.ghost { background: var(--panel-2); color: #fff; border-color: var(--line); box-shadow: none; font-size: 18px; }
.btn.small { font-size: 15px; padding: 4px 10px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.preview { width: 100%; max-width: 220px; height: auto; aspect-ratio: 220 / 260; background: radial-gradient(circle at 50% 70%, #4a1f7a, #1f0d3d); border: 4px solid var(--ink); border-radius: 16px; }

/* Buat petarung */
.create-panel { max-width: 860px; margin: 0 auto; }
.create-grid { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.create-form { display: grid; gap: 10px; min-width: 0; }
.create-form label, legend { color: var(--yellow); font-size: 20px; }
.create-form label { font-family: var(--display); letter-spacing: 1px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input#nameInput {
  font: 700 18px system-ui, sans-serif; text-transform: uppercase; padding: 10px 12px; border-radius: 10px;
  border: 3px solid var(--ink); background: #fff; color: var(--ink); width: 100%; max-width: 320px;
}
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button, .chips button {
  border: 3px solid var(--line); background: var(--panel-2); color: #fff; border-radius: 10px;
  padding: 8px 14px; font: 800 14px system-ui, sans-serif; cursor: pointer;
}
.choices button.on, .chips button.on { background: var(--pink); border-color: #fff; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--ink); cursor: pointer; }
.swatches button.on { outline: 3px solid #fff; outline-offset: 2px; }

/* Markas */
#hub { display: flex; flex-direction: column; gap: 10px; }
#hub[hidden] { display: none; }
.hub-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; background: var(--panel);
  border: 4px solid var(--ink); border-radius: 14px; padding: 8px 14px;
}
.who { display: flex; align-items: baseline; gap: 10px; }
.who b { font-family: var(--display); font-size: 26px; letter-spacing: 1px; color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.lv { background: var(--yellow); color: var(--ink); border-radius: 8px; padding: 0 8px; font-size: 20px; border: 2px solid var(--ink); }
.xp { flex: 1 1 180px; min-width: 0; }
.xp-bar { height: 14px; background: #1a1026; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width 0.4s; }
.xp small { color: var(--muted); font-variant-numeric: tabular-nums; }
.coins { display: flex; align-items: center; gap: 6px; font-size: 24px; color: var(--yellow); }
.coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4b0, var(--yellow) 45%, #d99a00); border: 2px solid var(--ink); }

.hub-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 10px; min-height: 0; }
.hub-left { background: var(--panel); border: 4px solid var(--ink); border-radius: 14px; padding: 10px; text-align: center; }
.record { margin: 8px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.hub-main { background: var(--panel); border: 4px solid var(--ink); border-radius: 14px; padding: 10px 14px 14px; min-width: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 3px solid var(--line); padding-bottom: 8px; margin-bottom: 6px; }
.tabs button { background: transparent; border: 0; color: var(--muted); font-size: 22px; padding: 4px 10px; cursor: pointer; border-radius: 8px; position: relative; }
.tabs button.on { background: var(--pink); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.tabs em { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--green); color: var(--ink); font: 800 12px/20px system-ui, sans-serif; font-style: normal; text-shadow: none; padding: 0 5px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.card {
  display: grid; gap: 4px; text-align: left; background: var(--panel-2); border: 3px solid var(--line); color: #fff;
  border-radius: 12px; padding: 10px 12px; cursor: pointer; font: 14px/1.35 system-ui, sans-serif;
}
.card b { font-family: var(--display); font-size: 22px; letter-spacing: 1px; font-weight: 400; }
.card small { color: var(--muted); }
.card.on { border-color: #fff; background: #4a1f7a; box-shadow: 0 0 0 3px var(--pink); }
.card.train { border-color: var(--cyan); }
.card.train:hover, .card:hover { filter: brightness(1.15); }

.stat-list { display: grid; gap: 10px; }
.stat { display: grid; grid-template-columns: 110px 1fr auto auto; align-items: center; gap: 10px; }
.stat b { font-family: var(--display); font-size: 20px; letter-spacing: 1px; font-weight: 400; }
.stat .bar { height: 14px; background: #1a1026; border-radius: 7px; border: 2px solid var(--ink); overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--yellow); }
.stat span { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 9ch; text-align: right; }
.stat button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--ink); background: var(--green); font: 800 20px system-ui; cursor: pointer; }
.stat button:disabled { background: #555; cursor: not-allowed; }
.stat p { grid-column: 1 / -1; margin: -6px 0 0; color: var(--muted); font-size: 12px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.chips button { padding: 6px 10px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.item {
  display: grid; grid-template-columns: 34px 1fr; gap: 4px 8px; align-items: center; text-align: left;
  background: var(--panel-2); border: 3px solid var(--line); border-radius: 12px; padding: 8px; color: #fff; cursor: pointer;
  font: 13px/1.25 system-ui, sans-serif;
}
.item i { width: 34px; height: 34px; border-radius: 8px; border: 2px solid var(--ink); grid-row: span 2; }
.item b { font-weight: 800; }
.item small { color: var(--muted); }
.item.equipped { border-color: var(--green); }
.item.equipped small { color: var(--green); }
.item.locked { opacity: 0.55; }
.item.buy small { color: var(--yellow); }

.missions { display: grid; gap: 10px; }
.mission { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; background: var(--panel-2); border: 3px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.mission .bar { grid-column: 1; height: 10px; background: #1a1026; border-radius: 5px; overflow: hidden; }
.mission .bar i { display: block; height: 100%; background: var(--cyan); }
.mission small { color: var(--muted); }
.mission .btn { grid-row: 1 / span 3; grid-column: 2; }
.mission.done { opacity: 0.6; }
.danger { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: #ffb3b3; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; border: 3px solid var(--yellow); border-radius: 12px; padding: 8px 16px;
  font-weight: 700; opacity: 0; transition: opacity 0.2s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; z-index: 20;
}
.toast.show { opacity: 1; }

/* Hasil */
#reward { display: grid; place-items: center; }
#reward[hidden] { display: none; }
.reward-panel { width: min(520px, 100%); text-align: center; }
.reward-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.reward-list li { display: flex; justify-content: space-between; gap: 12px; background: var(--panel-2); border-radius: 10px; padding: 6px 12px; font-variant-numeric: tabular-nums; }
.reward-list li b { color: var(--yellow); }
.level-up { background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px; font-weight: 700; margin-bottom: 8px; }
.level-up strong { font-family: var(--display); font-size: 26px; font-weight: 400; letter-spacing: 1px; display: block; }

@media (max-width: 720px), (max-height: 460px) {
  .hub-body { grid-template-columns: 150px minmax(0, 1fr); }
  .create-grid { grid-template-columns: 150px 1fr; }
  .preview { max-width: 150px; }
  .tabs button { font-size: 18px; padding: 3px 7px; }
  .who b { font-size: 20px; }
  .stat { grid-template-columns: 90px 1fr auto; }
  .stat span { display: none; }
}
@media (max-width: 480px) {
  .hub-body, .create-grid { grid-template-columns: minmax(0, 1fr); }
  .hub-left { display: grid; grid-template-columns: 120px 1fr; grid-template-rows: auto 1fr; column-gap: 12px; align-items: start; text-align: left; }
  .hub-left .preview { grid-row: 1 / span 2; max-width: 120px; }
  .hub-left .record { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) { .xp-bar i { transition: none; } }

/* Latihan & papan skor */
.cards.three { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card .best { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .best b { font: 800 13px system-ui, sans-serif; color: var(--yellow); letter-spacing: 0; }
h2.sub { font-size: 20px; margin-top: 14px; }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 300px; overflow: auto; }
.board li { display: grid; grid-template-columns: 34px 22px 1fr auto auto; align-items: center; gap: 8px; background: var(--panel-2); border-radius: 10px; padding: 6px 10px; font-variant-numeric: tabular-nums; }
.board li .rk { font-family: var(--display); font-size: 20px; color: var(--muted); }
.board li:nth-child(1) .rk { color: var(--yellow); }
.board li:nth-child(2) .rk { color: #dfe3ff; }
.board li:nth-child(3) .rk { color: #ff9d5c; }
.board li:nth-child(1) { border: 2px solid var(--yellow); }
.board li .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); }
.board li .nm { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .lvl { font-size: 12px; color: var(--muted); }
.board li .sc { font-weight: 800; color: var(--yellow); }
.board li.me { background: #4a1f7a; outline: 2px solid var(--pink); }
.board .empty { display: block; color: var(--muted); background: transparent; }
.champs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.champs li { display: flex; justify-content: space-between; gap: 10px; background: var(--panel-2); border-radius: 10px; padding: 6px 10px; }
.champs li b { color: var(--yellow); }
.record-badge { background: var(--pink); color: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px; font-weight: 800; margin-bottom: 8px; }

/* ---------- HP portrait (prioritas) ---------- */
body.portrait[data-scene="fight"] #stage,
body.portrait[data-scene="minigame"] #stage { place-items: start center; }
body.portrait #game { border-radius: 0; box-shadow: none; }
body.portrait #touch.show {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  top: var(--canvas-h); bottom: 0; left: 0; right: 0;
  padding: 48px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: linear-gradient(#24104a, #12062b); border-top: 4px solid var(--ink);
  pointer-events: auto;
}
body.portrait #touch button { position: static; opacity: 1; width: 100%; height: 100%; font-size: clamp(12px, 3.6vw, 16px); }
body.portrait .pad {
  position: static; --pb: min(15vw, 64px);
  display: grid; grid-template-columns: repeat(3, var(--pb)); grid-template-rows: repeat(3, var(--pb)); width: auto; height: auto;
}
body.portrait .pad .up { grid-area: 1 / 2; }
body.portrait .pad .left { grid-area: 2 / 1; }
body.portrait .pad .right { grid-area: 2 / 3; }
body.portrait .pad .down { grid-area: 3 / 2; font-size: clamp(10px, 2.8vw, 13px) !important; }
body.portrait .actions {
  position: static; --ab: min(21vw, 86px);
  display: grid; grid-template-columns: repeat(2, var(--ab)); grid-template-rows: repeat(2, var(--ab)); gap: 8px; width: auto; height: auto;
}
body.portrait .actions .special { grid-area: 1 / 1; }
body.portrait .actions .punch { grid-area: 1 / 2; }
body.portrait .actions .dodge { grid-area: 2 / 1; }
body.portrait .actions .kick { grid-area: 2 / 2; }

.div-chip { color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; padding: 1px 8px; font: 800 13px system-ui, sans-serif; white-space: nowrap; }

/* Online */
.btn.big.online { background: var(--pink); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
#search { display: grid; place-items: center; }
#search[hidden] { display: none; }
.search-panel { width: min(520px, 100%); text-align: center; }
.search-panel .logo { font-size: clamp(30px, 8vw, 48px); }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 14px 0; }
.vs b { display: block; font-family: var(--display); font-size: clamp(22px, 6vw, 32px); letter-spacing: 1px; font-weight: 400; overflow-wrap: anywhere; }
.vs small { color: var(--muted); }
.vs-word { font-family: var(--display); font-size: 44px; color: var(--yellow); text-shadow: 3px 3px 0 var(--ink); }

/* Fight Night */
.prizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.prizes div { background: var(--panel-2); border: 3px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; }
.prizes div:first-child { border-color: var(--yellow); }
.prizes small { display: block; color: var(--muted); font-size: 12px; }
.prizes b { font-family: var(--display); font-weight: 400; font-size: clamp(18px, 5vw, 24px); letter-spacing: 1px; color: var(--yellow); }
.bracket { display: grid; gap: 10px; margin-top: 10px; }
.bracket h3 { margin: 0 0 4px; font: 400 18px var(--display); letter-spacing: 1px; color: var(--cyan); }
.bracket .m { display: flex; justify-content: space-between; gap: 8px; background: var(--panel-2); border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.bracket .m span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket .m .w { color: var(--yellow); font-weight: 800; }
.bracket .m .live { color: var(--green); font-weight: 800; }
.bracket .m.me { outline: 2px solid var(--pink); }
.rules { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.rules summary { cursor: pointer; color: #fff; font-weight: 800; }
.rules ol { padding-left: 20px; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--pink); }
.payout { display: grid; gap: 6px; background: var(--panel-2); border: 3px solid var(--yellow); border-radius: 12px; padding: 12px; margin-top: 10px; max-width: 420px; }
.payout h3 { margin: 0; font: 400 20px var(--display); letter-spacing: 1px; color: var(--yellow); }
.payout label { font-weight: 700; font-size: 13px; }
.payout input, .payout select { font: 600 16px system-ui, sans-serif; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; color: var(--ink); width: 100%; }

.pay { display: grid; justify-items: center; gap: 6px; background: #fff; color: var(--ink); border: 4px solid var(--ink); border-radius: 16px; padding: 12px; max-width: 320px; margin: 10px auto 0; text-align: center; }
.pay h3 { margin: 0; font: 400 22px var(--display); letter-spacing: 1px; }
.pay img { width: min(220px, 70vw); height: auto; aspect-ratio: 1; image-rendering: pixelated; background: #eee; }
.pay .lead { color: var(--ink); margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay .hint { color: #4b3f66; }

/* ---------- Blackjack ---------- */
#blackjack { padding: 0; background: radial-gradient(ellipse at 50% 40%, #1f8a4a 0%, #0f5a30 55%, #0a3d22 100%); }
.bj-table { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto 1fr auto; gap: 8px; padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); max-width: 560px; margin: 0 auto; }
.bj-top { display: flex; justify-content: space-between; align-items: center; }
.bj-chips { display: flex; align-items: center; gap: 8px; font: 400 28px var(--display); letter-spacing: 1px; color: var(--yellow); text-shadow: 2px 2px 0 var(--ink); }
.chip-ico { width: 26px; height: 26px; border-radius: 50%; background: repeating-conic-gradient(#ff3b3b 0 30deg, #fff 30deg 60deg); border: 3px solid var(--ink); box-shadow: inset 0 0 0 5px #ff3b3b; }
.bj-area { display: grid; justify-items: center; align-content: center; gap: 6px; }
.bj-label { margin: 0; font: 400 18px var(--display); letter-spacing: 2px; color: #d8ffe6; }
.bj-label span { color: var(--yellow); margin-left: 6px; }
.bj-hand { display: flex; justify-content: center; min-height: 112px; }
.bj-card {
  width: 74px; height: 106px; border-radius: 10px; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 4px 0 rgba(0,0,0,0.35);
  margin-left: -26px; display: grid; grid-template-rows: auto 1fr; padding: 4px 6px; color: var(--ink); font-family: var(--display);
  animation: bj-in 0.25s ease-out;
}
.bj-card:first-child { margin-left: 0; }
.bj-card.red { color: #d81b3a; }
.bj-card .rk { font-size: 24px; line-height: 1; }
.bj-card .st { font-size: 40px; align-self: center; justify-self: center; line-height: 1; }
.bj-card.back { background: repeating-linear-gradient(45deg, #a23bff 0 8px, #7a1fd6 8px 16px); }
.bj-card.back * { visibility: hidden; }
@keyframes bj-in { from { transform: translateY(-30px) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bj-card { animation: none; } }
.bj-msg { margin: 0; text-align: center; font: 400 clamp(26px, 8vw, 40px) var(--display); letter-spacing: 1px; color: #fff; text-shadow: 3px 3px 0 var(--ink); min-height: 1.2em; }
.bj-msg.win { color: var(--yellow); }
.bj-msg.lose { color: #ff9a9a; }
.bj-controls { display: grid; gap: 8px; }
.bj-bets { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.bj-bets button { width: 54px; height: 54px; border-radius: 50%; border: 3px dashed #fff; font: 800 14px system-ui, sans-serif; color: #fff; cursor: pointer; box-shadow: 0 0 0 3px var(--ink); }
.bj-bets button.on { outline: 3px solid var(--yellow); outline-offset: 3px; }
.bj-bets button:disabled { opacity: 0.35; cursor: not-allowed; }
.bj-betinfo { margin: 0; text-align: center; color: #d8ffe6; font-weight: 700; font-variant-numeric: tabular-nums; }
.bj-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.bj-actions .btn { width: 100%; }

/* ---------- Bagan turnamen ---------- */
.bracket-wrap { margin-top: 12px; max-width: 100%; min-width: 0; }
.tab-panel { min-width: 0; }
.bscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; touch-action: pan-x pan-y; }
.btree { --cardh: 54px; --gap: 10px; display: flex; gap: 22px; min-height: calc(var(--rows) * (var(--cardh) + var(--gap)) + 30px); width: max-content; }
.bcol { display: flex; flex-direction: column; width: 148px; }
.bcol h3 { margin: 0 0 6px; font: 400 15px var(--display); letter-spacing: 1px; color: var(--cyan); text-align: center; white-space: nowrap; }
.bcol-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.bpair { flex: 1; display: flex; flex-direction: column; justify-content: space-around; position: relative; }
/* garis: dari tiap kotak ke kanan, lalu garis tegak menyatukan pasangan */
.bpair .bm::after { content: ""; position: absolute; right: -12px; top: 50%; width: 12px; border-top: 2px solid var(--line); }
.bpair::after { content: ""; position: absolute; right: -12px; top: 25%; bottom: 25%; border-right: 2px solid var(--line); }
.bpair::before { content: ""; position: absolute; right: -22px; top: 50%; width: 10px; border-top: 2px solid var(--line); }
.bcol.last .bm::before, .bcol:not(.first):not(.champ) .bm::before { content: ""; position: absolute; left: -10px; top: 50%; width: 10px; border-top: 2px solid var(--line); }
.bcol:not(.first) .bpair::before { right: -22px; }
.bm { position: relative; background: var(--panel-2); border: 2px solid var(--line); border-radius: 8px; margin: calc(var(--gap) / 2) 0; font-size: 12px; overflow: visible; }
.bm-p { display: flex; justify-content: space-between; gap: 6px; padding: 3px 7px; min-height: 22px; align-items: center; }
.bm-p + .bm-p { border-top: 1px solid var(--line); }
.bm-p span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.bm-p.w { color: var(--yellow); }
.bm-p.w b { color: var(--yellow); font-size: 11px; }
.bm-p.l span { color: #8f84a8; text-decoration: line-through; text-decoration-thickness: 1px; }
.bm-p.tbd span { color: #8f84a8; font-weight: 400; font-style: italic; }
.bm.me { border-color: var(--pink); box-shadow: 0 0 0 2px var(--pink); }
.bm.live { border-color: var(--green); }
.bm-live { position: absolute; top: -9px; right: 6px; background: var(--green); color: var(--ink); font: 800 9px system-ui, sans-serif; font-style: normal; padding: 1px 5px; border-radius: 6px; }
.bm.final { border-color: var(--yellow); }
.bchamp { display: grid; justify-items: center; gap: 2px; background: var(--panel-2); border: 3px dashed var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; }
.bchamp.won { border: 3px solid var(--yellow); box-shadow: 0 0 18px rgba(255, 210, 63, 0.35); }
.bchamp .trophy { font-size: 28px; }
.bchamp b { font: 400 17px var(--display); letter-spacing: 1px; color: var(--yellow); overflow-wrap: anywhere; }
.bcol.champ { width: 120px; }
.bronze { max-width: 200px; margin-top: 6px; }
.bronze h3 { margin: 0 0 4px; font: 400 15px var(--display); letter-spacing: 1px; color: #ff9d5c; }
.bracket-wait h3 { margin: 0; font: 400 18px var(--display); letter-spacing: 1px; color: var(--cyan); }
.plist { margin: 6px 0 0; padding-left: 24px; display: grid; gap: 3px; font-size: 13px; }
.plist li span { font-weight: 800; margin-right: 6px; }
.plist li small { color: var(--muted); }
.plist li.me span { color: var(--pink); }

.legal { text-align: center; font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.8; }
.legal a, .check a { color: var(--cyan); }
