/* ==========================================================================
   Kerajaan Kadiri — gaya utama
   ========================================================================== */
:root {
  --bg: #f7f0e1; --bg2: #efe4cb; --surface: #fffaf0; --surface2: #fbf3e1;
  --ink: #2b2218; --ink2: #51432f; --muted: #6f5f49;
  --line: rgba(80, 55, 20, .18);
  --gold: #8a5c0c; --gold-fill: #c98f2a; --gold-soft: rgba(201, 143, 42, .16);
  --accent: #9a3b1e; --jade: #1f6f66;
  --shadow: 0 10px 34px rgba(60, 40, 10, .16);
  --radius: 16px;
  --f-display: "Cinzel", "Trajan Pro", Georgia, serif;
  --f-head: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --f-body: "Lora", Georgia, "Times New Roman", serif;
  --f-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 66px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1a1f; --bg2: #13232a; --surface: #172a32; --surface2: #1c3340;
  --ink: #f3ead4; --ink2: #d7cbb0; --muted: #a99e86;
  --line: rgba(240, 210, 150, .16);
  --gold: #e6b95f; --gold-fill: #e0b25c; --gold-soft: rgba(230, 185, 95, .14);
  --accent: #e58a5f; --jade: #58c1aa;
  --shadow: 0 10px 34px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
.dark {
  --bg: #0f1a1f; --bg2: #13232a; --surface: #172a32; --surface2: #1c3340;
  --ink: #f3ead4; --ink2: #d7cbb0; --muted: #a99e86;
  --line: rgba(240, 210, 150, .18);
  --gold: #e6b95f; --gold-fill: #e0b25c; --gold-soft: rgba(230, 185, 95, .14);
  --accent: #e58a5f; --jade: #58c1aa;
  --shadow: 0 10px 34px rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); font-size: 17px; -webkit-text-size-adjust: 100%; }
html[data-font="l"] { font-size: 19px; }
html[data-font="xl"] { font-size: 21px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); line-height: 1.75; overflow-x: hidden;
  transition: background .35s, color .35s;
}
img, svg { max-width: 100%; }
img { display: block; height: auto; }
a { color: var(--gold); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.15; margin: 0; font-weight: 700; }
:focus-visible { outline: 3px solid var(--gold-fill); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--gold-fill); color: #1a1208; padding: 10px 16px; border-radius: 8px; font-family: var(--f-ui); font-weight: 600; transition: top .2s; }
.skip:focus { top: 12px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.wrap.narrow { width: min(820px, 100% - 40px); }

/* ---------- Loader & progress ---------- */
.loader { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #1b2f39, #0a1216); color: #f3ead4; transition: opacity .6s, visibility .6s; animation: loaderFallback .01s 4.5s forwards; }
.loader.hide { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; font-family: var(--f-display); letter-spacing: .18em; font-size: .8rem; }
.loader-inner img { margin: 0 auto 18px; animation: spin 2.4s ease-in-out infinite; filter: drop-shadow(0 0 16px rgba(230, 185, 95, .55)); }
.loader .bar { display: block; width: 180px; height: 3px; margin: 14px auto 0; background: rgba(255, 255, 255, .14); border-radius: 3px; overflow: hidden; }
.loader .bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, #e6b95f, transparent); animation: slide 1.2s linear infinite; }
@keyframes spin { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(180deg); } }
@keyframes slide { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
@keyframes loaderFallback { to { opacity: 0; visibility: hidden; } }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 250; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c98f2a, #f3d28a, #c98f2a); box-shadow: 0 0 10px rgba(230, 185, 95, .7); }

/* ---------- Navigasi ---------- */
.nav { position: fixed; z-index: 200; top: 0; left: 0; right: 0; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 clamp(14px, 3vw, 32px); color: #f3ead4; transition: background .3s, box-shadow .3s, backdrop-filter .3s; }
.nav.solid { background: rgba(15, 26, 31, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 4px 24px rgba(0, 0, 0, .3); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-family: var(--f-display); font-weight: 700; letter-spacing: .12em; font-size: 1.05rem; line-height: 1.1; flex: none; }
.brand small { display: block; font-family: var(--f-ui); font-weight: 400; letter-spacing: .06em; font-size: .64rem; opacity: .75; }
.menu { display: flex; align-items: center; gap: 2px; font-family: var(--f-ui); font-size: .8rem; }
.menu a { color: inherit; text-decoration: none; padding: 8px 10px; border-radius: 999px; opacity: .85; transition: background .2s, opacity .2s, color .2s; white-space: nowrap; }
.menu a:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.menu a.active { background: rgba(230, 185, 95, .2); color: #f6d98a; opacity: 1; }
.menu a.menu-ai { border: 1px solid rgba(230, 185, 95, .55); color: #f6d98a; margin-left: 4px; }
.tools { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn { background: transparent; border: 1px solid rgba(255, 255, 255, .22); color: inherit; width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; transition: background .2s, transform .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.icon-btn:active { transform: scale(.94); }
.burger { display: none; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (max-width: 1380px) {
  .burger { display: inline-grid; }
  .menu { position: fixed; top: var(--nav-h); left: 0; right: 0; max-height: calc(100dvh - var(--nav-h)); overflow: auto; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 18px 16px 24px; background: rgba(12, 21, 26, .97); backdrop-filter: blur(14px); transform: translateY(-12px); opacity: 0; visibility: hidden; transition: .25s; border-bottom: 1px solid rgba(230, 185, 95, .3); }
  .menu.open { transform: none; opacity: 1; visibility: visible; }
  .menu a { font-size: .92rem; padding: 10px 16px; border: 1px solid rgba(255, 255, 255, .12); }
}

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: 999px; border: 1.5px solid transparent; font-family: var(--f-ui); font-size: .92rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .25s, background .25s, color .25s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: linear-gradient(135deg, #f3d28a, #c98f2a); color: #241705; box-shadow: 0 8px 24px rgba(201, 143, 42, .4); }
.btn.primary:hover { box-shadow: 0 10px 30px rgba(230, 185, 95, .6); transform: translateY(-2px); }
.btn.ghost { background: rgba(255, 255, 255, .06); border-color: rgba(246, 217, 138, .6); color: #f6d98a; }
.btn.ghost:hover { background: rgba(246, 217, 138, .16); }
.band:not(.dark) .btn.ghost { color: var(--gold); border-color: var(--gold); background: transparent; }
.btn.sm { padding: 8px 16px; font-size: .82rem; }
.btn.lg { padding: 15px 34px; font-size: 1.02rem; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: max(100svh, 640px); display: grid; align-items: center; overflow: hidden; color: #f3ead4; background: #0a1226; isolation: isolate; }
.hero-layers { position: absolute; inset: 0; z-index: -3; }
.hero-layers .layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; transform: scale(1.12); will-change: transform; }
#dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, rgba(5, 8, 20, .55), rgba(5, 8, 20, .1) 35%, rgba(5, 8, 20, .25) 70%, rgba(5, 8, 20, .75)); }
.hero-content { padding: calc(var(--nav-h) + 40px) 0 130px; text-align: center; width: min(920px, 100% - 36px); margin-inline: auto; }
.eyebrow { font-family: var(--f-display); letter-spacing: .38em; text-transform: uppercase; font-size: .72rem; color: #f6d98a; margin: 0 0 14px; }
.hero h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(2.6rem, 9vw, 6.2rem); letter-spacing: .06em; line-height: 1.02; text-shadow: 0 4px 30px rgba(0, 0, 0, .6); }
.hero h1 span { display: block; font-size: .36em; letter-spacing: .6em; font-weight: 500; color: #f6d98a; margin-bottom: .35em; padding-left: .6em; }
.hero h1 { background: linear-gradient(180deg, #fff3cf 10%, #f0c36a 55%, #b8791d 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 span { -webkit-text-fill-color: #f6d98a; }
.sub { font-family: var(--f-head); font-style: italic; font-size: clamp(1.15rem, 2.6vw, 1.55rem); max-width: 40ch; margin: 18px auto 28px; color: #f3e8cf; text-shadow: 0 2px 14px rgba(0, 0, 0, .7); line-height: 1.4; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.stats { list-style: none; margin: 44px auto 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 760px; }
.stats li { background: rgba(10, 16, 30, .5); border: 1px solid rgba(246, 217, 138, .28); border-radius: 14px; padding: 14px 8px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.stats b { display: block; font-family: var(--f-display); font-size: clamp(1.4rem, 3.6vw, 2rem); color: #f6d98a; line-height: 1.1; }
.stats span { font-family: var(--f-ui); font-size: .72rem; opacity: .85; line-height: 1.3; display: block; margin-top: 4px; }
.scroll-hint { position: absolute; left: 50%; bottom: 26px; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(246, 217, 138, .8); border-radius: 14px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; background: #f6d98a; border-radius: 3px; animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } .hero-content { padding-bottom: 110px; } .hero h1 span { letter-spacing: .4em; } }

/* ---------- Seksi umum ---------- */
.band { padding: clamp(64px, 9vw, 110px) 0; position: relative; }
.band.alt, .chapter.alt { background: var(--bg2); }
.band.dark { background: radial-gradient(ellipse at 20% 0%, #1a3039, #0c161b 70%); color: var(--ink); }
.sec-head { text-align: center; margin-bottom: 40px; }
.kicker { font-family: var(--f-display); letter-spacing: .3em; text-transform: uppercase; font-size: .72rem; color: var(--gold); margin: 0 0 10px; }
.sec-head h2 { font-size: clamp(2rem, 5vw, 3.1rem); font-family: var(--f-head); }
.sec-head h2::after { content: ""; display: block; width: 90px; height: 14px; margin: 14px auto 0; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 14'%3E%3Cpath d='M0 7h34M56 7h34' stroke='%23c98f2a' stroke-width='1.5'/%3E%3Cpath d='M45 1l6 6-6 6-6-6z' fill='%23c98f2a'/%3E%3Ccircle cx='38' cy='7' r='1.8' fill='%23c98f2a'/%3E%3Ccircle cx='52' cy='7' r='1.8' fill='%23c98f2a'/%3E%3C/svg%3E"); }
.sec-lead { max-width: 62ch; margin: 18px auto 0; color: var(--ink2); font-size: 1.05rem; }

/* kartu fakta */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cards li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); transition: transform .25s, border-color .25s; }
.cards li:hover { transform: translateY(-4px); border-color: var(--gold-fill); }
.cards h3 { font-size: 1.35rem; margin: 10px 0 4px; }
.cards p { margin: 0; color: var(--ink2); font-size: .96rem; line-height: 1.55; }
.ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); font-size: 1.15rem; font-family: var(--f-ui); }
.howto { margin: 28px 0 0; padding: 14px 18px; background: var(--gold-soft); border: 1px dashed var(--gold-fill); border-radius: 12px; font-family: var(--f-ui); font-size: .9rem; color: var(--ink2); line-height: 1.55; }

/* ---------- Bab ---------- */
.chapter { padding: clamp(60px, 8vw, 100px) 0; position: relative; }
.ch-head { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); margin: 0 auto 34px; max-width: 880px; }
.ch-num { font-family: var(--f-display); font-size: clamp(3.4rem, 10vw, 6rem); line-height: 1; color: transparent; -webkit-text-stroke: 2px var(--gold-fill); opacity: .9; min-width: 1.1em; text-align: center; }
.era { font-family: var(--f-display); font-size: .8rem; letter-spacing: .24em; color: var(--gold); margin: 0 0 6px; text-transform: uppercase; }
.ch-head h2 { font-size: clamp(2rem, 5.4vw, 3.3rem); }
.prose { max-width: 720px; margin: 0 auto; }
.prose p { margin: 0 0 1.15em; }
.prose h3 { font-size: clamp(1.5rem, 3.4vw, 1.9rem); margin: 1.9em 0 .5em; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.prose h3::before { content: ""; width: 26px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--gold-fill), transparent); flex: none; }
.lead { font-size: 1.14rem; color: var(--ink); }
.lead::first-letter { font-family: var(--f-display); font-size: 3.5em; float: left; line-height: .82; padding: .06em .12em 0 0; color: var(--gold); }
.prose i { color: var(--ink); }

.fig { margin: 2.2rem auto; max-width: 720px; }
.fig.wide { max-width: 980px; }
.fig .zoom { display: block; width: 100%; padding: 0; border: 0; background: var(--surface2); border-radius: 18px; overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow); position: relative; }
.fig .zoom::after { content: "Perbesar"; position: absolute; right: 12px; bottom: 12px; padding: 5px 12px; font-family: var(--f-ui); font-size: .72rem; border-radius: 999px; background: rgba(10, 16, 20, .7); color: #f6d98a; opacity: 0; transform: translateY(6px); transition: .25s; }
.fig .zoom:hover::after, .fig .zoom:focus-visible::after { opacity: 1; transform: none; }
.fig img { width: 100%; aspect-ratio: 5 / 3; object-fit: cover; transition: transform .6s; }
.fig .zoom:hover img { transform: scale(1.035); }
.fig figcaption { text-align: center; font-size: .88rem; font-style: italic; color: var(--muted); margin-top: 12px; padding-inline: 12px; }

.note { margin: 1.6em 0 0; padding: 14px 18px; background: var(--surface); border-left: 4px solid var(--gold-fill); border-radius: 0 12px 12px 0; font-size: .9rem; color: var(--ink2); font-family: var(--f-ui); line-height: 1.6; }
details.debate { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 14px 0; overflow: hidden; }
details.debate summary { cursor: pointer; padding: 14px 18px; font-family: var(--f-ui); font-weight: 600; font-size: .92rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details.debate summary::-webkit-details-marker { display: none; }
details.debate summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--gold); transition: transform .25s; flex: none; }
details.debate[open] summary::after { transform: rotate(45deg); }
details.debate > :not(summary) { padding: 0 18px; font-size: .95rem; color: var(--ink2); }
details.debate > p { margin: 0; padding-bottom: 16px; }
details.debate > ul { margin: 0; padding: 0 18px 16px 38px; }
details.debate li { margin-bottom: .45em; }
.links a { word-break: break-word; }

/* istilah */
.term { appearance: none; background: none; border: 0; padding: 0; margin: 0; cursor: help; color: inherit; border-bottom: 1.5px dotted var(--gold-fill); transition: color .2s, background .2s; }
.term:hover, .term:focus-visible { color: var(--gold); background: var(--gold-soft); }
.tip { position: fixed; z-index: 350; max-width: min(330px, 100vw - 24px); background: var(--surface); color: var(--ink); border: 1px solid var(--gold-fill); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); font-family: var(--f-ui); font-size: .85rem; line-height: 1.5; }
.tip b { display: block; font-family: var(--f-head); font-size: 1.1rem; color: var(--gold); margin-bottom: 2px; }

/* tabs */
.tabs { margin: 18px 0 8px; }
.tablist { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tablist button { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-family: var(--f-ui); font-size: .85rem; font-weight: 600; transition: .2s; }
.tablist button:hover { border-color: var(--gold-fill); }
.tablist button[aria-selected="true"] { background: linear-gradient(135deg, #f3d28a, #c98f2a); color: #241705; border-color: transparent; }
.tabpanel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; animation: fadeUp .35s; }
.tabpanel p { margin: 0; font-size: .98rem; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* lancana */
.lancana-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 22px 0 8px; }
.lc { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-family: var(--f-ui); font-size: .82rem; line-height: 1.35; }
.lc svg { flex: none; width: 52px; height: 52px; }
.lc b { display: block; font-family: var(--f-head); font-size: 1.1rem; }
.lc small { color: var(--muted); }

/* ---------- Lini masa ---------- */
.tl-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; }
.chipb { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--ink2); cursor: pointer; font-family: var(--f-ui); font-size: .8rem; transition: .2s; }
.chipb:hover { border-color: var(--gold-fill); color: var(--gold); }
.chipb[aria-pressed="true"] { background: linear-gradient(135deg, #f3d28a, #c98f2a); color: #241705; border-color: transparent; font-weight: 600; }
.tl-viewport { overflow-x: auto; overflow-y: hidden; cursor: grab; scrollbar-width: thin; scrollbar-color: var(--gold-fill) transparent; padding-bottom: 8px; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
.tl-viewport.drag { cursor: grabbing; user-select: none; }
.tl-track { list-style: none; margin: 0; padding: 0 40px; display: flex; min-width: max-content; position: relative; }
.tl-track::before { content: ""; position: absolute; left: 0; right: 0; top: 98px; height: 3px; background: linear-gradient(90deg, transparent, var(--gold-fill) 6%, var(--gold-fill) 94%, transparent); opacity: .65; }
.tl-item { width: 150px; flex: none; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tl-item button { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; width: 100%; padding: 10px 6px 14px; border-radius: 12px; box-sizing: border-box; }
.tl-item button:focus-visible { outline: 3px solid var(--gold-fill); }
.tl-year { font-family: var(--f-display); font-size: .95rem; color: var(--gold); height: 54px; display: flex; align-items: flex-end; padding-bottom: 8px; }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--c, var(--gold-fill)); border: 4px solid #0c161b; box-shadow: 0 0 0 2px var(--c, var(--gold-fill)); position: relative; z-index: 1; transition: transform .25s, box-shadow .25s; margin-top: 8px; }
.tl-item button:hover .tl-dot { transform: scale(1.25); }
.tl-item.active .tl-dot { transform: scale(1.5); box-shadow: 0 0 0 3px var(--c), 0 0 22px var(--c); }
.tl-name { font-family: var(--f-ui); font-size: .78rem; margin-top: 14px; line-height: 1.35; color: var(--ink2); padding-inline: 4px; }
.tl-item.active .tl-name { color: var(--gold); font-weight: 600; }
.tl-item.dim { opacity: .28; }
.tl-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0 20px; font-family: var(--f-ui); font-size: .85rem; color: var(--ink2); }
.tl-detail { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--gold-fill)); border-radius: 18px; padding: clamp(20px, 3vw, 32px); display: grid; grid-template-columns: 150px 1fr; gap: 22px; box-shadow: var(--shadow); animation: fadeUp .4s; }
.tl-big { font-family: var(--f-display); font-size: clamp(2rem, 5vw, 2.9rem); color: var(--c, var(--gold)); line-height: 1; }
.tl-tag { display: inline-block; margin-top: 10px; font-family: var(--f-ui); font-size: .7rem; padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); }
.tl-detail h3 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: 8px; }
.tl-detail p { margin: 0 0 10px; color: var(--ink2); }
.tl-src { font-family: var(--f-ui); font-size: .8rem; color: var(--muted); }
@media (max-width: 640px) { .tl-detail { grid-template-columns: 1fr; gap: 10px; } }

/* ---------- Peta ---------- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.map-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.map-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.seg { display: inline-flex; background: var(--bg2); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 7px 14px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; font-family: var(--f-ui); font-size: .78rem; font-weight: 600; color: var(--ink2); }
.seg button[aria-pressed="true"] { background: linear-gradient(135deg, #f3d28a, #c98f2a); color: #241705; }
.chk { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--f-ui); font-size: .78rem; align-items: center; }
.chk label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.chk input { accent-color: #c98f2a; width: 16px; height: 16px; }
.map-scroll { overflow-x: auto; border-radius: 12px; -webkit-overflow-scrolling: touch; }
#kmap { width: 100%; min-width: 760px; height: auto; display: block; background: #1d4a63; }
.map-hint { display: none; margin: 6px 4px 0; font-family: var(--f-ui); font-size: .75rem; color: var(--muted); }
@media (max-width: 700px) { .map-hint { display: block; } }
.map-note { margin: 10px 4px 2px; font-family: var(--f-ui); font-size: .82rem; color: var(--ink2); min-height: 3em; }
.map-info { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); position: sticky; top: calc(var(--nav-h) + 16px); font-family: var(--f-ui); }
.map-info h3 { font-family: var(--f-head); font-size: 1.6rem; margin-bottom: 4px; }
.map-info .mod { color: var(--gold); font-size: .82rem; margin: 0 0 12px; }
.map-info p { font-size: .9rem; line-height: 1.6; color: var(--ink2); margin: 0 0 10px; }
.map-info .badge { display: inline-block; font-size: .7rem; padding: 3px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); margin-bottom: 10px; }
.map-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding: 0; list-style: none; }
.map-list button { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: .74rem; color: var(--ink2); }
.map-list button:hover, .map-list button.on { border-color: var(--gold-fill); color: var(--gold); background: var(--gold-soft); }
.mk { cursor: pointer; }
.mk circle.dot { stroke: #fff; stroke-width: 2; transition: r .2s; }
.mk:hover circle.dot, .mk.sel circle.dot { r: 12; stroke: #f6d98a; }
.mk text { font-family: var(--f-ui); font-size: 16px; font-weight: 600; fill: #fff; paint-order: stroke; stroke: rgba(8, 20, 28, .92); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.mk .pulse { fill: none; stroke: #f6d98a; stroke-width: 2; opacity: 0; }
.mk.sel .pulse { animation: ping 1.6s infinite; }
@keyframes ping { 0% { r: 10; opacity: .9; } 100% { r: 34; opacity: 0; } }
.region { transition: opacity .6s; }
@media (max-width: 900px) { .map-layout { grid-template-columns: minmax(0, 1fr); } .map-info { position: static; } }
.map-layout > * { min-width: 0; }
.map-scroll { max-width: 100%; }

/* ---------- Raja ---------- */
.reign-bar { display: flex; height: 54px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.reign-bar button { border: 0; padding: 0 4px; cursor: pointer; background: var(--c); color: #fff; font-family: var(--f-ui); font-size: .66rem; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-right: 1px solid rgba(255, 255, 255, .35); transition: filter .2s, transform .2s; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.reign-bar button:hover, .reign-bar button.on { filter: brightness(1.2) saturate(1.2); transform: scaleY(1.12); z-index: 1; }
.reign-axis { position: relative; height: 24px; margin: 6px 0 28px; font-family: var(--f-ui); font-size: .72rem; color: var(--muted); }
.reign-axis span { position: absolute; transform: translateX(-50%); }
.reign-axis span:first-child { transform: none; }
.reign-axis span:last-child { transform: translateX(-100%); }
@media (max-width: 640px) { .reign-axis span:nth-child(4) { display: none; } }
.kings { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.king { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .25s, border-color .25s, box-shadow .25s; }
.king::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.king:hover { transform: translateY(-3px); }
.king.hl { border-color: var(--gold-fill); box-shadow: 0 0 0 3px var(--gold-soft), var(--shadow); transform: translateY(-4px); }
.king-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.king h3 { font-size: 1.5rem; }
.king .range { font-family: var(--f-display); font-size: .78rem; letter-spacing: .1em; color: var(--gold); margin: 4px 0 8px; }
.king svg.emb { width: 46px; height: 46px; flex: none; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badge2 { font-family: var(--f-ui); font-size: .68rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink2); }
.badge2.peak { background: linear-gradient(135deg, #f3d28a, #c98f2a); color: #241705; border-color: transparent; font-weight: 600; }
.badge2.warn { border-color: var(--accent); color: var(--accent); }
.badge2.end { background: var(--accent); color: #fff; border-color: transparent; }
.king .insc { font-family: var(--f-ui); font-size: .78rem; color: var(--muted); margin: 0 0 8px; }
.king p.nt { font-size: .93rem; margin: 0; color: var(--ink2); line-height: 1.6; }
.after-h { margin: 44px 0 14px; font-size: 1.7rem; }
.after { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.after li { padding: 14px 16px; border: 1px dashed var(--gold-fill); border-radius: 12px; font-size: .9rem; color: var(--ink2); font-family: var(--f-ui); }
.after b { display: block; font-family: var(--f-head); font-size: 1.25rem; color: var(--ink); }

/* ---------- Galeri ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.gitem { position: relative; padding: 0; border: 0; border-radius: 16px; overflow: hidden; cursor: zoom-in; background: var(--surface2); box-shadow: var(--shadow); text-align: left; }
.gitem img { width: 100%; aspect-ratio: 5 / 3; object-fit: cover; transition: transform .6s; }
.gitem:hover img { transform: scale(1.07); }
.gitem .gcap { position: absolute; inset: auto 0 0 0; padding: 40px 14px 12px; background: linear-gradient(transparent, rgba(6, 10, 14, .88)); color: #f3ead4; font-family: var(--f-ui); font-size: .8rem; line-height: 1.4; transform: translateY(28%); opacity: .95; transition: transform .35s; }
.gitem:hover .gcap, .gitem:focus-visible .gcap { transform: none; }
.gcap b { display: block; font-family: var(--f-head); font-size: 1.2rem; color: #f6d98a; }
.gcap span { display: block; opacity: 0; max-height: 0; transition: .35s; }
.gitem:hover .gcap span, .gitem:focus-visible .gcap span { opacity: 1; max-height: 6em; margin-top: 4px; }

/* ---------- Kuis ---------- */
.quiz { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 4vw, 36px); box-shadow: var(--shadow); }
.qbar { height: 6px; border-radius: 6px; background: var(--bg2); overflow: hidden; margin-bottom: 8px; }
.qbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c98f2a, #f3d28a); transition: width .4s; }
.qmeta { display: flex; justify-content: space-between; font-family: var(--f-ui); font-size: .78rem; color: var(--muted); margin-bottom: 18px; }
.qq { font-family: var(--f-head); font-size: clamp(1.4rem, 3.6vw, 1.9rem); line-height: 1.3; margin-bottom: 20px; }
.qopts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.qopts button { width: 100%; text-align: left; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; font-family: var(--f-ui); font-size: .95rem; line-height: 1.45; display: flex; gap: 12px; align-items: flex-start; transition: border-color .2s, background .2s, transform .15s; }
.qopts button:hover:not(:disabled) { border-color: var(--gold-fill); transform: translateX(3px); }
.qopts .key { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: .78rem; }
.qopts button.ok { border-color: #2e9e6a; background: rgba(46, 158, 106, .14); }
.qopts button.ok .key { background: #2e9e6a; color: #fff; }
.qopts button.no { border-color: #c4452d; background: rgba(196, 69, 45, .13); }
.qopts button.no .key { background: #c4452d; color: #fff; }
.qopts button:disabled { cursor: default; }
.qfb { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--bg2); font-family: var(--f-ui); font-size: .9rem; line-height: 1.6; color: var(--ink2); animation: fadeUp .3s; }
.qfb b { color: var(--ink); }
.qnext { margin-top: 16px; display: flex; justify-content: flex-end; }
.qresult { text-align: center; }
.qring { width: 170px; height: 170px; margin: 0 auto 10px; position: relative; }
.qring svg { transform: rotate(-90deg); }
.qring .val { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: 2.3rem; color: var(--gold); }
.qrank { font-family: var(--f-head); font-size: 2rem; margin: 8px 0 4px; }
.qresult p { color: var(--ink2); max-width: 46ch; margin: 0 auto 18px; }
.qreview { text-align: left; margin: 20px 0 0; padding: 0; list-style: none; font-family: var(--f-ui); font-size: .84rem; display: grid; gap: 6px; }
.qreview li { padding: 8px 12px; border-radius: 8px; background: var(--bg2); display: flex; gap: 10px; }
.qreview li span:first-child { flex: none; font-weight: 700; }
.qreview li.r-ok span:first-child { color: #2e9e6a; }
.qreview li.r-no span:first-child { color: #c4452d; }

/* ---------- Glosarium ---------- */
.gloss-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
#glossSearch { flex: 1 1 280px; padding: 14px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-family: var(--f-ui); font-size: .95rem; }
#glossSearch:focus { outline: none; border-color: var(--gold-fill); box-shadow: 0 0 0 4px var(--gold-soft); }
#glossCount { font-family: var(--f-ui); font-size: .82rem; color: var(--muted); }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 0; }
.gloss > div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.gloss dt { font-family: var(--f-head); font-size: 1.35rem; color: var(--gold); margin-bottom: 4px; font-weight: 700; }
.gloss dd { margin: 0; font-size: .92rem; line-height: 1.6; color: var(--ink2); }
.gloss mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: 0 0 0 1px var(--gold-fill); }
.gloss-empty { font-family: var(--f-ui); color: var(--muted); grid-column: 1 / -1; text-align: center; padding: 30px 0; }

/* ---------- Tanya AI ---------- */
.ask { padding: clamp(70px, 9vw, 110px) 0; color: #f3ead4; background: radial-gradient(ellipse at 50% 0%, rgba(230, 185, 95, .16), transparent 60%), linear-gradient(180deg, #13232a, #0a1216); text-align: center; }
.ask .sec-lead { color: #d7cbb0; }
.ask .kicker { color: #f6d98a; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0 30px; }
.chips button { padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(246, 217, 138, .5); background: rgba(255, 255, 255, .05); color: #f3ead4; cursor: pointer; font-family: var(--f-ui); font-size: .85rem; transition: .2s; }
.chips button:hover { background: rgba(246, 217, 138, .18); transform: translateY(-2px); }

/* ---------- Footer ---------- */
.footer { background: #080f13; color: #cfc4a9; padding: 54px 0 22px; font-family: var(--f-ui); font-size: .88rem; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.foot-grid p { max-width: 46ch; line-height: 1.6; opacity: .85; }
.foot-grid h4 { font-family: var(--f-display); letter-spacing: .2em; font-size: .78rem; color: #f6d98a; margin-bottom: 10px; text-transform: uppercase; }
.foot-grid nav a { display: block; color: inherit; text-decoration: none; padding: 3px 0; opacity: .85; }
.foot-grid nav a:hover { color: #f6d98a; opacity: 1; }
.footer .brand { color: #f3ead4; margin-bottom: 12px; }
.copy { text-align: center; margin: 34px 0 0; opacity: .6; font-size: .78rem; padding-inline: 16px; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- Elemen melayang ---------- */
.to-top { position: fixed; left: 18px; bottom: 18px; z-index: 150; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--gold-fill); background: var(--surface); color: var(--gold); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(12px); transition: .3s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.lightbox { position: fixed; inset: 0; z-index: 500; background: rgba(5, 8, 11, .92); display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; padding: 20px 8px; backdrop-filter: blur(6px); }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; max-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; animation: fadeUp .3s; }
.lightbox img { max-height: 76vh; width: auto; max-width: 100%; border-radius: 14px; box-shadow: 0 20px 70px rgba(0, 0, 0, .7); background: #111; }
.lightbox figcaption { color: #e9dfc6; font-family: var(--f-ui); font-size: .9rem; margin-top: 14px; max-width: 70ch; line-height: 1.5; }
.lb-close { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; z-index: 2; }
.lb-nav { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; justify-self: center; }
.lb-nav:hover, .lb-close:hover { background: rgba(246, 217, 138, .25); }
.lb-nav[hidden] { visibility: hidden; display: block; }
@media (max-width: 600px) { .lightbox { grid-template-columns: 40px 1fr 40px; padding-inline: 2px; } .lb-nav { width: 38px; height: 38px; font-size: 1.6rem; } }

/* ---------- Animasi muncul ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero-layers .layer { transform: none !important; }
}
@media print { .nav, .fab, .chat, .to-top, .loader, .progress, #dust { display: none !important; } .js .reveal { opacity: 1; transform: none; } }
