/* Gaya coretan per ruang, dimuat paling akhir.
   - Huruf: Plus Jakarta Sans untuk isi; judul HSK Noto Serif SC (gaya Song) dengan aksen kuas Ma Shan Zheng;
     judul IELTS Libre Caslon Text (serif klasik Inggris). Font dari Google Fonts (lihat index.html dan CSP di vercel.json);
     saat offline jatuh ke huruf sistem.
   - Tanpa bulatan besar: lencana bulat diganti kotak bersudut lembut (cap stempel di HSK).
   - HSK: kertas bertekstur, garis bawah sapuan kuas, ornamen awan ruyi. IELTS: garis pena, ornamen menara jam. */

:root {
  --huruf-isi: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --huruf-judul: "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --huruf-kuas: "Ma Shan Zheng", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  --sudut-lencana: 9px;
}
:root[data-ruang="hsk"] { --huruf-judul: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif; --sudut-lencana: 6px; }
:root[data-ruang="ielts"] { --huruf-judul: "Libre Caslon Text", "Iowan Old Style", Georgia, serif; --sudut-lencana: 8px; }

body { font-family: var(--huruf-isi); }
button, input, select, textarea { font-family: inherit; }
h1, .merek, .judul-display, .hero-ruang h1, .misi-besar h3, .vd-papan h3, .rt-kartu b.rt-nama, .runtun-angka, .sisi-kartu .sk-angka, .skill-blok > header h2 { font-family: var(--huruf-judul); }
:root[data-ruang="hsk"] h1 { font-weight: 700; letter-spacing: 0; }
:root[data-ruang="ielts"] h1 { font-weight: 700; letter-spacing: -.005em; }
:root[data-ruang="ielts"] .hero-ruang h1 em, :root[data-ruang="ielts"] .judul-display em { font-style: italic; font-weight: 400; }

/* ---------- Ilustrasi hero ---------- */
.hero-ruang .ilustrasi { overflow: visible; }
.ilustrasi .ng-isi { fill: currentColor; stroke: none; }
.ilustrasi .ng-tipis { fill: none; stroke: currentColor; stroke-width: 1.1; }
.ilustrasi .ng-surai { fill: none; stroke: currentColor; stroke-width: 1.7; }
.ilustrasi .ng-cakar { fill: none; stroke: currentColor; stroke-width: 1.3; }
.ilustrasi .ng-perut { fill: none; stroke: var(--hero-bg); stroke-width: 1.2; opacity: .7; }
.ilustrasi .ng-kering { fill: none; stroke: var(--hero-bg); stroke-width: .6; stroke-dasharray: 9 4 3 6; opacity: .5; }
.ilustrasi .ng-mata { fill: var(--hero-bg); stroke: none; }
.ilustrasi .ng-lidah { fill: none; stroke: var(--misi-bg); stroke-width: 1.4; }
.ilustrasi .ng-sisik { fill: none; stroke: var(--hero-bg); stroke-width: .7; opacity: .55; }
.ilustrasi .awan-isi { fill: var(--hero-bg); stroke: currentColor; stroke-width: 1.1; }
.ilustrasi .sapuan { fill: var(--hiasan); opacity: .38; }
.ilustrasi .stempel { fill: var(--misi-bg); }
.ilustrasi .stempel-garis { stroke: #FFF5EF; stroke-width: .7; opacity: .55; }
.ilustrasi .stempel-huruf { fill: #FFF5EF; font-family: var(--huruf-kuas); font-size: 17px; }
.ilustrasi .arsir { fill: url(#arsirIelts); opacity: .7; }
.ilustrasi .bus { fill: var(--hiasan); stroke: none; opacity: .9; }
.il-hsk { color: var(--hero-garis); }
@media (min-width: 760px) { .hero-ruang .il-hsk, .hero-ruang .il-ielts { max-width: 560px; } }
@media (prefers-reduced-motion: no-preference) {
  .il-hsk .naga { animation: nagaMelayang 7s ease-in-out infinite alternate; transform-origin: 60% 50%; }
}
@keyframes nagaMelayang { from { transform: translateY(0); } to { transform: translateY(-3px) rotate(-.6deg); } }

/* ---------- Kertas bertekstur (HSK) ---------- */
:root[data-ruang="hsk"] body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
}

/* ---------- Garis bawah judul halaman: sapuan kuas (HSK) dan coretan pena (IELTS) ---------- */
:root[data-ruang="hsk"] #view > h1::after, :root[data-ruang="ielts"] #view > h1::after {
  content: ""; display: block; width: 84px; height: 9px; margin-top: 6px; background: var(--utama);
  -webkit-mask: var(--garis-judul) no-repeat left center / 100% 100%; mask: var(--garis-judul) no-repeat left center / 100% 100%;
}
:root[data-ruang="hsk"] { --garis-judul: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12'%3E%3Cpath d='M2 7C10 3 30 2 52 3s38 1 46 3c1 1 0 3-2 3-14 0-30-1-48 0S10 11 4 10C1 10 0 8 2 7Z'/%3E%3Cpath d='M60 4l30 0.5' stroke='white' stroke-width='.7' opacity='.6'/%3E%3C/svg%3E"); }
:root[data-ruang="ielts"] { --garis-judul: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12' fill='none' stroke='black' stroke-linecap='round'%3E%3Cpath d='M2 5c20-2 50-3 96-1' stroke-width='2.2'/%3E%3Cpath d='M8 9c24-2 48-2 80-1' stroke-width='1.2'/%3E%3C/svg%3E"); }
:root[data-ruang="ielts"] #view > h1::after { background: var(--hiasan); width: 72px; }

/* ---------- Kartu misi: lingkaran hiasan diganti ornamen ---------- */
.misi-besar .mb-bunga { border: 0; border-radius: 0; display: none; }
.misi-besar .mb-bunga::after { display: none; }
:root[data-ruang="hsk"] .misi-besar .mb-bunga, :root[data-ruang="ielts"] .misi-besar .mb-bunga {
  display: block; top: 8px; right: 10px; width: 150px; height: 96px; background: color-mix(in srgb, var(--misi-teks) 26%, transparent);
  -webkit-mask: var(--hiasan-misi) no-repeat center / contain; mask: var(--hiasan-misi) no-repeat center / contain;
}
:root[data-ruang="hsk"] { --hiasan-misi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 80' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 62h56c9 0 11-11 3-14 2-10-10-15-16-7-4-11-20-11-22 0-9-6-17 1-13 9-9 0-13 12-8 12Z'/%3E%3Cpath d='M40 52c-3-6 5-10 8-4M60 46c0-6 9-6 9 0M28 58c1-4 6-4 6 0'/%3E%3Cpath d='M70 28h36c6 0 7-7 2-9 1-6-6-9-10-4-2-7-12-7-13 0-6-4-11 1-8 6-6 0-8 7-7 7Z'/%3E%3Cpath d='M84 21c0-4 6-4 6 0'/%3E%3Cpath d='M4 40c10-6 22-6 30-2M92 50c8-3 16-3 24 0' stroke-width='1.4'/%3E%3C/svg%3E"); }
:root[data-ruang="ielts"] { --hiasan-misi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 80' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M88 80V40h16v40M86 40V22h20v18M86 22h20M88 22V14h16v8M87 14l9-12 9 12M96 2V-2'/%3E%3Cpath d='M92 44v34M96 44v34M100 44v34' stroke-width='.9'/%3E%3Cpath d='M101 31a5 5 0 1 1-10 0 5 5 0 0 1 10 0ZM96 31v-3M96 31l2 1.5'/%3E%3Cpath d='M10 74h70M20 74V60h20v14M46 74V54h24v20M50 60h4M58 60h4M50 66h4M58 66h4' stroke-width='1.2'/%3E%3Cpath d='M14 30h30M20 36h34' stroke-width='1' opacity='.7'/%3E%3C/svg%3E"); }

/* ---------- Runtun 7 hari: bulatan diganti sapuan ---------- */
.runtun-hari i { width: 100%; max-width: 34px; height: 9px; border: 0; border-radius: 3px; background: var(--garis); }
.runtun-hari .aktif i { background: var(--tes); }
.runtun-hari .aktif i::after { display: none; }
.runtun-hari .kini i { outline: 1.5px solid var(--teks-2); outline-offset: 2px; }
:root[data-ruang="hsk"] .runtun-hari i, :root[data-ruang="ielts"] .runtun-hari i {
  height: 11px; border-radius: 0; -webkit-mask: var(--garis-judul) no-repeat center / 100% 100%; mask: var(--garis-judul) no-repeat center / 100% 100%;
}
:root[data-ruang="hsk"] .runtun-hari .kini i, :root[data-ruang="ielts"] .runtun-hari .kini i { outline: 0; }
:root[data-ruang="hsk"] .runtun-hari .kini, :root[data-ruang="ielts"] .runtun-hari .kini { text-decoration: underline 1.5px; text-underline-offset: 3px; }

/* ---------- Lencana bulat jadi kotak (ruang HSK dan IELTS) ---------- */
:is(:root[data-ruang="hsk"], :root[data-ruang="ielts"]) :is(
  .cek-item .centang, .selesai-hero .lingkar, .node-bulat, .penalaran li span, .umpan-ikon, .minggu-titik .hari i, .ikon-bulat,
  .tangga-n, .br-minggu b, .ps-foto, .rp-minggu b, .rp-tonggak li b, .tf-ikon, .jl-titik, .kb-siapa, .kb-urut button b, .sisi-profil .avatar
) { border-radius: var(--sudut-lencana); }
:is(:root[data-ruang="hsk"], :root[data-ruang="ielts"]) .cek-item .centang { width: 20px; height: 20px; }
:root[data-ruang="hsk"] .node-bulat { border-radius: 14px; }
@media (max-width: 759px) {
  :root[data-ruang="hsk"] .misi-besar .mb-bunga, :root[data-ruang="ielts"] .misi-besar .mb-bunga { top: 4px; right: 4px; width: 104px; height: 66px; background: color-mix(in srgb, var(--misi-teks) 17%, transparent); }
}

/* ---------- Tanpa titik besar di semua ruang (permintaan pemilik: bulatan terasa generik) ---------- */
/* Lencana bulat jadi kotak bersudut lembut di semua ruang, bukan hanya HSK dan IELTS. */
:is(.cek-item .centang, .selesai-hero .lingkar, .node-bulat, .penalaran li span, .umpan-ikon, .minggu-titik .hari i, .ikon-bulat,
  .tangga-n, .br-minggu b, .ps-foto, .rp-minggu b, .rp-tonggak li b, .tf-ikon, .jl-titik, .kb-siapa, .kb-urut button b, .sisi-profil .avatar) { border-radius: var(--sudut-lencana); }
.node-bulat { border-radius: 16px; }
/* Titik penanda dihapus atau diganti garis pendek. */
.ruang-chip i { display: none; }
.analisis h2 i { display: none; }
.titik-oranye { width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; }
.poin li::before { top: 10px; width: 14px; height: 3px; border-radius: 2px; background: var(--utama); box-shadow: none; }
.cek li::before { border-radius: 6px; }
.atas-profil { border-radius: 12px; }
.item.saklar input { border-radius: 10px; }
.item.saklar input::after { border-radius: 7px; }
/* Peta Tes: bulatan lembar jawaban diganti batang meteran yang terisi dari bawah. */
.bulat { --d: 14px; width: 11px; height: var(--d); border-radius: 3px; overflow: hidden; }
.bulat::after { inset: auto 0 0 0; margin: 0; border-radius: 0; width: 100%; height: 0; }
.bulat.isi-1::after { width: 100%; height: 34%; }
.bulat.isi-2::after { width: 100%; height: 67%; }
.bulat.isi-3::after { width: 100%; height: 100%; }
.bulat.kecil { --d: 11px; width: 8px; }
.bulat.kecil { border-radius: 2px; }

/* Hero HSK: lukisan tinta naga (gambar). Latar putih dibaurkan ke kertas; mode gelap dibalik jadi naga perak. */
.hero-ruang .il-gambar { position: relative; display: block; width: 100%; max-width: 560px; margin: 4px 0 0 auto; }
.il-gambar img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
:root[data-tema="gelap"] .il-gambar img { filter: invert(1) brightness(.92); mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root[data-tema="ikut"] .il-gambar img { filter: invert(1) brightness(.92); mix-blend-mode: screen; } }
.il-stempel { position: absolute; right: 4%; bottom: 10%; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 3px; transform: rotate(-4deg);
  background: var(--misi-bg); color: #FFF5EF; font-family: var(--huruf-kuas); font-size: 21px; line-height: 1; box-shadow: inset 0 0 0 2px rgb(255 245 239 / .45), inset 0 0 0 3px var(--misi-bg); }
@media (prefers-reduced-motion: no-preference) { .il-gambar img { animation: nagaMelayang 7s ease-in-out infinite alternate; } }

/* Hero 10 ruang bahasa: sketsa arsitektur dari data/<tes>/identitas.json (Opus 5.5), cap aksara asli, salam asli. */
.il-bahasa-bingkai { position: relative; display: block; width: 100%; max-width: 560px; margin: 4px 0 0 auto; color: var(--hero-garis); }
.il-bahasa-bingkai > svg { display: block; width: 100%; height: auto; overflow: visible; }
.il-bahasa-bingkai .aksen { fill: var(--hiasan); stroke: none; opacity: .85; }
.il-bahasa-bingkai .il-cap { font-family: var(--huruf-judul); font-size: 16px; width: auto; min-width: 30px; padding: 0 5px; }
.il-slot { min-height: 120px; }
.hero-ruang .hr-asli { display: grid; gap: 2px; margin: 0 0 6px; }
.hero-ruang .hr-asli > span { font-family: var(--huruf-judul); font-size: 17px; font-weight: 700; color: var(--aksen); }
.hero-ruang .hr-asli small { color: var(--redup); font-size: 12.5px; max-width: 420px; }
@media (prefers-reduced-motion: no-preference) { .il-bahasa-bingkai > svg { animation: ilMuncul .7s ease-out both; } }
@keyframes ilMuncul { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Konfirmasi usia di ruang HSK: banner tipis, tidak bersaing dengan misi. */
:root[data-ruang="hsk"] .kartu-usia { padding: 10px 14px; gap: 10px; border-width: 1px; background: var(--permukaan); box-shadow: none; }
:root[data-ruang="hsk"] .kartu-usia b { font-size: 14.5px; }
:root[data-ruang="hsk"] .kartu-usia small { font-size: 13px; }
:root[data-ruang="hsk"] .kartu-usia .ikon svg { width: 20px; height: 20px; }

/* Kontras ruang HSK: garis runtun kosong dan jalur progres lebih jelas. */
:root[data-ruang="hsk"] .runtun-hari i { background: var(--hiasan); }
:root[data-ruang="hsk"] .runtun-hari .aktif i { background: var(--utama); }
:root[data-ruang="hsk"] .runtun-hari span { color: var(--teks-2); }
:root[data-ruang="hsk"] .kartu-misi .bar { background: color-mix(in srgb, var(--teks) 14%, transparent); }

/* ---------- Layar hasil sesi tanpa cincin, lingkaran kuning, atau garis bertitik (29 November 2026) ---------- */
.rp-skor { display: grid; justify-items: center; gap: 12px; width: min(300px, 80vw); }
.rp-skor .rp-cap { transform: rotate(-4deg); font-size: 20px; padding: 5px 14px; border-width: 3px; }
.rp-skor .rp-cap.panjang { font-size: 15px; }
.rp-cap.biru { color: #A5C4FF; }
@keyframes rpCap { 0% { opacity: 0; transform: scale(1.8) rotate(-10deg); } 60% { opacity: 1; transform: scale(.94) rotate(-4deg); } 100% { transform: scale(1) rotate(-4deg); } }
.rp-skor-angka { font-size: 84px; font-weight: 900; line-height: .95; letter-spacing: -.02em; }
.rp-skor-angka.kecil { font-size: 30px; }
.rp-skor-bar { width: 100%; height: 14px; border-radius: 7px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.rp-skor-bar i { display: block; height: 100%; width: var(--p); border-radius: inherit; background: #4ADE80; transform-origin: left; animation: rpIsiBar 1s .25s cubic-bezier(.3, .8, .3, 1) both; }
.rp-skor-bar.sedang i { background: #60A5FA; }
.rp-skor-bar.rendah i { background: #FB923C; }
@keyframes rpIsiBar { from { transform: scaleX(0); } }
.rp-skor-ket { font-size: 15px; opacity: .8; }
.rp-t-skor .rp-isi { animation: none; }
.rp-kotak i { width: 30px; height: 30px; border-radius: 8px; }
@media (min-width: 900px) {
  .rp-skor { width: 380px; justify-items: start; }
  .rp-skor-angka { font-size: 128px; }
  .rp-skor-bar { height: 18px; border-radius: 9px; }
}
@media (max-height: 700px) and (max-width: 899px) { .rp-skor-angka { font-size: 60px; } }

/* Tonggak runtun: garis polos, bukan titik-titik */
.rp-tonggak .garis { border-top: 0; height: 3px; top: 30px; background: rgba(255, 255, 255, .14); border-radius: 2px; }
.rp-tonggak .garis i { top: 0; border-radius: 2px; }
.rp-tonggak li b { background: #1B2537; }
.rp-tonggak li.kini b { box-shadow: none; animation: rpPop .6s .9s cubic-bezier(.34, 1.56, .64, 1) both; }

/* Cocokkan pasangan gaya Duolingo: pasangan benar berkedip hijau sebentar, lalu meredup jadi abu-abu,
   sehingga yang tersisa terlihat jelas. Salah: getar merah. */
.ls .pas { transition: transform .12s, border-color .15s, background-color .15s; }
.ls .pas.dipilih { transform: translateY(-2px); border-color: #3B6CF0; background: #EEF3FF; color: #1E3A8A; }
:root[data-tema="gelap"] .ls .pas.dipilih { background: rgba(59, 108, 240, .18); color: #C7D7FF; }
.ls .pas.cocok { animation: pasCocok .9s ease-out both; }
@keyframes pasCocok {
  0% { transform: scale(1); border-color: var(--benar); background: var(--benar-lembut); color: var(--benar); opacity: 1; }
  25% { transform: scale(1.05); border-color: var(--benar); background: var(--benar-lembut); color: var(--benar); opacity: 1; }
  55% { transform: scale(1); border-color: var(--benar); background: var(--benar-lembut); color: var(--benar); opacity: 1; }
  100% { transform: scale(1); border-color: var(--garis); background: transparent; color: var(--redup); opacity: .5; }
}
.ls .pas.getar { border-color: var(--salah); background: var(--salah-lembut); color: var(--salah); }
@media (prefers-reduced-motion: reduce) { .ls .pas.cocok { animation: none; opacity: .5; } }
@media (prefers-color-scheme: dark) { :root[data-tema="ikut"] .ls .pas.dipilih { background: rgba(59, 108, 240, .18); color: #C7D7FF; } }
