/* Manasik 3D. Ditulis untuk layar HP dulu; layar lebar diatur di bagian bawah. */
:root {
  --paper: #f4f5f8; --card: #fff; --ink: #0d1326; --muted: #5a627a; --line: #dfe3ee; --gold: #2f4bff; --gold-soft: #dfe3ee; --amber: #ffb224;
  --sans: 'Host Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif; --arabic: 'Amiri', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; height: 100dvh; background: #e6e9f2; color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
h1, h2, p, ul, ol, figure { margin: 0; padding: 0; } ul, ol { list-style: none; }
h1, h2 { font-weight: 700; letter-spacing: -0.035em; line-height: 1.06; text-wrap: balance; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.fine { font-size: 13px; color: var(--muted); }
.src { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border-radius: 16px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; font-weight: 600; font-size: 15.5px; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.3; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.big { min-height: 56px; width: 100%; font-size: 16.5px; }
.glass { background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); }

/* Bilah atas */
.bar { position: fixed; inset: 0 0 auto 0; z-index: 10; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: calc(8px + var(--st)) 10px 8px; }
.rbtn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; font-size: 26px; line-height: 1; padding-bottom: 3px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); }
.rbtn.txt { width: auto; padding: 0 14px; font-size: 13.5px; font-weight: 600; border-radius: 999px; }
.stg { display: grid; gap: 6px; padding: 8px 14px 9px; border-radius: 18px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); min-width: 0; }
.stg p { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.prog li { height: 4px; border-radius: 4px; background: var(--gold-soft); }
.prog li.done { background: var(--ink); } .prog li.on { background: var(--amber); }
body:not(.playing) .prog { display: none; }

/* Pembuka */
.intro { position: fixed; inset: 0; z-index: 5; display: grid; align-items: end; padding: 0 16px calc(18px + var(--sb)); background: linear-gradient(0deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 94%, transparent) 52%, transparent 78%); transition: opacity 0.5s; overflow-y: auto; }
.intro.gone { opacity: 0; pointer-events: none; }
.intro-in { display: grid; gap: 12px; padding-top: 34dvh; }
.intro h1 { font-size: clamp(32px, 9.4vw, 44px); }
.lede { color: #39415c; font-size: 15.5px; }
.pick { display: grid; gap: 6px; }
.pick > p, .pick > div > p { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.pick small { font-size: 12.5px; color: var(--muted); }
.pick.two { grid-template-columns: 1fr 1.25fr; gap: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.seg button { padding: 9px 4px; border-radius: 10px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.seg button[aria-pressed='true'] { background: var(--ink); color: #fff; }

/* Kartu: lembar dari bawah */
.card { position: fixed; z-index: 8; inset: auto 0 0 0; max-height: 62dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--card); border-radius: 26px 26px 0 0; border-top: 1px solid var(--line); box-shadow: 0 -20px 50px -24px rgba(40, 30, 10, 0.4); padding: 0 18px; display: grid; gap: 9px; user-select: text; -webkit-user-select: text; animation: up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes up { from { transform: translateY(28px); } }
.handle { position: sticky; top: 0; z-index: 2; height: 26px; margin: 0 -18px -4px; background: var(--card); border-radius: 26px 26px 0 0; display: grid; place-items: center; }
.handle::before { content: ''; width: 42px; height: 5px; border-radius: 5px; background: var(--line); }
.card h2 { font-size: 23px; }
.card-body { display: grid; gap: 9px; font-size: 14.5px; }
.dua { background: var(--paper); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; }
.ar { font-family: var(--arabic); font-size: 22px; line-height: 1.95; }
.latin { font-size: 13.5px; font-weight: 500; } .arti { font-size: 13.5px; color: var(--muted); }
.actions { position: sticky; bottom: 0; display: flex; gap: 8px; margin: 2px -18px 0; padding: 10px 18px calc(12px + var(--sb)); background: var(--card); border-top: 1px solid var(--line); align-items: center; }
.actions .btn:last-child { flex: 1; }
.card.peek { max-height: none; overflow: hidden; }
.card.peek .card-body, .card.peek .src, .card.peek .eyebrow { display: none; }
.card.peek h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rules { display: grid; gap: 0; border-top: 1px solid var(--line); }
.rules li { padding: 9px 0 9px 26px; border-bottom: 1px solid var(--line); position: relative; font-weight: 500; }
.rules li::before { content: ''; position: absolute; left: 4px; top: 16px; width: 12px; height: 2.5px; border-radius: 2px; background: #b3372c; }
.map { background: var(--paper); border-radius: 14px; padding: 8px 8px 10px; }
.map svg { display: block; width: 100%; height: auto; }
.map figcaption { font-size: 11.5px; color: var(--muted); padding: 2px 6px 0; }
.map .sea { fill: #cfe0e6; } .map .route { fill: none; stroke: var(--amber); stroke-width: 2.4; stroke-dasharray: 5 5; stroke-linecap: round; }
.map circle { fill: #b5ab97; } .map .on circle { fill: var(--amber); stroke: var(--ink); stroke-width: 2; }
.map text { font: 500 8.4px var(--sans); fill: var(--muted); } .map .n { font-weight: 700; fill: var(--ink); font-size: 9.4px; }
.map .on .n { fill: #1c2fb8; } .map .kb { fill: var(--ink); } .map .mk { font: 800 11px var(--sans); fill: var(--ink); } .map .lbl { font: 600 8.6px var(--sans); fill: #5f7f8b; } .map .city { fill: #5f7f8b; }
.opts { display: grid; gap: 8px; }
.opts button { text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-size: 15px; font-weight: 600; color: var(--ink); }
.opts button.right { border-color: #1d7a4f; background: #e2f3ea; } .opts button.wrong { border-color: #b3372c; background: #fbe6e2; }
.why { background: var(--paper); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sum div { background: var(--paper); border-radius: 14px; padding: 12px 8px; text-align: center; display: grid; }
.sum b { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; } .sum span { font-size: 11.5px; color: var(--muted); }

/* Saat berjalan */
.hud > * { pointer-events: auto; }
.obj { position: fixed; z-index: 9; top: calc(64px + var(--st)); left: 10px; right: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 8px 8px 8px; border-radius: 18px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); }
.compass-wrap { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; }
.compass { color: #ffb224; font-size: 19px; font-weight: 700; line-height: 1; transition: transform 0.12s linear; }
.obj-main { min-width: 0; display: grid; gap: 5px; }
.obj-text { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.dots { display: flex; gap: 5px; }
.dots i { width: 18px; height: 6px; border-radius: 6px; background: var(--gold-soft); }
.dots i.done { background: var(--ink); } .dots i.on { background: var(--amber); }
.skip { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 8px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.flash { position: fixed; z-index: 9; top: 34dvh; left: 50%; transform: translate(-50%, 8px) scale(0.96); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 16px; white-space: nowrap; opacity: 0; transition: 0.3s; pointer-events: none; }
.flash.on { opacity: 1; transform: translate(-50%, 0); }
.low { position: fixed; z-index: 8; left: 10px; right: 10px; bottom: calc(176px + var(--sb)); display: grid; gap: 8px; justify-items: start; pointer-events: none; }
.low > * { pointer-events: auto; }
.info { display: flex; align-items: center; gap: 9px; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; animation: up 0.3s; }
.info b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #ffb224; color: var(--ink); font: 700 18px Georgia, serif; }
.hint { width: 100%; max-height: 30dvh; overflow-y: auto; border-radius: 18px; padding: 12px 14px; display: grid; gap: 8px; font-size: 14px; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: 0 16px 40px -24px rgba(40, 30, 10, 0.4); }
.hint.pop { animation: up 0.3s; }
.hint .dua { padding: 10px 12px; } .hint .ar { font-size: 20px; } .hint .latin { display: none; }
.hint.min { max-height: 44px; overflow: hidden; }
.hint.min p:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint.min > :not(:first-child) { display: none; }
.joy { position: fixed; z-index: 8; left: 16px; bottom: calc(22px + var(--sb)); width: 136px; height: 136px; border-radius: 50%; display: grid; place-items: center; touch-action: none; background: color-mix(in srgb, var(--card) 55%, transparent); border: 1.5px solid color-mix(in srgb, var(--ink) 22%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.joy i { width: 58px; height: 58px; border-radius: 50%; background: var(--ink); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.5); pointer-events: none; }
.pad { position: fixed; z-index: 8; right: 14px; bottom: calc(22px + var(--sb)); display: grid; gap: 10px; justify-items: end; }
.act { display: inline-flex; align-items: center; min-height: 58px; max-width: 58vw; padding: 0 22px; border-radius: 999px; background: var(--amber); color: var(--ink); font-weight: 700; font-size: 15.5px; line-height: 1.2; text-align: left; box-shadow: 0 12px 30px -10px rgba(120, 80, 0, 0.6); animation: pulse 1.6s ease-in-out infinite; }
.act kbd { display: none; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.rounds { display: flex; gap: 10px; align-items: center; }
.round { width: 52px; height: 52px; border-radius: 50%; font-weight: 700; font-size: 14px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); }
.round.big { width: 68px; height: 68px; font-size: 15px; }
.round[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }
.keys { display: none; }
.isheet { position: fixed; inset: 0; z-index: 20; background: rgba(15, 12, 6, 0.5); display: grid; align-items: end; }
.isheet-in { background: var(--card); border-radius: 26px 26px 0 0; padding: 22px 18px calc(16px + var(--sb)); display: grid; gap: 10px; animation: up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); user-select: text; -webkit-user-select: text; }
.isheet-in h2 { font-size: 24px; } .isheet-in > p:not(.eyebrow):not(.src) { font-size: 15px; }
.fade { position: fixed; inset: 0; z-index: 30; background: var(--paper); opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.fade.on { opacity: 1; }
body[data-time='malam'] .fade { background: #0c1022; }
@media (max-height: 640px) { .intro-in { padding-top: 16dvh; gap: 9px; } .lede { display: none; } .card { max-height: 68dvh; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ----- Layar lebar ----- */
@media (min-width: 900px) and (pointer: fine) {
  body { font-size: 16px; }
  .bar { grid-template-columns: auto minmax(260px, 380px) auto; justify-content: space-between; padding: 14px 22px; }
  .intro { align-items: end; padding: 0 clamp(24px, 4vw, 56px) clamp(32px, 7vh, 72px); background: linear-gradient(90deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 88%, transparent) 30%, transparent 60%); }
  .intro-in { max-width: 470px; padding-top: 0; gap: 16px; }
  .intro h1 { font-size: clamp(40px, 4.4vw, 62px); }
  .card { inset: auto auto 24px 24px; width: 450px; max-height: calc(100dvh - 120px); border-radius: 24px; border: 1px solid var(--line); padding: 0 24px; }
  .handle { margin: 0 -24px -4px; border-radius: 24px 24px 0 0; }
  .actions { margin: 2px -24px 0; padding: 12px 24px 16px; border-radius: 0 0 24px 24px; }
  .card h2 { font-size: 28px; } .card-body { font-size: 15.5px; } .ar { font-size: 25px; }
  .obj { right: auto; left: 22px; top: 82px; min-width: 340px; max-width: 460px; }
  .low { left: 50%; right: auto; transform: translateX(-50%); width: 520px; bottom: 96px; justify-items: center; }
  .hint .latin { display: block; }
  .joy { display: none; }
  .pad { right: 50%; transform: translateX(50%); bottom: 24px; grid-auto-flow: column; align-items: center; }
  .act kbd { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 14px var(--sans); margin: 0 12px 0 -12px; }
  .round, .round.big { width: auto; height: 46px; padding: 0 18px; border-radius: 999px; }
  .keys { display: block; position: fixed; left: 22px; bottom: 26px; z-index: 8; font-size: 12.5px; background: color-mix(in srgb, var(--card) 85%, transparent); padding: 7px 12px; border-radius: 12px; }
  .keys kbd { font: 700 11.5px var(--sans); background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 6px; }
  .isheet { align-items: center; justify-items: center; }
  .isheet-in { width: 480px; border-radius: 24px; padding: 28px; }
}

/* ----- Poin, suara, cek cepat ----- */
.bar-r { display: flex; align-items: center; gap: 6px; }
.pts { font-weight: 800; font-size: 13.5px; padding: 0 12px; height: 42px; display: grid; place-items: center; border-radius: 999px; background: var(--ink); color: #ffb224; white-space: nowrap; }
.pts.bump { animation: bump 0.45s ease; }
@keyframes bump { 40% { transform: scale(1.22); } }
body:not(.playing) .pts { display: none; }
.rbtn.txt[aria-pressed='false'] { opacity: 0.6; text-decoration: line-through; }
.listen { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; }
.listen::before { content: ''; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent #ffb224; }
@media (max-width: 420px) { .rbtn.txt { padding: 0 10px; font-size: 12.5px; } .pts { padding: 0 9px; font-size: 12.5px; } .stg { padding: 8px 10px 9px; } .bar { gap: 6px; } }
.how { background: var(--paper); border-radius: 14px; padding: 10px 8px 10px; }
.how svg { display: block; width: 100%; height: auto; }
.how figcaption { font-size: 11.5px; color: var(--muted); padding: 2px 6px 0; }
.how .sk { fill: #cfa884; } .how .bd { fill: #b9c4c0; } .how .sd { fill: #4a3a2c; }
.how .cl { fill: #ffffff; stroke: #8a91a6; stroke-width: 1.2; } .how .fo { fill: none; stroke: #8a91a6; stroke-width: 1.2; }
.how .bt { fill: #2f4a3a; } .how .ar { fill: none; stroke: var(--amber); stroke-width: 2.4; } .how .ah { fill: var(--amber); }
.how text { font: 600 9.6px var(--sans); fill: var(--ink); }

/* ----- Perbaikan dari audit desain ----- */
.card-body { font-size: 15.5px; } .latin, .arti { font-size: 14.5px; } .src { font-size: 12.5px; }
.sum { grid-template-columns: repeat(2, 1fr); }
.act { max-width: calc(100vw - 188px); min-height: 60px; padding: 8px 18px; }
.round.big { width: 76px; height: 76px; font-size: 13.5px; line-height: 1.15; padding: 0 6px; }
.round { font-size: 13px; }
@media (max-width: 420px) { .stg p { font-size: 12.5px; } }
@media (min-width: 900px) and (pointer: fine) { .act { max-width: none; } .round.big { width: auto; height: 46px; } }
/* HP: latar tombol padat, tanpa efek buram di atas kanvas yang terus digambar ulang */
@media (pointer: coarse) {
  .rbtn, .stg, .obj, .hint, .round, .joy { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .rbtn, .stg, .obj, .hint, .round { background: var(--card); }
  .joy { background: color-mix(in srgb, var(--card) 78%, transparent); }
  .rbtn { width: 46px; height: 46px; } .rbtn.txt { width: auto; }
}
.btn:disabled { cursor: progress; }

/* ----- Manasik atas nama travel ----- */
.pick.who { gap: 7px; }
.pick.who input { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); width: 100%; user-select: text; -webkit-user-select: text; }
.pick.who input:focus { outline: none; border-color: var(--brand, var(--ink)); }
.branded #start { background: var(--brand); border-color: var(--brand); }
.branded .intro .eyebrow { color: var(--brand); }
.sent { background: var(--paper); border-radius: 14px; padding: 12px 14px; font-weight: 600; }
