/* Tooltips */
.tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    z-index: 10000;
    pointer-events: none;
    display: none;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tooltip::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}

.tooltip-top::after {
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #1f2937;
}

.tooltip-bottom::after {
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #1f2937;
}

.tooltip-left::after {
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #1f2937;
}

.tooltip-right::after {
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #1f2937;
}

/* Tutorial */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Затемнение делает highlight ниже; два слоя превращали страницу почти в чёрную. */
    background: transparent;
    z-index: 9998;
    animation: fadeIn 0.3s;
}

.tutorial-modal {
    position: fixed;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 9999;
    max-width: 350px;
    animation: slideIn 0.3s;
}

.tutorial-content h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.25rem;
}

.tutorial-content p {
    margin: 0 0 1rem 0;
    color: var(--secondary-color);
    line-height: 1.6;
}

.tutorial-progress {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.tutorial-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tutorial-actions .btn {
    flex: 1;
    min-width: 80px;
}

.tutorial-highlight {
    position: fixed;
    border: 3px solid var(--primary-color);
    border-radius: 8px;
    pointer-events: none;
    z-index: 9997;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
    animation: pulse 2s infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

@media (max-width: 768px) {
    .tutorial-modal {
        max-width: 90%;
        margin: 1rem;
    }
    
    .tooltip {
        max-width: 200px;
        font-size: 0.75rem;
    }
}
