/* Pemandu interaktif: lapisan tembus klik, cincin sorotan, gelembung, menu "Cara bermain". */

.tut-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.tut-ring {
  position: fixed; border: 2px solid var(--gold-hi); border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(241, 214, 142, .25), 0 0 18px rgba(241, 214, 142, .45);
  animation: tut-pulse 1.6s ease-in-out infinite;
}
.tut-ring.is-point { border-radius: 50%; }
.tut-ring.is-dim { box-shadow: 0 0 0 3px rgba(241, 214, 142, .25), 0 0 0 9999px rgba(5, 6, 14, .42); }
.tut-ring.is-off, .tut-bubble.is-off { visibility: hidden; }

.tut-bubble {
  position: fixed; pointer-events: auto; width: min(340px, calc(100vw - 32px)); padding: 12px 14px;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); border: 1px solid var(--gold);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); color: var(--ink);
  z-index: 71; transition: opacity .15s;
}
/* Panah menunjuk jangkar; --ax = posisi di sepanjang sisi gelembung. */
.tut-bubble::before {
  content: ""; position: absolute; width: 12px; height: 12px; background: var(--panel-a);
  border: 1px solid var(--gold); transform: rotate(45deg); display: none;
}
.tut-bubble[data-side="bottom"]::before { display: block; top: -7px; left: calc(var(--ax, 50%) - 6px); border-right: 0; border-bottom: 0; }
.tut-bubble[data-side="top"]::before { display: block; bottom: -7px; left: calc(var(--ax, 50%) - 6px); border-left: 0; border-top: 0; }
.tut-bubble[data-side="right"]::before { display: block; left: -7px; top: calc(var(--ax, 50%) - 6px); border-right: 0; border-top: 0; }
.tut-bubble[data-side="left"]::before { display: block; right: -7px; top: calc(var(--ax, 50%) - 6px); border-left: 0; border-bottom: 0; }
.tut-bubble.is-tip { border-color: var(--line); width: min(300px, calc(100vw - 32px)); }
.tut-head {
  display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold);
}
.tut-prog { color: var(--muted); }
.tut-text { margin: 6px 0 10px; font-size: .95rem; line-height: 1.4; }
.tut-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tut-foot .btn { min-height: 36px; padding: 6px 14px; }
.tut-link {
  background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer;
  padding: 6px 2px; font: inherit; font-size: .82rem; min-height: 32px;
}
.tut-link:focus-visible, .tut-bubble .btn:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.tut-bubble.is-done .tut-text { color: var(--ok); }
.tut-bubble.is-done .tut-foot { display: none; }

.tut-menu {
  position: fixed; top: calc(var(--topbar) + 6px); right: 12px; z-index: 72; width: min(320px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--topbar) - 18px); overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.tut-menu h3, .tut-menu h4 { margin: 0; }
.tut-menu h4 { font-size: .9rem; color: var(--gold); margin-top: 6px; }
.tut-note { color: var(--muted); font-size: .8rem; margin-top: -4px; }
.tut-keys { display: grid; grid-template-columns: 1fr; gap: 2px; font-size: .85rem; color: var(--muted); margin: 0; }
.tut-keys dd { margin: 0; }
.tut-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Dua tombol ikon berdampingan: hanya yang pertama didorong ke kanan. */
#btn-help + .btn-icon { margin-left: 0; }
#btn-help { font-weight: 700; font-size: 1.1rem; font-family: var(--font); }

@keyframes tut-pulse { 50% { box-shadow: 0 0 0 6px rgba(241, 214, 142, .12), 0 0 26px rgba(241, 214, 142, .6); } }
@keyframes tut-pulse-dim { 50% { box-shadow: 0 0 0 6px rgba(241, 214, 142, .12), 0 0 0 9999px rgba(5, 6, 14, .42); } }
.tut-ring.is-dim { animation-name: tut-pulse-dim; }

@media (max-height: 500px) {
  .tut-bubble { width: min(400px, 58vw); padding: 8px 10px; }
  .tut-text { font-size: .85rem; margin: 4px 0 6px; }
  .tut-menu { max-height: calc(100dvh - var(--topbar) - 10px); }
}
@media (prefers-reduced-motion: reduce) {
  .tut-ring, .tut-ring.is-dim { animation: none; }
  .tut-bubble { transition: none; }
}
