/* Kerajaan Mabar: Javanese royal palette (sogan brown, maroon, gold, cream parchment), Cinzel + Alegreya Sans,
   batik kawung borders, carved-wood dock. */
:root {
  --sogan: #3B2414; --sogan-2: #5B3A21; --sogan-3: #7A5638; --muted: #7A6450;
  --maroon: #8E2B1E; --maroon-d: #6E1F15; --gold: #C99A2E; --gold-l: #E8C766; --gold-d: #9C7418;
  --cream: #FBF3E2; --parchment: #F3E4C6; --line: #E2CFA8; --jade: #2F6F5E; --indigo: #2B3A67;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 6px 20px rgba(59, 36, 20, .22), 0 1px 3px rgba(59, 36, 20, .2);
  --kawung: radial-gradient(circle at 0 0, transparent 7px, var(--gold) 7.5px, var(--gold) 8.5px, transparent 9px) 0 0 / 16px 16px,
            radial-gradient(circle at 16px 16px, transparent 7px, var(--gold) 7.5px, var(--gold) 8.5px, transparent 9px) 0 0 / 16px 16px,
            radial-gradient(circle at 8px 8px, var(--gold) 1.6px, transparent 2px) 0 0 / 16px 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #BDE6F7; font-family: var(--body); color: var(--sogan); -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#kota { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; cursor: grab; }
#kota:active { cursor: grabbing; }

/* ---------- HUD ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 15px; border-radius: 999px; border: 2px solid var(--gold);
  background: linear-gradient(var(--cream), var(--parchment)); box-shadow: var(--shadow); font-weight: 800; font-size: 15px; white-space: nowrap; color: var(--sogan); }
.hud-top { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; z-index: 5; }
.hud-top > *, .hud-right > * { pointer-events: auto; }
.hud-right { display: flex; gap: 8px; }
.brand { font-family: var(--display); font-weight: 800; letter-spacing: .04em; color: var(--maroon); padding: 0 16px 0 10px; }
.brand .logo { font-size: 18px; }
.stat { font-variant-numeric: tabular-nums; }
.iconbtn { width: 40px; justify-content: center; padding: 0; font-size: 17px; }
.raid-pill { position: fixed; top: calc(max(12px, env(safe-area-inset-top)) + 50px); left: 50%; transform: translateX(-50%); z-index: 5;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; width: min(310px, calc(100vw - 24px)); padding: 8px 14px;
  border: 2px solid var(--gold); border-radius: 14px; background: linear-gradient(var(--maroon), var(--maroon-d)); color: var(--cream); box-shadow: var(--shadow); text-align: left; }
.raid-pill b { font-size: 13px; font-family: var(--display); letter-spacing: .02em; } .raid-pill small { font-size: 11.5px; color: var(--gold-l); font-weight: 800; text-align: right; }
.raid-pill .hp { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: rgba(0,0,0,.35); overflow: hidden; }
.raid-pill .hp i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-d), var(--gold-l)); transition: width .5s; }
.raid-pill.won { background: linear-gradient(var(--jade), #234F44); }
.ticker { position: fixed; top: calc(max(12px, env(safe-area-inset-top)) + 106px); left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--sogan); color: var(--cream); border: 1.5px solid var(--gold); font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow);
  max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: pop .35s ease-out; }
.zoom { position: fixed; right: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.zoom button { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--gold); background: var(--cream); box-shadow: var(--shadow); font-size: 20px; font-weight: 800; color: var(--sogan); }

/* carved-wood dock */
.dock { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 2px; padding: 6px 8px; border-radius: 22px;
  background: linear-gradient(180deg, var(--sogan-2), var(--sogan)); border: 2px solid var(--gold); box-shadow: var(--shadow), inset 0 1px 0 rgba(232,199,102,.35);
  width: min(540px, calc(100vw - 16px)); }
.dbtn { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 54px;
  border: 0; border-radius: 16px; background: transparent; padding: 0 4px; color: var(--cream); }
.dbtn:hover { background: rgba(232,199,102,.12); }
.dbtn .ic { font-size: 20px; line-height: 1; }
.dbtn .lb { font-size: 11.5px; font-weight: 800; letter-spacing: .03em; color: var(--gold-l); }
.dbtn .dot { position: absolute; top: 5px; right: calc(50% - 20px); width: 10px; height: 10px; border-radius: 50%; background: #E8553E; box-shadow: 0 0 0 2px var(--sogan); }
.dbtn.cta .lb { color: #fff; } .dbtn.cta { background: rgba(142,43,30,.6); }
.naga-btn { flex: 0 0 76px; height: 76px; margin-top: -30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #F6D66A, var(--gold) 55%, var(--gold-d));
  box-shadow: 0 6px 18px rgba(59,36,20,.45), inset 0 -5px 0 rgba(0,0,0,.15); border: 4px solid var(--maroon); }
.naga-btn:hover { background: radial-gradient(circle at 35% 30%, #F9E08A, #EBC04F 55%, #B8861E); }
.naga-btn .ic { font-size: 28px; } .naga-btn .lb { color: var(--maroon); }
.naga-btn .dot { right: 4px; top: 2px; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(30, 18, 10, .38); animation: fade .2s ease-out; }
.sheet-card { position: relative; width: min(540px, 100vw); max-height: min(88vh, 780px); overflow: auto; background: var(--cream);
  border-radius: 22px 22px 0 0; padding: 26px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.25);
  border: 2px solid var(--gold); border-bottom: 0; animation: up .28s cubic-bezier(.2,.9,.3,1.1); }
.sheet-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; border-radius: 20px 20px 0 0; background: var(--kawung), var(--maroon); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-card { border-radius: 22px; border-bottom: 2px solid var(--gold); } }
.x { position: absolute; top: 20px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gold); background: var(--parchment); font-size: 22px; line-height: 1; color: var(--sogan); }
.sheet h2 { margin: 0 40px 6px 0; font-family: var(--display); font-size: 22px; line-height: 1.2; color: var(--maroon); letter-spacing: .01em; }
.sheet h3 { font-family: var(--display); color: var(--sogan); }
.sheet p { margin: 6px 0; color: var(--sogan-2); line-height: 1.5; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-d); margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 13.5px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px;
  border: 2px solid var(--gold); font-weight: 800; font-size: 15px; text-decoration: none; background: var(--sogan); color: var(--cream); }
.btn.red { background: linear-gradient(var(--maroon), var(--maroon-d)); color: #fff; }
.btn.red:hover { background: var(--maroon-d); }
.btn.gold { background: linear-gradient(#F0CF6A, var(--gold)); color: var(--sogan); }
.btn.ghost { background: var(--parchment); color: var(--sogan); }
.btn.block { width: 100%; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: default; }
.row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.row > .btn { flex: 1; }
.steps { margin: 14px 0 4px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 10px 0 10px 44px; border-bottom: 1px dashed var(--line); line-height: 1.45; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 8px; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--sogan); font-family: var(--display); font-weight: 800; display: grid; place-items: center; }
.kw { display: inline-block; background: var(--maroon); color: #fff; font-weight: 800; padding: 1px 8px; border-radius: 6px; letter-spacing: .05em; }
.code { font-size: 32px; font-weight: 800; font-family: var(--display); letter-spacing: .08em; text-align: center; background: var(--parchment); border: 2px dashed var(--gold); border-radius: 16px; padding: 14px; margin: 12px 0; user-select: all; }
.story { background: var(--parchment); border-left: 4px solid var(--maroon); padding: 10px 14px; border-radius: 0 12px 12px 0; font-style: italic; color: var(--sogan-2); }

.tabs { display: flex; gap: 4px; background: var(--parchment); padding: 4px; border-radius: 999px; margin: 12px 0 6px; border: 1.5px solid var(--line); }
.tabs button { flex: 1; height: 38px; border: 0; border-radius: 999px; background: transparent; font-weight: 800; font-size: 13.5px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--sogan); color: var(--gold-l); }

/* cards and lists */
.vote-list, .games, .jobs, .projects { display: grid; gap: 10px; margin-top: 12px; }
.vopt { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; border: 2px solid var(--line); background: #fff; }
.vopt.mine { border-color: var(--maroon); background: #FFF6F0; }
.vopt canvas, .pcard canvas { width: 96px; height: 80px; background: linear-gradient(#EAF4F8, #F3E4C6); border-radius: 12px; }
.vopt h3, .pcard h3 { margin: 0; font-size: 16px; }
.vopt p, .pcard p { margin: 2px 0 6px; font-size: 13px; }
.bar { height: 8px; border-radius: 99px; background: var(--parchment); overflow: hidden; margin: 6px 0 8px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s; }
.vopt.mine .bar i { background: var(--maroon); }
.vmeta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--sogan-2); }
.history { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.history li { font-size: 13.5px; color: var(--sogan-2); margin: 4px 0; }
.effect { display: inline-block; font-size: 12px; font-weight: 800; color: var(--jade); background: #E3F2EC; padding: 2px 8px; border-radius: 99px; margin: 2px 0 6px; }
.burned { color: var(--maroon); background: #FBE3DF; }
.igtip { margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(90deg, #FDF1E4, #F8E4F0); border: 1.5px dashed #D07AA0; font-size: 13.5px; }

.pcard { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; border-radius: 18px; border: 2px solid var(--line); background: #fff; }
.mats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px; margin: 6px 0; }
.mat { font-size: 13px; font-weight: 700; display: grid; grid-template-columns: auto 1fr; gap: 2px 6px; align-items: center; }
.mat .bar { grid-column: 1 / -1; margin: 0; height: 6px; }
.inv { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.inv span { font-weight: 800; font-size: 14px; background: var(--parchment); border: 1.5px solid var(--line); padding: 4px 10px; border-radius: 99px; font-variant-numeric: tabular-nums; }

.jcard { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: 18px; border: 2px solid var(--line); background: #fff; }
.jcard .gi, .gcard .gi { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: var(--parchment); border: 1.5px solid var(--gold); }
.jcard b, .gcard b { font-size: 15.5px; } .jcard span, .gcard span { font-size: 13px; color: var(--sogan-2); }
.shift { margin-top: 12px; padding: 14px; border-radius: 18px; background: linear-gradient(var(--parchment), #fff); border: 2px solid var(--gold); }
.shift .big { font-family: var(--display); font-size: 20px; color: var(--maroon); font-weight: 800; }
.gcard { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: 18px; border: 2px solid var(--line); background: #fff; }
.gcard .btn { height: 38px; padding: 0 14px; font-size: 13.5px; }
.left-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.left-pills span { font-size: 12.5px; font-weight: 800; background: var(--parchment); padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); }

.house-hero { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: center; margin-top: 8px; }
.house-hero canvas { width: 140px; height: 112px; border-radius: 16px; background: linear-gradient(#EAF4F8, #F3E4C6); border: 2px solid var(--line); }
.tier { display: flex; gap: 4px; margin: 4px 0; } .tier i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); } .tier i.on { background: var(--gold); }

/* districts */
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.dcard { text-align: left; border: 2px solid var(--line); border-radius: 18px; padding: 14px; background: #fff; display: grid; gap: 4px; }
.dcard:hover { border-color: var(--c); }
.dcard .sw { width: 34px; height: 34px; border-radius: 10px; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0,0,0,.15); border: 2px solid var(--gold); }
.dcard b { font-size: 16px; font-family: var(--display); } .dcard span { font-size: 13px; color: var(--sogan-2); } .dcard small { font-size: 12px; color: var(--muted); font-weight: 700; }

/* info */
.who { display: flex; gap: 12px; align-items: center; }
.ava { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 24px; background: var(--c, var(--maroon)); box-shadow: inset 0 -6px 0 rgba(0,0,0,.15); border: 2px solid var(--gold); flex: none; }
.chip { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--parchment); color: var(--sogan-2); }
.chip.c { background: var(--c); color: #fff; }
.facts { margin: 14px 0 0; display: grid; gap: 8px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 700; text-align: right; }
.stats { display: grid; gap: 8px; margin-top: 12px; }
.stat-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; font-weight: 700; }
.stat-row .bar { margin: 0; height: 10px; } .stat-row .bar i { background: var(--jade); }
.xpbar { height: 10px; border-radius: 99px; background: var(--parchment); overflow: hidden; margin: 8px 0 2px; } .xpbar i { display: block; height: 100%; background: var(--gold); }
.hp-meta { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--sogan-2); }
.naga-hero { width: 100%; height: 170px; display: block; border-radius: 18px; background: linear-gradient(#BDE6F7, #F3E4C6); margin: 10px 0; border: 2px solid var(--line); }
.big-hp { height: 14px; border-radius: 99px; background: var(--parchment); overflow: hidden; margin: 6px 0; } .big-hp i { display: block; height: 100%; background: linear-gradient(90deg, var(--maroon), var(--gold)); border-radius: 99px; }
.board { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.board li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 8px 12px; border-radius: 12px; background: var(--parchment); }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 12px; }
.vs .side { background: var(--parchment); border-radius: 16px; padding: 12px; font-size: 13.5px; border: 1.5px solid var(--line); }
.vs .side b { display: block; font-size: 15px; margin-bottom: 4px; } .vs .mid { font-weight: 800; color: var(--maroon); font-family: var(--display); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; height: min(46vh, 380px); overflow-y: auto; padding: 8px; border-radius: 16px; background: var(--parchment); border: 1.5px solid var(--line); }
.msg { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: start; padding: 6px 8px; border-radius: 12px; background: #fff; }
.msg .ava { width: 30px; height: 30px; font-size: 13px; border-radius: 10px; border-width: 1.5px; }
.msg b { font-size: 13px; } .msg time { font-size: 11px; color: var(--muted); margin-left: 6px; }
.msg p { margin: 1px 0 0; font-size: 14px; color: var(--sogan); word-break: break-word; }
.msg .rep { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 2px 4px; }
.msg.me { background: #FFF6E3; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input { flex: 1; min-width: 0; height: 46px; border-radius: 999px; border: 2px solid var(--line); background: #fff; padding: 0 16px; font-weight: 600; outline: none; }
.chat-form input:focus { border-color: var(--gold); }
.chat-rules { font-size: 12px; color: var(--muted); margin-top: 6px; }
.chat-err { color: var(--maroon); font-weight: 700; font-size: 13px; margin-top: 6px; min-height: 1em; }
.search-form { display: flex; gap: 8px; margin-top: 12px; }
.search-form input { flex: 1; height: 46px; border-radius: 999px; border: 2px solid var(--line); padding: 0 16px; font-weight: 600; outline: none; }

/* serat kawula */
.kawula canvas { width: 100%; height: auto; border-radius: 14px; box-shadow: 0 10px 30px rgba(59,36,20,.3); display: block; margin-top: 10px; }

/* play overlay */
.play { position: fixed; inset: 0; z-index: 40; background: #1E1B16; }
.play[hidden] { display: none; }
.play canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.play-x { position: absolute; z-index: 2; top: auto; left: auto; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
.play-result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 32px)); background: var(--cream);
  border-radius: 22px; padding: 26px 22px 22px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.4); border: 2px solid var(--gold); animation: pop2 .3s ease-out; overflow: hidden; }
.play-result::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--kawung), var(--maroon); }
.play-result[hidden] { display: none; }
.play-result h2 { margin: 4px 0 8px; font-size: 26px; font-family: var(--display); color: var(--maroon); }
.play-result .gain { font-size: 18px; font-weight: 800; color: var(--jade); margin: 6px 0; }
.play-result .row { justify-content: center; }
.play-result .num { font-variant-numeric: tabular-nums; }
.play-result.lvl { box-shadow: 0 0 0 4px var(--gold), 0 20px 50px rgba(0,0,0,.4); }

.toast { position: fixed; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 84px); transform: translateX(-50%); z-index: 30;
  background: var(--sogan); color: var(--cream); border: 1.5px solid var(--gold); padding: 12px 18px; border-radius: 16px; font-weight: 700; font-size: 14.5px; box-shadow: var(--shadow);
  max-width: calc(100vw - 24px); animation: pop .3s ease-out; }
.toast[hidden] { display: none; }

@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateX(-50%) scale(.9); opacity: 0; } }
@keyframes pop2 { from { transform: translate(-50%, -50%) scale(.9); opacity: 0; } }
@media (max-width: 480px) {
  .pill { height: 36px; padding: 0 11px; font-size: 13.5px; }
  .brand { font-size: 13.5px; }
  .dbtn .lb { font-size: 10.5px; }
  .naga-btn { flex-basis: 66px; height: 66px; }
  .zoom { top: auto; bottom: 104px; transform: none; }
  .zoom button { width: 38px; height: 38px; }
  #clock { display: none; }
  .stat-row { grid-template-columns: 96px 1fr 36px; }
  .house-hero { grid-template-columns: 110px 1fr; } .house-hero canvas { width: 110px; height: 90px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Phase 1: pasar, hadiah, dicari, perbaikan, rampasan ---------- */
.chip.hot { background: #FCE3D2; color: #A2401C; border: 1px solid #E8A27A; }
.mat.hot > span:first-child { filter: drop-shadow(0 0 4px #F08A4B); }
.market { display: grid; gap: 8px; margin-top: 12px; }
.mrow { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line); background: #fff; }
.mrow.hot { border-color: #E8A27A; background: linear-gradient(90deg, #FFF6EE, #fff); }
.mrow .gi { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--parchment); border: 1.5px solid var(--gold); }
.mrow span { font-size: 13px; color: var(--sogan-2); }
.mbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.gift { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: 8px 0 4px; padding: 12px 14px; border-radius: 16px; background: var(--parchment); border: 2px dashed var(--line); }
.gift.ready { border: 2px solid var(--gold); background: linear-gradient(90deg, #FFF3D6, #FBF3E2); }
.gift span { font-size: 13px; color: var(--sogan-2); }
.streak { display: flex; gap: 4px; margin-top: 6px; }
.streak i { font-style: normal; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: #fff; border: 1.5px solid var(--line); color: var(--sogan-2); }
.streak i.on { background: var(--gold); border-color: var(--gold); color: #fff; }
.pcard.repair { border-color: #E8A27A; background: linear-gradient(#FFF6EE, #fff); }
.spoils { margin: 10px 0 0; padding: 10px 12px; border-radius: 14px; background: linear-gradient(90deg, #FFF3D6, #FBF3E2); border: 1.5px solid var(--gold); font-size: 14px; }

/* ---------- Phase 2: Mitra ---------- */
.mtag { display: inline-block; vertical-align: middle; font: 800 10px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 99px; background: var(--m2); color: var(--m1); border: 1px solid var(--m1); }
.mcredit { display: block; width: 100%; text-align: left; margin: 8px 0; padding: 8px 12px; border-radius: 12px; border: 0; cursor: pointer; font: inherit; font-size: 13.5px; background: var(--m1); color: var(--m2); }
.mcredit b { color: var(--m2); } .mcredit span:not(.mtag) { font-size: 12.5px; opacity: .95; }
.mlist { display: grid; gap: 6px; } .mlist .mcredit { margin: 0; }
.mhero { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: linear-gradient(135deg, var(--m1), color-mix(in srgb, var(--m1) 70%, #000)); color: var(--m2); }
.mhero h2 { color: var(--m2); margin: 0 0 4px; } .mhero p { margin: 0; color: var(--m2); opacity: .92; }
.mhero canvas { width: 150px; height: 100px; border-radius: 12px; background: linear-gradient(#EAF4F8, #F3E4C6); }
.moffer { margin: 12px 0 4px; padding: 12px 14px; border-radius: 14px; border: 2px dashed var(--m1); background: color-mix(in srgb, var(--m2) 18%, #fff); font-weight: 700; }
.mitem { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; margin: 12px 0 0; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--m1); background: color-mix(in srgb, var(--m2) 14%, #fff); }
.mitem .gi { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--m1); }
.mitem span { font-size: 13px; color: var(--sogan-2); }
.linkish { border: 0; background: none; padding: 0; font: inherit; font-weight: 800; color: var(--maroon); text-decoration: underline; cursor: pointer; }
@media (max-width: 520px) { .mhero { grid-template-columns: 1fr; } .mhero canvas { width: 100%; height: auto; } }

/* ---------- Phase 3: Babad, Prasasti ---------- */
.lontar-slots { display: flex; gap: 6px; margin: 10px 0 4px; flex-wrap: wrap; }
.lontar-slots i { font-style: normal; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--parchment); border: 1.5px dashed var(--line); color: var(--sogan-2); }
.lontar-slots i.on { border: 1.5px solid var(--gold); background: #FFF3D6; }
.lontar { margin: 10px 0; padding: 10px 14px; border-left: 4px solid var(--gold); background: linear-gradient(90deg, #FFF3D6, #FBF3E2); border-radius: 0 12px 12px 0; font-style: italic; font-size: 14px; }
.lontar b { font-style: normal; color: var(--maroon); }
.babad-ch h3 { margin: 6px 0; font-size: 15px; color: var(--maroon); }
.babad-ch ul { margin: 4px 0; padding-left: 18px; font-size: 14px; }
.babad-ch .teaser { font-weight: 700; font-size: 13.5px; }
.babad-old, .lontar-all { margin: 6px 0; padding: 8px 12px; border-radius: 12px; background: var(--parchment); border: 1.5px solid var(--line); }
.babad-old summary, .lontar-all summary { cursor: pointer; font-weight: 800; }
.prasasti { list-style: none; margin: 12px 0 0; padding: 14px; display: grid; gap: 8px; border-radius: 16px; background: linear-gradient(#77716A, #5F5A54); color: #F3E9C6; }
.prasasti li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(232,199,102,0.25); }
.prasasti li:last-child { border-bottom: 0; padding-bottom: 0; }
.prasasti b { color: #E8C766; } .prasasti span { font-size: 12px; opacity: .8; }
.prasasti q { grid-column: 1 / -1; font-size: 13.5px; font-style: italic; }
.spoils.boss { border-color: #C0392B; background: linear-gradient(90deg, #FCE3D2, #FBF3E2); }
