/* Ticket Tycoon — tutorial overlay layer (driven by static/js/tutorial.js).
 *
 * Theme-safe: only var(--bs-*) tokens and Bootstrap class language, no
 * hardcoded palette — follows templates/game.html card tokens and
 * static/css/style.css conventions. Honors body.no-animations and
 * prefers-reduced-motion.
 */

/* ---------- dim ---------- */
#tt-dim {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 11002;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
#tt-dim.tt-on {
    opacity: 1; visibility: visible; pointer-events: auto;
    transition: opacity 0.25s ease;
}

/* ---------- tooltip card ---------- */
#tt-tip {
    position: fixed; z-index: 11004;
    max-width: min(360px, 92vw);
    background: var(--bs-body-bg); color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color); border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    padding: 14px 16px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}
#tt-tip.tt-on {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.tt-title { font-weight: 700; font-size: 1.02rem; margin-bottom: 4px; }
.tt-title .fa-solid { color: var(--bs-info); margin-right: 0.35rem; }
.tt-body { font-size: 0.9rem; color: var(--bs-secondary-color, inherit); margin-bottom: 8px; white-space: pre-wrap; }
.tt-meta { font-size: 0.75rem; opacity: 0.7; margin-bottom: 8px; }
.tt-progress { height: 6px; margin-bottom: 10px; background: var(--bs-tertiary-bg); }
.tt-btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tt-btnrow .btn .fa-solid { margin-left: 0.3rem; }
.tt-skip-confirm { color: var(--bs-danger) !important; font-weight: 700; }

/* ---------- spotlight target ---------- */
.tt-target {
    position: relative !important; z-index: 11003 !important;
    outline: 3px solid var(--bs-info) !important; border-radius: 8px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--bs-info) 35%, transparent),
                0 0 24px var(--bs-info) !important;
    animation: ttTargetPulse 1.6s ease-in-out infinite;
}
@keyframes ttTargetPulse {
    0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bs-info) 35%, transparent),
                             0 0 24px var(--bs-info); }
    50%      { box-shadow: 0 0 0 7px color-mix(in srgb, var(--bs-info) 22%, transparent),
                             0 0 34px var(--bs-info); }
}

/* ---------- paused chip ---------- */
#tt-paused {
    position: fixed; left: 12px; bottom: 12px; z-index: 12000;
    max-width: min(320px, 90vw);
    background: var(--bs-body-bg); color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    padding: 10px 12px; font-size: 0.85rem;
    animation: slideInRight 0.3s ease-out;
}

/* ---------- motion guards (match style.css conventions) ---------- */
@media (prefers-reduced-motion: reduce) {
    #tt-dim, #tt-tip, .tt-target, #tt-paused {
        transition: none !important; animation: none !important;
    }
    #tt-tip { transform: none; }
}
body.no-animations #tt-dim,
body.no-animations #tt-tip,
body.no-animations .tt-target,
body.no-animations #tt-paused {
    transition: none !important; animation: none !important;
}
body.no-animations #tt-tip { transform: none; }
