/* GrooxTyper's tutorial (guide.js): the lessons' list, the card and the rings */

/* The lessons */
.guide-hub { display: flex; flex-direction: column; width: min(760px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); }
.guide-hub:not([open]) { display: none; }
.guide-hub__head { display: grid; gap: 8px; padding: 18px 20px 12px; background: linear-gradient(135deg, rgb(var(--blue-rgb) / 0.18), rgba(240, 160, 32, 0.08)); border-bottom: 1px solid var(--line); }
.guide-hub__title { margin: 0; font-size: 18px; font-weight: 700; }
.guide-hub__lead { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; max-width: 62ch; }
.guide-hub__progress { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.guide-hub__meter { position: relative; flex: 0 0 160px; height: 5px; border-radius: 3px; background: var(--ui-darker); overflow: hidden; }
.guide-hub__meter::after { content: ""; position: absolute; inset: 0; width: calc(var(--done, 0) * 100%); background: #3fb950; border-radius: 3px; }
.guide-hub__stat { color: var(--muted); font-size: 12px; }
.guide-hub__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 14px 20px; overflow-y: auto; }
.guide-lesson { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 10px; padding: 11px 12px; background: var(--ui-dark); border: 1px solid var(--line); border-radius: 6px; color: var(--text); text-align: start; cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.15s; }
.guide-lesson:hover { background: var(--ui-2); border-color: var(--ui-3); transform: translateY(-1px); }
.guide-lesson:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.guide-lesson.is-next { border-color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }
.guide-lesson__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: rgb(var(--blue-rgb) / 0.16); color: var(--blue-text); }
.guide-lesson.is-done .guide-lesson__icon { background: rgba(63, 185, 80, 0.16); color: #3fb950; }
.guide-lesson__words { display: grid; gap: 3px; min-width: 0; }
.guide-lesson__words strong { font-size: 13px; }
.guide-lesson__about { color: var(--muted); font-size: 12px; line-height: 1.35; }
.guide-lesson__meta { color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.guide-lesson.is-done .guide-lesson__meta { color: #3fb950; font-size: 14px; }
.guide-hub__foot { align-items: center; }
.guide-hub__tidy { margin-inline-end: auto; }

/* The card */
.guide-coach { position: fixed; inset: auto; margin: 0; z-index: 60; display: flex; flex-direction: column; width: 330px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; background: var(--ui); color: var(--text); border: 1px solid var(--line); border-left: 3px solid #f0a020; border-radius: 6px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); transition: border-color 0.25s, left 0.25s ease, top 0.25s ease; }
.guide-coach.is-passed { border-left-color: #3fb950; }
.guide-coach.is-away { display: none !important; }
.guide-coach__head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 6px 12px; background: var(--ui-dark); cursor: grab; user-select: none; }
.guide-coach__head:active { cursor: grabbing; }
.guide-coach__title { flex: 1; min-width: 0; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.guide-coach__count { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.03em; white-space: nowrap; }
.guide-coach.is-passed .guide-coach__count { color: #3fb950; }
.guide-coach__icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 3px; color: var(--muted); font-size: 13px; line-height: 1; }
.guide-coach__icon:hover { background: var(--ui-3); color: var(--text); }
.guide-coach__bar { display: flex; gap: 3px; padding: 0 12px 0; background: var(--ui-dark); padding-bottom: 8px; }
.guide-coach__bar span { flex: 1; height: 3px; border-radius: 2px; background: var(--ui-3); transition: background 0.25s; }
.guide-coach__bar .is-done { background: #3fb950; }
.guide-coach__bar .is-on { background: #f0a020; }
.guide-coach__body { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.guide-coach.is-folded .guide-coach__body { display: none; }
.guide-coach__text { margin: 0; font-size: 13px; line-height: 1.5; }
.guide-coach__text .sk__cap, .guide-coach__result .sk__cap { margin: 0 1px; }
.guide-coach__result { margin: 0; padding: 8px 10px; background: rgba(63, 185, 80, 0.12); border-radius: 4px; color: #b9e6c0; font-size: 12.5px; line-height: 1.45; animation: guide-in 0.25s ease; }
.guide-coach__result[hidden] { display: none; }
.guide-coach__result.is-keys { display: grid; gap: 6px; background: var(--ui-dark); color: var(--muted); }
.guide-coach__result.is-keys[hidden] { display: none; }
.guide-coach__keys-title { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.guide-coach__keys { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-coach__combo { display: inline-flex; gap: 2px; }
.guide-coach__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.guide-coach__foot .btn { min-height: 26px; padding: 0 12px; font-size: 12px; }
.guide-coach.is-finished .guide-coach__text { font-size: 13.5px; }
@keyframes guide-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* The rings: what to look at, anywhere on screen */
.guide-layer { position: fixed; inset: 0; z-index: 59; pointer-events: none; }
.guide-ring { position: fixed; border: 2px solid #f0a020; border-radius: 6px; box-shadow: 0 0 0 4px rgba(240, 160, 32, 0.22), 0 0 22px rgba(240, 160, 32, 0.35); animation: guide-pulse 1.6s ease-in-out infinite; }
.guide-ring.is-round { border-radius: 50%; }
.guide-ring[hidden] { display: none; }
.guide-ring__label { position: absolute; top: -11px; left: 10px; padding: 1px 7px; background: #f0a020; border-radius: 9px; color: #1d1b1b; font-size: 11px; font-weight: 700; white-space: nowrap; }
.guide-ring__label[hidden] { display: none; }
@keyframes guide-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(240, 160, 32, 0.2), 0 0 16px rgba(240, 160, 32, 0.3); } 50% { box-shadow: 0 0 0 8px rgba(240, 160, 32, 0.08), 0 0 30px rgba(240, 160, 32, 0.5); } }
@media (prefers-reduced-motion: reduce) { .guide-ring { animation: none; } .guide-coach { transition: none; } }

/* A lesson done */
.guide-bit { position: fixed; width: 7px; height: 10px; border-radius: 2px; opacity: 0; animation: guide-bit 1.2s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes guide-bit { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 120px)) rotate(var(--turn)); } }

/* "Show me": a pointer that plays the gesture */
.guide-ghost { position: fixed; left: 0; top: 0; z-index: 61; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); transition: none; }
.guide-ghost::before { content: ""; position: absolute; left: -10px; top: -10px; width: 26px; height: 26px; border-radius: 50%; background: rgba(240, 160, 32, 0.55); transform: scale(0); transition: transform 0.12s; }
.guide-ghost.is-pressed::before { transform: scale(1); }
.guide-trail { position: fixed; z-index: 60; border: 2px dashed #f0a020; background: rgba(240, 160, 32, 0.08); }
.guide-trail[hidden] { display: none; }
