/* Royal Battlefield: tema game kartu fantasi. Satu breakpoint susun = 1180 px (sama dengan LEBAR di royal.js). */
:root {
  --ink: #0a1733; --bg: #2c5dae; --bg-hi: #3668ba; --bg-lo: #23509b; --deep: #16367a; --night: #0f2756;
  --band: #5b8fd8; --band-hi: #8db5ec; --band-lo: #3f6fb8; --slab: rgba(9, 26, 70, .55); --slab-line: rgba(130, 180, 250, .22);
  --gold: #ffb825; --gold-hi: #ffd973; --gold-lo: #d98500; --blue: #3f9bff; --blue-hi: #8cc8ff; --blue-lo: #1d6bd0;
  --green: #4cc24a; --green-hi: #8de08a; --green-lo: #2f8f2e; --red: #e23a44; --red-hi: #ff8a90; --red-lo: #a8202a;
  --purple: #6b5bd6; --cyan: #5fe0ff; --text: #fff; --soft: #cfe0ff; --mute: #a9c3f2;
  --opus: #ffc928; --opus-ink: #3a2400; --sonnet: #d5e1ee; --sonnet-ink: #13243f; --haiku: #d88a4e; --haiku-ink: #2e1405; --auto: #5fe0ff;
  --outline: 0 2px 0 var(--ink), 1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 1px -1px 0 var(--ink), -1px -1px 0 var(--ink);
  --nav-h: 80px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; font: 800 15px/1.4 Nunito, system-ui, sans-serif; color: var(--text);
  background-color: var(--bg);
  background-image: repeating-linear-gradient(45deg, rgba(12, 34, 84, .5) 0 2px, transparent 2px 44px), repeating-linear-gradient(-45deg, rgba(12, 34, 84, .5) 0 2px, transparent 2px 44px), linear-gradient(var(--bg-hi), var(--bg-lo));
  background-attachment: fixed; overflow-x: hidden;
}
body.merah { --bg: #8a1f2c; --bg-hi: #9c2633; --bg-lo: #6a1420; --ink: #1a0508; --slab: rgba(40, 6, 12, .55); --slab-line: rgba(255, 200, 80, .28); --band: #ffb825; --band-hi: #ffd973; --band-lo: #d98500; --soft: #ffd9c2; --mute: #f3c7cc; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.o, h1, h2, h3 { font-family: "Lilita One", sans-serif; font-weight: 400; letter-spacing: .3px; text-shadow: var(--outline); margin: 0; }
.mono { font-family: "JetBrains Mono", monospace; font-weight: 600; }
.mute { color: var(--mute); } .soft { color: var(--soft); } .kecil { font-size: 12px; } .mini { font-size: 11px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; min-width: 0; } .row { display: flex; gap: 8px; align-items: center; min-width: 0; } .wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- Kerangka ---------- */
.app { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "top" "izin" "view"; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.top { grid-area: top; position: sticky; top: 0; z-index: 20; }
#izin { grid-area: izin; }
.view { grid-area: view; min-width: 0; padding: 10px 10px 16px; outline: none; }
.isi { width: 100%; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rail { display: none; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; background: var(--night); border-top: 3px solid var(--ink); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #22468a; border-right: 2px solid var(--ink); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .14); min-width: 0; }
.tab:last-child { border-right: 0; }
.tab svg { width: 38px; height: 38px; transition: transform .15s; }
.tab span { display: none; font-family: "Lilita One"; font-size: 13px; text-shadow: var(--outline); }
.tab.on { background: #4f86d6; }
.tab.on svg { width: 46px; height: 46px; transform: translateY(-6px); }
.tab.on span { display: block; margin-top: -6px; }
.bdg { position: absolute; top: 5px; right: 8px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; background: var(--red); border: 2px solid var(--ink); font: 400 11px/14px "Lilita One"; text-align: center; }

@media (min-width: 1180px) {
  .app { grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "rail top" "rail izin" "rail view"; padding-bottom: 0; }
  .nav { display: none; }
  .rail { grid-area: rail; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; background: var(--night); border-right: 3px solid var(--ink); position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
  .ri { width: 66px; min-height: 62px; border-radius: 12px; border: 3px solid var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: #22468a; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .14); font: 400 11px "Lilita One"; color: var(--soft); position: relative; }
  .ri svg { width: 30px; height: 30px; }
  .ri.on { background: #4f86d6; color: #fff; }
  .ri.raja { background: var(--red); color: #fff; }
  .view { padding: 14px 18px 24px; }
}

/* ---------- Bilah atas ---------- */
.topbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--deep); border-bottom: 3px solid var(--ink); }
.lv { position: relative; flex: 1.25; min-width: 0; height: 40px; display: flex; align-items: center; }
.lv-badge { position: absolute; left: 0; top: 0; z-index: 1; width: 38px; height: 40px; }
.lv-badge b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 400 16px "Lilita One"; text-shadow: var(--outline); }
.bar { display: block; position: relative; height: 24px; border-radius: 7px; background: #0b1836; border: 2px solid var(--ink); overflow: hidden; flex: 1; min-width: 0; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #3fa9ff; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2); }
.bar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 400 13px "Lilita One"; text-shadow: var(--outline); white-space: nowrap; }
.lv .bar { margin-left: 22px; } .lv .bar b { padding-left: 14px; }
.bar.tipis { height: 16px; border-radius: 6px; } .bar.tipis b { font-size: 11px; }
.pill { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; gap: 4px; border-radius: 7px; background: #0b1836; border: 2px solid var(--ink); padding-right: 2px; }
.pill .plus { width: 22px; height: 22px; margin-left: 1px; flex: none; border-radius: 5px; background: var(--green); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -3px 0 var(--green-lo); }
.pill b { flex: 1; text-align: right; font: 400 14px "Lilita One"; text-shadow: var(--outline); white-space: nowrap; overflow: hidden; }
.pill svg { flex: none; }
.topbar .top-extra { display: none; }
@media (min-width: 1180px) {
  .topbar { gap: 12px; padding: 10px 18px; }
  .topbar .top-extra { display: flex; align-items: center; gap: 12px; }
  .lv { flex: 0 0 240px; } .pill { flex: 0 0 auto; padding: 0 6px 0 2px; min-width: 120px; }
  .brand { font: 400 24px "Lilita One"; text-shadow: var(--outline); margin-right: auto; }
}

/* ---------- Komponen ---------- */
.slab { background: var(--slab); border: 3px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 2px var(--slab-line); min-width: 0; }
.slab.emas { box-shadow: inset 0 0 0 2px var(--gold); }
.slab.cyan { box-shadow: inset 0 0 0 2px var(--cyan); }
.band { background: var(--band); border: 3px solid var(--ink); border-radius: 12px; box-shadow: inset 0 3px 0 var(--band-hi), inset 0 -4px 0 var(--band-lo); padding: 8px 10px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.band h1 { font-size: 22px; line-height: 1.1; }
.band .sub { font-size: 12px; color: #0b2f66; }
body.merah .band .sub { color: #5a2a00; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 3px solid var(--ink); border-radius: 12px; font: 400 16px "Lilita One"; color: #fff; text-shadow: var(--outline); background: var(--blue); box-shadow: inset 0 3px 0 var(--blue-hi), inset 0 -6px 0 var(--blue-lo), 0 3px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 3px 0 var(--blue-hi), inset 0 -4px 0 var(--blue-lo), 0 1px 0 var(--ink); }
.btn:disabled { filter: grayscale(.6) brightness(.8); cursor: default; }
.btn.y { background: var(--gold); box-shadow: inset 0 4px 0 var(--gold-hi), inset 0 -7px 0 var(--gold-lo), 0 4px 0 var(--ink); }
.btn.g { background: var(--green); box-shadow: inset 0 3px 0 var(--green-hi), inset 0 -6px 0 var(--green-lo), 0 3px 0 var(--ink); }
.btn.r { background: var(--red); box-shadow: inset 0 3px 0 var(--red-hi), inset 0 -6px 0 var(--red-lo), 0 3px 0 var(--ink); }
.btn.p { background: var(--purple); box-shadow: inset 0 3px 0 #a297f0, inset 0 -5px 0 #4a3cae, 0 3px 0 var(--ink); }
.btn.dk { background: #5a0f19; box-shadow: inset 0 3px 0 #a33a48, inset 0 -5px 0 #3a0710; }
.btn.kcl { min-height: 34px; padding: 0 10px; font-size: 13px; border-width: 2px; border-radius: 9px; }
.btn.sq { width: 44px; padding: 0; }
.btn.besar { min-height: 72px; flex-direction: column; gap: 0; font-size: 26px; flex: 1; }
.btn.besar small { font: 800 11px Nunito; text-shadow: none; color: #5a3600; }
.btn.besar.b small { color: #0b2f66; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #16326a; border: 3px solid var(--ink); min-width: 0; }
body.merah .seg { background: #3a0710; }
.sg { flex: 1; min-width: 0; min-height: 36px; border: 2px solid var(--ink); border-radius: 7px; background: #24498f; color: var(--soft); font: 400 14px "Lilita One"; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.merah .sg { background: #5a0f19; }
.sg[aria-pressed="true"], .sg[aria-selected="true"] { background: var(--gold); color: #fff; text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink); box-shadow: inset 0 3px 0 var(--gold-hi), inset 0 -4px 0 var(--gold-lo); }
.sg.cy[aria-pressed="true"] { background: var(--cyan); color: var(--ink); text-shadow: none; box-shadow: inset 0 -4px 0 #1aa6c9; }
.tier { display: inline-block; font: 400 12px/1.2 "Lilita One"; padding: 1px 7px; border-radius: 6px; border: 2px solid var(--ink); text-shadow: none; white-space: nowrap; }
.tier.opus, .tier.fable { background: var(--opus); color: var(--opus-ink); } .tier.sonnet { background: var(--sonnet); color: var(--sonnet-ink); }
.tier.haiku { background: var(--haiku); color: var(--haiku-ink); } .tier.auto { background: var(--auto); color: var(--ink); } .tier.mati { background: #16326a; color: var(--mute); }
.tag { font: 400 12px "Lilita One"; padding: 2px 8px; border-radius: 7px; border: 2px solid var(--ink); background: #16326a; color: var(--mute); white-space: nowrap; }
.field { box-sizing: border-box; width: 100%; min-height: 44px; border: 3px solid var(--ink); border-radius: 10px; background: #f4f7ff; color: var(--ink); font: 700 15px Nunito; padding: 8px 10px; }
textarea.field { resize: vertical; line-height: 1.4; }
select.field { padding: 0 8px; }
.lbl { font-size: 12px; color: var(--soft); }
.err { color: #ffb3b8; font-size: 13px; background: rgba(120, 10, 20, .5); border: 2px solid var(--red); border-radius: 8px; padding: 6px 8px; }
.kosong { color: var(--mute); text-align: center; padding: 18px 8px; font-size: 13px; }
.face { width: 40px; height: 40px; flex: none; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; display: block; }
.face svg { display: block; width: 100%; height: 100%; }
.faces { display: flex; padding-left: 6px; } .faces .face { width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; }
.faces .lebih { width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; border: 2px solid var(--ink); background: #0b1836; font: 400 11px/24px "Lilita One"; text-align: center; }

/* Kartu agent */
.kartu { position: relative; width: 84px; height: 128px; display: flex; flex-direction: column; border: 3px solid var(--ink); border-radius: 9px; overflow: hidden; background: #0b1836; box-shadow: inset 0 0 0 2px var(--tier, var(--sonnet)), 0 3px 0 var(--ink); flex: none; }
.kartu .potret { width: 78px; height: 78px; flex: none; display: block; }
.kartu .biaya { position: absolute; top: 2px; left: 2px; min-width: 26px; height: 22px; padding: 0 4px; border-radius: 11px 11px 11px 3px; background: var(--cyan); border: 2px solid var(--ink); box-shadow: inset 0 -3px 0 #1aa6c9; font: 400 11px/18px "Lilita One"; text-align: center; color: var(--ink); }
.kartu .lvl { position: absolute; top: 2px; right: 2px; min-width: 20px; height: 22px; padding: 0 2px; border-radius: 4px 4px 10px 10px; background: #3b8cf0; border: 2px solid var(--ink); font: 400 11px/18px "Lilita One"; text-align: center; text-shadow: 0 1px 0 var(--ink); }
.kartu .nama { position: absolute; left: 0; right: 0; top: 57px; text-align: center; font: 400 13px "Lilita One"; text-shadow: var(--outline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.kartu .maju { height: 20px; display: flex; align-items: center; gap: 2px; padding: 0 3px; }
.kartu .maju .bar { height: 13px; border-radius: 4px; border: 0; background: #1b2c52; }
.kartu .maju .bar b { font-size: 10px; padding: 0; }
.kartu .pita { height: 20px; border-top: 2px solid var(--ink); background: var(--tier, var(--sonnet)); color: var(--tier-ink, var(--sonnet-ink)); font: 400 12px/18px "Lilita One"; text-align: center; }
.kartu .kerja { position: absolute; left: 4px; right: 4px; top: 30px; text-align: center; font: 400 10px "Lilita One"; background: rgba(10, 23, 51, .8); border-radius: 6px; padding: 2px; color: var(--gold-hi); }
.kartu.ketua::after { content: ""; position: absolute; left: 50%; top: 2px; width: 18px; height: 12px; margin-left: -9px; background: var(--gold); clip-path: polygon(0 100%, 8% 0, 30% 45%, 50% 0, 70% 45%, 92% 0, 100% 100%); }
.kartu.slot-kosong { background: rgba(9, 26, 70, .4); border-style: dashed; align-items: center; justify-content: center; box-shadow: none; color: var(--mute); font: 400 13px "Lilita One"; }
.kartu-btn { padding: 0; border: 0; background: none; text-align: inherit; display: block; }
.grid-kartu { display: grid; grid-template-columns: repeat(auto-fill, 84px); justify-content: space-between; gap: 10px 6px; }
@media (min-width: 700px) { .grid-kartu { justify-content: start; gap: 12px; } }
.tambah { position: absolute; top: 28px; right: 3px; width: 26px; height: 26px; border-radius: 7px; background: var(--green); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -3px 0 var(--green-lo); }

/* ---------- Battle ---------- */
.profil { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.banner { display: flex; gap: 8px; }
.banner .jt { flex: 1; min-width: 0; display: flex; align-items: center; height: 58px; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; background: #2a1c4f; box-shadow: inset 0 0 0 2px var(--gold); }
.banner .jt .cap { height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 8px; background: var(--gold); border-right: 3px solid var(--ink); color: var(--opus-ink); font: 400 14px/1 "Lilita One"; }
.arena { position: relative; display: flex; flex-direction: column; align-items: center; }
.arena svg.benteng { width: 300px; max-width: 100%; height: auto; }
.arena .panah { position: absolute; top: 110px; width: 42px; height: 42px; border-radius: 50%; padding: 0; min-height: 0; }
.arena .panah.kiri { left: 4px; } .arena .panah.kanan { right: 4px; }
.serbu { display: flex; gap: 10px; }
.gulungan { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.gul { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 4px; padding: 8px 4px; min-height: 112px; text-align: center; }
.gul .o { font-size: 12px; line-height: 1.1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* HP: urutan seperti layar utama game (arena dulu); desktop: dua kolom lewat area grid */
.battle .pasukan { order: 9; }
.battle .luar { display: none; } /* hanya layar lebar: mengisi kolom kiri yang kosong */
@media (min-width: 1180px) {
  .battle { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; align-items: start;
    grid-template-areas: "p a" "b a" "j a" "k s" "k g"; }
  .battle .profil { grid-area: p; } .battle .banner { grid-area: b; } .battle .pasukan { grid-area: j; } .battle .luar { grid-area: k; }
  .battle .arena { grid-area: a; } .battle .serbu { grid-area: s; } .battle .gulungan { grid-area: g; }
  .battle .luar { display: flex; }
}

/* ---------- Markas, deck, agent ---------- */
.mk { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 4px; }
.mk-list { display: grid; gap: 9px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .mk-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.subs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: end; }
.subtab { position: relative; height: 54px; display: flex; align-items: center; justify-content: center; border: 3px solid var(--ink); border-bottom: none; border-radius: 10px 10px 0 0; background: #24498f; }
.subtab[aria-current="page"] { background: var(--band); height: 60px; box-shadow: inset 0 3px 0 var(--band-hi); }
.subtab svg { width: 36px; height: 36px; }
.huruf { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
.huruf button { flex: none; width: 40px; height: 40px; border: 3px solid var(--ink); border-radius: 8px; background: #16326a; color: var(--mute); font: 400 18px "Lilita One"; padding: 0; }
.huruf button[aria-current="true"] { background: var(--gold); color: #fff; box-shadow: inset 0 3px 0 var(--gold-hi), inset 0 -5px 0 var(--gold-lo); text-shadow: var(--outline); }
.tetes { width: 56px; flex: none; display: flex; flex-direction: column; align-items: center; }
.detail-atas { display: flex; gap: 12px; }
.besar-kartu { width: 118px; height: 179px; flex: none; }
.besar-kartu .kartu { transform: scale(1.4); transform-origin: top left; }
.statk { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.statk div { display: flex; flex-direction: column; align-items: center; padding: 5px 2px; border-radius: 8px; background: #16326a; border: 2px solid var(--ink); }
.statk .o { font-size: 17px; } .statk span { font-size: 9.5px; color: var(--mute); }
.orb { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 5px 0 rgba(255, 255, 255, .3), inset 0 -6px 0 rgba(0, 0, 0, .25); padding: 0; position: relative; }
.orb.kosong { background: #16326a; border-style: dashed; box-shadow: none; }
.spells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.spell { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; text-align: center; line-height: 1.15; word-break: break-word; min-width: 0; }
.spell .lepas { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--red); border: 2px solid var(--ink); font: 400 12px/14px "Lilita One"; color: #fff; padding: 0; }
.gd { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--slab); border: 2px solid var(--ink); font-size: 12px; min-width: 0; }
.daftar-grp { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.daftar-wrap { display: flex; flex-wrap: wrap; gap: 14px; }
.it { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.it .cap { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.15; }
.it .cap b { font: 400 13px "Lilita One"; } .it .cap span { font-size: 10.5px; color: var(--mute); }

/* ---------- Job ---------- */
.sdlc { position: relative; display: grid; }
.sdlc .rel { position: absolute; left: 8%; right: 8%; top: 15px; height: 6px; border-radius: 3px; background: #0b1836; }
.sdlc .rel i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--green); }
.st { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--mute); text-align: center; }
.st.done { color: #fff; } .st.now { color: var(--gold-hi); }
.jr { display: flex; align-items: center; gap: 8px; padding: 9px 10px; }
.izin-kartu { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; border: 3px solid var(--ink); border-radius: 12px; background: #c22a35; box-shadow: inset 0 3px 0 #ff7b83, inset 0 -5px 0 #8f1a22; }
#izin { padding: 8px 10px 0; display: flex; flex-direction: column; gap: 6px; }
#izin:empty { display: none; }
@media (min-width: 1180px) { #izin { padding: 10px 18px 0; } #izin .izin-kartu { max-width: 760px; } }
.izin-kartu code { font: 600 12px "JetBrains Mono"; word-break: break-all; }

/* Chat ala Discord */
.chat { display: flex; flex-direction: column; height: calc(100dvh - 86px - var(--nav-h) - env(safe-area-inset-bottom)); min-height: 420px; background: #142a57; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; }
.chat-h { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--band); border-bottom: 3px solid var(--ink); box-shadow: inset 0 3px 0 var(--band-hi), inset 0 -4px 0 var(--band-lo); }
.chs { display: flex; gap: 5px; padding: 8px 10px; background: #0f2350; border-bottom: 3px solid var(--ink); overflow-x: auto; scrollbar-width: none; }
.ch { flex: none; min-height: 36px; font: 400 13px "Lilita One"; padding: 5px 10px; border-radius: 9px; color: var(--mute); background: #1c3a74; border: 2px solid var(--ink); }
.ch[aria-pressed="true"] { background: var(--gold); color: #fff; box-shadow: inset 0 2px 0 var(--gold-hi), inset 0 -4px 0 var(--gold-lo); text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); }
.pesan-list { flex: 1; overflow-y: auto; padding: 8px 0; display: flex; flex-direction: column; gap: 2px; font-weight: 700; }
.msg { display: flex; gap: 10px; padding: 6px 12px; min-width: 0; }
.msg .badan { flex: 1; min-width: 0; }
.msg .who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.msg .who .nm { font: 400 15px "Lilita One"; color: var(--gold-hi); }
.msg .who time { font-size: 11px; color: #7f97c4; }
.msg.raja { background: #1d2f5a; border-left: 4px solid var(--gold); padding-left: 8px; }
.msg.raja .nm { color: #ff8a90; }
.md { font-size: 14px; line-height: 1.45; color: #e6edfb; overflow-wrap: anywhere; }
.md p { margin: 4px 0; } .md ul, .md ol { margin: 4px 0; padding-left: 20px; } .md h4 { margin: 8px 0 4px; font: 400 15px "Lilita One"; }
.md code { font: 600 12.5px "JetBrains Mono"; background: #0a1733; border-radius: 4px; padding: 0 4px; }
.md .kode { position: relative; margin: 6px 0; background: #0a1733; border: 2px solid #24498f; border-radius: 8px; }
.md .kode pre { margin: 0; padding: 8px; overflow-x: auto; font: 500 12px/1.5 "JetBrains Mono"; color: var(--soft); }
.md .kode button { position: absolute; top: 4px; right: 4px; }
.md .tabel { overflow-x: auto; } .md table { border-collapse: collapse; font-size: 13px; } .md td, .md th { border: 1px solid #24498f; padding: 3px 6px; text-align: left; }
.sys { margin: 4px 12px; padding: 7px 10px; border-radius: 10px; background: #0f2b5e; border: 2px dashed var(--cyan); font-size: 12px; line-height: 1.4; color: var(--soft); }
.sys.tahap { border-style: solid; border-color: var(--gold); background: #2a2a10; }
.akt { margin: 0 12px 0 62px; font-size: 12px; color: #7f97c4; overflow-wrap: anywhere; }
.akt.err { color: #ff9aa0; }
.composer { padding: 8px 10px 10px; background: #0f2350; border-top: 3px solid var(--ink); display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 160px; }
.berkas a { display: inline-flex; gap: 4px; align-items: center; margin: 3px 6px 0 0; font: 600 12px "JetBrains Mono"; color: var(--cyan); text-decoration: underline; word-break: break-all; }
.job3 { display: flex; flex-direction: column; gap: 10px; }
.job3 .jobs, .job3 .side { display: none; }
@media (min-width: 1180px) {
  .job3 { display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
  .job3 .jobs, .job3 .side { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 76px; max-height: calc(100dvh - 90px); overflow-y: auto; }
  .chat { height: calc(100dvh - 100px); }
}
.vst { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 4px 0; color: var(--mute); }
.vst.done { color: #fff; } .vst.now { color: var(--gold-hi); }

/* ---------- News, statistik, Raja, terminal ---------- */
.repo { display: flex; gap: 10px; padding: 10px; }
.ow { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font: 400 16px "Lilita One"; color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tiles .tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; text-align: center; }
.tiles .o { font-size: 21px; } .tiles span { font-size: 10px; color: var(--mute); }
.brs { display: grid; grid-template-columns: 62px minmax(0, 1fr) 64px; gap: 8px; align-items: center; font-size: 12px; }
.lead { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; }
.rk { width: 24px; height: 24px; flex: none; border-radius: 6px; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font: 400 13px "Lilita One"; color: var(--ink); }
.kuasa { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.kuasa button, .kuasa a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 10px; background: var(--slab); border: 2px solid var(--ink); font-size: 11px; text-align: center; line-height: 1.15; min-height: 64px; justify-content: center; }
.term { flex: 1; min-height: 50dvh; background: #0b0f14; border: 3px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 2px rgba(255, 200, 80, .25); padding: 10px; font: 500 12px/1.55 "JetBrains Mono"; color: #d6e2f0; white-space: pre-wrap; overflow-y: auto; overflow-wrap: anywhere; margin: 0; }
.keys { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.k { min-height: 40px; border: 2px solid var(--ink); border-radius: 9px; background: #5a0f19; color: #fff; font: 600 12px "JetBrains Mono"; box-shadow: inset 0 2px 0 #a33a48, inset 0 -4px 0 #3a0710; padding: 0; }
.k[aria-pressed="true"] { background: var(--gold); color: var(--ink); }

/* ---------- Lembar (panel/dialog) ---------- */
.tirai { position: fixed; inset: 0; z-index: 50; background: rgba(5, 12, 30, .6); display: flex; align-items: flex-end; justify-content: center; }
.lembar { width: 100%; max-height: 92dvh; display: flex; flex-direction: column; background: #3f74c8; border: 4px solid var(--ink); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: inset 0 0 0 3px var(--band-hi); overflow: hidden; }
.lembar-h { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; background: var(--band); border-bottom: 3px solid var(--ink); box-shadow: inset 0 -4px 0 var(--band-lo); }
.lembar-h h2 { font-size: 21px; flex: 1; min-width: 0; }
.lembar-b { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.lembar-b .aksi { position: sticky; bottom: -12px; display: flex; gap: 8px; padding: 8px 0 4px; background: #3f74c8; }
@media (min-width: 1180px) {
  .tirai { align-items: center; }
  .lembar { width: min(640px, 92vw); border-bottom: 4px solid var(--ink); border-radius: 16px; max-height: 88dvh; }
}
.pilih-tool { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 10px; font-size: 13px; }
.pilih-tool label, .cek { display: flex; align-items: center; gap: 6px; }
.item { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; }
.item p { margin: 0; font-size: 12px; color: var(--soft); overflow-wrap: anywhere; }

/* ---------- Notifikasi kecil ---------- */
.toasts { position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; max-width: 420px; width: 100%; padding: 8px 12px; background: var(--deep); border: 3px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 2px var(--gold), 0 4px 0 var(--ink); animation: masuk .2s ease-out; }
.toast b { font: 400 15px "Lilita One"; text-shadow: var(--outline); display: block; }
.toast span { font-size: 12px; color: var(--soft); }
@media (min-width: 1180px) { .toasts { left: auto; right: 18px; bottom: 18px; align-items: flex-end; } }
@keyframes masuk { from { transform: translateY(10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Masuk ---------- */
.masuk { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.masuk form { width: min(400px, 100%); }
.masuk-judul { align-items: center; gap: 4px; text-align: center; }
.masuk-judul h1 { font-size: 34px; line-height: 1; }
.masuk-judul p, .masuk-catatan { margin: 0; }
.masuk-catatan { text-align: center; }
.masuk-kotak { padding: 14px; }
.masuk-go { min-height: 56px; font-size: 22px; }
.field.otp { letter-spacing: 6px; font-family: "JetBrains Mono", monospace; }

/* ---------- 3D: kubus, tokoh, benteng (seni3d.js) ----------
   translate/rotate/scale dipakai sebagai properti terpisah supaya animasi `transform` tidak menimpa penempatan.
   Jangan beri filter/opacity/overflow pada leluhur preserve-3d: itu meratakan kubus jadi bidang datar. */
.kb, .pv, .p3, .adegan { position: absolute; transform-style: preserve-3d; }
.pv { left: 0; top: 0; width: 0; height: 0; translate: var(--x, 0px) var(--y, 0px) var(--z, 0px); }
.kb { left: 0; top: 0; width: var(--w); height: var(--h); margin: calc(var(--h) / -2) 0 0 calc(var(--w) / -2); translate: var(--x, 0px) var(--y, 0px) var(--z, 0px); }
.kb > .f { position: absolute; display: block; left: 0; top: 0; width: var(--w); height: var(--h); backface-visibility: hidden;
  background: linear-gradient(var(--sh, transparent), var(--sh, transparent)), var(--c); box-shadow: inset 0 0 0 1px rgba(10, 23, 51, .55); }
.kb > .f svg { display: block; width: 100%; height: 100%; }
.kb > .dp { transform: translateZ(calc(var(--d) / 2)); }
.kb > .bl { --sh: rgba(0, 0, 0, .45); transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.kb > .ki { --sh: rgba(0, 0, 0, .14); width: var(--d); left: calc((var(--w) - var(--d)) / 2); transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); }
.kb > .ka { --sh: rgba(0, 0, 0, .34); width: var(--d); left: calc((var(--w) - var(--d)) / 2); transform: rotateY(90deg) translateZ(calc(var(--w) / 2)); }
.kb > .at { --sh: rgba(255, 255, 255, .24); height: var(--d); top: calc((var(--h) - var(--d)) / 2); transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); }
  background: linear-gradient(var(--sh, transparent), var(--sh, transparent)), var(--c); transform: rotateY(var(--r)) translateZ(calc(var(--w) / 2)) rotateX(var(--a)); }

/* Semua animasi 3D ikut fase global: delay negatif = (fase + offset) detik, dan durasi membagi 60 */
.fig3, .dada3, .kd, .fd, .panggung, .hero3, .kartu, .btn.besar, .gul, .pion { --fz: calc((var(--fase, 0) + var(--o, 0)) * -1s); }
.fig3 *, .dada3 *, .kd *, .panggung .awan, .panggung .matahari, .hero3 .awan { animation-delay: var(--fz) !important; }
.st-kerja .lgn-n, .st-kerja .kk-n { animation-delay: calc(var(--fz) - .5s) !important; }
.adegan { left: 50%; top: 50%; width: 0; height: 0; scale: var(--sk, 1); transform: rotateX(-14deg) rotateY(-22deg); animation: putar 12s ease-in-out infinite; }
@keyframes putar { 0%, 100% { transform: rotateX(-14deg) rotateY(-24deg); } 50% { transform: rotateX(-14deg) rotateY(24deg); } }

/* Tokoh penuh */
.fig3 { position: relative; display: block; width: calc(92px * var(--sk, 1)); height: calc(112px * var(--sk, 1)); perspective: 700px; flex: none; pointer-events: none; }
.fig3 .adegan { top: 58%; }
.fig3 .bayang, .fd .bayang { position: absolute; left: 50%; bottom: calc(2px * var(--sk, 1)); width: calc(46px * var(--sk, 1)); height: calc(12px * var(--sk, 1)); margin-left: calc(-23px * var(--sk, 1)); border-radius: 50%; background: radial-gradient(rgba(10, 23, 51, .55), transparent 70%); }
.st-err .bayang { background: radial-gradient(rgba(226, 58, 68, .8), transparent 70%); }
.tubuh { animation: napas 4s ease-in-out infinite; }
@keyframes napas { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.kpl { animation: noleh 6s ease-in-out infinite; }
@keyframes noleh { 0%, 100% { transform: rotateY(-14deg) rotateX(2deg); } 50% { transform: rotateY(14deg) rotateX(-2deg); } }
.lgn-k { animation: ayunK 4s ease-in-out infinite; } .lgn-n { animation: ayunN 4s ease-in-out infinite; }
@keyframes ayunK { 0%, 100% { transform: rotateX(8deg) rotateZ(2deg); } 50% { transform: rotateX(-8deg) rotateZ(2deg); } }
@keyframes ayunN { 0%, 100% { transform: rotateX(-8deg) rotateZ(-2deg); } 50% { transform: rotateX(8deg) rotateZ(-2deg); } }
/* Bekerja: tubuh memantul, lengan memalu bergantian, kepala mengangguk, bola sihir mengorbit */
.st-kerja .tubuh { animation: loncat 1s ease-in-out infinite; }
@keyframes loncat { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-3px); } 75% { transform: translateY(1px); } }
.st-kerja .kpl { animation: angguk 1s ease-in-out infinite; }
@keyframes angguk { 0%, 100% { transform: rotateX(8deg); } 50% { transform: rotateX(-4deg) rotateY(6deg); } }
.st-kerja .lgn-k, .st-kerja .lgn-n { animation: palu 1s ease-in-out infinite; }
@keyframes palu { 0%, 100% { transform: rotateX(-125deg); } 50% { transform: rotateX(-35deg); } }
.st-kerja .kk-k, .st-kerja .kk-n { animation: langkah 1s ease-in-out infinite; }
@keyframes langkah { 0%, 100% { transform: rotateX(14deg); } 50% { transform: rotateX(-14deg); } }
.sihir { animation: orbit 3s linear infinite; }
@keyframes orbit { from { transform: rotateY(0) translateX(20px) rotateY(0); } to { transform: rotateY(360deg) translateX(20px) rotateY(-360deg); } }
.bola3 { animation: putarBola 2s linear infinite; }
@keyframes putarBola { from { transform: rotateX(0) rotateY(0); } to { transform: rotateX(360deg) rotateY(360deg); } }
.st-err .tubuh { animation: gemetar .4s linear infinite; }
@keyframes gemetar { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2.5px); } 75% { transform: translateX(2.5px); } }
.st-err .kpl { animation: tunduk 2s ease-in-out infinite; }
@keyframes tunduk { 0%, 100% { transform: rotateX(22deg); } 50% { transform: rotateX(14deg); } }

/* Dada di kartu */
.dada3 { position: relative; display: block; width: 78px; height: 78px; flex: none; overflow: hidden; perspective: 380px; background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .35), transparent 65%), var(--bg, #7fb0e8); }
.dada3 .adegan { top: 70%; scale: 1.12; animation-name: putarKecil; animation-duration: 6s; }
@keyframes putarKecil { 0%, 100% { transform: rotateX(-8deg) rotateY(-20deg); } 50% { transform: rotateX(-8deg) rotateY(20deg); } }
.kartu .dada3 { width: 78px; height: 78px; }
/* Hanya kartu 3D hidup (agent bekerja/error) yang bergerak; yang di luar layar dijeda (kelas .jeda dari royal.js) */
.dada3.jeda * { animation-play-state: paused !important; }
.kartu.sibuk { animation: denyutKartu 2s ease-in-out infinite; animation-delay: var(--fz, 0s); }
@keyframes denyutKartu { 0%, 100% { box-shadow: inset 0 0 0 2px var(--tier, var(--sonnet)), 0 3px 0 var(--ink), 0 0 0 0 rgba(255, 184, 37, 0); } 50% { box-shadow: inset 0 0 0 2px var(--tier, var(--sonnet)), 0 3px 0 var(--ink), 0 0 14px 3px rgba(255, 184, 37, .8); } }
.kartu-btn .kartu { transition: transform .18s cubic-bezier(.2, 1.4, .4, 1); }
@media (hover: hover) { .kartu-btn:hover .kartu { transform: translateY(-6px) rotate(-2deg) scale(1.06); } }
.kartu-btn:active .kartu { transform: scale(.95); }

/* Benteng */
.mk-3d { flex: none; display: block; width: 92px; height: 74px; }

/* Panggung arena battle */
.panggung { position: relative; width: min(100%, 390px); height: 310px; margin: 4px auto 0; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden;
  background: linear-gradient(#5aa8ff 0, #aee0ff 52%, #6fcf6a 52.5%, #3f9f45 100%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25), 0 4px 0 var(--ink); }
.matahari { position: absolute; right: 22px; top: 16px; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(#fff6c2, #ffd84a 60%, rgba(255, 216, 74, 0) 72%); animation: denyutMatahari 4s ease-in-out infinite; }
@keyframes denyutMatahari { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.awan { position: absolute; width: 74px; height: 22px; border-radius: 12px; background: #fff; opacity: .85; animation: awan 60s linear infinite; }
.awan::before { content: ""; position: absolute; left: 14px; top: -11px; width: 34px; height: 24px; border-radius: 50%; background: #fff; }
.awan.a1 { top: 22px; } .awan.a2 { top: 58px; animation-duration: 30s; transform: scale(.7); opacity: .7; } .awan.a3 { top: 36px; animation-duration: 20s; width: 56px; }
@keyframes awan { from { left: -90px; } to { left: 100%; } }
.pion { position: absolute; margin-left: -28px; display: flex; flex-direction: column; align-items: center; pointer-events: auto; }
.pion .fig3 { pointer-events: none; }
.pion .nm { font: 400 11px/1 "Lilita One"; text-shadow: var(--outline); margin-top: -6px; background: rgba(10, 23, 51, .55); border-radius: 6px; padding: 2px 5px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pion .gelembung { position: absolute; bottom: calc(100% - 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; font: 400 10px "Lilita One"; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 1px 6px; animation: melayang 2s ease-in-out infinite; animation-delay: var(--fz, 0s); z-index: 3; }
.pion .gelembung::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -4px; border: 4px solid transparent; border-top-color: var(--ink); }
@keyframes melayang { 0%, 100% { margin-bottom: 0; } 50% { margin-bottom: 4px; } }
.pion:active .fig3 { transform: scale(.94); }
.hero3 { position: relative; height: 190px; overflow: hidden; border: 3px solid var(--ink); border-radius: 14px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  background: linear-gradient(#5aa8ff, #aee0ff 62%, #6fcf6a 62.5%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.hero3 .awan.a1 { top: 12px; } .hero3 .awan.a3 { top: 40px; }
.hero3 .fig3 .bayang { background: radial-gradient(rgba(10, 23, 51, .6), transparent 70%); }

/* Gerak antarmuka: masuk layar bertahap, tombol Serbu berdenyut, XP mengisi, lencana berdenyut */
.pindah .view .isi > * { animation: masukLayar .4s cubic-bezier(.2, 1.1, .4, 1) both; }
.pindah .view .isi > *:nth-child(2) { animation-delay: .05s; } .pindah .view .isi > *:nth-child(3) { animation-delay: .1s; }
.pindah .view .isi > *:nth-child(4) { animation-delay: .15s; } .pindah .view .isi > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes masukLayar { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.pindah .grid-kartu .kartu { animation: bagiKartu .45s cubic-bezier(.2, 1.2, .4, 1) both; }
.pindah .grid-kartu > :nth-child(2) .kartu { animation-delay: .06s; } .pindah .grid-kartu > :nth-child(3) .kartu { animation-delay: .12s; }
.pindah .grid-kartu > :nth-child(4) .kartu { animation-delay: .18s; } .pindah .grid-kartu > :nth-child(n+5) .kartu { animation-delay: .24s; }
@keyframes bagiKartu { from { opacity: 0; transform: translateY(-30px) rotate(-8deg) scale(.8); } }
.pindah .bar i { animation: isiBar .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
@keyframes isiBar { from { transform: scaleX(0); } }
.pindah .tab.on svg, .pindah .ri.on svg { animation: lompat .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes lompat { 0% { transform: translateY(0) scale(.8); } 60% { transform: translateY(-12px) scale(1.15); } 100% { transform: translateY(-6px) scale(1); } }
.btn.y.besar { animation: denyutTombol 2.4s ease-in-out infinite; animation-delay: var(--fz, 0s); }
@keyframes denyutTombol { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18) drop-shadow(0 0 8px rgba(255, 184, 37, .8)); } }
.bdg { animation: denyutLencana 1.6s ease-in-out infinite; }
@keyframes denyutLencana { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.gul svg { animation: goyangGulung 3s ease-in-out infinite; animation-delay: var(--fz, 0s); transform-origin: 50% 90%; }
@keyframes goyangGulung { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.lembar { animation: naikLembar .28s cubic-bezier(.2, 1.1, .4, 1); }
@keyframes naikLembar { from { transform: translateY(40px); opacity: 0; } }
.tirai { animation: munculTirai .2s ease-out; }
@keyframes munculTirai { from { background: rgba(5, 12, 30, 0); } }
.toast { animation: masuk .3s cubic-bezier(.2, 1.4, .4, 1); }
.panggung .awan, .hero3 .awan { animation-delay: var(--fz, 0s); }

/* ---------- Efek aksi (gerak.js) ---------- */
#fx { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
#fx .pt { position: absolute; width: var(--u); height: var(--u); margin: calc(var(--u) / -2); background: var(--c); animation: ledak .8s cubic-bezier(.15, .7, .3, 1) forwards; }
#fx .pt.bintang { clip-path: polygon(50% 0, 62% 38%, 100% 38%, 69% 60%, 81% 100%, 50% 75%, 19% 100%, 31% 60%, 0 38%, 38% 38%); width: calc(var(--u) * 1.7); height: calc(var(--u) * 1.7); margin: calc(var(--u) * -.85); }
#fx .pt.kertas { width: var(--u); height: calc(var(--u) * 1.6); border-radius: 1px; animation-duration: 1.05s; }
#fx .pt.asap { border-radius: 50%; opacity: .8; }
@keyframes ledak { 0% { transform: translate(0, 0) rotate(0) scale(.4); opacity: 1; } 15% { opacity: 1; transform: translate(calc(var(--dx) * .35), calc(var(--dy) * .35)) rotate(calc(var(--r) * .3)) scale(1.1); }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(.2); opacity: 0; } }
.banner-fx { position: fixed; left: 50%; top: 22%; z-index: 91; pointer-events: none; text-align: center; transform: translateX(-50%); animation: bannerMasuk 2s cubic-bezier(.2, 1.3, .4, 1) forwards; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.banner-fx b { display: block; font: 400 clamp(34px, 11vw, 64px)/1 "Lilita One"; letter-spacing: 1px; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink), 0 0 24px var(--glow, #ffb825); padding: 4px 18px; }
.banner-fx span { font: 400 15px "Lilita One"; text-shadow: var(--outline); background: rgba(10, 23, 51, .75); border-radius: 8px; padding: 3px 10px; }
.banner-fx.menang { --glow: #ffb825; } .banner-fx.naik { --glow: #5fe0ff; } .banner-fx.gagal { --glow: #e23a44; } .banner-fx.gagal b { color: #ffb3b8; } .banner-fx.serbu { --glow: #ffd973; }
@keyframes bannerMasuk { 0% { transform: translateX(-50%) scale(.2) rotate(-8deg); opacity: 0; } 18% { transform: translateX(-50%) scale(1.15) rotate(2deg); opacity: 1; } 28% { transform: translateX(-50%) scale(1) rotate(0); }
  80% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) scale(1.1) translateY(-30px); opacity: 0; } }
.getar { animation: getar .42s cubic-bezier(.36, .07, .19, .97) both !important; }
@keyframes getar { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.tekan { animation: tekan .26s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes tekan { 0% { transform: scale(1); } 35% { transform: scale(.9); } 100% { transform: scale(1); } }
.kartu-btn.tekan { animation: none; } .kartu-btn.tekan .kartu { animation: tekan .26s cubic-bezier(.3, 1.8, .5, 1); }
.tab.tekan svg, .ri.tekan svg { animation: tekan .3s cubic-bezier(.3, 1.8, .5, 1); } .tab.tekan, .ri.tekan { animation: none; }

/* Chat: pesan baru muncul, izin baru berayun, tombol kirim terbang, lampiran */
.pesan-list > .baru { animation: pesanBaru .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pesanBaru { from { opacity: 0; transform: translateY(16px) scale(.96); } }
#izin .izin-kartu.baru { animation: izinBaru .6s cubic-bezier(.2, 1.5, .4, 1); transform-origin: top center; }
@keyframes izinBaru { 0% { opacity: 0; transform: translateY(-24px) rotate(-3deg); } 40% { opacity: 1; transform: rotate(2deg); } 60% { transform: rotate(-1.5deg); } 80% { transform: rotate(.8deg); } 100% { transform: none; } }
.composer { flex-wrap: wrap; position: relative; }
.composer.seret { outline: 3px dashed var(--gold); outline-offset: -6px; background: #1a3570; }
.composer.seret::after { content: "Lepas berkas di sini"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 400 15px "Lilita One"; text-shadow: var(--outline); background: rgba(15, 35, 80, .85); pointer-events: none; }
.btn.terbang svg { animation: terbang .5s ease-in forwards; }
@keyframes terbang { to { transform: translate(26px, -26px) scale(.4) rotate(20deg); opacity: 0; } }
.lamp-baris { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.msg .lamp-baris { flex-basis: auto; }
.chip-lamp { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 28px; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 9px; background: #24498f; font: 400 12px "Lilita One"; color: #fff; animation: pesanBaru .3s cubic-bezier(.2, 1.4, .4, 1); }
.chip-lamp > span { min-width: 0; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-lamp button { width: 20px; height: 20px; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: var(--red); color: #fff; font: 400 13px/14px "Lilita One"; }
a.chip-lamp:hover { background: #3a68c2; }

/* Benteng dan tokoh diam (SVG, seni3d.js datar()): satu layer, bukan ratusan sisi kubus. Hanya bendera, api obor, dan jendela
   gerbang yang bergerak, di SVG .efek yang kecil; tokoh hanya bernapas pelan. */
.kd { position: relative; display: block; width: 300px; height: 250px; margin: 0 auto; }
.kd.mini { width: 92px; height: 74px; }
.kd svg { position: absolute; left: 0; top: 0; overflow: visible; }
.panggung .kd { position: absolute; left: 50%; top: 6px; margin-left: -150px; }
.kd .efek .kibar { transform-box: fill-box; transform-origin: 0 50%; animation: kibarDatar 2s ease-in-out infinite; }
@keyframes kibarDatar { 0%, 100% { transform: skewY(-5deg) scaleX(.96); } 50% { transform: skewY(5deg) scaleX(1.03); } }
.kd .efek .api { animation: apiDatar .5s steps(2, end) infinite; }
@keyframes apiDatar { 0% { opacity: 1; } 100% { opacity: .55; } }
.kd .efek .nyala { animation: kedipDatar 4s ease-in-out infinite; }
@keyframes kedipDatar { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
.kd .efek .api.o2 { animation-delay: calc(var(--fz) - .25s) !important; } .kd .efek .nyala.o2 { animation-delay: calc(var(--fz) - 2s) !important; }
.fd { position: relative; display: block; width: calc(92px * var(--sk, 1)); height: calc(112px * var(--sk, 1)); flex: none; pointer-events: none; animation: bobDatar 4s ease-in-out infinite; }
.fd svg { position: absolute; left: 0; top: 0; }
@keyframes bobDatar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }

/* News: berita dan CVE dari luar */
a.berita { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; color: inherit; text-decoration: none; }
a.berita.rel { box-shadow: inset 4px 0 0 var(--gold); }
a.berita.bahaya { box-shadow: inset 4px 0 0 var(--red); }
.ellip3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* SDLC */
.alur { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.vs { display: inline-flex; align-items: center; gap: 4px; font: 400 13px "Lilita One"; text-shadow: var(--outline); }
.masuk-ikon { display: block; margin: 0 auto; border-radius: 24px; box-shadow: 0 4px 0 var(--ink), 0 8px 18px rgba(0, 0, 0, .35); }

/* Tombol + di kartu koleksi: area ketuk diperluas tanpa mengubah ukuran gambarnya, dan label "bekerja" tidak tertimpa */
.tambah::after { content: ""; position: absolute; inset: -9px; }
div:has(> .tambah) .kartu .kerja { right: 32px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Daftar News: satu kolom di HP, dua kolom di layar lebar supaya baris tidak sepanjang layar */
.berita-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 900px) { .berita-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Tombol musik latar di bilah atas dan penggeser volume */
.musik-btn { width: 38px; min-height: 38px; height: 38px; padding: 0; flex: none; }
.musik-btn[aria-pressed="true"] { background: var(--purple, #a46bff); }
input[type="range"] { width: 100%; accent-color: var(--gold); }
